Skip to content

Instantly share code, notes, and snippets.

@digitallysavvy
Last active July 19, 2019 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitallysavvy/ce4a1935028811cd6dee119f3e6d54ef to your computer and use it in GitHub Desktop.
Save digitallysavvy/ce4a1935028811cd6dee119f3e6d54ef to your computer and use it in GitHub Desktop.
logic to swap small container with full screen video
var containerId = '#' + streamId + '_container';
$(containerId).dblclick(function() {
// play selected container as full screen - swap out current full screen stream
remoteStreams[mainStreamId].stop(); // stop the main video stream playback
addRemoteStreamMiniView(remoteStreams[mainStreamId]); // send the main video stream to a container
$(containerId).empty().remove(); // remove the stream's miniView container
remoteStreams[streamId].stop() // stop the container's video stream playback
remoteStreams[streamId].play('full-screen-video'); // play the remote stream as the full screen video
mainStreamId = streamId; // set the container stream id as the new main stream id
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment