MediaPlayer instance: stop behaves like a pause

后端 未结 2 1708
忘掉有多难
忘掉有多难 2021-01-13 11:00

I wrote a small music playback control test application. I have a play, pause, stop and rewind button. My issue is that that player.stop(); is behaving the same exact w

2条回答
  •  天命终不由人
    2021-01-13 11:32

    I think this might be a bug, because the API documentation for the MediaPlayer start method suggests the behavior that you expect:

    public void start ()

    Starts or resumes playback. If playback had previously been paused, playback will continue from where it was paused. If playback had been stopped, or never started before, playback will start at the beginning.

    For the time being, explicitly calling seekTo(0) once the player is prepared seems to be a reasonable workaround.

提交回复
热议问题