avoid fetching the player position while it is being initialized
This commit is contained in:
parent
b64335fe06
commit
602e21ad5f
1 changed files with 4 additions and 2 deletions
|
@ -895,8 +895,10 @@ class MusicService : Service(), MediaPlayer.OnPreparedListener, MediaPlayer.OnEr
|
|||
if (isPlaying) {
|
||||
mProgressHandler.post(object : Runnable {
|
||||
override fun run() {
|
||||
val secs = mPlayer!!.currentPosition / 1000
|
||||
broadcastTrackProgress(secs)
|
||||
if (mPlayer?.isPlaying == true) {
|
||||
val secs = mPlayer!!.currentPosition / 1000
|
||||
broadcastTrackProgress(secs)
|
||||
}
|
||||
mProgressHandler.removeCallbacksAndMessages(null)
|
||||
mProgressHandler.postDelayed(this, PROGRESS_UPDATE_INTERVAL)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue