问题
I want to play the mediaplayer for just 10 sec. How to control it?
回答1:
You could use TimerTask
to schedule a MediaPlayer.stop()
to run after 10 secs.
回答2:
You can implement a CountDownTimer that will stop your MediaPlayer. so you will not have to implement a thread or something.
来源:https://stackoverflow.com/questions/4958003/play-mediaplayer-for-certain-duration