Android MediaController End Of song

大兔子大兔子 提交于 2020-02-08 04:02:18

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/32673246/android-mediacontroller-end-of-song

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!