开发者

Flex: Accessing video content over local network

I am having a strange issue in my flex app. I have a Video element that loads an FLV file from the same directory as the SWF app. If I move my SWF and FLV to a local directory on my computer and load the SWF in my browser, the video plays without any issues. However, if I move the same collection of files (SWF, FLV, HTML) to a network share, the video no longer loads.

I am loading video using a NetConnection and NetStream and calling video.attachNetStream(stream) on my Video object.

stream = new NetStream(connection);
stream.addEventListener(NetStatusEvent.NET_ST开发者_如何转开发ATUS, netStatusHandler);
stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
var video:Video = new Video();
video.attachNetStream(stream);

In my netStatusHandler() callback I get an event status of: NetStream.Play.StreamNotFound.

Again, I only have this issue when loading content from a network share.


That would be because of the security sandbox since now your application is not 'local' anymore, the security sandbox policy is activated. There's 2 things you can do; you can add that network share/swf into your security sandbox through the security settings page or you can 'share' this over an http server (apache).

You should read up more on security sandboxes.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜