2015-10-20 103 views
1

我使用https://simplewebrtc.com/实现WebRTC一切都没有工作在Firefox中工作正常,但是当我尝试在Chrome相同的位置不工作是我的代码: -网络RTC屏幕共享在Chrome

var webrtc = new SimpleWebRTC({ 
     localVideoEl: 'local-videos-container', 
     remoteVideosEl: 'videos-container', 
     autoRequestMedia: false, 
     url: '//192.168.1.51:8001' 
}); 

$(document).on('click', '#share-screen', function() { 
     webrtc.shareScreen(function (e, d) { 
      if (e) { 
       alert(e); // throwing NavigatorUserMediaError 
      } 
     }); 
}); 

我有加镀铬扩展以及这里是扩展的代码: -

{ 
"name": "Screensharing Sample", 
"description": "Screensharing utility sample for getscreenmedia", 
"version": "0.0.1", 
"manifest_version": 2, 
"minimum_chrome_version": "34", 
"icons": { 
}, 
"permissions": [ 
"desktopCapture" 
], 
"background": { 
    "scripts": ["background.js"] 
}, 
"content_scripts": [ { 
"js": [ "content.js" ], 
"matches": ["https://192.168.1.51:2013/*"] 
}], 
"externally_connectable": { 
    "matches": [   
     "https://192.168.1.51:2013/*" 
    ] 
    } 
} 

什么我做错了。请帮我 感谢

回答

2

看来你是不添加匹配域correctly.try与下面的代码替换匹配: -

取代"matches": ["https://192.168.1.51:2013/*"]"matches": ["https://192.168.1.51:*/*"]

让我知道如果这个工作。

+1

它的工作现在非常感谢我浪费我的4小时在这个:( – user3819192

+0

你能帮我http://stackoverflow.com/questions/33436505/starting-audio-call-only-in-simplewebrtc – user3819192