diff --git a/changelog.md b/changelog.md index e25e8953..bf87bd90 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,7 @@ - Включен обход Media CSP для player.vimeo.com - Исправлена работа встраиваемого плеера Vimeo (player.vimeo.com), если видео залито в приватный доступ и доступно только через встраивание (#543, #828) - Добавлена поддержка субтитров от сайта для Vimeo +- Исправлено неверное название при отключение чекбокса усилителя громкости аудио # 1.7.0 diff --git a/dist/vot-min.user.js b/dist/vot-min.user.js index 06bfb911..3e258ca9 100644 --- a/dist/vot-min.user.js +++ b/dist/vot-min.user.js @@ -276,7 +276,7 @@ ${100*this.getVideoVolume()}%`,100*this.getVideoVolume()),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoVolumeSlider.container),this.votVideoTranslationVolumeSlider=Te.createSlider(Ut`${z.get("VOTVolumeTranslation")}: ${this.data?.defaultVolume??100}%`,this.data?.defaultVolume??100,0,this.data.audioBooster?900:100),this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoTranslationVolumeSlider.container),this.votMenu.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votSettingsDialog=Te.createDialog(z.get("VOTSettings")),document.documentElement.appendChild(this.votSettingsDialog.container),this.votTranslationHeader=Te.createHeader(z.get("translationSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationHeader),this.votAutoTranslateCheckbox=Te.createCheckbox(z.get("VOTAutoTranslate"),this.data?.autoTranslate??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoTranslateCheckbox.container),this.votDontTranslateYourLangSelect=Te.createVOTSelect(z.get("langs")[this.data.dontTranslateLanguage],z.get("VOTDontTranslateYourLang"),Ye(at,this.data.dontTranslateLanguage),{onSelectCb:async t=>{this.data.dontTranslateLanguage=t.target.dataset.votValue,await q.set("dontTranslateLanguage",this.data.dontTranslateLanguage)},labelElement:Te.createCheckbox(z.get("VOTDontTranslateYourLang"),this.data?.dontTranslateYourLang??!0).container}),this.votSettingsDialog.bodyContainer.appendChild(this.votDontTranslateYourLangSelect.container),this.changehotkeyButton=Te.createOutlinedButton(Ke(this.data.hotkeyButton)),this.votSettingsDialog.bodyContainer.appendChild(this.changehotkeyButton),this.votAutoSetVolumeCheckbox=Te.createCheckbox(`${z.get("VOTAutoSetVolume")}`,this.data?.autoSetVolumeYandexStyle??!0),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeCheckbox.container),this.votAutoSetVolumeSlider=Te.createSlider(Ut`${Math.round(100*(this.data?.autoVolume??N))}%`,Math.round(100*(this.data?.autoVolume??N)),0,100),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeSlider.container),this.votShowVideoSliderCheckbox=Te.createCheckbox(z.get("VOTShowVideoSlider"),this.data?.showVideoSlider??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votShowVideoSliderCheckbox.container),this.votAudioBoosterCheckbox=Te.createCheckbox(z.get("VOTAudioBooster"),this.data?.audioBooster??!1),this.audioContext||(this.votBypassMediaCSPCheckbox.input.disabled=!0,this.votBypassMediaCSPCheckbox.container.title=z.get("VOTNeedWebAudioAPI")),this.votSettingsDialog.bodyContainer.appendChild(this.votAudioBoosterCheckbox.container),this.votSyncVolumeCheckbox=Te.createCheckbox(z.get("VOTSyncVolume"),this.data?.syncVolume??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votSyncVolumeCheckbox.container),this.votDownloadWithNameCheckbox=Te.createCheckbox(z.get("VOTDownloadWithName"),this.data?.downloadWithName??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votDownloadWithNameCheckbox.container),this.votTranslationServiceSelect=Te.createVOTSelect(this.data.translationService.toUpperCase(),z.get("VOTTranslationService"),Ye(Ae,this.data.translationService),{onSelectCb:async t=>{this.data.translationService=t.target.dataset.votValue,await q.set("translationService",this.data.translationService)},labelElement:Te.createCheckbox(z.get("VOTTranslateAPIErrors"),this.data.translateAPIErrors??!0).container}),this.votTranslationServiceSelect.container.hidden="ru"===z.lang,this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationServiceSelect.container),this.votDetectServiceSelect=Te.createVOTSelect(this.data.detectService.toUpperCase(),z.get("VOTDetectService"),Ye(Ie,this.data.detectService),{onSelectCb:async t=>{this.data.detectService=t.target.dataset.votValue,await q.set("detectService",this.data.detectService)},labelElement:Te.createVOTSelectLabel(z.get("VOTDetectService"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votDetectServiceSelect.container),this.votSubtitlesHeader=Te.createHeader(z.get("subtitlesSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHeader),this.votSubtitlesDetails=Te.createDetails(z.get("VOTSubtitlesDesign")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesDetails.container),this.votProxyHeader=Te.createHeader(z.get("proxySettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyHeader),this.votM3u8ProxyHostTextfield=Te.createTextfield(z.get("VOTM3u8ProxyHost"),this.data?.m3u8ProxyHost,E),this.votSettingsDialog.bodyContainer.appendChild(this.votM3u8ProxyHostTextfield.container),this.votProxyWorkerHostTextfield=Te.createTextfield(z.get("VOTProxyWorkerHost"),this.data?.proxyWorkerHost,_),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyWorkerHostTextfield.container),this.votAudioProxyCheckbox=Te.createCheckbox(z.get("VOTAudioProxy"),this.data?.audioProxy??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAudioProxyCheckbox.container),this.votBypassMediaCSPCheckbox=Te.createCheckbox(z.get("VOTBypassMediaCSP")+(this.site.needBypassCSP?` (${z.get("VOTMediaCSPEnabledOnSite")})`:""),this.data?.bypassMediaCSP??!1),this.audioContext||(this.votBypassMediaCSPCheckbox.input.disabled=!0,this.votBypassMediaCSPCheckbox.container.title=z.get("VOTNeedWebAudioAPI")),this.votSettingsDialog.bodyContainer.appendChild(this.votBypassMediaCSPCheckbox.container),this.votAboutHeader=Te.createHeader(z.get("about")),this.votSettingsDialog.bodyContainer.appendChild(this.votAboutHeader),this.votLanguageSelect=Te.createVOTSelect(z.get("langs")[q.syncGet("locale-lang-override","auto")],z.get("VOTMenuLanguage"),Ye(H,q.syncGet("locale-lang-override","auto")),{onSelectCb:async t=>{await q.set("locale-lang-override",t.target.dataset.votValue)},labelElement:Te.createVOTSelectLabel(z.get("VOTMenuLanguage"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votLanguageSelect.container),this.votShowPiPButtonCheckbox=Te.createCheckbox(z.get("VOTShowPiPButton"),this.data?.showPiPButton??!1),this.votShowPiPButtonCheckbox.container.hidden=!Y(),this.votSettingsDialog.bodyContainer.appendChild(this.votShowPiPButtonCheckbox.container),this.votVersionInfo=Te.createInformation(`${z.get("VOTVersion")}:`,GM_info.script.version),this.votSettingsDialog.bodyContainer.appendChild(this.votVersionInfo.container),this.votAuthorsInfo=Te.createInformation(`${z.get("VOTAuthors")}:`,GM_info.script.author),this.votSettingsDialog.bodyContainer.appendChild(this.votAuthorsInfo.container),this.votLoaderInfo=Te.createInformation(`${z.get("VOTLoader")}:`,`${GM_info.scriptHandler} v${GM_info.version}`),this.votSettingsDialog.bodyContainer.appendChild(this.votLoaderInfo.container),this.votBrowserInfo=Te.createInformation(`${z.get("VOTBrowser")}:`,`${We.browser.name} ${We.browser.version} (${We.os.name} ${We.os.version})`),this.votSettingsDialog.bodyContainer.appendChild(this.votBrowserInfo.container),this.votLocaleInfo=Te.createInformation(`${z.get("VOTLocaleHash")}:`,Ut`${this.data.localeHash}
(${z.get("VOTUpdatedAt")} + >`,Math.round(100*(this.data?.autoVolume??N)),0,100),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeSlider.container),this.votShowVideoSliderCheckbox=Te.createCheckbox(z.get("VOTShowVideoSlider"),this.data?.showVideoSlider??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votShowVideoSliderCheckbox.container),this.votAudioBoosterCheckbox=Te.createCheckbox(z.get("VOTAudioBooster"),this.data?.audioBooster??!1),this.audioContext||(this.votAudioBoosterCheckbox.input.disabled=!0,this.votAudioBoosterCheckbox.container.title=z.get("VOTNeedWebAudioAPI")),this.votSettingsDialog.bodyContainer.appendChild(this.votAudioBoosterCheckbox.container),this.votSyncVolumeCheckbox=Te.createCheckbox(z.get("VOTSyncVolume"),this.data?.syncVolume??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votSyncVolumeCheckbox.container),this.votDownloadWithNameCheckbox=Te.createCheckbox(z.get("VOTDownloadWithName"),this.data?.downloadWithName??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votDownloadWithNameCheckbox.container),this.votTranslationServiceSelect=Te.createVOTSelect(this.data.translationService.toUpperCase(),z.get("VOTTranslationService"),Ye(Ae,this.data.translationService),{onSelectCb:async t=>{this.data.translationService=t.target.dataset.votValue,await q.set("translationService",this.data.translationService)},labelElement:Te.createCheckbox(z.get("VOTTranslateAPIErrors"),this.data.translateAPIErrors??!0).container}),this.votTranslationServiceSelect.container.hidden="ru"===z.lang,this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationServiceSelect.container),this.votDetectServiceSelect=Te.createVOTSelect(this.data.detectService.toUpperCase(),z.get("VOTDetectService"),Ye(Ie,this.data.detectService),{onSelectCb:async t=>{this.data.detectService=t.target.dataset.votValue,await q.set("detectService",this.data.detectService)},labelElement:Te.createVOTSelectLabel(z.get("VOTDetectService"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votDetectServiceSelect.container),this.votSubtitlesHeader=Te.createHeader(z.get("subtitlesSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHeader),this.votSubtitlesDetails=Te.createDetails(z.get("VOTSubtitlesDesign")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesDetails.container),this.votProxyHeader=Te.createHeader(z.get("proxySettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyHeader),this.votM3u8ProxyHostTextfield=Te.createTextfield(z.get("VOTM3u8ProxyHost"),this.data?.m3u8ProxyHost,E),this.votSettingsDialog.bodyContainer.appendChild(this.votM3u8ProxyHostTextfield.container),this.votProxyWorkerHostTextfield=Te.createTextfield(z.get("VOTProxyWorkerHost"),this.data?.proxyWorkerHost,_),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyWorkerHostTextfield.container),this.votAudioProxyCheckbox=Te.createCheckbox(z.get("VOTAudioProxy"),this.data?.audioProxy??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAudioProxyCheckbox.container),this.votBypassMediaCSPCheckbox=Te.createCheckbox(z.get("VOTBypassMediaCSP")+(this.site.needBypassCSP?` (${z.get("VOTMediaCSPEnabledOnSite")})`:""),this.data?.bypassMediaCSP??!1),this.audioContext||(this.votBypassMediaCSPCheckbox.input.disabled=!0,this.votBypassMediaCSPCheckbox.container.title=z.get("VOTNeedWebAudioAPI")),this.votSettingsDialog.bodyContainer.appendChild(this.votBypassMediaCSPCheckbox.container),this.votAboutHeader=Te.createHeader(z.get("about")),this.votSettingsDialog.bodyContainer.appendChild(this.votAboutHeader),this.votLanguageSelect=Te.createVOTSelect(z.get("langs")[q.syncGet("locale-lang-override","auto")],z.get("VOTMenuLanguage"),Ye(H,q.syncGet("locale-lang-override","auto")),{onSelectCb:async t=>{await q.set("locale-lang-override",t.target.dataset.votValue)},labelElement:Te.createVOTSelectLabel(z.get("VOTMenuLanguage"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votLanguageSelect.container),this.votShowPiPButtonCheckbox=Te.createCheckbox(z.get("VOTShowPiPButton"),this.data?.showPiPButton??!1),this.votShowPiPButtonCheckbox.container.hidden=!Y(),this.votSettingsDialog.bodyContainer.appendChild(this.votShowPiPButtonCheckbox.container),this.votVersionInfo=Te.createInformation(`${z.get("VOTVersion")}:`,GM_info.script.version),this.votSettingsDialog.bodyContainer.appendChild(this.votVersionInfo.container),this.votAuthorsInfo=Te.createInformation(`${z.get("VOTAuthors")}:`,GM_info.script.author),this.votSettingsDialog.bodyContainer.appendChild(this.votAuthorsInfo.container),this.votLoaderInfo=Te.createInformation(`${z.get("VOTLoader")}:`,`${GM_info.scriptHandler} v${GM_info.version}`),this.votSettingsDialog.bodyContainer.appendChild(this.votLoaderInfo.container),this.votBrowserInfo=Te.createInformation(`${z.get("VOTBrowser")}:`,`${We.browser.name} ${We.browser.version} (${We.os.name} ${We.os.version})`),this.votSettingsDialog.bodyContainer.appendChild(this.votBrowserInfo.container),this.votLocaleInfo=Te.createInformation(`${z.get("VOTLocaleHash")}:`,Ut`${this.data.localeHash}
(${z.get("VOTUpdatedAt")} ${new Date(1e3*this.data.localeUpdatedAt).toLocaleString()})`),this.votSettingsDialog.bodyContainer.appendChild(this.votLocaleInfo.container),this.votUpdateLocaleFilesButton=Te.createOutlinedButton(z.get("VOTUpdateLocaleFiles")),this.votSettingsDialog.bodyContainer.appendChild(this.votUpdateLocaleFilesButton),this.votResetSettingsButton=Te.createButton(z.get("resetSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votResetSettingsButton)}async handleTranslationBtnClick(){if(this.audio.src||this.playSound)return M.log("[click translationBtn] audio.src is not empty"),void this.stopTranslate();if(this.hls.url)return M.log("[click translationBtn] hls is not empty"),void this.stopTranslate();try{if(M.log("[click translationBtn] trying execute translation"),!this.videoData.videoId)throw new ct("VOTNoVideoIDFound");"vk"===this.site.host&&"clips"===this.site.additionalData&&(this.videoData=await this.getVideoData()),await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t?.message)}}initUIEvents(){this.votButton.translateButton.addEventListener("click",(async()=>{await this.handleTranslationBtnClick()})),this.votButton.pipButton.addEventListener("click",(()=>{(async()=>{this.video!==document.pictureInPictureElement?await this.video.requestPictureInPicture():await document.exitPictureInPicture()})()})),this.votButton.menuButton.addEventListener("click",(()=>{this.votMenu.container.hidden=!this.votMenu.container.hidden})),this.votButton.container.addEventListener("mousedown",(()=>{this.dragging=!0})),this.container.addEventListener("mouseup",(()=>{this.dragging=!1})),this.container.addEventListener("mousemove",(async t=>{if(this.dragging){t.preventDefault();const e=t.clientX/this.container.clientWidth*100,o=this.container.clientWidth>550,a=e<=44?"left":e>=66?"right":"default";this.data.buttonPos=o?a:"default",this.votButton.container.dataset.direction="default"===this.data.buttonPos?"row":"column",this.votButton.container.dataset.position=this.data.buttonPos,this.votMenu.container.dataset.position=this.data.buttonPos,o&&await q.set("buttonPos",this.data.buttonPos)}})),this.votDownloadButton.addEventListener("click",(async()=>{if(!this.downloadTranslationUrl)return;if(!this.data.downloadWithName)return window.open(this.downloadTranslationUrl,"_blank").focus();const t=document.querySelector("#vot-loader-download"),e=getComputedStyle(this.votMenu.container).getPropertyValue("--vot-primary-rgb"),o=Te.animateLoader(t,e),a=await Q(this.downloadTranslationUrl),n=a.body.getReader(),i=+a.headers.get("Content-Length");let r=0;const s=[];for(;;){const{done:t,value:e}=await n.read();if(t)break;s.push(e),r+=e.length,o(Math.round(r/i*100))}Te.afterAnimateLoader(t,e);const l=new Blob(s),d=X(this.videoData.title??this.videoData.videoId),u=await l.arrayBuffer(),c=new me(u);c.setFrame("TIT2",d),c.addTag(),Z(c.getBlob(),`${d}.mp3`)})),this.votDownloadSubtitlesButton.addEventListener("click",(async()=>{const t=this.data.subtitlesDownloadFormat,e=wt(this.yandexSubtitles,t);Z(new Blob(["json"===t?JSON.stringify(e):e],{type:"text/plain"}),`${this.data.downloadWithName?X(this.videoData.title??this.videoData.videoId):`subtitles_${this.videoData.videoId}`}.${t}`)})),this.votSettingsButton.addEventListener("click",(()=>{this.votSettingsDialog.container.hidden=!this.votSettingsDialog.container.hidden,(document.fullscreenElement||document.webkitFullscreenElement)&&(document.webkitExitFullscreen&&document.webkitExitFullscreen(),document.exitFullscreen&&document.exitFullscreen())})),this.votVideoVolumeSlider.input.addEventListener("input",(t=>{const e=Number(t.target.value);this.votVideoVolumeSlider.label.querySelector("strong").textContent=`${e}%`,this.setVideoVolume(e/100),this.data.syncVolume&&this.syncVolumeWrapper("video",e)})),this.votVideoTranslationVolumeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.defaultVolume=Number(t.target.value),await q.set("defaultVolume",this.data.defaultVolume),this.votVideoTranslationVolumeSlider.label.querySelector("strong").textContent=`${this.data.defaultVolume}%`,this.setAudioVolume(this.data.defaultVolume/100),this.data.syncVolume&&(this.syncVolumeWrapper("translation",this.data.defaultVolume),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData&&this.setVideoVolume(this.tempOriginalVolume/100))})()}));{this.votAutoTranslateCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoTranslate=Number(t.target.checked),await Promise.all([q.set("autoTranslate",this.data.autoTranslate),this.autoTranslate()]),M.log("autoTranslate value changed. New value: ",this.data.autoTranslate)})()})),this.votDontTranslateYourLangSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.dontTranslateYourLang=Number(t.target.checked),await q.set("dontTranslateYourLang",this.data.dontTranslateYourLang),M.log("dontTranslateYourLang value changed. New value: ",this.data.dontTranslateYourLang)})()}));const t=async t=>{await q.set("hotkeyButton",t),this.data.hotkeyButton=t,this.changehotkeyButton.textContent=Ke(t)},e=o=>{const a="Escape"===o.code?null:o.code;t(a),document.removeEventListener("keydown",e)};this.changehotkeyButton.addEventListener("click",(()=>{this.changehotkeyButton.textContent=z.get("VOTPressNewHotkey"),document.addEventListener("keydown",e)})),this.votAutoSetVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoSetVolumeYandexStyle=Number(t.target.checked),await q.set("autoSetVolumeYandexStyle",this.data.autoSetVolumeYandexStyle),M.log("autoSetVolumeYandexStyle value changed. New value: ",this.data.autoSetVolumeYandexStyle)})()})),this.votAutoSetVolumeSlider.input.addEventListener("input",(t=>{(async()=>{const e=Number(t.target.value);this.data.autoVolume=(e/100).toFixed(2),await q.set("autoVolume",this.data.autoVolume),this.votAutoSetVolumeSlider.label.querySelector("strong").textContent=`${e}%`})()})),this.votShowVideoSliderCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showVideoSlider=Number(t.target.checked),await q.set("showVideoSlider",this.data.showVideoSlider),M.log("showVideoSlider value changed. New value: ",this.data.showVideoSlider),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status})()})),this.votAudioBoosterCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioBooster=Number(t.target.checked),await q.set("audioBooster",this.data.audioBooster),M.log("audioBooster value changed. New value: ",this.data.audioBooster);const e=this.votVideoTranslationVolumeSlider.input.value;this.votVideoTranslationVolumeSlider.input.max=this.data.audioBooster?900:100,this.data.audioBooster||(this.votVideoTranslationVolumeSlider.input.value=e>100?100:e,this.votVideoTranslationVolumeSlider.input.dispatchEvent(new Event("input")))})()})),this.votSyncVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.syncVolume=Number(t.target.checked),await q.set("syncVolume",this.data.syncVolume),M.log("syncVolume value changed. New value: ",this.data.syncVolume)})()})),this.votDownloadWithNameCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.downloadWithName=Number(t.target.checked),await q.set("downloadWithName",this.data.downloadWithName),M.log("downloadWithName value changed. New value: ",this.data.downloadWithName)})()})),this.votTranslationServiceSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.translateAPIErrors=Number(t.target.checked),await q.set("translateAPIErrors",this.data.translateAPIErrors),M.log("translateAPIErrors value changed. New value: ",this.data.translateAPIErrors)})()})),this.votSubtitlesDetails.container.addEventListener("click",(()=>{this.votSubtitlesDialog=Te.createDialog(z.get("VOTSubtitlesDesign")),this.votSubtitlesDialog.container.classList.add("vot-dialog-temp"),this.votSubtitlesDialog.container.hidden=!1,this.votSubtitlesDialog.backdrop.onclick=this.votSubtitlesDialog.closeButton.onclick=()=>{this.votSubtitlesDialog.container.remove()},this.votSubtitlesHighlightWordsCheckbox=Te.createCheckbox(z.get("VOTHighlightWords"),this.data?.highlightWords??!1),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesHighlightWordsCheckbox.container),this.votSubtitlesDownloadFormatSelect=Te.createVOTSelect(this.data.subtitlesDownloadFormat.toUpperCase(),z.get("VOTSubtitlesDownloadFormat"),Ye(it,this.data.subtitlesDownloadFormat),{onSelectCb:async t=>{this.data.subtitlesDownloadFormat=t.target.dataset.votValue,await q.set("subtitlesDownloadFormat",this.data.subtitlesDownloadFormat)},labelElement:Te.createVOTSelectLabel(z.get("VOTSubtitlesDownloadFormat"))}),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesDownloadFormatSelect.container),this.votSubtitlesMaxLengthSlider=Te.createSlider(Ut`${z.get("VOTSubtitlesMaxLength")}: ${this.data?.subtitlesMaxLength??300}`,this.data?.subtitlesMaxLength??300,50,300),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesMaxLengthSlider.container),this.votSubtitlesFontSizeSlider=Te.createSlider(Ut`${z.get("VOTSubtitlesFontSize")}: ${this.data?.subtitlesFontSize??20}`,this.data?.subtitlesFontSize??20,8,50),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesFontSizeSlider.container),this.votSubtitlesOpacitySlider=Te.createSlider(Ut`${z.get("VOTSubtitlesOpacity")}: diff --git a/dist/vot.user.js b/dist/vot.user.js index 69cfb352..a2623ccf 100644 --- a/dist/vot.user.js +++ b/dist/vot.user.js @@ -7735,8 +7735,8 @@ class VideoHandler { this.data?.audioBooster ?? false, ); if (!this.audioContext) { - this.votBypassMediaCSPCheckbox.input.disabled = true; - this.votBypassMediaCSPCheckbox.container.title = + this.votAudioBoosterCheckbox.input.disabled = true; + this.votAudioBoosterCheckbox.container.title = localizationProvider.get("VOTNeedWebAudioAPI"); } this.votSettingsDialog.bodyContainer.appendChild( @@ -8127,8 +8127,9 @@ class VideoHandler { this.votVideoVolumeSlider.input.addEventListener("input", (e) => { const value = Number(e.target.value); - this.votVideoVolumeSlider.label.querySelector("strong").textContent = - `${value}%`; + this.votVideoVolumeSlider.label.querySelector( + "strong", + ).textContent = `${value}%`; this.setVideoVolume(value / 100); if (this.data.syncVolume) { this.syncVolumeWrapper("video", value); @@ -8951,8 +8952,9 @@ class VideoHandler { const newSlidersVolume = Math.round(videoVolume); this.votVideoVolumeSlider.input.value = newSlidersVolume; - this.votVideoVolumeSlider.label.querySelector("strong").textContent = - `${newSlidersVolume}%`; + this.votVideoVolumeSlider.label.querySelector( + "strong", + ).textContent = `${newSlidersVolume}%`; ui.updateSlider(this.votVideoVolumeSlider.input); if (this.data.syncVolume === 1) { diff --git a/src/index.js b/src/index.js index f50cf9d2..ca9be875 100644 --- a/src/index.js +++ b/src/index.js @@ -746,8 +746,8 @@ class VideoHandler { this.data?.audioBooster ?? false, ); if (!this.audioContext) { - this.votBypassMediaCSPCheckbox.input.disabled = true; - this.votBypassMediaCSPCheckbox.container.title = + this.votAudioBoosterCheckbox.input.disabled = true; + this.votAudioBoosterCheckbox.container.title = localizationProvider.get("VOTNeedWebAudioAPI"); } this.votSettingsDialog.bodyContainer.appendChild(