AS3确定摄像机的访问被拒绝 [英] as3 determine if camera access was denied

查看:321
本文介绍了AS3确定摄像机的访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何才能确定是否获得了摄像头和麦克风在Flash中被剥夺了?

How can I determine if access to the camera and mic were denied in Flash?

我可以在摄像头和麦克风,但我需要知道,如果用户拒绝访问。

I can get the camera and mic, but I need to know if the user denied access.

推荐答案

连接状态事件侦听器和检查相机是否静音,请参阅文档:

Attach a status event listener and check if the camera is muted, see docs:

在摄像头报告其状态时调度。在访问一个   摄像头,运行时将显示一个隐私对话框,让用户允许   或拒绝访问其摄像头。如果code属性的值   Camera.muted,则用户拒绝SWF文件访问   用户的摄像头。如果code属性的值   Camera.Unmuted,则表示用户允许SWF文件访问   用户的摄像头。   <一href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Camera.html#event:status">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Camera.html#event:status

Dispatched when a camera reports its status. Before accessing a camera, the runtime displays a Privacy dialog box to let users allow or deny access to their camera. If the value of the code property is "Camera.Muted", the user has refused to allow the SWF file access to the user's camera. If the value of the code property is "Camera.Unmuted", the user has allowed the SWF file access to the user's camera. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Camera.html#event:status

flash.media.Microphone具有同样的事情。

flash.media.Microphone has the same thing too.

这篇关于AS3确定摄像机的访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆