video .f4v very slow
Hello:
I'm having problems playing f4v video is very slow. The size is 100 MB and resolution 1280x720. When I play out of Flash it reproduces well.
I need to play in Desktop application not over Internet.
What I'm doing bad? Is there anywhere to play well or wich is the better option to do it?
thank you very much.
This is my code:
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.media.Video;
import flash.events.AsyncErrorEvent;
//fullscreen
stage.displayState = StageDisplayState.FULL_SCREEN;
var conexion:NetConnection= new NetConnection();
conexion.connect(null);
var display:NetStream = new NetStream(conexion);
display.play("videos/ocioelecer.f4v");
var video:Video = new Video(1280,720);
video.attachNetStream(display);
addChild(video);
display.addEventListener(AsyncErrorEvent.ASYNC_ERROR, noshow);
function noshow(event:AsyncErrorEvent):void{
//no show error
}
display.addEventListener(NetStatusEvent.NET_STATUS, statusHandler);
function statusHandler(event:NetStatusEvent):void
{
switch (event.info.code)
{
case "NetStream.Play.Start":
trace("Start [" + display.time.toFixed(3) + " seconds]");
break;
case "NetStream.Play.Stop":
//End video
trace("Stop [" + display.time.toFixed(3) + " seconds]");
(root.loaderInfo.loader.root as Object).removeSWF();
break;
}
}
