W3C home > Mailing lists > Public > public-webrtc@w3.org > September 2011

Re: MediaStreamTrack disabling - effect on downstream MediaStreams?

From: ᛏᚮᛘᛘᚤ <tommyw@google.com>
Date: Thu, 15 Sep 2011 11:12:27 -0700
Message-ID: <CALLKCfNhU4erxSnnoKa5a+W7rACjjFb-TC8v78PG+7OLbkHa9Q@mail.gmail.com>
To: Adam Bergkvist <adam.bergkvist@ericsson.com>
Cc: Harald Alvestrand <harald@alvestrand.no>, "public-webrtc@w3.org" <public-webrtc@w3.org>
Your suggestion seems very powerful but possibly more powerful than needed.
What kind of use cases do you have in mind for this? I personally like the
clear relationship between parent and child.

/Tommy


On Thu, Sep 15, 2011 at 04:57, Adam Bergkvist
<adam.bergkvist@ericsson.com>wrote:

>
> It would be more flexible and easier for developers to grasp if a new
> MediaStream, constructed from another MediaStream, would have tracks
> that are independent from its "parent" (even though they map to the
> same underlying audio and/or video sources). The new MediaStream would
> also get its own label.
>
> For example, the MediaStream forking functionality was added to support
> the use case where you want to stop sending video without disabling the
> video in your local self-view. If you then instead would like to disable
> the local self-view without stop sending video you would have to create
> yet another "child" for the local self-view, rather than just using the
> "parent".
>
> The way we would like to achieve this is to let the MediaStream
> constructor take an array of MediaStreamTrack objects.
>
> // streamB will contain copies of all tracks from streamA
> var streamB = new MediaStream(streamA.tracks);
>
> // the below statements are all true
> streamB.label != streamA.label;
> streamB.tracks[0] !== streamA.tracks[0];
> streamB.tracks[0].kind == streamA.tracks[0].kind;
> streamB.tracks[0].label == streamA.tracks[0].label;
>
> // streamC will contain copies of a subset of the tracks in streamA
> var streamC = new MediaStream([streamA.tracks[0], streamA.tracks[2]]);
>
> // combinedStream will contain copies of the first tracks in localStream
> // and remoteStream (the audio tracks)
> var combinedStream =
>    new MediaStream([localStream.tracks[0], remoteStream.tracks[0]]);
> // record the conversation
> var recorder = combinedStream.record();
>
> BR
> Adam
>
>


-- 
Tommy Widenflycht, Senior Software Engineer
Google Sweden AB, Kungsbron 2, SE-11122 Stockholm, Sweden
Org. nr. 556656-6880
And yes, I have to include the above in every outgoing email according to EU
law.
Received on Thursday, 15 September 2011 18:13:00 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:25 UTC