Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaXser authored Jan 19, 2024
1 parent 68d1627 commit 3ad9892
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class VideoHandler {
this.srcObserver.observe(this.video, {
attributeFilter: ["src", "currentSrc"],
});
this.video.addEventListener("loadeddata", this.handleSrcChangedBound);
this.video.addEventListener("canplaythrough", this.handleSrcChanged);
this.stopTranslationBound = this.stopTranslation.bind(this);
this.handleVideoEventBound = this.handleVideoEvent.bind(this);
this.changeOpacityOnEventBound = this.changeOpacityOnEvent.bind(this);
Expand Down Expand Up @@ -1480,14 +1480,14 @@ class VideoHandler {

videoData.translationHelp = null; // ! should be null for ALL websites except coursera and udemy !
videoData.isStream = false; // by default, we request the translation of the video
videoData.duration = this.video.duration;
videoData.duration = this.video.duration; // ! if 0 - we get 400 error
videoData.videoId = getVideoId(this.site.host, this.video);
videoData.detectedLanguage = this.translateFromLang;
videoData.responseLanguage = this.translateToLang;

if (!videoData.videoId) {
this.ytData = {};
return;
return videoData;
}

if (window.location.hostname.includes("youtube.com")) {
Expand Down

0 comments on commit 3ad9892

Please sign in to comment.