Last active
August 29, 2015 14:00
-
-
Save peterhpchen/11240463 to your computer and use it in GitHub Desktop.
control remote peer's video and audio
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
<input type="checkbox" id="disabledVideo"/>Disabled remote video | |
<input type="checkbox" id="disabledAudio"/>Disabled remote audio |
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
function disabledVideo() { | |
//video | |
if (disabledVideoBox.checked) { | |
trace("Disabled video"); | |
remoteStream.getVideoTracks()[0].enabled = false; | |
} | |
else if (!disabledVideoBox.checked) { | |
trace("Enabled video"); | |
remoteStream.getVideoTracks()[0].enabled = true; | |
} | |
} | |
function disabledAudio() { | |
//audio | |
if (disabledAudioBox.checked) { | |
trace("Disabled audio"); | |
remoteStream.getAudioTracks()[0].enabled = false; | |
} | |
else if (!disabledAudioBox.checked) { | |
trace("Enabled audio"); | |
remoteStream.getAudioTracks()[0].enabled = true; | |
} | |
} |
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
remoteStream = new webkitMediaStream(localStream); | |
//Add local stream to connection | |
peerLocalConnection.addStream(remoteStream); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment