xarizmat
xarizmat

Reputation: 81

BackgroundAudioAgent WP7: Fast-forward/rewind audio playback

I am currently developing a WP7 Mango using Windows Phone Audio Playback Agent Application which streams music (in form of MP3 and WMA files) from a web service. Everything works perfectly, but i can't seem to figure out how to fast-forward/rewind audio playback. when i press and hold the next/previous buttons, the music stops, and it looks like its' seeking, but as soon as i let go, it reverts back to the position it was playing at before. Any help would be great.

Upvotes: 1

Views: 1134

Answers (4)

Derek Beattie
Derek Beattie

Reputation: 9478

I see, you have to do:

 case UserAction.Seek:
 player.Position = (TimeSpan) param;

Upvotes: 0

Waleed
Waleed

Reputation: 3145

From my understanding, you're trying to make a fast forwarding action then stop it, I guess you have to call the play (if the old state was playing) or pause (the other case) to stop the action of the fast forwarding.

Upvotes: 0

Edward Moemka
Edward Moemka

Reputation: 11

did you change the position property of the player in your audio task. You need to call FastForward and Rewind within these functions. And you also need to handle the Seek action and within there set the player's Position property to the value of param (passed as an argument only when a seek is specified). This will give you the functionality you want.

Upvotes: 1

Skomski
Skomski

Reputation: 4870

You have to react to the FastForward or Rewind Action in the OnUserAction Callback.

From Documentation:

User actions do not automatically make any changes in system state; the agent is responsible for carrying out the user actions if they are supported.

Upvotes: 1

Related Questions