2015-10-20 105 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