问题描述
我搜索了很多有关getUserMedia的DEMO和示例,但是大多数只是摄像头,而不是麦克风.
I had searched a lot of DEMO and examples about getUserMedia , but most are just camera capturing, not microphone.
因此,我下载了一些示例,并在自己的计算机上进行了尝试,可以进行相机捕获,但是当我改变
So I downloaded some examples and tried on my own computer , camera capturing is work ,But when I changed
navigator.webkitGetUserMedia({video : true},gotStream);
到
navigator.webkitGetUserMedia({audio : true},gotStream);
浏览器要求我先允许麦克风访问,然后失败,
The browser ask me to allow microphone access first, and then it failed at
document.getElementById("audio").src = window.webkitURL.createObjectURL(stream);
消息是:
GET blob:http%3A//localhost/a5077b7e-097a-4281-b444-8c1d3e327eb4 404 (Not Found)
这是我的代码: getUserMedia_simple_audio_test
我做错了吗?还是只有getUserMedia现在可以在相机上使用?
Did I do something wrong? Or only getUserMedia can work for camera now ?
推荐答案
当前在Google Chrome中不可用.请参见问题112367 .
It is currently not available in Google Chrome. See Issue 112367.
您可以在演示中看到它,它总是会提示错误
You can see in the demo, it will always throw an error saying
而且您也无法在
{
video: true,
audio: true
}
这篇关于HTML5的用于录音的getUserMedia现在可以正常工作了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!