Jump to content
Search Community

VideoLoader and Papervision SecurityError: Error #2123

baldscone test
Moderator Tag

Recommended Posts

Hi - Im doing a project at the moment where I am trying to play a video from mydeo.net using VideoLoader. I am loading the video and setting the container of the loaded video to a movieclip instance which is then used to make a Papervision MovieMaterial. It worked fine locally with an flv but then when I hooked it up to use a mydeo flv it throws the following error:

[Fault] exception, information=SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///Z|/Dropbox/Current%20Projects/MyCompany/development/bin/MyCompany.swf cannot access unknown URL. No policy files granted access.

 

This also happens when I host it online. I have tried with and without checking Security files etc,

The code I am using is:

 

//Make up container for texture

container_clip = new MovieClip();

 

Security.loadPolicyFile("http://ht.cdn.mydeo.net/o1/u1/m3/crossdomain.xml");

Security.allowDomain("http://ht.cdn.mydeo.net");

 

var videoLoadVars:VideoLoaderVars = new VideoLoaderVars();

videoLoadVars.onComplete(videoLoaded);

videoLoadVars.container(frontVideoSpr.video_holder_mc);

videoLoadVars.width(frontVideoSpr.video_holder_mc.width);

videoLoadVars.height(frontVideoSpr.video_holder_mc.height);

videoLoadVars.scaleMode("stretch");

videoLoadVars.bgColor(0x000000);

videoLoadVars.autoPlay(false);

videoLoadVars.volume(1);

videoLoadVars.checkPolicyFile(true);

videoLoadVars.autoAdjustBuffer(true);

videoLoadVars.bufferTime(5);

videoLoadVars.centerRegistration(false);

videoLoadVars.onCancel(onLoadCancel);

videoLoadVars.onError(onLoadError);

videoLoadVars.onFail(onLoadError);

videoLoadVars.onIOError(onLoadError);

videoLoadVars.onSecurityError(onLoadError);

videoLoadVars.autoDispose(false);

videoLoader = new VideoLoader(_data.videoURL,videoLoadVars);

videoLoader.load();

 

Then later on...

 

container_clip.addChild(frontVideoSpr);

 

var maskrect:Rectangle = new Rectangle(0, 0, container_clip.width * TEXTURE_QUALITY, container_clip.height * TEXTURE_QUALITY);

 

//Set up MovieClip

var frontMaterial:MovieMaterial = new MovieMaterial(container_clip, true, true, true, maskrect);

frontMaterial.doubleSided = false;

frontMaterial.interactive = true;

frontMaterial.smooth = true;//BUG - could we set this later???

frontMaterial.precise = false;

frontMaterial.movieTransparent = false;//cleans up text but at big performance hit!

frontMaterial.tiled = true;//to clear up locks upat high angles

 

etc... then I make a cube with this texture as the front material.

 

This bug happens intermittently and I thought it may be the old progressive flash player bug but I noticed in the VideoLoader.as class that you have included a fix for that.

 

Any ideas what I can try next??? Im not 100% sure whether the mydeo is progressive or streaming but Im pretty sure its streaming - maybe I should be using Papervisions VideoStreamMaterial? Or am I just using the VideoLoader wrongly?

 

Any help would be great tracking this down.

 

Cheers,

baldscone

Link to comment
Share on other sites

I don't know PV3D, so I'm not quite sure what to tell you other than it sounds like you're trying to draw() a video that either isn't loaded adequately or you don't have the crossdomain.xml file in place that grants permission. Have you checked those things?

Link to comment
Share on other sites

Hi baldscone,

 

As greensock correctly identified, the issue you are encountering is in part due to our crossdomain.xml file not permitting connections from your domain, and this is compounded by the fact that your code tries to load the crossdomain.xml file from a URL with a typo in it. It should, in fact, be http://ht.cdn.mydeo.net/o1/u/m3/crossdomain.xml- and not http://ht.cdn.mydeo.net/o1/u1/m3/crossdomain.xml as you have asserted in your code snippet.

 

Once you've corrected the code to pull from the correct URL shown above, please contact us at help@mydeo.com providing your account details, and we will be glad to assist you further in regards to adding your domains into the crossdomain.xml file so you can continue with your project.

 

Kind Regards,

 

Richard.

Mydeo.com Customer Care

Link to comment
Share on other sites

Thanks Richard for your help - very nice support! I will get my client who has an account with you to request to add the domains for the site on to your crossdomain file. I might also add my dev server so I know it all works.

 

Greensock - brilliant work on the Loader stuff (and the rest of the Tweening APIs) - saving me heaps of time and I am happy to say I have been a club member for over a year now. Maybe we might see some papervision3D specific Tween stuff for Club members one day perhaps? Like a camera follow tween with easing or a 3D layout assistant for 3D objects?

Maybe not :D

Thanks,

baldscone

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...