帮助加载本地视频文件
我目前在从本地主机加载视频文件时遇到问题。我尝试使用 -use-network=false 编译我的 mxml。但我不能这样做,因为我的项目还通过 youtubeloader 从 youtube 加载视频。
我使用代码加载本地视频
<:mx:VideoDisplay id="vid" source="media/MyVideo.flv" height="250" width="250"/>
或者有其他方法加载本地视频文件吗?
这是错误
安全错误:错误 #2148:SWF 文件 文件:///C|/Users/ifcdu1/Desktop/MP/Main.swf 无法访问本地资源 文件:///C|/Users/ifcdu1/Desktop/MP/media/MyVideo.flv。 仅本地文件系统且受信任 本地 SWF 文件可以访问本地 资源。
如果我使用 -use-network=false 进行编译,则会出现错误
安全错误:错误#2028: 本地文件系统 SWF 文件 文件:///C|/Users/ifcdu1/Desktop/MP/Main.swf 无法访问 Internet URL http://www.youtube.com/apiplayer?version=3。
任何帮助将不胜感激。谢谢
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. thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有多种方法可以通过编辑安全沙箱来处理此问题。
但完成此操作的最简单方法是:
在 Windows 计算机上安装 Apache(如果您想要更快的方式管理本地主机服务器,请安装 WAMP/XAMPP,下载和安装大约需要 5 分钟)
将文件放在 wamp/www/media 下
3.而不是使用
use
这应该可以解决所有问题。
PS:看来您想创建一个Web应用程序而不是桌面应用程序,因此出现了这个问题。如果您一直使用AIR应用程序,则不会出现本地安全沙箱异常。
There are ways to handle this by editing your security sandbox.
But the easiest way to get this done would be to:
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)
Put the files under wamp/www/media
3.Instead of using
use
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.