问题描述:

Android's documentation describes how MediaPlayer changes state as outlined in this diagram:

I'd like to update my GUI to provide the user with playback feedback. There should be a label in the interface that says "Playing", "Buffering" or "Stopped" depending on the state of the player. How can I implement this? I've been looking for something like an OnStateChangedListener, but apparently that doesn't exist.

网友答案:

For buffering you can listen setOnBufferingUpdateListener.
For "Playing" and "Stopped" after onPrepared() is called, you can monitor getCurrentPosition.

相关阅读:
Top