File tree 1 file changed +2
-2
lines changed
android/src/org/coolreader/tts
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1308,12 +1308,12 @@ public void work() {
1308
1308
SentenceInfo nextSentenceInfo = sentenceInfo .nextSentence ;
1309
1309
if (sentenceInfo .audioFile == TTSControlService .this .audioFile ){
1310
1310
if (nextSentenceInfo .isFirstSentenceInAudioFile ){
1311
- if (mState == State .PLAYING && !mMediaPlayer .isPlaying ()){
1311
+ if (mState == State .PLAYING && ( mMediaPlayer == null || !mMediaPlayer .isPlaying () )){
1312
1312
//this is the last sentence in the file, and the media player ended
1313
1313
isAfterSentence = true ;
1314
1314
}
1315
1315
}else {
1316
- if (mMediaPlayer .isPlaying ()){
1316
+ if (mMediaPlayer != null && mMediaPlayer .isPlaying ()){
1317
1317
double curPos = mMediaPlayer .getCurrentPosition () / 1000.0 ;
1318
1318
if (curPos >= nextSentenceInfo .startTime ){
1319
1319
isAfterSentence = true ;
You can’t perform that action at this time.
0 commit comments