|
|
@ -134,14 +134,18 @@ class AudioPlayService : BaseService(), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun pause(pause: Boolean) { |
|
|
|
private fun pause(pause: Boolean) { |
|
|
|
AudioPlayService.pause = pause |
|
|
|
if (url.contains(".m3u8", false)) { |
|
|
|
handler.removeCallbacks(mpRunnable) |
|
|
|
stopSelf() |
|
|
|
position = mediaPlayer.currentPosition |
|
|
|
} else { |
|
|
|
mediaPlayer.pause() |
|
|
|
AudioPlayService.pause = pause |
|
|
|
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PAUSED) |
|
|
|
handler.removeCallbacks(mpRunnable) |
|
|
|
AudioPlay.status = Status.PAUSE |
|
|
|
position = mediaPlayer.currentPosition |
|
|
|
postEvent(Bus.AUDIO_STATE, Status.PAUSE) |
|
|
|
mediaPlayer.pause() |
|
|
|
upNotification() |
|
|
|
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PAUSED) |
|
|
|
|
|
|
|
AudioPlay.status = Status.PAUSE |
|
|
|
|
|
|
|
postEvent(Bus.AUDIO_STATE, Status.PAUSE) |
|
|
|
|
|
|
|
upNotification() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun resume() { |
|
|
|
private fun resume() { |
|
|
|