fast forward
Forward……maaaaaach.
Thursday, July 16th, 2009 | Keith Morgan's Blog, teh internets | No Comments
More Flash video player PDL code. This time, Fast forward and reverse. Basically you set a timer that counts for you.
private const PLAYHEAD_UPDATE_INTERVAL_MS:uint = 10;
public var rewFF:Timer = new Timer(PLAYHEAD_UPDATE_INTERVAL_MS);
public function ffcontroller():void {
< button >.removeEventListener(MouseEvent.MOUSE_DOWN, ffcontroller);
video.pause();
rewFF.start();
rewFF.addEventListener(TimerEvent.TIMER, ffmotioncontroller);
this.addEventListener(MouseEvent.MOUSE_UP, ffstopcontroller);
}
public function ffstopcontroller(pEvent:MouseEvent):void {
rewFF.stop();
rewFF.removeEventListener(TimerEvent.TIMER, ffmotioncontroller);
rewFF.reset();
video.play();
ffBtn.addEventListener(MouseEvent.MOUSE_DOWN, ffcontroller);
}
public function ffmotioncontroller(event:TimerEvent):void {
elapsedTime = (time_elapsed + rewFF.currentCount);
video.seek(Number(elapsedTime.toFixed(1)));
}
…for reverse, just subtract the time_elapsed from the current count. You will also need a good number of frames embedded in your video for this to look cool.
Enjoy!
Find
Currently
There are no events to show at this time.