W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > May 2017

Re: [webrtc-pc] does MSID still work? (was: example 13: getReceivers semantics)

From: jan-ivar via GitHub <sysbot+gh@w3.org>
Date: Mon, 01 May 2017 18:25:13 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-298394432-1493663112-sysbot+gh@w3.org>
Here's why it sucks: Any moderately complex website today is going to want to correlate remote streams and tracks to local streams and tracks. They'll need to use msid for that today.

As an example, take this [simple Firefox fiddle](https://jsfiddle.net/jib1/aanj0zay/) that sends two videos, and swaps them after 3 seconds. Without correlating streams, there's no telling which video ends up on the left vs. right. Thus the fiddle correlates streams like this today:
  let videos = {[streamA.id]: videoA, [streamB.id]: videoB};

  pc2.ontrack = ({streams: [stream]}) => {
    let video = videos[stream.id];
    if (!video.srcObject) video.srcObject = stream;
vs. like this tomorrow:
  let videos = {[transceiverA.mid]: videoA, [transceiverB.id]: videoB};

  pc2.ontrack = ({transceiver, streams: [stream]}) => {
    let video = videos[transceiver.mid];
    if (!video.srcObject) video.srcObject = stream;

Luckily, both should continue to work, since I'm correlating streams not tracks.

What's not intuitive is that the same does not hold for track.ids, even though we'll continue to have them. I don't have a fiddle that swaps tracks, but you can easily imagine one I hope.

GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1128#issuecomment-298394432 using your GitHub account
Received on Monday, 1 May 2017 18:25:19 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 6 May 2023 21:19:40 UTC