Skip to content

Commit

Permalink
Merge pull request #1248 from sbwhitt/fix/tts-play/pause
Browse files Browse the repository at this point in the history
Fix TTS play/pause button remaining in paused state after re-opening
  • Loading branch information
cdrini authored Oct 3, 2023
2 parents be0b1a7 + 46df883 commit ecbac78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/plugins/tts/AbstractTTSEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export default class AbstractTTSEngine {
*/
start(leafIndex, numLeafs) {
this.playing = true;
this.paused = false;
this.opts.onLoadingStart();

this._chunkIterator = new PageChunkIterator(numLeafs, leafIndex, {
Expand All @@ -95,6 +96,7 @@ export default class AbstractTTSEngine {
stop() {
if (this.activeSound) this.activeSound.stop();
this.playing = false;
this.paused = true;
this._chunkIterator = null;
this.activeSound = null;
this.events.trigger('stop');
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tts/plugin.tts.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ BookReader.prototype.ttsPlayPause = function() {
this.ttsToggle();
} else {
this.ttsEngine.togglePlayPause();
this.ttsUpdateState(this.ttsEngine.paused);
this.ttsUpdateState();
}
};

Expand Down

0 comments on commit ecbac78

Please sign in to comment.