Starting audio call only in SImpleWebRTC

南笙酒味 提交于 2020-01-25 19:58:44

问题


I am using This jQuery plugin for WebRtc

I want to start audio call only but i can't see any function for this. I am using following code with autoRequestMedia:false :-

 webrtc = new SimpleWebRTC({
            localVideoEl: 'local-videos-container',
            remoteVideosEl: 'videos-container',
            autoRequestMedia: false,
            url: 'https://192.168.1.11:2001/'
});

So when user click on audio call i just want to start audio call only not video i can see the method webrtc.startLocalVideo() which start audio and video both. so is there any function for audio only?

Thanks


回答1:


You can pass media: { audio: true, video: false } to the constructor of webrtc.

try this:-

 webrtc = new SimpleWebRTC({
        localVideoEl: 'local-videos-container',
        remoteVideosEl: 'videos-container',
        autoRequestMedia: false,
        url: 'https://192.168.1.11:2001/',
        media: { audio: true, video: false }
 );


来源:https://stackoverflow.com/questions/33436505/starting-audio-call-only-in-simplewebrtc

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