Skip to content

Commit ecbac78

Browse files
authored
Merge pull request #1248 from sbwhitt/fix/tts-play/pause
Fix TTS play/pause button remaining in paused state after re-opening
2 parents be0b1a7 + 46df883 commit ecbac78

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/plugins/tts/AbstractTTSEngine.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export default class AbstractTTSEngine {
8080
*/
8181
start(leafIndex, numLeafs) {
8282
this.playing = true;
83+
this.paused = false;
8384
this.opts.onLoadingStart();
8485

8586
this._chunkIterator = new PageChunkIterator(numLeafs, leafIndex, {
@@ -95,6 +96,7 @@ export default class AbstractTTSEngine {
9596
stop() {
9697
if (this.activeSound) this.activeSound.stop();
9798
this.playing = false;
99+
this.paused = true;
98100
this._chunkIterator = null;
99101
this.activeSound = null;
100102
this.events.trigger('stop');

src/plugins/tts/plugin.tts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ BookReader.prototype.ttsPlayPause = function() {
251251
this.ttsToggle();
252252
} else {
253253
this.ttsEngine.togglePlayPause();
254-
this.ttsUpdateState(this.ttsEngine.paused);
254+
this.ttsUpdateState();
255255
}
256256
};
257257

0 commit comments

Comments
 (0)