File tree Expand file tree Collapse file tree
android/src/org/coolreader/tts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1308,12 +1308,12 @@ public void work() {
13081308 SentenceInfo nextSentenceInfo = sentenceInfo .nextSentence ;
13091309 if (sentenceInfo .audioFile == TTSControlService .this .audioFile ){
13101310 if (nextSentenceInfo .isFirstSentenceInAudioFile ){
1311- if (mState == State .PLAYING && !mMediaPlayer .isPlaying ()){
1311+ if (mState == State .PLAYING && ( mMediaPlayer == null || !mMediaPlayer .isPlaying () )){
13121312 //this is the last sentence in the file, and the media player ended
13131313 isAfterSentence = true ;
13141314 }
13151315 }else {
1316- if (mMediaPlayer .isPlaying ()){
1316+ if (mMediaPlayer != null && mMediaPlayer .isPlaying ()){
13171317 double curPos = mMediaPlayer .getCurrentPosition () / 1000.0 ;
13181318 if (curPos >= nextSentenceInfo .startTime ){
13191319 isAfterSentence = true ;
You can’t perform that action at this time.
0 commit comments