Pause/Stop MediaPlayer Android at given time programmatically

后端 未结 5 2054
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-09 12:23

I researched a little bit, but couldn\'t find any solutions to this problem: I would like to play a MediaPlayer and pause/stop it at a given time.. (ie: play from s

5条回答
  •  没有蜡笔的小新
    2021-02-09 12:44

    I think you can create Timer and call seekTo() directly from its task. Then call stop()/pause() inside of that Timer Task.

    Maybe this post will be helpfull for you.

    Or you can use handler for this task, like Ken Wolf shows you.

    Best wishes.

提交回复
热议问题