朗读暂停时,下一章现在会自动开始播放; 修复朗读暂停时直接下一章/段,系统媒体控件还保留在暂停状态的问题 (#5105)

This commit is contained in:
zhongerxll
2025-05-30 17:13:28 +08:00
committed by GitHub
parent bce208c9df
commit 39785e5eab
@@ -285,6 +285,7 @@ abstract class BaseReadAloudService : BaseService(),
needResumeOnAudioFocusGain = false needResumeOnAudioFocusGain = false
needResumeOnCallStateIdle = false needResumeOnCallStateIdle = false
upReadAloudNotification() upReadAloudNotification()
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING)
postEvent(EventBus.ALOUD_STATE, Status.PLAY) postEvent(EventBus.ALOUD_STATE, Status.PLAY)
} }
@@ -664,11 +665,13 @@ abstract class BaseReadAloudService : BaseService(),
open fun prevChapter() { open fun prevChapter() {
toLast = false toLast = false
ReadBook.moveToPrevChapter(true, toLast = false) ReadBook.moveToPrevChapter(true, toLast = false)
play()
} }
open fun nextChapter() { open fun nextChapter() {
ReadBook.upReadTime() ReadBook.upReadTime()
AppLog.putDebug("${ReadBook.curTextChapter?.chapter?.title} 朗读结束跳转下一章并朗读") AppLog.putDebug("${ReadBook.curTextChapter?.chapter?.title} 朗读结束跳转下一章并朗读")
play()
if (!ReadBook.moveToNextChapter(true)) { if (!ReadBook.moveToNextChapter(true)) {
stopSelf() stopSelf()
} }