Archive | Media RSS for this section

BitmapData.draw() RTMP streaming

In many circumstances you may want to use BitmapData.draw() method to draw a Video Object into a Bitmap. Perhaps you want to take a ‘snapshot’ of a video stream,or to create some effects within the stream. If the stream is carried by http protocal,you just have to place a crossdomain.xml file on the domain where your flv files are.

However,there is no such policy file could be applied with rtmp protocal. So you should follow these two ways below to configure FMS setting. Either of them is OK.

1.Add this in FMS server side main.asc file:


2.If you are using FMSS(not the full version of FMS),you have no way to define server side Script. Then you can open the global config xml file,locate the VideoSampleAccess Tag,edit the node value. Note it must be a stroke as the node value:

<VideoSampleAccess enabled="true">/</VideoSampleAccess>

Flash Player privacy settings dialog disabled

When an application running in Adobe Flash Player is trying to access your camera or microphone. You should receive a privacy message similar to the one below, of course you should permit access:

However, sometimes you will find this message never exists and the program’s execution just stops here. Basically,that is because an important value in flash configuration file has been changed by anti-virus software. To solve the problem,you can simply delete this file or change the AVHardwareDisable value in this file from 1 to 0.

The configuration file “mms.cfg” is located in these places:

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

While in this circumstance how could we inform user? In official document, it says: In ActionScript, an author can query the System.capabilities.avHardwareDisable property to determine the value of this setting. But when I query this it always returns 0 which means the hardware was not disabled,which indeed it was. Thus, we should consider that in most of the conditions,there is no event could be listened from system level,which means the block problem could not be captured directly.

To hack the problem, I always use this way and it really works fine. When you enable Camera or Microphone in your application like running Camera.get(), attach an alert Sprite to the top layer. The layer could be exactly the same size as(or smaller than) the privacy setting dialog, and be placed in the absolutely center of the stage like this:

It occurs to give user information when the system privacy message was disabled, and it’s masked by the system privacy message in normal conditions. It works fine! Of course, don’t forget to remove this Sprite when the Camera.currentFps property turns to be positive numbers.