|
|
@ -116,6 +116,7 @@ class AudioPlayService : BaseService(), |
|
|
|
|
|
|
|
|
|
|
|
private fun pause(pause: Boolean) { |
|
|
|
private fun pause(pause: Boolean) { |
|
|
|
this.pause = pause |
|
|
|
this.pause = pause |
|
|
|
|
|
|
|
handler.removeCallbacks(mpRunnable) |
|
|
|
position = mediaPlayer.currentPosition |
|
|
|
position = mediaPlayer.currentPosition |
|
|
|
mediaPlayer.pause() |
|
|
|
mediaPlayer.pause() |
|
|
|
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PAUSED) |
|
|
|
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PAUSED) |
|
|
@ -127,6 +128,7 @@ class AudioPlayService : BaseService(), |
|
|
|
pause = false |
|
|
|
pause = false |
|
|
|
mediaPlayer.start() |
|
|
|
mediaPlayer.start() |
|
|
|
mediaPlayer.seekTo(position) |
|
|
|
mediaPlayer.seekTo(position) |
|
|
|
|
|
|
|
handler.postDelayed(mpRunnable, 1000) |
|
|
|
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING) |
|
|
|
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING) |
|
|
|
postEvent(Bus.AUDIO_STATE, Status.PLAY) |
|
|
|
postEvent(Bus.AUDIO_STATE, Status.PLAY) |
|
|
|
upNotification() |
|
|
|
upNotification() |
|
|
|