帮助加载本地视频文件

发布于 2024-11-14 12:48:01 字数 802 浏览 5 评论 0原文

我目前在从本地主机加载视频文件时遇到问题。我尝试使用 -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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

扎心 2024-11-21 12:48:01

有多种方法可以通过编辑安全沙箱来处理此问题。

但完成此操作的最简单方法是:

  1. 在 Windows 计算机上安装 Apache(如果您想要更快的方式管理本地主机服务器,请安装 WAMP/XAMPP,下载和安装大约需要 5 分钟)

  2. 将文件放在 wamp/www/media 下

3.而不是使用

<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"/>

这应该可以解决所有问题。

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:

  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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文