6/23/2010 12:50:37 AM
Title:
videoplayer
i want to add forward and rewind option in my player using flex 3. how can i do it. help me please.
6/23/2010 2:47:41 AM
hiii.amutha .
do u want this on scroll bar thumbPress/thumbReleaseor on buttongs?
see the code given blow for thumb:
---------------------------------------------------------
<mx:Script>
<![CDATA[
private function slider_thumbPress():void {
videoDisplay.pause();
}
private function slider_thumbRelease():void {
//videoDisplay.pause();
videoDisplay.playheadTime = slider.value;
videoDisplay.play();
}
</mx:Script>
<mx:HSlider id="slider" width="358"
allowTrackClick="false"
invertThumbDirection="true"
liveDragging="true"
maximum="{videoDisplay.totalTime}"
minimum="0"
thumbPress="slider_thumbPress()"
thumbRelease="slider_thumbRelease()"
tickInterval="1"
value="{videoDisplay.playheadTime}" height="14"
/>
6/23/2010 2:48:27 AM
you can update this for ur application.
6/23/2010 3:52:57 AM
thanks for your reply gourav. but i had 2 buttons for forward and rewind once i click it means it will play the forward r rewind action. i dont want the above one.plz help me...
6/23/2010 4:16:40 AM
I have altered gaurav's code. for forward use
private function forwardVideo():void {
// 5 is the jump that you want to make to forward video
videoDisplay.playheadTime = videoDisplay.playheadTime+5;
videoDisplay.play();
}
for backuse
private function forwardVideo():void {
// 5 is the jump that you want to make to forward video
videoDisplay.playheadTime = videoDisplay.playheadTime-5;
videoDisplay.play();
}
6/23/2010 4:59:42 AM
hiii ur welcome..
i mean bow u have concept you can apply this code to ur button also
u can use ohio code also it will work
6/23/2010 9:09:52 PM
thanks ohio its work well thanks for your replay.
6/23/2010 9:57:17 PM
i have an another problem shall i control playing speed of my player that means i had normal and slow button if i click normal means video will play normal speed ,if i click slow means it will play slow , speed will reduced from normal.can i do it. please help me?
6/24/2010 6:50:04 AM
there is no way in the flash to change the speed or framerate of a video. An alternative is that your video should contain every frame as keyframe and then you can set the playhead property in a loop to move the video slow or fast. see this code
function slowVideo (){
myMovie.playheadTime=myMovie.playheadTime+.1;
}
var slowTimer=setInterval(slowVideo, 1000);
But remember if you create keframe on every frame of your video , the video size becomes very big