Play mediaplayer for certain duration

后端 未结 2 1414
我在风中等你
我在风中等你 2020-12-22 11:14

I want to play the mediaplayer for just 10 sec. How to control it?

相关标签:
2条回答
  • 2020-12-22 12:00

    You could use TimerTask to schedule a MediaPlayer.stop() to run after 10 secs.

    0 讨论(0)
  • 2020-12-22 12:04

    You can implement a CountDownTimer that will stop your MediaPlayer. so you will not have to implement a thread or something.

    0 讨论(0)
提交回复
热议问题