Skip to content

Commit

Permalink
fix double detect lang on youtube
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaXser authored Jan 18, 2024
1 parent e3a5407 commit 965824d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ class VideoHandler {
return;
}

if (mode === "play") {
if (mode == "play") {
debug.log("lipsync mode is play");
const audioPromise = this.audio.play();
if (audioPromise !== undefined) {
Expand All @@ -1604,19 +1604,19 @@ class VideoHandler {
}
return;
}
if (mode === "pause") {
if (mode == "pause") {
debug.log("lipsync mode is pause");
this.audio.pause();
}
if (mode === "stop") {
if (mode == "stop") {
debug.log("lipsync mode is stop");
this.audio.pause();
}
if (mode === "waiting") {
if (mode == "waiting") {
debug.log("lipsync mode is waiting");
this.audio.pause();
}
if (mode === "playing") {
if (mode == "playing") {
debug.log("lipsync mode is playing");
this.audio.play();
}
Expand Down Expand Up @@ -2070,6 +2070,8 @@ class VideoHandler {

this.stopTranslation();

if (!this.video?.duration) return;

this.videoData = await this.getVideoData();

this.firstPlay = true;
Expand Down

0 comments on commit 965824d

Please sign in to comment.