WebRTC | Failed to execute 'setLocalDescription' on 'RTCPeerConnection': Failed to parse SessionDesc

1.问题回放

  使用如下代码获取局域网IP报错

  (代码来源:https://github.com/diafygi/webrtc-ips 日期:2019-02-16)

Uncaught (in promise) DOMException: Failed to execute 'setLocalDescription' on 'RTCPeerConnection': Failed to parse SessionDescription. a=msid:  Missing track ID in msid attribute.

复制代码

 1 //get the IP addresses associated with an account
 2 function getIPs(callback){
 3     var ip_dups = {};
 4 
 5     //compatibility for firefox and chrome
 6     var RTCPeerConnection = window.RTCPeerConnection
 7         || window.mozRTCPeerConnection
 8         || window.webkitRTCPeerConnection;
 9     var useWebKit = !!window.webkitRTCPeerConnection;
10 
11     //bypass naive webrtc blocking using an iframe
12     if(!RTCPeerConnection){
13         //NOTE: you need to have an iframe in the page right above the script tag
14         //
15         //
16         //
                    
                    

你可能感兴趣的:(chrome简单的拓展)