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

This commit is contained in:
zhongerxll
2025-05-30 04:13:28 -05:00
committed by GitHub
parent bce208c9df
commit 39785e5eab

View File

@@ -285,6 +285,7 @@ abstract class BaseReadAloudService : BaseService(),
needResumeOnAudioFocusGain = false
needResumeOnCallStateIdle = false
upReadAloudNotification()
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING)
postEvent(EventBus.ALOUD_STATE, Status.PLAY)
}
@@ -664,11 +665,13 @@ abstract class BaseReadAloudService : BaseService(),
open fun prevChapter() {
toLast = false
ReadBook.moveToPrevChapter(true, toLast = false)
play()
}
open fun nextChapter() {
ReadBook.upReadTime()
AppLog.putDebug("${ReadBook.curTextChapter?.chapter?.title} 朗读结束跳转下一章并朗读")
play()
if (!ReadBook.moveToNextChapter(true)) {
stopSelf()
}