Search code examples
androidmediacontroller

Android MediaController End Of song


I have a play service that is playing audio in background task. I am letting MediaController control the playback of the audio in a "player window" which handles the playback UI.

All works fine except then the song gets to the end. The player does not "reset" as I would like it to. I want the progress bar to return to 0 and the pause/play button to revert back to play.

I can get the progress bar to return to 0 with a call to mediaPlayer.seekTo(0); How do I get the MediaController to reset the pause/play button back to show the play button?


Solution

  • So it turns out that show(0) after the audio has ended, re-displays the UI correctly. Thanks Cylon for the help!