开发者

Help with loading local video file

I'm currently having a problem on loading video files from my local host. i have tried compiling my mxml with -use-network=false. but i cant do so because my project is also loading videos from youtube via a youtubeloader.

code im using for loading my local vid

<:mx:VideoDisplay id="vid" source="media/MyVideo.flv" height="250" width="250"/>

or is there any other way to load local video files?

Here is the error

SecurityError: Error #2148: SWF file file:///C|/Users/ifcdu1/Desktop/MP/Main.swf cannot access local resource file:///C|/Users/ifcdu1/Desktop/MP/media/MyVideo.flv. Only local-with-filesystem and trusted local SWF files may access local resources.

And here is the error if i compile with -use-network=false

SecurityError: Error #2028: Local-with-filesystem SWF file file:///C|/Users/ifcdu1/Desktop/MP/Main.swf cannot access Internet URL http://www.youtube.com/apiplayer?version=3.

Any help would be appreciated. than开发者_如何转开发ks


There are ways to handle this by editing your security sandbox.

But the easiest way to get this done would be to:

  1. Install Apache on your windows machine (incase you want a faster way of managing a localhost server install WAMP/XAMPP, takes around 5 minutes to download and install)

  2. Put the files under wamp/www/media

3.Instead of using

<mx:VideoDisplay id="vid" source="media/MyVideo.flv" height="250" width="250"/>

use

<mx:VideoDisplay id="vid" source="http://localhost/media/MyVideo.flv" height="250" width="250"/>

This should solve all the issues.

PS:It seems you want to create a web application and not a desktop application , because of which this issue is coming.Had you been using an AIR application , the local security sandbox exception would not have arose.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜