小编use*_*276的帖子

WebRTC:Firefox 未检测到任何输出设备

我尝试在 Ubuntu 16.04 上运行此脚本以检测 Mozilla Firefox v50.1.0 中的音频设备。[1]

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);
});
Run Code Online (Sandbox Code Playgroud)

它只检测输入设备,不检测输出。适用于 Chrome 和 Opera,但不适用于 Firefox。

顺便说一下,我需要手动将我的页面域添加到 Firefox 的 about:config 中的 media.getusermedia.screensharing.allowed_domains 以获取弹出窗口提示以允许共享我的设备。为什么这是必要的?

javascript firefox device webrtc output

3
推荐指数
1
解决办法
2014
查看次数

标签 统计

device ×1

firefox ×1

javascript ×1

output ×1

webrtc ×1