pull/46/head
kunfei 5 years ago
parent 50aeb530e8
commit 3697cb3a1c
  1. 2
      app/src/main/java/io/legado/app/service/AudioPlayService.kt

@ -128,6 +128,7 @@ class AudioPlayService : BaseService(),
pause = false pause = false
mediaPlayer.start() mediaPlayer.start()
mediaPlayer.seekTo(position) mediaPlayer.seekTo(position)
handler.removeCallbacks(mpRunnable)
handler.postDelayed(mpRunnable, 1000) handler.postDelayed(mpRunnable, 1000)
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING) upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING)
postEvent(Bus.AUDIO_STATE, Status.PLAY) postEvent(Bus.AUDIO_STATE, Status.PLAY)
@ -147,6 +148,7 @@ class AudioPlayService : BaseService(),
mp?.start() mp?.start()
mp?.seekTo(position) mp?.seekTo(position)
postEvent(Bus.AUDIO_SIZE, mp?.duration) postEvent(Bus.AUDIO_SIZE, mp?.duration)
handler.removeCallbacks(mpRunnable)
handler.post(mpRunnable) handler.post(mpRunnable)
} }

Loading…
Cancel
Save