-
-
Save digitallysavvy/9667474ed38eef463b41785dbbe45c66 to your computer and use it in GitHub Desktop.
remote stream toggles
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
// show mute icon whenever a remote has muted their mic | |
client.on("mute-audio", function (evt) { | |
toggleVisibility('#' + evt.uid + '_mute', true); | |
}); | |
client.on("unmute-audio", function (evt) { | |
toggleVisibility('#' + evt.uid + '_mute', false); | |
}); | |
// show user icon whenever a remote has disabled their video | |
client.on("mute-video", function (evt) { | |
var remoteId = evt.uid; | |
// if the main user stops their video select a random user from the list | |
if (remoteId != mainStreamId) { | |
// if not the main vidiel then show the user icon | |
toggleVisibility('#' + remoteId + '_no-video', true); | |
} | |
}); | |
client.on("unmute-video", function (evt) { | |
toggleVisibility('#' + evt.uid + '_no-video', false); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment