Jump to content
Search Community

VideoLoader - BitmapData.draw - SecurityError: Error #2123

murd test
Moderator Tag

Recommended Posts

Hi, I am striking a security error when trying to draw bitmapdata from a videoloader. This might be more a Flashplayer question but would like to know how to fix when using VideoLoader. Any help appreciated!


Crossdomain policy file:


<site-control permitted-cross-domain-policies="all"/>

<allow-access-from domain="*" secure="false"/>

<allow-http-request-headers-from domain="*" headers="*" secure="false"/>




masterLoader.append( new VideoLoader(aryStringPath, {name:aryStringPath, container:videocontainer.videos, width:VIDEO_HI_WIDTH, height:VIDEO_HI_HEIGHT, autoPlay:false, visible:false, scaleMode:"proportionalOutside", checkPolicyFile:true}) );



I then wait for the complete event. VideoLoader.VIDEO_COMPLETE


Bitmap Draw:

I then attempt to draw from the parent container.

bmDataLeft.draw(videocontainer, new Matrix(1, 0, 0, 1, 0, 0));


Security Error:

SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: www.domain.com/swf.swf cannot access unknown URL. No policy files granted access.
    at flash.display::BitmapData/draw()
    at com.packagename::WaterRippler/drawBitmaps()
    at com.packagename::WaterRippler/setupRipples()
    at com.packagename::VideoContainer/onVideoComplete()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at com.greensock.loading::VideoLoader/_statusHandler()

Things I have tried/checked:

 - policy file - completely open as above and in the root. Using a dedbugging proxy I can tell it loads correctly on page load.

 - added checkPolicyFile:true to loader params

 - video file is an FLV pulling from a static server (not streaming)

 - there is no DRM on the FLV's, they are produced by ourselves and hosted on our own server


If you have any ideas please let me know!

Thanks for your help.

Link to comment
Share on other sites

I don't see any obvious errors - this is certainly a Flash thing, not a VideoLoader/LoaderMax thing so I'm not entirely sure what to tell you. It almost sounds like your policy file isn't doing what it should. 


Have you tried just using a regular NetStream and circumventing VideoLoader altogether, just to see if it works? 

Link to comment
Share on other sites

Thanks for your response.


Turns out it is very buggy and inconsistent. I can draw from the video during first play, but if it pauses, stops or basically anything happens then it stops allowing me to draw. Then once the video is cached in the browser it actually allows it.


My solution for now is putting both the swf and videos on the same domain and in my test environment just populating the bitmapdata with transparent pixels so nothing breaks. Using a try, catch for when the security error fires on draw.


Not a real solution to the problem but means I can get on with my work and use my test environment!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...