通过程序在Web浏览器里调用摄像头,报错“NotReadableError: Failed to allocate videosource”的原因及解决办法。文末附Web调用摄像头的程序说明。
一开始在360浏览器里调用摄像头,报错“[object NavigatorUserMediaError]”,也没找到相关权限开关的设置!Web程序基本上是没问题的,因为此前成功开启过摄像头。想到可能权限的问题,欲换成在Firefox火狐浏览器运行程序并打开摄像头,错误提示“NotReadableError: Failed to allocate videosource”,百度了一下在stackoverflow找到了答案(英文):
NotReadableError: Failed to allocate videosource
Most commonly this happens on Windows because the webcam is already in use by another app. Firefox will throw this error on both
Windows and Mac even though only on Windows processes get exclusive access to the webcam.
翻译:最常见的是在Windows上发生,因为网络摄像头已经被另一个应用程序使用。Firefox会在Windows和Mac上抛出这个错误,即使只有在Windows进程中对网络摄像头进行独占访问。
Please make sure your camera is not been used by some other application (chrome, ie or any other browser). I wasted have of my day
searchin