Archive for August, 2009

flash摄像头被禁止之mms.cfg与AVHardwareDisable

Friday, August 7th, 2009

突然接到很多用户投诉摄像头开启不了,也没有任何提示.
查了半天原来是360还不知道金山的升级补丁把flash的影音功能完全禁止了.
神经病的,还让不让开发者活了.
mms.cfg 位置:

Windows (Vista, XP and 2000) %WINDIR%\System32\Macromed\Flash
Macintosh /Library/Application Support/Macromedia
Linux, Flash Player 9 /etc/adobe/

里面有很多管理员可以设置的属性,比如:AVHardwareDisable
不过很傻的是:

If this value is set to 1, the privacy pop-up dialog never appears. However, the user can still access the Privacy tab and the Settings Manager, as well as tabs to let them designate which camera or microphone an application can use. These settings will appear functional, but any choices the user makes are ignored.

设成1后,不会弹出setting选项让用户设置了,即使用户打开,设置的也都无效…
不过还好有这个,至少让人知道有没有被禁止:

In ActionScript, an author can query the System. capabilities. avHardwareDisable property to determine the value of this setting.

用flash cs4测试果然可以了,谁知道用flash8打开测试一下,无论mms.cfg里如何设置,System.capabilities.avHardwareDisable 都返回true,我下的文档明明是8的guide文档.
于是,只好无论如何都在舞台上放一个提示,并且exactly放到这个下面,

adobe

当被AVHardwareDisable阻止弹出的时候,这个modal的框就不会出来,用户就可以看到提示了.
……