Android WebView中使用WebRTC功能时出错 Failed to parse: "a=extmap-allow-mixed"

wx_user_94061671 wechat_user 2021-03-18 21:14:25

在Android中使用WebView运行WebRTC功能时出现Failed to parse: "a=extmap-allow-mixed"错误而无法成功,怎么办?

我来回答
请  登录  后回答问题
所有回答
Peter 2021-03-18 21:18:23

这是因为Android中的WebView支持的WebRTC与浏览器中不一致,可以在创建RTCPeerConnection时指定 offerExtmapAllowMixed:false 来解决该问题,示例代码如下:

let conn = new RTCPeerConnection({
    offerExtmapAllowMixed: false
})