Can I receive video without giving permission to browser to use my camera in SimpleWebRTC?

老子叫甜甜 提交于 2019-12-12 03:17:43

问题


Does SimpleWebRTC has this feature to get data(video/audio) without giving permission to browser to use my camera/microphone?

// create our webrtc connection
var webrtc = new SimpleWebRTC({
    // the id/element dom element that will hold "our" video
    localVideoEl: 'localVideo',
    // the id/element dom element that will hold remote videos
    remoteVideosEl: '',
    // immediately ask for camera access
    **autoRequestMedia: true,**
    debug: true,
    detectSpeakingEvents: true,
    autoAdjustMic: false,
    media: {
        video: false,
        **audio: true**
    },
});

When I change those parts surrounded by asterisks to true it works, otherwise it doesn't.


回答1:


Have you tried setting autoRequestMedia to true and while having both video and audio of the media object set to false? You should receive the readyToCall event and can join the room as shown on the simplewebrtc homepage.




回答2:


First negotiate (accept the call/join the room) with video and audio and then disable the video, somehting like webrtc.videoStreams.disable()



来源:https://stackoverflow.com/questions/38435103/can-i-receive-video-without-giving-permission-to-browser-to-use-my-camera-in-sim

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!