PDL

Forward……maaaaaach.

Thursday, July 16th, 2009 | Keith Morgan's Blog, teh internets | No Comments

No Gravatar

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!

Tags: , , , , ,

zoom zoom….

Thursday, July 16th, 2009 | Keith Morgan's Blog, teh internets | No Comments

No Gravatar

Cleaning out some of my flash video player junk and ran across a basic zoom in/out function for progressive download players. Assuming your video object is the child of a sprite (videoSprite):


public function zoomincontroller(pEvent:MouseEvent):void {
//move and scale sprite
videoSprite.x -= ;
videoSprite.y -= ;
videoSprite.width += (*2);
videoSprite.height += (*2);
}
public function zoomoutcontroller(pEvent:MouseEvent):void {
//reset sprite
videoSprite.x = 0;
videoSprite.y = 0;
videoSprite.width = stage.stageWidth;
videoSprite.height = stage.stageHeight;
}

….never really got around to retooling it. The basic concept is that you scale and reposition the Sprite the video is in. Obviously you will need a high-res video for this to look like anything…

Enjoy!

Tags: , , , , , , ,

Find

Currently

There are no events to show at this time.

Fix