NotReadableError: Failed to allocate audiosource in Firefox for getUserMedia
NotReadableError: Failed to allocate audiosource in Firefox for getUserMedia
运行 我的 Firefox 控制台中的以下代码片段 returns 以下错误 [FF/56.0.2(64 位)在 Mac OS 10.13 .1]:
MediaStreamError { name: "NotReadableError", message: "Failed to
allocate audiosource", constraint: "", stack: "" } (unknown)
// Sippet
navigator.mediaDevices
.getUserMedia({
audio: true,
video: true
})
.then(stream=>{
console.log(stream.getAudioTracks())
document.getElementById('storybook-preview-iframe').contentWindow.document.getElementById('video-camera').srcObject = stream
mr = new window.MediaRecorder(stream, {
mimeType: 'video/webm'
})
mr.ondataavailable = console.log
})
.catch(console.log)
最麻烦的是它在某一时刻工作,然后就停止了。好像有什么东西被永久锁定了......我无法(据我所知)看到音频源有什么问题。
我运行这些精神错乱检查无济于事:
- 未使用相机打开其他浏览器或应用程序and/or
- 重新启动浏览器,最终重新启动计算机
- 我正在 mac,听说这会有所帮助
#> sudo killall AppleCameraAssistant;sudo killall VDCAssistant
。它没有。
- 运行一个单独的脚本(https://jsfiddle.net/App7P/348/) but when I turned the
audio
to true (https://jsfiddle.net/3k89sy27/2/),我得到了和上面一样的错误。
- getusermedia 上的这个 example/demo 页面也出现了同样的错误:https://webrtc.github.io/samples/src/content/getusermedia/record/
更新: 我把失败代码进一步简化了。
navigator.mediaDevices.getUserMedia({
audio: true
}).then(function (stream) {
console.log(stream)
}).catch(console.log)
音频不想注册.....
甚至尝试了 FF 自己的 Test Pilot 也失败了 https://testpilot.firefox.com/experiments/voice-fill/
按照@mrchestnut 的建议,我下载了 Firefox Quantum (which was released as of Nov. 14th 2017) 并且成功了!
Mozilla 上的博客 Post:
https://blog.mozilla.org/blog/2017/11/14/introducing-firefox-quantum/
下载量子:
https://www.mozilla.org/en-US/firefox/new/?scene=2
虽然这并不能解释为什么它不起作用,但糖确实解决了我的问题。
运行 我的 Firefox 控制台中的以下代码片段 returns 以下错误 [FF/56.0.2(64 位)在 Mac OS 10.13 .1]:
MediaStreamError { name: "NotReadableError", message: "Failed to allocate audiosource", constraint: "", stack: "" } (unknown)
// Sippet
navigator.mediaDevices
.getUserMedia({
audio: true,
video: true
})
.then(stream=>{
console.log(stream.getAudioTracks())
document.getElementById('storybook-preview-iframe').contentWindow.document.getElementById('video-camera').srcObject = stream
mr = new window.MediaRecorder(stream, {
mimeType: 'video/webm'
})
mr.ondataavailable = console.log
})
.catch(console.log)
最麻烦的是它在某一时刻工作,然后就停止了。好像有什么东西被永久锁定了......我无法(据我所知)看到音频源有什么问题。
我运行这些精神错乱检查无济于事:
- 未使用相机打开其他浏览器或应用程序and/or
- 重新启动浏览器,最终重新启动计算机
- 我正在 mac,听说这会有所帮助
#> sudo killall AppleCameraAssistant;sudo killall VDCAssistant
。它没有。 - 运行一个单独的脚本(https://jsfiddle.net/App7P/348/) but when I turned the
audio
to true (https://jsfiddle.net/3k89sy27/2/),我得到了和上面一样的错误。 - getusermedia 上的这个 example/demo 页面也出现了同样的错误:https://webrtc.github.io/samples/src/content/getusermedia/record/
更新: 我把失败代码进一步简化了。
navigator.mediaDevices.getUserMedia({
audio: true
}).then(function (stream) {
console.log(stream)
}).catch(console.log)
音频不想注册.....
甚至尝试了 FF 自己的 Test Pilot 也失败了 https://testpilot.firefox.com/experiments/voice-fill/
按照@mrchestnut 的建议,我下载了 Firefox Quantum (which was released as of Nov. 14th 2017) 并且成功了!
Mozilla 上的博客 Post:
https://blog.mozilla.org/blog/2017/11/14/introducing-firefox-quantum/
下载量子:
https://www.mozilla.org/en-US/firefox/new/?scene=2
虽然这并不能解释为什么它不起作用,但糖确实解决了我的问题。