I have NetStream attached to video control in flash movie.
I cannot understand how to jump forward or backward.
var ns:NetStream = new NetStream(nc);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
ns.play("Video.flv");
vid.attachNetStream(ns);
I need somethinf like
btnSkip.addEventListener(MouseEvent.CLICK, playClicked);
function playClicked(e:MouseEvent):void {
ns.pause();
//ns.step(1000)
//ns.seek(1);
ns.resume();
}
ns.step() – doesn’t work and I don’t know why.
ns.seek – works fine, but I don’t know where is a position, there’s no ns.position and no ns.fps properties to add ns.seek(ns.position+(ns.fps*3)) to skip 3 seconds forward.
It is rather simple actually. Use the seek method on your netStream. To get the position use the time method and then add the offset you need
For 3 sec forward:
For 3 sec backward: