Skip to main content

How to fast forward or rewind

4 replies [Last post]
vinaykagarwal
Offline
Joined: 2006-01-14
Points: 0

Hello,

I am having difficulty making fast forward or rewind work. Here is what I have tried

player.stop(); // Clock must be stopped to change rate
player.setRate(2.0f);
player.start();

But this simply plays at the normal rate. I tried the following instead of the last line
player.syncStart(player.getMediaTime()) or
player.syncStart(player.getSyncTime())

but all of them just play at the normal speed. What am I doing wrong? Thanks in advance.

Regards,
Vinay Agarwal

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joe Rice

You may need to set media time directly to achieve this. Only rates of
0.0 and 1.0 are required for JMF player support in BD.

Oh, and the Player doesn't need to be stopped to change the rate (or
to set the media time). See the javadocs for Player.

Cheers,
Joe

On 18 Sep 2009, at 9:04 AM, bd-j-dev@mobileandembedded.org wrote:

> Hello,
>
> I am having difficulty making fast forward or rewind work. Here is
> what I have tried
>
> player.stop(); // Clock must be stopped to change rate
> player.setRate(2.0f);
> player.start();
>
> But this simply plays at the normal rate. I tried the following
> instead of the last line
> player.syncStart(player.getMediaTime()) or
> player.syncStart(player.getSyncTime())
>
> but all of them just play at the normal speed. What am I doing
> wrong? Thanks in advance.
>
> Regards,
> Vinay Agarwal
> [Message sent by forum member 'vinaykagarwal' (VinayKAgarwal@hotmail.com
> )]
>
> http://forums.java.net/jive/thread.jspa?messageID=364646
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

vinaykagarwal
Offline
Joined: 2006-01-14
Points: 0

Joe,

My javadoc (which was created about a year ago) shows setRate method comes from Clock interface part of the Player where the further details state

You can only call this method on a Stopped Clock. A ClockStartedError is thrown if setRate is called on a Started Clock.

Has the spec changed? (May be I should update javadoc anyway.)

Vinay

Joe Rice

Look at the top of the javax.media.Player javadoc, in the section
called "How a Player Differs from a Controller"

Cheers,
Joe

On 18 Sep 2009, at 12:58 PM, bd-j-dev@mobileandembedded.org wrote:

> Joe,
>
> My javadoc (which was created about a year ago) shows setRate method
> comes from Clock interface part of the Player where the further
> details state
>
> You can only call this method on a Stopped Clock. A
> ClockStartedError is thrown if setRate is called on a Started Clock.
>
> Has the spec changed? (May be I should update javadoc anyway.)
>
> Vinay
> [Message sent by forum member 'vinaykagarwal' (VinayKAgarwal@hotmail.com
> )]
>
> http://forums.java.net/jive/thread.jspa?messageID=364704
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

vinaykagarwal
Offline
Joined: 2006-01-14
Points: 0

Thanks Joe - I had missed that completely. :-)