You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
2.3 KiB

(()=>{"use strict";var e,t={9612:(e,t,n)=>{function a(e,t){const n=e.lastIndexOf(".");let a=t;return-1!==n&&(a=e.substring(n+1)),a}function o({onJson:e,onRequest:t,waitForBasename:n}){setTimeout((()=>{const a={};let o="",s=!1;const r=JSON.parse;JSON.parse=function(){const t=r.apply(this,arguments);let n=!1,i=!1;return e(t,(e=>{const t=window.location.pathname;void 0===a[t]&&(a[t]=[]),void 0===a[t].find((t=>t.label===e.label&&t.language===e.language))&&(a[t].push(e),n=!0)}),(e=>{o=e,i=!0})),s&&(n||i)&&document.dispatchEvent(new CustomEvent("asbplayer-synced-data",{detail:{error:"",basename:o,subtitles:a[window.location.pathname]}})),t},document.addEventListener("asbplayer-get-synced-data",(async()=>{t?.((e=>{const t=window.location.pathname;void 0===a[t]&&(a[t]=[]),void 0===a[t].find((t=>t.label===e.label&&t.language===e.language))&&a[t].push(e)}),(e=>{o=e,s||document.dispatchEvent(new CustomEvent("asbplayer-synced-data",{detail:{error:"",basename:o,subtitles:void 0}}))}));const e=()=>(!n||""!==o)&&window.location.pathname in a;e()||await function(e,t=1e4){return new Promise((async(n,a)=>{e()&&n(!0);const o=Date.now();let s=!1;for(;!s&&Date.now()<o+t;)await new Promise((t=>{setTimeout((()=>{s=e(),t()}),1e3)}));n(s)}))}(e),document.dispatchEvent(new CustomEvent("asbplayer-synced-data",{detail:{error:"",basename:o,subtitles:a[window.location.pathname]??[]}})),function(){for(const e of Object.keys(a))e!==window.location.pathname&&delete a[e]}(),s=!0}),!1)}),0)}n.d(t,{NC:()=>o,YU:()=>a})}},n={};function a(e){var o=n[e];if(void 0!==o)return o.exports;var s=n[e]={exports:{}};return t[e](s,s.exports,a),s.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(0,(e=a(9612)).NC)({onJson:(t,n,a)=>{if(t?.text_tracks instanceof Array){for(const a of t.text_tracks)if("captions"===a.kind&&"text/webvtt"===a.mime_type&&a.sources instanceof Array&&a.sources.length>0&&"string"==typeof a.sources[0].src&&"string"==typeof a.srclang){const t="string"==typeof a.label?`${a.srclang} - ${a?.label}`:a.srclang,o=a.srclang.toLowerCase(),s=a.sources[0].src;n({label:t,language:o,url:s.replace(/^http:\/\//,"https://"),extension:(0,e.YU)(s,"vtt")})}"string"==typeof t?.name&&a(t?.name)}},waitForBasename:!0})})();