javascript - RTCMultiConnection exception on connection.addStream() -


i'm trying switch source - screen webcam (live). i've started function addstream() , after executing i'm getting error:

domexception: failed execute 'webkitgetusermedia' on 'navigator': @ least 1 of audio , video must requested(…) object {audio: false, video: false} 

here code:

       function switchtowebcam() {              connection.sdpconstraints.mandatory = {                 offertoreceiveaudio: true,                 offertoreceivevideo: true             };              connection.addstream({                 video: true,                 audio: true             });         } 

maybe there other ways switch source. can't find example. thanks.

here how add audio+video stream in screensharing session:

connection.session.audio = true; connection.session.video = true;  connection.addstream({     audio: true, // because session.audio==true, works     video: true, // because session.video==true, works     oneway: true }); 

you can try audio+screen demo on canary. demo has "add video" button well.


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -