On 24 Jun 2015 5:09 pm, "Stefan HÃ¥kansson LK" <
stefan.lk.hakansson@ericsson.com> wrote:
>
> On 23/06/15 13:07, Silvia Pfeiffer wrote:
>
> >
> > I did some more digging.
> >
> > Reading the spec, I stumble over both an ontrack and an onaddtrack
> > event. The ontrack event is used in Example 4 to replace the
> > onaddstream event from earlier on the RTCPeerConnection. The
> > onaddtrack fires on MediaStream directly.
> > So, we're really talking about the ontrack event here.
>
> Right.
>
> >
> > It seems to me that ontrack has the exact same definition as
> > onaddstream, except it is a RTCTrackEvent (and not a MediaStreamEvent)
> > and can report the addition of multiple MediaStream objects in one go.
> >
> > http://w3c.github.io/webrtc-pc/#idl-def-RTCTrackEvent
> > I'm actually a bit confused about this description: it seems that a
> > track can be part of multiple streams there. That's not how I
> > understand MediaStreams to work - rather, a track would always be part
> > of one stream, but a stream could have multiple tracks.
>
> I think both ways are OK. A MediaStream is basically a collection of
> MediaStreamTrack's, but a MediaStreamTrack can be part of more than one
> MediaStream.
>
> Just assume you have MediaStream's A and B, and a MediastreamTrack X,
> AFAIK nothing forbids
>
> A.addTrack(X);
> B.addTrack(X);
>
Oh and that doesn't clone the track? Feels wrong...
I'm particularly thinking about e.g. A being a stream between two endpoints
X and Y and B being a stream between Y and Z. How can it still be the same
track?
Cheers,
Silvia.