1 person found this helpful
It is a security restriction to prevent unauthorized sampling.
To enable sampling (BitmapData.draw) you may want to do the following.
- Create a valid crossdomain file at your video location
- Set checkPolicyFile on NetStream to true if you are subclassing netstream load trait or video element (there is no such property on video element right away)
- If you are not subclassing - try to explicitly load crossdomain with Security before loading video to cache policy.
RTMP (for FMS):
- You should have VideoSampleAccess enabled for your streaming application: http://livedocs.adobe.com/flashmediaserver/3.0/docs/help.html?content=08_xmlref_168.html
I don't know how to enable it for other streamers but I beleive there should be some setting also.
Ah... the security restriction makes sense.
I am loading the video locally.
Loading the crossdomain.xml via Security.loadPolicyFile("crossdomain.xml"); is not working and I do not know how to set checkPolicyFile on Netstream in OSMF.
Looks like I will have to dump OSMF and just roll omy own video player.
We have being using Bitmap.draw in couple of OSMF projects.
Although we are using RTMP I've tried HTTP also.
That loadPolicyFile thing is annoying.
I'll try to upload an example here lil' bit later...
Thank you Mykola,
Your example proved it is possible, and I was able to locate the problem.
I was grabbing the bitmapData.draw on an EnterFrame.
The solution was to kill the enter frame when switching videos and restart it when the video is playing.
var mediaPlayer:MediaPlayer = new MediaPlayer();
if(e.state == "playing")
You are right. We have used the BitmapData.draw to cut a live video region - simillary to what you are talking about.
We were having exceptions fired at the playback start - before "all gears are in correct place" somehow.
So we have being swallowing those exceptions until video start.
i am facing a same problem plz can u post yor crossdomain.xml here i am not able to view this anymore may be deleted??..