mirror of
https://github.com/gedoor/legado.git
synced 2024-07-19 01:17:25 +08:00
优化
This commit is contained in:
parent
07f722faa1
commit
381c4d8e19
@ -350,13 +350,7 @@ class AudioPlayService : BaseService(),
|
|||||||
postEvent(EventBus.AUDIO_BUFFER_PROGRESS, exoPlayer.bufferedPosition.toInt())
|
postEvent(EventBus.AUDIO_BUFFER_PROGRESS, exoPlayer.bufferedPosition.toInt())
|
||||||
it.durChapterPos = exoPlayer.currentPosition.toInt()
|
it.durChapterPos = exoPlayer.currentPosition.toInt()
|
||||||
postEvent(EventBus.AUDIO_PROGRESS, it.durChapterPos)
|
postEvent(EventBus.AUDIO_PROGRESS, it.durChapterPos)
|
||||||
mediaSessionCompat?.setPlaybackState(
|
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING)
|
||||||
PlaybackStateCompat.Builder()
|
|
||||||
.setActions(PlaybackStateCompat.ACTION_SEEK_TO)
|
|
||||||
.setState(PlaybackStateCompat.STATE_NONE, exoPlayer.currentPosition, 1f)
|
|
||||||
.setBufferedPosition(exoPlayer.bufferedPosition)
|
|
||||||
.build()
|
|
||||||
)
|
|
||||||
saveProgress(it)
|
saveProgress(it)
|
||||||
}
|
}
|
||||||
delay(1000)
|
delay(1000)
|
||||||
@ -435,7 +429,8 @@ class AudioPlayService : BaseService(),
|
|||||||
mediaSessionCompat?.setPlaybackState(
|
mediaSessionCompat?.setPlaybackState(
|
||||||
PlaybackStateCompat.Builder()
|
PlaybackStateCompat.Builder()
|
||||||
.setActions(MediaHelp.MEDIA_SESSION_ACTIONS)
|
.setActions(MediaHelp.MEDIA_SESSION_ACTIONS)
|
||||||
.setState(state, position.toLong(), 1f)
|
.setState(state, exoPlayer.currentPosition, 1f)
|
||||||
|
.setBufferedPosition(exoPlayer.bufferedPosition)
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user