0
即時通訊做一個小的應用程序,我想知道是否有觀看屏幕上您是「捕獲」屏幕chrome.desktopCapture記錄後,選擇什麼卡住捕捉
的問題是,現在的方式當我選擇一個屏幕捕捉它不顯示「停止共享」白色欄或類似的東西,它只是隱藏選擇框捕捉。這對我來說是個問題,因爲我不能記錄任何東西。
這是代碼的一部分,其中代碼:
chrome.runtime.onConnect.addListener(function(port){
// listen for messages from the port
port.onMessage.addListener(function(message){
// send back a "pending" answer on the port
port.postMessage({
"answer": 1,
"state": "pending",
"requestId": message.requestId
});
chrome.desktopCapture.chooseDesktopMedia(["screen", "window"], port.sender.tab, function(id){
var response = {
"answer": 1,
"state": "completed",
"requestId": message.requestId,
"streamId": id
};
// send back a "completed" answer on the port
port.postMessage(response);
});
});
});
是有辦法調試這樣我就可以知道爲什麼就是共享桌面部件卡住?
謝謝!
我看到即時沒有得到任何錯誤或任何,但檢查了幾次後,我意識到該擴展是有一個錯誤:錯誤:試圖使用斷開的端口對象,但沒有顯示控制檯上的任何東西大部分時間 – AbdulHamid
這個問題可能會在談話中花費更長的時間。嘗試閱讀[長期連接](http://stackoverflow.com/questions/22943988/one-more-time-about-error-attempting-to-use-a-disconnected-port-object-how-to)和[重新建立連接](http://stackoverflow.com/questions/22943988/one-more-time-about-error-attempting-to-use-a-disconnected-port-object-how-to)到檢查有關此錯誤的解決方法。 –