# Start/stop publishing video/audio while still keep other data in the local stream

**URL:** https://discourse.lynckia.com/t/start-stop-publishing-video-audio-while-still-keep-other-data-in-the-local-stream/81
**Category:** Uncategorized
**Created:** [December 18, 2013, 8:13am UTC](https://discourse.lynckia.com/t/start-stop-publishing-video-audio-while-still-keep-other-data-in-the-local-stream/81 "2013-12-18T08:13:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Son\_Nguyen](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@Son\_Nguyen](https://discourse.lynckia.com/u/Son_Nguyen)
#### Post date: [December 18, 2013, 8:13am UTC](https://discourse.lynckia.com/t/start-stop-publishing-video-audio-while-still-keep-other-data-in-the-local-stream/81/1 "2013-12-18T08:13:40Z")

</div>

Hi,

Once we have published the local stream over the room, is there any way to  
stop (and start later) publishing only video or audio while still keep the  
local stream connected?

Thanks,  
Son

---

<div class="post-metadata">

### Author: ![Son\_Nguyen](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@Son\_Nguyen](https://discourse.lynckia.com/u/Son_Nguyen)
#### Post date: [December 24, 2013, 3:08pm UTC](https://discourse.lynckia.com/t/start-stop-publishing-video-audio-while-still-keep-other-data-in-the-local-stream/81/2 "2013-12-24T15:08:35Z")

</div>

Hi,

I’ve found a way to do that after spending some time on the eziroClient  
source code.  
To stop publishing audio:  
localStream.stream.getAudioTracks()[0].enabled = fasle;  
And stop publishing video:  
localStream.stream.getVideoTracks()[0].enabled = false;

Son

Vào 15:13:40 UTC+7 Thứ tư, ngày 18 tháng mười hai năm 2013, Son Nguyen đã  
viết:\>

> Hi,
> 
> Once we have published the local stream over the room, is there any way to  
> stop (and start later) publishing only video or audio while still keep the  
> local stream connected?
> 
> Thanks,  
> Son

---

<div class="post-metadata">

### Author: ![Jose\_Ramon\_Huerga](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@Jose\_Ramon\_Huerga](https://discourse.lynckia.com/u/Jose_Ramon_Huerga)
#### Post date: [November 9, 2014, 9:08am UTC](https://discourse.lynckia.com/t/start-stop-publishing-video-audio-while-still-keep-other-data-in-the-local-stream/81/3 "2014-11-09T09:08:42Z")

</div>

but if you create two streams, then the user would be asked twice, first to  
share his microfone, and later to share his video, right ? is there any way  
to use two streams but ask the user only one question about sharing his  
audio AND his video ?On Tuesday, January 28, 2014 10:00:18 PM UTC+1, Álvaro Alonso wrote:

> Using the erizoClient API the way to do that is creating two streams, one  
> for the video and other for the audio. Thus you can stop/start them  
> whenever you want
> 
> BR  
> Álvaro
> 
> 2013-12-24 Son Nguyen \<[sonn...@gmail.com](mailto:sonn...@gmail.com) \<javascript:\>\>
> 
> > Hi,
> > 
> > I’ve found a way to do that after spending some time on the eziroClient  
> > source code.  
> > To stop publishing audio:  
> > localStream.stream.getAudioTracks()[0].enabled = fasle;  
> > And stop publishing video:  
> > localStream.stream.getVideoTracks()[0].enabled = false;
> > 
> > Son
> > 
> > Vào 15:13:40 UTC+7 Thứ tư, ngày 18 tháng mười hai năm 2013, Son Nguyen đã  
> > viết:
> > 
> > > Hi,
> > > 
> > > Once we have published the local stream over the room, is there any way  
> > > to stop (and start later) publishing only video or audio while still keep  
> > > the local stream connected?
> > > 
> > > Thanks,  
> > > Son
> > 
> > –  
> > You received this message because you are subscribed to the Google Groups  
> > “lynckia” group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [lynckia+u...@googlegroups.com](mailto:lynckia+u...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Alvaro\_Alonso](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/alvaro_alonso/32/32_2.png) [@Alvaro\_Alonso](https://discourse.lynckia.com/u/Alvaro_Alonso)
#### Post date: [January 28, 2014, 9:00pm UTC](https://discourse.lynckia.com/t/start-stop-publishing-video-audio-while-still-keep-other-data-in-the-local-stream/81/4 "2014-01-28T21:00:18Z")

</div>

Using the erizoClient API the way to do that is creating two streams, one  
for the video and other for the audio. Thus you can stop/start them  
whenever you want

BR  
Álvaro2013-12-24 Son Nguyen [sonnh273@gmail.com](mailto:sonnh273@gmail.com)

> Hi,
> 
> I’ve found a way to do that after spending some time on the eziroClient  
> source code.  
> To stop publishing audio:  
> localStream.stream.getAudioTracks()[0].enabled = fasle;  
> And stop publishing video:  
> localStream.stream.getVideoTracks()[0].enabled = false;
> 
> Son
> 
> Vào 15:13:40 UTC+7 Thứ tư, ngày 18 tháng mười hai năm 2013, Son Nguyen đã  
> viết:
> 
> > Hi,
> > 
> > Once we have published the local stream over the room, is there any way  
> > to stop (and start later) publishing only video or audio while still keep  
> > the local stream connected?
> > 
> > Thanks,  
> > Son
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “lynckia” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [lynckia+unsubscribe@googlegroups.com](mailto:lynckia+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
