-
netStream..rewind/fast forward an FLV??
OK well I've made a video player using XML and netstream to bring in the FLV's - but how on earth would I go about making fast forward/rewind buttons to control it? I've browsed forums for ages but can't find a solution..someone please help!
Thankyou for your time!
-
Hi,
Here's the code to fastforward when using my Custom FLV Player component:
Code:
function fastForward (toTime, step)
{
this.toTime = toTime;
this.step = step;
count = 0;
this.onEnterFrame = function()
{
duration = myDisplay._duration;
// Wait until duration property is accessible, only then can we begin fast forward
if(myDisplay._duration != null)
{
delete this.onEnterFrame;
this.onEnterFrame = moveForward;
}
}
}
function moveForward ()
{
if(myDisplay._netStream.time >= toTime)
{
delete this.onEnterFrame;
return;
}
var currentTime = myDisplay._netStream.time;
myDisplay._netStream.seek(currentTime + step);
}
// begin fast forward to 20 seconds, stepping forward by 0.1 seconds each frame
fastForward(20, 0.1);
Start the fast-forward by calling the function
fastForward(toTime, step);
where 'toTime' is the time in seconds to fast-forward to, and 'step' is the amount of time in seconds to move forward each frame of the fast-forward. The value of 'step' cannot be lower than 0.1. The higher the value of 'step', the faster the fast-forward.
Dene
Last edited by Dene; 05-28-2006 at 08:00 AM.
-
Your FLV should have plenty of keyframes encoded for the fast-forward effect to work.
-
re4m-astic to the bone! =]
how about in AS3?
Is there a way to make ff or rw to f4v ?
-
My video component above was developed for AS2.
For AS3, coding from scratch would involve calling the seek() function (of the NetStream object) repeatedly while the fast-forward button is held down.
I would do this with a Timer. Each time the TimerEvent runs, increment the time value passed to seek().
-
Thanks for the code Dene!
I'm trying to get this to work and haven't quite got there yet. What is the "my_display" part? Perhaps that's what's missing in my application.
Best wishes,
Video Man
-
In Custom FLV Player's component's, the Display component (which might have an instance name of 'myDisplay') is the video object which displays the video.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|