Friday, February 4, 2011

Video Player

Since I never handled FLV video in actionscript before, I referred to the script in this tutorial:
http://www.thetechlabs.com/tech-tutorials/audionvideo/how-to-build-a-as3-videoplayer/
However the video player that I need does not require the play/stop button, the volume scrubber and the timer display, so I removed the following lines

var bolVolumeScrub:Boolean = false;
function playClicked(e:MouseEvent):void { ... }
function pauseClicked(e:MouseEvent):void { ... }
function stopClicked(e:MouseEvent):void { ... }
function volumeScrubberClicked(e:MouseEvent):void { ... }
function formatTime(t:int):String { ... }


and some nested lines in updateDisplay and mouseReleased methods.
The submitted final had some bugs though, you can see it in the uploaded version here when you seek for the parts which hasn't been streamed yet. I should have written a progress handling function for it. Other than that, I intended to use TweenMax to slowly fade out the background music instead of just mute it, however it failed and the script did not work very well. Further improvement will be made soon.