Playing FLV unexpectedly stops, but why?
Posted
by Josamoto
on Stack Overflow
See other posts from Stack Overflow
or by Josamoto
Published on 2010-04-15T20:27:52Z
Indexed on
2010/04/16
6:03 UTC
Read the original article
Hit count: 184
actionscript-3
I am trying to play an FLV video that is about 90Mb big, using the following snippet:
private function playVideo(url:String):void
{
var customClient:Object = new Object();
customClient.onMetaData = metaDataHandler;
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = customClient;
ns.play(url);
var myVideo:Video = new Video();
myVideo.attachNetStream(ns);
addChild(myVideo);
function metaDataHandler(infoObject:Object):void
{
myVideo.width = 640;
myVideo.x = stage.stageWidth / 2 - 640 / 2;
myVideo.height = 400;
myVideo.y = 230;
}
}
The video is not going to be streamed across the internet, in fact, the application will run locally and videos will also be loaded locally from disc.
When starting my application, the video starts, but at random locations, playback completely freezes up, without any errors being thrown at all.
Does anybody have any idea as to why this might happen?
© Stack Overflow or respective owner