actionscript-3 - 检测相机是否在使用中?

标签 actionscript-3 webcam

The docs

If getCamera() returns null, either the camera is in use by another application, or there are no cameras installed on the system. To determine whether any cameras are installed, use the names.length property

所以为了检测相机是否被拍摄,我应该能够检查 if (Camera.getCamera() == null && Camera.names.length > 0),对吗?

我可以通过在 IE 中打开 Webcam Toy,然后尝试在 Chrome 中调试我的应用程序来复制另一个应用程序“拍摄”我的网络摄像头,但是 Camera.getCamera() 仍然返回一个相机对象,即使我无法从我的网络摄像头看到提要。

如果我关闭 IE 应用程序并在 Chrome 中重新启动我的应用程序,我可以再次看到提要。

是文档错了,还是我错了?

最佳答案

希望这会有所帮助。我不久前写了一篇关于检测多个摄像头并在 AS3 中设置默认值的博文。希望这些信息对您有用。

博文: http://www.charlesclements.net/blog/flash-as3-setting-default-camera-part-2/

源文件: http://www.charlesclements.net/blog/swfs/camera_detection/UseDefaultCameras_201203141746.zip

关于actionscript-3 - 检测相机是否在使用中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26981843/

相关文章:

actionscript-3 - 引用由 Actionscript 3 中的子类定义的函数

php - Flash AS2 将分数存储在 mysql 数据库中

ffmpeg 水平翻转网络摄像头到虚拟摄像机

python - OpenCV 升级网络摄像头的提要而不是使用全分辨率

Java Eclipse "process"关闭应用程序后未结束

c++ - mediafoundation 能否允许多个客户端同时访问单个网络摄像头设备?

actionscript-3 - As3 同时按字母和数字排序

actionscript-3 - AS3 Sound.Play(starttime)奇怪的延迟

javascript - Adobe Canvas HTML5 AS3 点击标签

linux - 网络摄像头罗技和 Linux