mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-23 14:55:24 -07:00
EsLint
This commit is contained in:
parent
8081293fe4
commit
9846c8bf9f
1 changed files with 13 additions and 14 deletions
|
@ -77,41 +77,40 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
play() {
|
play() {
|
||||||
const self = this;
|
|
||||||
speechSynthesis.cancel();
|
speechSynthesis.cancel();
|
||||||
|
|
||||||
const utterance = new SpeechSynthesisUtterance(this.step.text);
|
const utterance = new SpeechSynthesisUtterance(this.step.text);
|
||||||
utterance.onstart = (event) => {
|
utterance.onstart = (event) => {
|
||||||
self.playing = true;
|
this.playing = true;
|
||||||
self.played = false;
|
this.played = false;
|
||||||
self.paused = false;
|
this.paused = false;
|
||||||
// self.$emit("playing", true); // TODO: Consider if this event should bubble or a proxy of it should.
|
// this.$emit("playing", true); // TODO: Consider if this event should bubble or a proxy of it should.
|
||||||
|
|
||||||
console.debug("Now playing: " + this.step.text);
|
console.debug("Now playing: " + this.step.text);
|
||||||
};
|
};
|
||||||
utterance.onend = () => {
|
utterance.onend = () => {
|
||||||
self.playing = false;
|
this.playing = false;
|
||||||
self.played = true;
|
this.played = true;
|
||||||
self.paused = false;
|
this.paused = false;
|
||||||
self.$emit("ttscompleted", true);
|
this.$emit("ttscompleted", true);
|
||||||
|
|
||||||
console.debug("Playback complete");
|
console.debug("Playback complete");
|
||||||
};
|
};
|
||||||
|
|
||||||
utterance.onpause = () => {
|
utterance.onpause = () => {
|
||||||
self.playing = false;
|
this.playing = false;
|
||||||
self.paused = true;
|
this.paused = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
utterance.onresume = () => {
|
utterance.onresume = () => {
|
||||||
self.playing = true;
|
this.playing = true;
|
||||||
self.paused = false;
|
this.paused = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
utterance.onboundary = (event) => {
|
utterance.onboundary = (event) => {
|
||||||
// Update the start of the current sentence.
|
// Update the start of the current sentence.
|
||||||
if (event.name === "sentence") {
|
if (event.name === "sentence") {
|
||||||
self.currentIndex = event.charIndex;
|
this.currentIndex = event.charIndex;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// TODO: Evaluate the usefulness of this event.
|
// TODO: Evaluate the usefulness of this event.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue