Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaXser authored Mar 16, 2024
1 parent 0526f7a commit 16445b8
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 35 deletions.
2 changes: 1 addition & 1 deletion dist/vot-cloudflare-min.user.js

Large diffs are not rendered by default.

20 changes: 9 additions & 11 deletions dist/vot-cloudflare.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -5442,23 +5442,16 @@ class VideoHandler {
this.container.draggable = false;
}

addExtraEventListener(this.video, "emptied", () => {
debug/* default */.A.log("lipsync mode is emptied");
this.stopTranslation();
});

addExtraEventListener(this.video, "progress", async () => {
if (
!(this.firstPlay && this.data.autoTranslate === 1) ||
!this.videoData.videoId ||
!this.firstPlay ||
this.data.autoTranslate !== 1 ||
getVideoId(this.site.host, this.video) !== this.videoData.videoId
) {
return;
}

if (!this.videoData.videoId) {
throw new VOTLocalizedError("VOTNoVideoIDFound");
}

try {
this.firstPlay = false;
await this.translateExecutor(this.videoData.videoId);
Expand Down Expand Up @@ -5814,6 +5807,10 @@ class VideoHandler {
debug/* default */.A.log("lipsync mode is playing");
this.audio.play();
}
if (mode == "emptied") {
debug/* default */.A.log("lipsync mode is emptied");
this.stopTranslation();
}
}

// Define a function to handle common events
Expand Down Expand Up @@ -6187,7 +6184,8 @@ class VideoHandler {
}

const hide =
!this.video.src && !this.video.currentSrc && !this.video.srcObject;
(!this.video.src && !this.video.currentSrc && !this.video.srcObject) ||
!this.videoData.videoId;
this.votButton.container.hidden = hide;
hide && (this.votMenu.container.hidden = hide);

Expand Down
2 changes: 1 addition & 1 deletion dist/vot-min.user.js

Large diffs are not rendered by default.

20 changes: 9 additions & 11 deletions dist/vot.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -5421,23 +5421,16 @@ class VideoHandler {
this.container.draggable = false;
}

addExtraEventListener(this.video, "emptied", () => {
debug/* default */.A.log("lipsync mode is emptied");
this.stopTranslation();
});

addExtraEventListener(this.video, "progress", async () => {
if (
!(this.firstPlay && this.data.autoTranslate === 1) ||
!this.videoData.videoId ||
!this.firstPlay ||
this.data.autoTranslate !== 1 ||
getVideoId(this.site.host, this.video) !== this.videoData.videoId
) {
return;
}

if (!this.videoData.videoId) {
throw new VOTLocalizedError("VOTNoVideoIDFound");
}

try {
this.firstPlay = false;
await this.translateExecutor(this.videoData.videoId);
Expand Down Expand Up @@ -5793,6 +5786,10 @@ class VideoHandler {
debug/* default */.A.log("lipsync mode is playing");
this.audio.play();
}
if (mode == "emptied") {
debug/* default */.A.log("lipsync mode is emptied");
this.stopTranslation();
}
}

// Define a function to handle common events
Expand Down Expand Up @@ -6156,7 +6153,8 @@ class VideoHandler {
}

const hide =
!this.video.src && !this.video.currentSrc && !this.video.srcObject;
(!this.video.src && !this.video.currentSrc && !this.video.srcObject) ||
!this.videoData.videoId;
this.votButton.container.hidden = hide;
hide && (this.votMenu.container.hidden = hide);

Expand Down
20 changes: 9 additions & 11 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1278,23 +1278,16 @@ class VideoHandler {
this.container.draggable = false;
}

addExtraEventListener(this.video, "emptied", () => {
debug.log("lipsync mode is emptied");
this.stopTranslation();
});

addExtraEventListener(this.video, "progress", async () => {
if (
!(this.firstPlay && this.data.autoTranslate === 1) ||
!this.videoData.videoId ||
!this.firstPlay ||
this.data.autoTranslate !== 1 ||
getVideoId(this.site.host, this.video) !== this.videoData.videoId
) {
return;
}

if (!this.videoData.videoId) {
throw new VOTLocalizedError("VOTNoVideoIDFound");
}

try {
this.firstPlay = false;
await this.translateExecutor(this.videoData.videoId);
Expand Down Expand Up @@ -1650,6 +1643,10 @@ class VideoHandler {
debug.log("lipsync mode is playing");
this.audio.play();
}
if (mode == "emptied") {
debug.log("lipsync mode is emptied");
this.stopTranslation();
}
}

// Define a function to handle common events
Expand Down Expand Up @@ -2023,7 +2020,8 @@ class VideoHandler {
}

const hide =
!this.video.src && !this.video.currentSrc && !this.video.srcObject;
(!this.video.src && !this.video.currentSrc && !this.video.srcObject) ||
!this.videoData.videoId;
this.votButton.container.hidden = hide;
hide && (this.votMenu.container.hidden = hide);

Expand Down

0 comments on commit 16445b8

Please sign in to comment.