Hello, when I use the following function in my doc class to launch a local video, the video “freezes” after a few seconds. This happens no matter what video I am trying to play.
private function startVideo(e:MouseEvent):void
{
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
ns.client = this;
ns.play("1280 x 800 Version_1.mp4");
function asyncErrorHandler(e:AsyncErrorEvent):void
{
trace(e.text);
}
var vid:Video = new Video();
vid.attachNetStream(ns);
vid.width = 1280;
vid.height = 800;
vid.x = 1024;
vid.y = 0;
addChild(vid);
}
Any reason why this might be happening? Thankyou.