0

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.

4

2 に答える 2

1

This article might help you a little further: Netstream and step() or seek()?.

What are you trying to play? If it's just a static video you might be able to use the regular video objects, then you'll be able to use the playheadTime property (which might not be very accurate by the way - depending on the number of keyframes).

Good luck!

于 2012-08-16T19:39:48.817 に答える
1

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:

ns.seek(ns.time + 3);

For 3 sec backward:

ns.seek(ns.time - 3);
于 2012-08-16T19:43:49.463 に答える