W3C home > Mailing lists > Public > public-webrtc@w3.org > January 2015

Re: No way to stop sending media but still displaying it locally

From: Stefan Håkansson LK <stefan.lk.hakansson@ericsson.com>
Date: Thu, 29 Jan 2015 06:54:19 +0000
To: Iñaki Baz Castillo <ibc@aliax.net>, "public-webrtc@w3.org" <public-webrtc@w3.org>
Message-ID: <1447FA0C20ED5147A1AA0EF02890A64B1D168E1D@ESESSMB209.ericsson.se>
On 28/01/15 23:38, Iñaki Baz Castillo wrote:
> Use case:
> 1) My local stream (mic&webcam) is being displayed on a <video> element.
> 2) And it is also being sent to the peer via WebRTC.
> 3) I want to "pause" my stream in the wire, but still view it in the
> <video> element.
> The only way to achieve bullet 2 (without stopping the PeerConnection
> or removing the local stream form it) is by setting "enabled=false" in
> each track of the local stream. But it also stops the local <video>
> rendering (so it does not satisfy bullet 3).
> So I miss something? I couldn't find any solution in the spec(s).
> P.S. Would stream.clone() work in this case?

I think this would be the solution now. Clone the MediaStream; attach 
one of the two clones to the video element and the other to the 
PeerConnection; put enabled=false on the track(s) in question of the 
MediaStream attached to the PC. Note, this does not really pause 
sending, but sends black frames/silence over the net.

A little bit down the road the RTCRTPSender (not yet in the main branch 
of the spec) will be there, and it will AFAIK have a method for "stop 
sending this track". Then you will not have to clone.


Received on Thursday, 29 January 2015 06:54:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:18:03 UTC