Skip to content

Instantly share code, notes, and snippets.

@soulfly
Created December 19, 2017 11:51
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 soulfly/d8aa7fec69350707785908ba9d3bb7b1 to your computer and use it in GitHub Desktop.
Save soulfly/d8aa7fec69350707785908ba9d3bb7b1 to your computer and use it in GitHub Desktop.
iceState: function(iceConnectionState){
if (iceConnectionState == "failed"){
restartLocalPeerConnection();
}
}
...
function restartLocalPeerConnection(){
switchVideoDevice(userVideoinputDevices[0].deviceId);
}
function switchVideoDevice(deviceId){
client.switchVideoinput(deviceId, {
error: function(error) {
console.error("Can't switch video source, error: ", error);
},
success: function() {
console.info("switchVideoDevice SUCCESS");
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment