Have you tried calling seekTo ()?
You can keep it updated by calling seekTo () every one and a half seconds using TimerTask , but I don't know how I feel about it.
EDIT: If you call seekTo () every 500 milliseconds to continue moving forward, you must call it the current ell since the last call (500 milliseconds in this case). But then again I do not know, this is the best approach. Another way is to create an OnSeekCompleteListener that will transform the new seekTo (currentPosition + timeEllapsed). In this case, you need to calculate timeEllapsed as follows: currentSystemTime - systemTimeOnLastCall
From http://developer.android.com/reference/android/media/MediaPlayer.html :
The playback position can be adjusted by calling seekTo (int).
Although the asynchronous seekTo (int) call returns to the right, the actual search operation may take some time, especially for streaming audio / video. When the actual search operation completes, the playerβs internal engine calls the user supplied by OnSeekComplete.onSeekComplete () if OnSeekCompleteListener is registered in advance through setOnSeekCompleteListener (OnSeekCompleteListener).
Note that seekTo (int) can also be called in other states, such as a ready, pause, and play state.
In addition, the actual current playback position can be obtained by calling getCurrentPosition (), which is useful for applications such as a music player that need to track playback progress.
bughi
source share