I'm trying to switch source - screen to webcam (LIVE). I've started from function addStream()
and after executing it I'm getting this error:
DOMException: Failed to execute 'webkitGetUserMedia' on 'Navigator': At least one of audio and video must be requested(…) Object {audio: false, video: false}
Here is the code:
function switchToWebcam() {
connection.sdpConstraints.mandatory = {
OfferToReceiveAudio: true,
OfferToReceiveVideo: true
};
connection.addStream({
video: true,
audio: true
});
}
Maybe there are other ways to switch source. Just can't find an example. Thanks.