Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Instead of joining the same channel twice, access the mediaStream and attach it to more than one video.

...

response.mediaStream.getStream()

returns a WebRTC stream that can be attached to another video. This saves the bandwidth and decoding for a second stream.

...

  1. Create multiple video UI elements, for example, videoElement1 and videoElement2.

  2. Join a channel for videoElement1.

  3. Populate videoElement2, for example:

    Code Block
            if (response.mediaStream) {
                setUserMessage('joinChannel()::subscriberCallback(error, response) returned response.mediaStream.getStreamId()=' + response.mediaStream.getStreamId());
    					  videoElement2.srcObject = response.mediaStream.getStream();
    						videoElement2.onloadedmetadata = function(e) {
                	console.log("metadataloaded");
        					videoElement2.play();
      					};
            }

...

Info

Example

See an example of this in JSFiddle: https://jsfiddle.net/phenixRTS/qap5L9vd/

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@104da
showSpacefalse
sortmodified
typepage
reversetrue
labelsUI
cqllabel = "ui" and type = "page" and space = "CKB"

...