Created
June 14, 2020 14:35
-
-
Save shriyaRam/efd97741fb0a1f19f88f1403874f3e93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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