Skip to content

Instantly share code, notes, and snippets.

@shriyaRam
Created June 14, 2020 14:35
Show Gist options
  • Save shriyaRam/efd97741fb0a1f19f88f1403874f3e93 to your computer and use it in GitHub Desktop.
Save shriyaRam/efd97741fb0a1f19f88f1403874f3e93 to your computer and use it in GitHub Desktop.
//When a stream is added to a channel
client.on('stream-added', function (evt) {
client.subscribe(evt.stream, handleFail);
});
//When you subscribe to a stream
client.on('stream-subscribed', function (evt) {
let stream = evt.stream;
addVideoStream(stream.getId());
stream.play('remote-container');
addCanvas(stream.getId());
});
mt.addEventListener('click', ()=>{
globalstream.muteAudio();
})
unmt.addEventListener('click', ()=>{
globalstream.un
muteAudio();
})
//When a person leaves or is removed from the stream
client.on('stream-removed',removeVideoStream);
client.on('peer-leave',removeVideoStream);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment