mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-03-11 00:50:14 +01:00
40 lines
576 KiB
JavaScript
40 lines
576 KiB
JavaScript
|
/**
|
||
|
* @license
|
||
|
* Video.js 8.5.3 <http://videojs.com/>
|
||
|
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
|
||
|
* Available under Apache License Version 2.0
|
||
|
* <https://github.com/videojs/video.js/blob/main/LICENSE>
|
||
|
*
|
||
|
* Includes vtt.js <https://github.com/mozilla/vtt.js>
|
||
|
* Available under Apache License Version 2.0
|
||
|
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
|
||
|
*/
|
||
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojs=t()}(this,function(){"use strict";var R="8.5.3";const U={},B=function(e,t){return U[e]=U[e]||[],t&&(U[e]=U[e].concat(t)),U[e]};function F(e,t){return!((t=B(e).indexOf(t))<=-1||(U[e]=U[e].slice(),U[e].splice(t,1),0))}const j={prefixed:!0};var H=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],q=H[0];let V;for(let e=0;e<H.length;e++)if(H[e][1]in document){V=H[e];break}if(V){for(let e=0;e<V.length;e++)j[q[e]]=V[e];j.prefixed=V[0]!==q[0]}let l=[];function z(e){return K(e)?Object.keys(e):[]}const d=function t(i){let s="info",n;function r(...e){n("log",s,e)}var a,o;return n=(a=i,(t,i,s)=>{var e,i=o.levels[i],n=new RegExp(`^(${i})$`);if("log"!==t&&s.unshift(t.toUpperCase()+":"),s.unshift(a+":"),l&&(l.push([].concat(s)),e=l.length-1e3,l.splice(0,0<e?e:0)),window.console){let e=window.console[t];(e=e||"debug"!==t?e:window.console.info||window.console.log)&&i&&n.test(t)&&e[Array.isArray(s)?"apply":"call"](window.console,s)}}),(o=r).createLogger=e=>t(i+": "+e),r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},r.level=e=>{if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);s=e}return s},r.history=()=>l?[].concat(l):[],r.history.filter=t=>(l||[]).filter(e=>new RegExp(`.*${t}.*`).test(e[0])),r.history.clear=()=>{l&&(l.length=0)},r.history.disable=()=>{null!==l&&(l.length=0,l=null)},r.history.enable=()=>{null===l&&(l=[])},r.error=(...e)=>n("error",s,e),r.warn=(...e)=>n("warn",s,e),r.debug=(...e)=>n("debug",s,e),r}("VIDEOJS"),$=d.createLogger,W=Object.prototype.toString;function G(t,i){z(t).forEach(e=>i(t[e],e))}function X(i,s,e=0){return z(i).reduce((e,t)=>s(e,i[t],t),e)}function K(e){return!!e&&"object"==typeof e}function Y(e){return K(e)&&"[object Object]"===W.call(e)&&e.constructor===Object}function h(...e){const i={};return e.forEach(e=>{e&&G(e,(e,t)=>{Y(e)?(Y(i[t])||(i[t]={}),i[t]=h(i[t],e)):i[t]=e})}),i}function Q(e={}){var t,i=[];for(const s in e)e.hasOwnProperty(s)&&(t=e[s],i.push(t));return i}function J(t,i,s,e=!0){const n=e=>Object.defineProperty(t,i,{value:e,enumerable:!0,writable:!0});var r={configurable:!0,enumerable:!0,get(){var e=s();return n(e),e}};return e&&(r.set=n),Object.defineProperty(t,i,r)}var Z=Object.freeze({__proto__:null,each:G,reduce:X,isObject:K,isPlain:Y,merge:h,values:Q,defineLazyProperty:J});let ee=!1,te=null,ie=!1,se,ne=!1,re=!1,ae=!1,oe=!1,le=null,de=null,he=null,ue=!1,ce=!1,pe=!1,me=!1;const ge=Boolean(ve()&&("ontouchstart"in window||window.navigator.maxTouchPoints||window.DocumentTouch&&window.document instanceof window.DocumentTouch));var fe,e=window.navigator&&window.navigator.userAgentData;if(e&&(ie="Android"===e.platform,re=Boolean(e.brands.find(e=>"Microsoft Edge"===e.brand)),ae=Boolean(e.brands.find(e=>"Chromium"===e.brand)),oe=!re&&ae,le=de=(e.brands.find(e=>"Chromium"===e.brand)||{}).version||null,ce="Windows"===e.platform),!ae){const M=window.navigator&&window.navigator.userAgent||"";ee=/iPod/i.test(M),te=(e=M.match(/OS (\d+)_/i))&&e[1]?e[1]:null,ie=/Android/i.test(M),se=(e=M.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i))?(ft=e[1]&&parseFloat(e[1]),fe=e[2]&&parseFloat(e[2]),ft&&fe?parseFloat(e[1]+"."+e[2]):ft||null):null,ne=/Firefox/i.test(M),re=/Edg/i.test(M),ae=/Chrome/i.test(M)||/CriOS/i.test(M),oe=!re&&ae,le=de=(fe=M.match(/(Chrome|CriOS)\/(\d+)/))&&fe[2]?parseFloat(fe[2]):null,he=function(){var e=/MSIE\s(\d+)\.\d/.exec(M);let t=e&&parseFloat(e[1]);return t=!t&&/Trident\/7.0/i.test(M)&&/rv:11.0/.test(M)?11:t}(),ue=/Safari/i.test(M)&&!oe&&!ie&&!re,ce=/Windows/i.test(M),pe=/iPad/i.test(M)||ue&&ge&&!/iPho
|
||
|
.${s} {
|
||
|
width: ${e}px;
|
||
|
height: ${t}px;
|
||
|
}
|
||
|
|
||
|
.${s}.vjs-fluid:not(.vjs-audio-only-mode) {
|
||
|
padding-top: ${100*n}%;
|
||
|
}
|
||
|
`)}}loadTech_(e,t){this.tech_&&this.unloadTech_();var i=g(e),s=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(_.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();const r={source:t,autoplay:n="string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay?!1:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+`_${s}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};a.names.forEach(e=>{e=a[e];r[e.getterName]=this[e.privateName]}),Object.assign(r,this.options_[i]),Object.assign(r,this.options_[s]),Object.assign(r,this.options_[e.toLowerCase()]),this.tag&&(r.tag=this.tag),t&&t.src===this.cache_.src&&0<this.cache_.currentTime&&(r.startTime=this.cache_.currentTime);s=_.getTech(e);if(!s)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new s(r),this.tech_.ready(m(this,this.handleTechReady_),!0),Qt(this.textTracksJson_||[],this.tech_),tr.forEach(t=>{this.on(this.tech_,t,e=>this[`handleTech${g(t)}_`](e))}),Object.keys(ir).forEach(t=>{this.on(this.tech_,t,e=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${ir[t]}_`].bind(this),event:e}):this[`handleTech${ir[t]}_`](e)})}),this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e)),this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e)),this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e)),this.on(this.tech_,"ended",e=>this.handleTechEnded_(e)),this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e)),this.on(this.tech_,"play",e=>this.handleTechPlay_(e)),this.on(this.tech_,"pause",e=>this.handleTechPause_(e)),this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e)),this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,"error",e=>this.handleTechError_(e)),this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e)),this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e)),this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||Ee(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){a.names.forEach(e=>{e=a[e];this[e.privateName]=this[e.getterName]()}),this.textTracksJson_=Yt(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&d.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"t
|
||
|
.video-js {
|
||
|
width: 300px;
|
||
|
height: 150px;
|
||
|
}
|
||
|
|
||
|
.vjs-fluid:not(.vjs-audio-only-mode) {
|
||
|
padding-top: 56.25%
|
||
|
}
|
||
|
`)),Ze(1,T),T.VERSION=R,T.options=b.prototype.options_,T.getPlayers=()=>b.players,T.getPlayer=e=>{var t=b.players;let i;if("string"==typeof e){var s=yr(e),n=t[s];if(n)return n;i=$e("#"+s)}else i=e;if(be(i)){var{player:n,playerId:s}=i;if(n||t[s])return n||t[s]}},T.getAllPlayers=()=>Object.keys(b.players).map(e=>b.players[e]).filter(Boolean),T.players=b.players,T.getComponent=f.getComponent,T.registerComponent=(e,t)=>(_.isTech(t)&&d.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),f.registerComponent.call(f,e,t)),T.getTech=_.getTech,T.registerTech=_.registerTech,T.use=function(e,t){cs[e]=cs[e]||[],cs[e].push(t)},Object.defineProperty(T,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(T.middleware,"TERMINATOR",{value:ms,writeable:!1,enumerable:!0}),T.browser=e,T.obj=Z,T.mergeOptions=fr(9,"videojs.mergeOptions","videojs.obj.merge",h),T.defineLazyProperty=fr(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",J),T.bind=fr(9,"videojs.bind","native Function.prototype.bind",m),T.registerPlugin=gr.registerPlugin,T.deregisterPlugin=gr.deregisterPlugin,T.plugin=(e,t)=>(d.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),gr.registerPlugin(e,t)),T.getPlugins=gr.getPlugins,T.getPlugin=gr.getPlugin,T.getPluginVersion=gr.getPluginVersion,T.addLanguage=function(e,t){return e=(""+e).toLowerCase(),T.options.languages=h(T.options.languages,{[e]:t}),T.options.languages[e]},T.log=d,T.createLogger=$,T.time=zt,T.createTimeRange=fr(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Bt),T.createTimeRanges=fr(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Bt),T.formatTime=fr(9,"videojs.formatTime","videojs.time.formatTime",Vt),T.setFormatTime=fr(9,"videojs.setFormatTime","videojs.time.setFormatTime",Ht),T.resetFormatTime=fr(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",qt),T.parseUrl=fr(9,"videojs.parseUrl","videojs.url.parseUrl",hi),T.isCrossOrigin=fr(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",ci),T.EventTarget=_t,T.any=ct,T.on=dt,T.one=ut,T.off=p,T.trigger=ht,T.xhr=Si,T.TextTrack=Pi,T.AudioTrack=Li,T.VideoTrack=Oi,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{T[e]=function(){return d.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),Ke[e].apply(null,arguments)}}),T.computedStyle=fr(9,"videojs.computedStyle","videojs.dom.computedStyle",Ge),T.dom=Ke,T.fn=ft,T.num=gi,T.str=Ot,T.url=mi,Mt(function(e,t){
|
||
|
/*! @name videojs-contrib-quality-levels @version 4.0.0 @license Apache-2.0 */
|
||
|
e.exports=function(e){function t(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var i=t(e);class s{constructor(e){let t=this;t.id=e.id;t.label=t.id;t.width=e.width;t.height=e.height;t.bitrate=e.bandwidth;t.frameRate=e.frameRate;t.enabled_=e.enabled;Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(e){t.enabled_(e)}});return t}}class r extends i["default"].EventTarget{constructor(){super();let e=this;e.levels_=[];e.selectedIndex_=-1;Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}});Object.defineProperty(e,"length",{get(){return e.levels_.length}});e[Symbol.iterator]=()=>e.levels_.values();return e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;t=new s(e);if(!(""+i in this))Object.defineProperty(this,i,{get(){return this.levels_[i]}});this.levels_.push(t);this.trigger({qualityLevel:t,type:"addqualitylevel"});return t}removeQualityLevel(i){let s=null;for(let e=0,t=this.length;e<t;e++)if(this[e]===i){s=this.levels_.splice(e,1)[0];if(this.selectedIndex_===e)this.selectedIndex_=-1;else if(this.selectedIndex_>e)this.selectedIndex_--;break}if(s)this.trigger({qualityLevel:i,type:"removequalitylevel"});return s}getQualityLevelById(i){for(let e=0,t=this.length;e<t;e++){const s=this[e];if(s.id===i)return s}return null}dispose(){this.selectedIndex_=-1;this.levels_.length=0}}r.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const l in r.prototype.allowedEvents_)r.prototype["on"+l]=null;var a="4.0.0";const n=function(e,t){const i=e.qualityLevels;const s=new r;const n=function(){s.dispose();e.qualityLevels=i;e.off("dispose",n)};e.on("dispose",n);e.qualityLevels=()=>s;e.qualityLevels.VERSION=a;return s},o=function(e){return n(this,i["default"].obj.merge({},e))};return i["default"].registerPlugin("qualityLevels",o),o.VERSION=a,o}(T)});var _r=Mt(function(e,t){var i,r,s,n,a;i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var s=a.parseURL(e);if(s)return s.path=a.normalizePath(s.path),a.buildURLFromParts(s);throw new Error("Error trying to parse base URL.")}s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return i.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;t=a.parseURL(e);if(!t)throw new Error("Error trying to parse base URL.");!t.netLoc&&t.path&&"/"!==t.path[0]&&(e=r.exec(t.path),t.netLoc=e[1],t.path=e[2]),t.netLoc&&!t.path&&(t.path="/");var n,e={scheme:t.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};return s.netLoc||(e.netLoc=t.netLoc,"/"!==s.path[0]&&(s.path?(n=(n=t.path).substring(0,n.lastIndexOf("/")+1)+s.path,e.path=a.normalizePath(n)):(e.path=t.path,s.params||(e.params=t.params,s.query)||(e.query=t.query)))),null===e.path&&(e.path=i.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(e)},parseURL:function(e){e=i.exec(e);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(s,"");e.length!==(e=e.replace(n,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a}),vr="http://example.com",Mn=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){return!!this.listeners[e]&&(t=this.listeners[e].indexOf(t),this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(t,1),-1<t)},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,s=0;s<i;++s)t[s].call(this,arguments[1]);else f
|
||
|
/*! @name m3u8-parser @version 7.1.0 @license Apache-2.0 */class Tr extends Mn{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");-1<t;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}function Sr(e){var e=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t}function wr(t){var i={};if(t){var s,n=t.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let e=n.length;for(;e--;)""!==n[e]&&((s=/([^=]*)=(.*)/.exec(n[e]).slice(1))[0]=s[0].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^['"](.*)['"]$/g,"$1"),i[s[0]]=s[1])}return i}const Er=String.fromCharCode(9);class kr extends Mn{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(i){let o,l;0!==(i=i.trim()).length&&("#"!==i[0]?this.trigger("data",{type:"uri",uri:i}):this.tagMappers.reduce((e,t)=>{t=t(i);return t===i?e:e.concat([t])},[i]).forEach(t=>{for(let e=0;e<this.customParsers.length;e++)if(this.customParsers[e].call(this,t))return;var e,i;if(0!==t.indexOf("#EXT"))this.trigger("data",{type:"comment",text:t.slice(1)});else if(t=t.replace("\r",""),o=/^#EXTM3U/.exec(t))this.trigger("data",{type:"tag",tagType:"m3u"});else if(o=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(t))l={type:"tag",tagType:"inf"},o[1]&&(l.duration=parseFloat(o[1])),o[2]&&(l.title=o[2]),this.trigger("data",l);else if(o=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(t))l={type:"tag",tagType:"targetduration"},o[1]&&(l.duration=parseInt(o[1],10)),this.trigger("data",l);else if(o=/^#EXT-X-VERSION:([0-9.]*)?/.exec(t))l={type:"tag",tagType:"version"},o[1]&&(l.version=parseInt(o[1],10)),this.trigger("data",l);else if(o=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(t))l={type:"tag",tagType:"media-sequence"},o[1]&&(l.number=parseInt(o[1],10)),this.trigger("data",l);else if(o=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(t))l={type:"tag",tagType:"discontinuity-sequence"},o[1]&&(l.number=parseInt(o[1],10)),this.trigger("data",l);else if(o=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(t))l={type:"tag",tagType:"playlist-type"},o[1]&&(l.playlistType=o[1]),this.trigger("data",l);else if(o=/^#EXT-X-BYTERANGE:(.*)?$/.exec(t))l=_i(Sr(o[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",l);else if(o=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(t))l={type:"tag",tagType:"allow-cache"},o[1]&&(l.allowed=!/NO/.test(o[1])),this.trigger("data",l);else if(o=/^#EXT-X-MAP:(.*)$/.exec(t))l={type:"tag",tagType:"map"},o[1]&&((i=wr(o[1])).URI&&(l.uri=i.URI),i.BYTERANGE)&&(l.byterange=Sr(i.BYTERANGE)),this.trigger("data",l);else if(o=/^#EXT-X-STREAM-INF:(.*)$/.exec(t))l={type:"tag",tagType:"stream-inf"},o[1]&&(l.attributes=wr(o[1]),l.attributes.RESOLUTION&&(i={},(e=l.attributes.RESOLUTION.split("x"))[0]&&(i.width=parseInt(e[0],10)),e[1]&&(i.height=parseInt(e[1],10)),l.attributes.RESOLUTION=i),l.attributes.BANDWIDTH&&(l.attributes.BANDWIDTH=parseInt(l.attributes.BANDWIDTH,10)),l.attributes["FRAME-RATE"]&&(l.attributes["FRAME-RATE"]=parseFloat(l.attributes["FRAME-RATE"])),l.attributes["PROGRAM-ID"])&&(l.attributes["PROGRAM-ID"]=parseInt(l.attributes["PROGRAM-ID"],10)),this.trigger("data",l);else if(o=/^#EXT-X-MEDIA:(.*)$/.exec(t))l={type:"tag",tagType:"media"},o[1]&&(l.attributes=wr(o[1])),this.trigger("data",l);else if(o=/^#EXT-X-ENDLIST/.exec(t))this.trigger("data",{type:"tag",tagType:"endlist"});else if(o=/^#EXT-X-DISCONTINUITY/.exec(t))this.trigger("data",{type:"tag",tagType:"discontinuity"});else if(o=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(t))l={type:"tag",tagType:"program-date-time"},o[1]&&(l.dateTimeString=o[1],l.dateTimeObject=new Date(o[1])),this.trigger("data",l);else if(o=/^#EXT-X-KEY:(.*)$/.exec(t))l={type:"tag",tagType:"key"},o[1]&&(l.attributes=wr(o[1]),l.attributes.IV)&&("0x"===l.attributes.IV.substring(0,2).toLowerCase()&&(l.attributes.IV=l.attributes.IV.substring(2)),l.attributes.IV=l.attributes.IV.match(/.{8}/g),l.attributes.IV[0]=parseInt(l.attributes.IV[0],16),l.attributes.IV[1]=parseInt(l.attributes.IV[1],16)
|
||
|
/*! @name mpd-parser @version 1.1.1 @license Apache-2.0 */
|
||
|
const Co=e=>!!e&&"object"==typeof e,I=(...e)=>e.reduce((t,i)=>("object"==typeof i&&Object.keys(i).forEach(e=>{Array.isArray(t[e])&&Array.isArray(i[e])?t[e]=t[e].concat(i[e]):Co(t[e])&&Co(i[e])?t[e]=I(t[e],i[e]):t[e]=i[e]}),t),{}),xo=t=>Object.keys(t).map(e=>t[e]),Io=e=>e.reduce((e,t)=>e.concat(t),[]),Ao=t=>{if(!t.length)return[];var i=[];for(let e=0;e<t.length;e++)i.push(t[e]);return i};var Do={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Po=({baseUrl:s="",source:n="",range:r="",indexRange:a=""})=>{s={uri:n,resolvedUri:Mr(s||"",n)};if(r||a){n=(r||a).split("-");let e=window.BigInt?window.BigInt(n[0]):parseInt(n[0],10),t=window.BigInt?window.BigInt(n[1]):parseInt(n[1],10);e<Number.MAX_SAFE_INTEGER&&"bigint"==typeof e&&(e=Number(e)),t<Number.MAX_SAFE_INTEGER&&"bigint"==typeof t&&(t=Number(t));let i;"bigint"==typeof(i="bigint"==typeof t||"bigint"==typeof e?window.BigInt(t)-window.BigInt(e)+window.BigInt(1):t-e+1)&&i<Number.MAX_SAFE_INTEGER&&(i=Number(i)),s.byterange={length:i,offset:e}}return s},Lo=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),Oo={static(e){var{duration:t,timescale:i=1,sourceDuration:s,periodDuration:n}=e,e=Lo(e.endNumber),t=t/i;return"number"==typeof e?{start:0,end:e}:"number"==typeof n?{start:0,end:n/t}:{start:0,end:s/t}},dynamic(e){var{NOW:t,clientOffset:i,availabilityStartTime:s,timescale:n=1,duration:r,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,e=Lo(e.endNumber),t=(t+i)/1e3,i=s+a,s=Math.ceil((t+o-i)*n/r),a=Math.floor((t-i-l)*n/r),o=Math.floor((t-i)*n/r);return{start:Math.max(0,a),end:"number"==typeof e?e:Math.min(s,o)}}},No=e=>{var r,{type:t,duration:i,timescale:s=1,periodDuration:n,sourceDuration:a}=e,{start:o,end:l}=Oo[t](e),o=((t,i)=>{var s=[];for(let e=t;e<i;e++)s.push(e);return s})(o,l).map((r=e,e=>{var{duration:t,timescale:i=1,periodStart:s,startNumber:n=1}=r;return{number:n+e,duration:t/i,timeline:s,time:e*t}}));return"static"===t&&(o[l=o.length-1].duration=("number"==typeof n?n:a)-i/s*l),o},Mo=e=>{var{baseUrl:t,initialization:i={},sourceDuration:s,indexRange:n="",periodStart:r,presentationTime:a,number:o=0,duration:l}=e;if(t)return i=Po({baseUrl:t,source:i.sourceURL,range:i.range}),(t=Po({baseUrl:t,source:t,indexRange:n})).map=i,l?(n=No(e)).length&&(t.duration=n[0].duration,t.timeline=n[0].timeline):s&&(t.duration=s,t.timeline=r),t.presentationTime=a||r,t.number=o,[t];throw new Error(Do.NO_BASE_URL)},Ro=(e,i,s)=>{var n=e.sidx.map||null,r=e.sidx.duration,a=e.timeline||0,t=e.sidx.byterange,t=t.offset+t.length,o=i.timescale,l=i.references.filter(e=>1!==e.referenceType),d=[],h=e.endList?"static":"dynamic",u=e.sidx.timeline;let c=u,p=e.mediaSequence||0,m;m="bigint"==typeof i.firstOffset?window.BigInt(t)+i.firstOffset:t+i.firstOffset;for(let t=0;t<l.length;t++){var g=i.references[t],f=g.referencedSize,g=g.subsegmentDuration;let e;e="bigint"==typeof m?m+window.BigInt(f)-window.BigInt(1):m+f-1;var y=m+"-"+e,y={baseUrl:s,timescale:o,timeline:a,periodStart:u,presentationTime:c,number:p,duration:g,sourceDuration:r,indexRange:y,type:h},y=Mo(y)[0];n&&(y.map=n),d.push(y),"bigint"==typeof m?m+=window.BigInt(f):m+=f,c+=g/o,p++}return e.segments=d,e},Uo=["AUDIO","SUBTITLES"],Bo=e=>{return e=e,i=({timeline:e})=>e,xo(e.reduce((t,e)=>(e.forEach(e=>{t[i(e)]=e}),t),{})).sort((e,t)=>e.timeline>t.timeline?1:-1);var i},Fo=e=>{let n=[];var r,a;return r=e,e=Uo,a=(e,t,i,s)=>{n=n.concat(e.playlists||[])},e.forEach(function(e){for(var t in r.mediaGroups[e])for(var i in r.mediaGroups[e][t]){var s=r.mediaGroups[e][t][i];a(s,e,t,i)}}),n},jo=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((e,t)=>{e.number=i.mediaSequence+t})},Ho=({oldManifest:e,newManifest:t})=>{var n,r,i=e.playlists.concat(Fo(e)),s=t.playlists.concat(Fo(t));return t.timelineStarts=Bo([e.timelineStarts,t.timelin
|
||
|
/*! @name @videojs/http-streaming @version 3.5.3 @license Apache-2.0 */
|
||
|
const jl=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=window.location&&window.location.href||"");var i="function"==typeof window.URL,s=/^\/\//.test(e),n=!window.location&&!/\/\//i.test(e);return i?e=new window.URL(e,window.location||vr):/\/\//i.test(e)||(e=_r.buildAbsoluteURL(window.location&&window.location.href||"",e)),i?(i=new URL(t,e),n?i.href.slice(vr.length):s?i.href.slice(i.protocol.length):i.href):_r.buildAbsoluteURL(e,t)},Hl=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,ql=e=>T.log.debug?T.log.debug.bind(T,"VHS:",e+" >"):function(){};function L(...e){var t=T.obj||T;return(t.merge||t.mergeOptions).apply(t,e)}function Vl(...e){var t=T.time||T;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}function zl(e,i){return Jl(e,function(e,t){return e-Ql<=i&&t+Ql>=i})}function $l(e,t){return Jl(e,function(e){return e-Yl>=t})}function Wl(e){if(e&&e.length&&e.end)return e.end(e.length-1)}function Gl(t,i){let s=0;if(t&&t.length)for(let e=0;e<t.length;e++){var n=t.start(e),r=t.end(e);r<i||(s+=n<i&&i<=r?r-i:r-n)}return s}function Xl({defaultDuration:t,durationList:i,startIndex:s,endIndex:n}){let r=0;if(n<s&&([s,n]=[n,s]),s<0){for(let e=s;e<Math.min(0,n);e++)r+=t;s=0}for(let e=s;e<n;e++)r+=i[e].duration;return r}function Kl(e,t,i,s){if(!e||!e.segments)return null;if(e.endList)return dd(e);if(null===t)return null;t=t||0;let n=ld(e,e.mediaSequence+e.segments.length,t);return i&&(s="number"==typeof s?s:rd(null,e),n-=s),Math.max(0,n)}const Yl=1/30,Ql=3*Yl,Jl=function(e,t){var i=[];let s;if(e&&e.length)for(s=0;s<e.length;s++)t(e.start(s),e.end(s))&&i.push([e.start(s),e.end(s)]);return Vl(i)},Zl=t=>{var i=[];if(!t||!t.length)return"";for(let e=0;e<t.length;e++)i.push(t.start(e)+" => "+t.end(e));return i.join(", ")},ed=t=>{var i=[];for(let e=0;e<t.length;e++)i.push({start:t.start(e),end:t.end(e)});return i},td=(t,e)=>{if(!e.preload)return e.duration;let i=0;return(e.parts||[]).forEach(function(e){i+=e.duration}),(e.preloadHints||[]).forEach(function(e){"PART"===e.type&&(i+=t.partTargetDuration)}),i},id=e=>(e.segments||[]).reduce((i,s,n)=>(s.parts?s.parts.forEach(function(e,t){i.push({duration:e.duration,segmentIndex:n,partIndex:t,part:e,segment:s})}):i.push({duration:s.duration,segmentIndex:n,partIndex:null,segment:s,part:null}),i),[]),sd=e=>{e=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return e&&e.parts||[]},nd=({preloadSegment:e})=>{var t;if(e)return{parts:e,preloadHints:t}=e,(t||[]).reduce((e,t)=>e+("PART"===t.type?1:0),0)+(e&&e.length?e.length:0)},rd=(e,t)=>{return t.endList?0:e&&e.suggestedPresentationDelay?e.suggestedPresentationDelay:(e=0<sd(t).length)&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:e&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},ad=function(e,t){let i=0,s=t-e.mediaSequence,n=e.segments[s];if(n){if("undefined"!=typeof n.start)return{result:n.start,precise:!0};if("undefined"!=typeof n.end)return{result:n.end-n.duration,precise:!0}}for(;s--;){if("undefined"!=typeof(n=e.segments[s]).end)return{result:i+n.end,precise:!0};if(i+=td(e,n),"undefined"!=typeof n.start)return{result:i+n.start,precise:!0}}return{result:i,precise:!1}},od=function(e,t){let i=0;var s;let n=t-e.mediaSequence;for(;n<e.segments.length;n++){if("undefined"!=typeof(s=e.segments[n]).start)return{result:s.start-i,precise:!0};if(i+=td(e,s),"undefined"!=typeof s.end)return{result:s.end-i,precise:!0}}return{result:-1,precise:!1}},ld=function(e,t,i){var s;return(t="undefined"==typeof t?e.mediaSequence+e.segments.length:t)<e.mediaSequence?0:(s=ad(e,t)).precise?s.result:(e=od(e,t)).precise?e.result:s.result+i},dd=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),"undefined"==typeof t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return window.Infinity}return ld(e,t,i)};function hd(e){return e.excludeUntil&&e.excludeUntil>Date.now()}function ud(e){return e.excludeUntil&&e.excludeUntil===1/0}function cd(e){var t=hd(e);return!e.disabled&&!t}funct
|
||
|
`+"browserWorkerPolyFill(self);\n"+e}function rh(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)}var ah=sh(nh(rh(function(){function e(){this.init=function(){var r={};this.on=function(e,t){r[e]||(r[e]=[]),r[e]=r[e].concat(t)},this.off=function(e,t){return!!r[e]&&(t=r[e].indexOf(t),r[e]=r[e].slice(),r[e].splice(t,1),-1<t)},this.trigger=function(e){var t,i,s,n=r[e];if(n)if(2===arguments.length)for(i=n.length,t=0;t<i;++t)n[t].call(this,arguments[1]);else{for(s=[],t=arguments.length,t=1;t<arguments.length;++t)s.push(arguments[t]);for(i=n.length,t=0;t<i;++t)n[t].apply(this,s)}},this.dispose=function(){r={}}}}var l,R,U,B,F,j,H,q,V,z,$,W,G,X,K,Y,Q,J,Z,ee,d,te,ie,se,ne,re,ae,oe,t,le,de,he,ue,ce,pe,me,ge,fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i=(e.prototype.pipe=function(t){return this.on("data",function(e){t.push(e)}),this.on("done",function(e){t.flush(e)}),this.on("partialdone",function(e){t.partialFlush(e)}),this.on("endedtimeline",function(e){t.endTimeline(e)}),this.on("reset",function(e){t.reset(e)}),t},e.prototype.push=function(e){this.trigger("data",e)},e.prototype.flush=function(e){this.trigger("done",e)},e.prototype.partialFlush=function(e){this.trigger("partialdone",e)},e.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},e.prototype.reset=function(e){this.trigger("reset",e)},e),ye=Math.pow(2,32),s={getUint64:function(e){var t,e=new DataView(e.buffer,e.byteOffset,e.byteLength);return e.getBigUint64?(t=e.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:e.getUint32(0)*ye+e.getUint32(4)},MAX_UINT32:ye},_e=s.MAX_UINT32;if(d={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(var n in d)d.hasOwnProperty(n)&&(d[n]=[n.charCodeAt(0),n.charCodeAt(1),n.charCodeAt(2),n.charCodeAt(3)]);te=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),se=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),ie=new Uint8Array([0,0,0,1]),Ce=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),Ie=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),ne={video:Ce,audio:Ie},oe=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ae=new Uint8Array([0,0,0,0,0,0,0,0]),t=new Uint8Array([0,0,0,0,0,0,0,0]),le=t,de=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),he=t,re=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}l=function(e){for(var t,i=[],s=0,n=1;n<arguments.length;n++)i.push(arguments[n]);for(n=i.length;n--;)s+=i[n].byteLength;for(t=new Uint8Array(s+8),new DataView(t.buffer,t.byteOffset,t.byteLength).setUint32(0,t.byteLength),t.set(e,4),n=0,s=8;n<i.length;n++)t.set(i[n],s),s+=i[n].byteLength;return t},R=function(){return l(d.dinf,l(d.dref,oe))},U=function(e){return l(d.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},X=function(e){return l(d.hdlr,ne[e])},G=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),l(d.mdhd,t)},W=function(e){return l(d.mdia,G(e),X(e.type),j(e))},F=function(e){return l(d.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},j=function(e){return l(d.minf,"video"===e.type?l(d.vmhd,re):l(d.smhd,ae),R(),Y(e))},q=function(e){for(var t=e.length,i=[];t--;)i[t]=Z(e[t]);return l.apply(null,[d.mvex].concat(i))},V=fun
|
||
|
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */let h=null;class g{constructor(e){h=h||function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],s=t[4],n=i[4];let r,a,o;var l,d,h,u,c=[],p=[];let m,g;for(r=0;r<256;r++)p[(c[r]=r<<1^283*(r>>7))^r]=r;for(a=o=0;!s[a];a^=l||1,o=p[o]||1)for(u=(u=o^o<<1^o<<2^o<<3^o<<4)>>8^255&u^99,h=c[d=c[l=c[n[s[a]=u]=a]]],g=16843009*h^65537*d^257*l^16843008*a,m=257*c[u]^16843008*u,r=0;r<4;r++)t[r][a]=m=m<<24^m>>>8,i[r][u]=g=g<<24^g>>>8;for(r=0;r<5;r++)t[r]=t[r].slice(0),i[r]=i[r].slice(0);return e}(),this._tables=[[h[0][0].slice(),h[0][1].slice(),h[0][2].slice(),h[0][3].slice(),h[0][4].slice()],[h[1][0].slice(),h[1][1].slice(),h[1][2].slice(),h[1][3].slice(),h[1][4].slice()]];let t,i,s;var n=this._tables[0][4],r=this._tables[1],a=e.length;let o=1;if(4!==a&&6!==a&&8!==a)throw new Error("Invalid aes key size");var l=e.slice(0),d=[];for(this._key=[l,d],t=a;t<4*a+28;t++)s=l[t-1],(t%a==0||8===a&&t%a==4)&&(s=n[s>>>24]<<24^n[s>>16&255]<<16^n[s>>8&255]<<8^n[255&s],t%a==0)&&(s=s<<8^s>>>24^o<<24,o=o<<1^283*(o>>7)),l[t]=l[t-a]^s;for(i=0;t;i++,t--)s=l[3&i?t:t-4],t<=4||i<4?d[i]=s:d[i]=r[0][n[s>>>24]]^r[1][n[s>>16&255]]^r[2][n[s>>8&255]]^r[3][n[255&s]]}decrypt(e,t,i,s,n,r){var a,o,l=this._key[1];let d=e^l[0],h=s^l[1],u=i^l[2],c=t^l[3],p;var m=l.length/4-2;let g,f=4;var e=this._tables[1],y=e[0],_=e[1],v=e[2],b=e[3],T=e[4];for(g=0;g<m;g++)p=y[d>>>24]^_[h>>16&255]^v[u>>8&255]^b[255&c]^l[f],a=y[h>>>24]^_[u>>16&255]^v[c>>8&255]^b[255&d]^l[f+1],o=y[u>>>24]^_[c>>16&255]^v[d>>8&255]^b[255&h]^l[f+2],c=y[c>>>24]^_[d>>16&255]^v[h>>8&255]^b[255&u]^l[f+3],f+=4,d=p,h=a,u=o;for(g=0;g<4;g++)n[(3&-g)+r]=T[d>>>24]<<24^T[h>>16&255]<<16^T[u>>8&255]<<8^T[255&c]^l[f++],p=d,d=h,h=u,u=c,c=p}}class l extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}function f(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}class d{constructor(e,t,i,s){var n=d.STEP,r=new Int32Array(e.buffer);const a=new Uint8Array(e.byteLength);let o=0;for(this.asyncStream_=new l,this.asyncStream_.push(this.decryptChunk_(r.subarray(o,o+n),t,i,a)),o=n;o<r.length;o+=n)i=new Uint32Array([f(r[o-4]),f(r[o-3]),f(r[o-2]),f(r[o-1])]),this.asyncStream_.push(this.decryptChunk_(r.subarray(o,o+n),t,i,a));this.asyncStream_.push(function(){var e;
|
||
|
/*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */s(null,(e=a).subarray(0,e.byteLength-e[e.byteLength-1]))})}static get STEP(){return 32e3}decryptChunk_(t,i,s,n){return function(){var e=function(e,t,i){var s,n,r,a,o=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),l=new g(Array.prototype.slice.call(t)),t=new Uint8Array(e.byteLength),d=new Int32Array(t.buffer);let h,u,c,p,m;for(h=i[0],u=i[1],c=i[2],p=i[3],m=0;m<o.length;m+=4)s=f(o[m]),n=f(o[m+1]),r=f(o[m+2]),a=f(o[m+3]),l.decrypt(s,n,r,a,d,m),d[m]=f(d[m]^h),d[m+1]=f(d[m+1]^u),d[m+2]=f(d[m+2]^c),d[m+3]=f(d[m+3]^p),h=s,u=n,c=r,p=a;return t}(t,i,s);n.set(e,t.byteOffset)}}}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t="undefined"!=typeof window?window:"undefined"!=typeof t?t:"undefined"!=typeof self?self:{},t=t.BigInt||Number;t("0x1"),t("0x100"),t("0x10000"),t("0x1000000"),t("0x100000000"),t("0x10000000000"),t("0x1000000000000"),t("0x100000000000000"),t("0x10000000000000000"),t=new Uint16Array([65484]),255!==(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength))[0]&&t[0];function n(s){const n={};return Object.keys(s).forEach(e=>{var t,i=s[e];t=i,("function"===ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer)?n[e]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:n[e]=i}),n}self.onmessage=function(e){const i=e.data;var e=new Uint8Array(i.encrypted.bytes,i.encrypted.byteOffset,i.encrypted.byteLength),t=new Uint32Array(i.key.bytes,i.key.byteOffset,i.key.byteLength/4),s=new Uint32Array(i.iv.bytes,i.iv.byteOffset,i.iv.byteLength/4);new d(e,t,s,function(e,t){self.postMessage(n({source:i.source,decrypted:t}),[t.buffer])})}})));const vu=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},bu=(e,t)=>{(t.activePlaylistLoader=e).load()},Tu={AUDIO:(a,o)=>()=>{var{segmentLoaders:{[a]:e},mediaTypes:{[a]:t},excludePlaylist:i}=o,e=(vu(e,t),t.activeTrack()),s=t.activeGroup(),s=(s.filter(e=>e.default)[0]||s[0]).id,n=t.tracks[s];if(e===n)i({error:{message:"Problem encountered loading the default audio track."}});else{T.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const r in t.tracks)t.tracks[r].enabled=t.tracks[r]===n;t.onTrackChanged()}},SUBTITLES:(i,s)=>()=>{var{segmentLoaders:{[i]:e},mediaTypes:{[i]:t}}=s,e=(T.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),vu(e,t),t.activeTrack());e&&(e.mode="disabled"),t.onTrackChanged()}},Su={AUDIO:(e,t,i)=>{if(!t)return;const{tech:s,requestOptions:n,segmentLoaders:{[e]:r}}=i;t.on("loadedmetadata",()=>{var e=t.media();r.playlist(e,n),(!s.paused()||e.endList&&"none"!==s.preload())&&r.load()}),t.on("loadedplaylist",()=>{r.playlist(t.media(),n),s.paused()||r.load()}),t.on("error",Tu[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:s,requestOptions:n,segmentLoaders:{[e]:r},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{var e=t.media();r.playlist(e,n),r.track(a.activeTrack()),(!s.paused()||e.endList&&"none"!==s.preload())&&r.load()}),t.on("loadedplaylist",()=>{r.playlist(t.media(),n),s.paused()||r.load()}),t.on("error",Tu[e](e,i))}},wu={AUDIO:(i,s)=>{var n,{vhs:r,sourceType:a,segmentLoaders:{[i]:e},requestOptions:o,main:{mediaGroups:l},mediaTypes:{[i]:{groups:d,tracks:h,logger_:u}},mainPlaylistLoader:c}=s,p=yd(c.main);l[i]&&0!==Object.keys(l[i]).length||(l[i]={main:{default:{default:!0}}},p&&(l[i].main.default.playlists=c.main.playlists));for(const m in l[i]){d[m]||(d[m]=[]);for(const g in l[i][m]){let e=l[i][m][g],t;t=p?(u(`AUDIO group '${m}' label '${g}' is a main playlist`),e.isMainPlaylist=!0,null):"vhs-json"===a&&e.playlists?new Pd(e.playlists[0],r,o):e.resolvedUri?new Pd(e.resolvedUri,r,o):e.playlists&&"dash"===a?new eh(e.playlists[0],r,o,c):null,e=L({id:g,playlistLoader:t},e),Su[i](i,e.playlistLoader,s),d[m].push(e),"undefined"==typeof h[g]&&(n=new T.AudioTrack({id:g,kind:(e=>{let t=e.default?"main":"alternative";return t=e.characteristics&&0<=e.ch
|