我試圖運行此腳本來檢測Ubuntu 16.04上Mozilla Firefox v50.1.0中的音頻設備。 [1]WebRTC:Firefox未檢測到任何輸出設備
navigator.mediaDevices.enumerateDevices()
.then(function(devices) {
devices.forEach(function(device) {
console.log(device.kind + ": " + device.label +
" id = " + device.deviceId);
});
})
.catch(function(err) {
console.log(err.name + ": " + err.message);
});
它只檢測輸入設備,但沒有輸出。適用於Chrome和Opera,但不適用於Firefox。
順便說一句,我需要手動添加我的網頁的域名到media.getusermedia.screensharing.allowed_domains在Firefox的about:config來獲得彈出窗口提示允許共享我的設備。爲什麼這是必要的?
謝謝你的回答 – user3618276