This commit is contained in:
kunfei 2022-01-19 17:12:24 +08:00
parent 0d1efeb529
commit 2c70845c06
2 changed files with 23 additions and 21 deletions

View File

@ -1,5 +1,5 @@
{ {
"UploadUrl": "http://sy.miaogongzi.cc/shuyuan,{\"method\":\"POST\",\"body\": {\"file\": \"fileRequest\"},\"type\": \"multipart/form-data\"}", "UploadUrl": "http://sy.mgz6.cc/shuyuan,{\"method\":\"POST\",\"body\": {\"file\": \"fileRequest\"},\"type\": \"multipart/form-data\"}",
"DownloadUrlRule": "$.data@js:if (result == '') \n '' \n else \n 'https://shuyuan.miaogongzi.cc/shuyuan/' + result", "DownloadUrlRule": "$.data@js:if (result == '') \n '' \n else \n 'https://shuyuan.mgz6.cc/shuyuan/' + result",
"summary": "有效期2天" "summary": "有效期2天"
} }

View File

@ -92,8 +92,7 @@ abstract class BaseReadAloudService : BaseService(),
} }
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
intent?.action?.let { action -> when (intent?.action) {
when (action) {
IntentAction.play -> { IntentAction.play -> {
textChapter = ReadBook.curTextChapter textChapter = ReadBook.curTextChapter
pageIndex = ReadBook.durPageIndex() pageIndex = ReadBook.durPageIndex()
@ -110,7 +109,6 @@ abstract class BaseReadAloudService : BaseService(),
IntentAction.setTimer -> setTimer(intent.getIntExtra("minute", 0)) IntentAction.setTimer -> setTimer(intent.getIntExtra("minute", 0))
else -> stopSelf() else -> stopSelf()
} }
}
return super.onStartCommand(intent, flags, startId) return super.onStartCommand(intent, flags, startId)
} }
@ -158,9 +156,13 @@ abstract class BaseReadAloudService : BaseService(),
@CallSuper @CallSuper
open fun resumeReadAloud() { open fun resumeReadAloud() {
pause = false pause = false
if (contentList.isEmpty()) {
ReadBook.readAloud()
} else {
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING) upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING)
postEvent(EventBus.ALOUD_STATE, Status.PLAY) postEvent(EventBus.ALOUD_STATE, Status.PLAY)
} }
}
abstract fun upSpeechRate(reset: Boolean = false) abstract fun upSpeechRate(reset: Boolean = false)