pull/1212/head
gedoor 3 years ago
parent 29475f2cee
commit 3465a79349
  1. 25
      app/src/main/java/io/legado/app/service/AudioPlayService.kt

@ -161,17 +161,22 @@ class AudioPlayService : BaseService(),
}
private fun resume() {
pause = false
if (!mediaPlayer.isPlaying) {
mediaPlayer.start()
mediaPlayer.seekTo(position)
try {
pause = false
if (!mediaPlayer.isPlaying) {
mediaPlayer.start()
mediaPlayer.seekTo(position)
}
handler.removeCallbacks(mpRunnable)
handler.postDelayed(mpRunnable, 1000)
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING)
AudioPlay.status = Status.PLAY
postEvent(EventBus.AUDIO_STATE, Status.PLAY)
upNotification()
} catch (e: Exception) {
e.printStackTrace()
stopSelf()
}
handler.removeCallbacks(mpRunnable)
handler.postDelayed(mpRunnable, 1000)
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING)
AudioPlay.status = Status.PLAY
postEvent(EventBus.AUDIO_STATE, Status.PLAY)
upNotification()
}
private fun adjustProgress(position: Int) {

Loading…
Cancel
Save