Created
December 19, 2017 11:51
-
-
Save soulfly/d8aa7fec69350707785908ba9d3bb7b1 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
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