...
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.
...
Create multiple video UI elements, for example, videoElement1 and videoElement2.
Join a channel for videoElement1.
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 |
---|
ExampleSee an example of this in JSFiddle: https://jsfiddle.net/phenixRTS/qap5L9vd/ |
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...