Skip to content

Commit

Permalink
update pause tracking in tts engine
Browse files Browse the repository at this point in the history
  • Loading branch information
sbwhitt committed Sep 27, 2023
1 parent 8adfae8 commit 46df883
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 46df883

Please sign in to comment.