webo-video
Version:
## 安装 ```javascript npm install webo-video ``` 该库依赖 video.js 以及 flv.js 安装 `webo-video` 之后可直接 `import videojs from "video.js"` 以及 `import flv.js from "flv.js"`
17 lines • 588 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("flv.js")):"function"==typeof define&&define.amd?define(["exports","flv.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).weboVideo={},e.flvjs)}(this,(function(e,t){"use strict";function i(){i=function(){return e};var e={},t=Object.prototype,s=t.hasOwnProperty,n=Object.defineProperty||function(e,t,i){e[t]=i.value},r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function u(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,i){return e[t]=i}}function d(e,t,i,s){var r=t&&t.prototype instanceof p?t:p,a=Object.create(r.prototype),o=new C(s||[]);return n(a,"_invoke",{value:S(e,i,o)}),a}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var c={};function p(){}function m(){}function f(){}var g={};u(g,a,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(I([])));_&&_!==t&&s.call(_,a)&&(g=_);var v=f.prototype=p.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function i(n,r,a,o){var l=h(e[n],e,r);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&s.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,o)}),(function(e){i("throw",e,a,o)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,o)}))}o(l.arg)}var r;n(this,"_invoke",{value:function(e,s){function n(){return new t((function(t,n){i(e,s,t,n)}))}return r=r?r.then(n,n):n()}})}function S(e,t,i){var s="suspendedStart";return function(n,r){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===n)throw r;return x()}for(i.method=n,i.arg=r;;){var a=i.delegate;if(a){var o=w(a,i);if(o){if(o===c)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===s)throw s="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);s="executing";var l=h(e,t,i);if("normal"===l.type){if(s=i.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(s="completed",i.method="throw",i.arg=l.arg)}}}function w(e,t){var i=t.method,s=e.iterator[i];if(void 0===s)return t.delegate=null,"throw"===i&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==i&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+i+"' method")),c;var n=h(s,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,c;var r=n.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function I(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,n=function t(){for(;++i<e.length;)if(s.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:x}}function x(){return{value:void 0,done:!0}}return m.prototype=f,n(v,"constructor",{value:f,configurable:!0}),n(f,"constructor",{value:m,configurable:!0}),m.displayName=u(f,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,l,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(T.prototype),u(T.prototype,o,(function(){return this})),e.AsyncIterator=T,e.async=function(t,i,s,n,r){void 0===r&&(r=Promise);var a=new T(d(t,i,s,n),r);return e.isGeneratorFunction(i)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(v),u(v,l,"Generator"),u(v,a,(function(){return this})),u(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),i=[];for(var s in t)i.push(s);return i.reverse(),function e(){for(;i.length;){var s=i.pop();if(s in t)return e.value=s,e.done=!1,e}return e.done=!0,e}},e.values=I,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,s){return a.type="throw",a.arg=e,t.next=i,s&&(t.method="next",t.arg=void 0),!!s}for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n],a=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var o=s.call(r,"catchLoc"),l=s.call(r,"finallyLoc");if(o&&l){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(o){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.finallyLoc,c):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),k(i),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var s=i.completion;if("throw"===s.type){var n=s.arg;k(i)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:I(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),c}},e}function s(e,t,i,s,n,r,a){try{var o=e[r](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(s,n)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,p(s.key),s)}}function a(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e,t,i){return(t=p(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function d(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,s=l(e);if(t){var n=l(this).constructor;i=Reflect.construct(s,arguments,n)}else i=s.apply(this,arguments);return d(this,i)}}function c(){return c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var s=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t);if(s){var n=Object.getOwnPropertyDescriptor(s,t);return n.get?n.get.call(arguments.length<3?e:i):n.value}},c.apply(this,arguments)}function p(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g={};
/**
* @license
* Video.js 8.0.4 <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){e.exports=function(){var e="8.0.4";const t={},i=function(e,i){return t[e]=t[e]||[],i&&(t[e]=t[e].concat(i)),t[e]},s=function(e,t){i(e,t)},n=function(e,s){const n=i(e).indexOf(s);return!(n<=-1||(t[e]=t[e].slice(),t[e].splice(n,1),0))},r=function(e,t){i(e,[].concat(t).map((t=>{const i=(...s)=>(n(e,i),t(...s));return i})))},a={prefixed:!0},o=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],l=o[0];let u;for(let Kf=0;Kf<o.length;Kf++)if(o[Kf][1]in document){u=o[Kf];break}if(u){for(let Yf=0;Yf<u.length;Yf++)a[l[Yf]]=u[Yf];a.prefixed=u[0]!==l[0]}let d=[];const h=(e,t)=>(i,s,n)=>{const r=t.levels[s],a=new RegExp(`^(${r})$`);if("log"!==i&&n.unshift(i.toUpperCase()+":"),n.unshift(e+":"),d){d.push([].concat(n));const e=d.length-1e3;d.splice(0,e>0?e:0)}if(!window.console)return;let o=window.console[i];o||"debug"!==i||(o=window.console.info||window.console.log),o&&r&&a.test(i)&&o[Array.isArray(n)?"apply":"call"](window.console,n)};function c(e){let t,i="info";const s=function(...e){t("log",i,e)};return t=h(e,s),s.createLogger=t=>c(e+": "+t),s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},s.level=e=>{if("string"==typeof e){if(!s.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);i=e}return i},s.history=()=>d?[].concat(d):[],s.history.filter=e=>(d||[]).filter((t=>new RegExp(`.*${e}.*`).test(t[0]))),s.history.clear=()=>{d&&(d.length=0)},s.history.disable=()=>{null!==d&&(d.length=0,d=null)},s.history.enable=()=>{null===d&&(d=[])},s.error=(...e)=>t("error",i,e),s.warn=(...e)=>t("warn",i,e),s.debug=(...e)=>t("debug",i,e),s}const p=c("VIDEOJS"),f=p.createLogger,g=Object.prototype.toString,y=function(e){return b(e)?Object.keys(e):[]};function _(e,t){y(e).forEach((i=>t(e[i],i)))}function v(e,t,i=0){return y(e).reduce(((i,s)=>t(i,e[s],s)),i)}function b(e){return!!e&&"object"==typeof e}function T(e){return b(e)&&"[object Object]"===g.call(e)&&e.constructor===Object}function S(...e){const t={};return e.forEach((e=>{e&&_(e,((e,i)=>{T(e)?(T(t[i])||(t[i]={}),t[i]=S(t[i],e)):t[i]=e}))})),t}function w(e,t,i,s=!0){const n=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),r={configurable:!0,enumerable:!0,get(){const e=i();return n(e),e}};return s&&(r.set=n),Object.defineProperty(e,t,r)}var E=Object.freeze({__proto__:null,each:_,reduce:v,isObject:b,isPlain:T,merge:S,defineLazyProperty:w});let k,C=!1,I=null,x=!1,A=!1,O=!1,P=!1,L=!1,D=null,N=null,R=null,M=!1,U=!1,B=!1,F=!1;const j=Boolean(z()&&("ontouchstart"in window||window.navigator.maxTouchPoints||window.DocumentTouch&&window.document instanceof window.DocumentTouch)),$=window.navigator&&window.navigator.userAgentData;if($&&(x="Android"===$.platform,O=Boolean($.brands.find((e=>"Microsoft Edge"===e.brand))),P=Boolean($.brands.find((e=>"Chromium"===e.brand))),L=!O&&P,D=N=($.brands.find((e=>"Chromium"===e.brand))||{}).version||null,U="Windows"===$.platform),!P){const Qf=window.navigator&&window.navigator.userAgent||"";C=/iPod/i.test(Qf),I=function(){const e=Qf.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),x=/Android/i.test(Qf),k=function(){const e=Qf.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),A=/Firefox/i.test(Qf),O=/Edg/i.test(Qf),P=/Chrome/i.test(Qf)||/CriOS/i.test(Qf),L=!O&&P,D=N=function(){const e=Qf.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),R=function(){const e=/MSIE\s(\d+)\.\d/.exec(Qf);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Qf)&&/rv:11.0/.test(Qf)&&(t=11),t}(),M=/Safari/i.test(Qf)&&!L&&!x&&!O,U=/Windows/i.test(Qf),B=/iPad/i.test(Qf)||M&&j&&!/iPhone/i.test(Qf),F=/iPhone/i.test(Qf)&&!B}const H=F||B||C,q=(M||H)&&!L;var V=Object.freeze({__proto__:null,get IS_IPOD(){return C},get IOS_VERSION(){return I},get IS_ANDROID(){return x},get ANDROID_VERSION(){return k},get IS_FIREFOX(){return A},get IS_EDGE(){return O},get IS_CHROMIUM(){return P},get IS_CHROME(){return L},get CHROMIUM_VERSION(){return D},get CHROME_VERSION(){return N},get IE_VERSION(){return R},get IS_SAFARI(){return M},get IS_WINDOWS(){return U},get IS_IPAD(){return B},get IS_IPHONE(){return F},TOUCH_ENABLED:j,IS_IOS:H,IS_ANY_SAFARI:q});function W(e){return"string"==typeof e&&Boolean(e.trim())}function G(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function z(){return document===window.document}function X(e){return b(e)&&1===e.nodeType}function K(){try{return window.parent!==window.self}catch(e){return!0}}function Y(e){return function(t,i){if(!W(t))return document[e](null);W(i)&&(i=document.querySelector(i));const s=X(i)?i:document;return s[e]&&s[e](t)}}function Q(e="div",t={},i={},s){const n=document.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){const i=t[e];"textContent"===e?J(n,i):n[e]===i&&"tabIndex"!==e||(n[e]=i)})),Object.getOwnPropertyNames(i).forEach((function(e){n.setAttribute(e,i[e])})),s&&ye(n,s),n}function J(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function Z(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function ee(e,t){return G(t),e.classList.contains(t)}function te(e,...t){return e.classList.add(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e}function ie(e,...t){return e?(e.classList.remove(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e):(p.warn("removeClass was called with an element that doesn't exist"),null)}function se(e,t,i){return"function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=void 0),t.split(/\s+/).forEach((t=>e.classList.toggle(t,i))),e}function ne(e,t){Object.getOwnPropertyNames(t).forEach((function(i){const s=t[i];null==s||!1===s?e.removeAttribute(i):e.setAttribute(i,!0===s?"":s)}))}function re(e){const t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0){const s=e.attributes;for(let n=s.length-1;n>=0;n--){const r=s[n].name;let a=s[n].value;"boolean"!=typeof e[r]&&-1===i.indexOf(","+r+",")||(a=null!==a),t[r]=a}}return t}function ae(e,t){return e.getAttribute(t)}function oe(e,t,i){e.setAttribute(t,i)}function le(e,t){e.removeAttribute(t)}function ue(){document.body.focus(),document.onselectstart=function(){return!1}}function de(){document.onselectstart=function(){return!0}}function he(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((e=>{void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(Se(e,"height"))),i.width||(i.width=parseFloat(Se(e,"width"))),i}}function ce(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};const t=e.offsetWidth,i=e.offsetHeight;let s=0,n=0;for(;e.offsetParent&&e!==document[a.fullscreenElement];)s+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{left:s,top:n,width:t,height:i}}function pe(e,t){const i={x:0,y:0};if(H){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){const e=Se(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13]}t=t.parentNode}}const s={},n=ce(t.target),r=ce(e),a=r.width,o=r.height;let l=t.offsetY-(r.top-n.top),u=t.offsetX-(r.left-n.left);return t.changedTouches&&(u=t.changedTouches[0].pageX-r.left,l=t.changedTouches[0].pageY+r.top,H&&(u-=i.x,l-=i.y)),s.y=1-Math.max(0,Math.min(1,l/o)),s.x=Math.max(0,Math.min(1,u/a)),s}function me(e){return b(e)&&3===e.nodeType}function fe(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function ge(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((e=>("function"==typeof e&&(e=e()),X(e)||me(e)?e:"string"==typeof e&&/\S/.test(e)?document.createTextNode(e):void 0))).filter((e=>e))}function ye(e,t){return ge(t).forEach((t=>e.appendChild(t))),e}function _e(e,t){return ye(fe(e),t)}function ve(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}const be=Y("querySelector"),Te=Y("querySelectorAll");function Se(e,t){if(!e||!t)return"";if("function"==typeof window.getComputedStyle){let i;try{i=window.getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}return""}var we=Object.freeze({__proto__:null,isReal:z,isEl:X,isInFrame:K,createEl:Q,textContent:J,prependTo:Z,hasClass:ee,addClass:te,removeClass:ie,toggleClass:se,setAttributes:ne,getAttributes:re,getAttribute:ae,setAttribute:oe,removeAttribute:le,blockTextSelection:ue,unblockTextSelection:de,getBoundingClientRect:he,findPosition:ce,getPointerPosition:pe,isTextNode:me,emptyEl:fe,normalizeContent:ge,appendContent:ye,insertContent:_e,isSingleLeftClick:ve,$:be,$$:Te,computedStyle:Se});let Ee,ke=!1;const Ce=function(){if(!1===Ee.options.autoSetup)return;const e=Array.prototype.slice.call(document.getElementsByTagName("video")),t=Array.prototype.slice.call(document.getElementsByTagName("audio")),i=Array.prototype.slice.call(document.getElementsByTagName("video-js")),s=e.concat(t,i);if(s&&s.length>0)for(let e=0,t=s.length;e<t;e++){const t=s[e];if(!t||!t.getAttribute){Ie(1);break}void 0===t.player&&null!==t.getAttribute("data-setup")&&Ee(t)}else ke||Ie(1)};function Ie(e,t){z()&&(t&&(Ee=t),window.setTimeout(Ce,e))}function xe(){ke=!0,window.removeEventListener("load",xe)}z()&&("complete"===document.readyState?xe():window.addEventListener("load",xe));const Ae=function(e){const t=document.createElement("style");return t.className=e,t},Oe=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var Pe=new WeakMap;let Le,De=3;function Ne(){return De++}function Re(e,t){if(!Pe.has(e))return;const i=Pe.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Pe.delete(e)}function Me(e,t,i,s){i.forEach((function(i){e(t,i,s)}))}function Ue(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){const s=e||window.event;e={};for(const t in s)"layerX"!==t&&"layerY"!==t&&"keyLocation"!==t&&"webkitMovementX"!==t&&"webkitMovementY"!==t&&"path"!==t&&("returnValue"===t&&s.preventDefault||(e[t]=s[t]));if(e.target||(e.target=e.srcElement||document),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){s.preventDefault&&s.preventDefault(),e.returnValue=!1,s.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){s.stopPropagation&&s.stopPropagation(),e.cancelBubble=!0,s.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){const t=document.documentElement,i=document.body;e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}const Be=function(){if("boolean"!=typeof Le){Le=!1;try{const e=Object.defineProperty({},"passive",{get(){Le=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}}return Le},Fe=["touchstart","touchmove"];function je(e,t,i){if(Array.isArray(t))return Me(je,e,t,i);Pe.has(e)||Pe.set(e,{});const s=Pe.get(e);if(s.handlers||(s.handlers={}),s.handlers[t]||(s.handlers[t]=[]),i.guid||(i.guid=Ne()),s.handlers[t].push(i),s.dispatcher||(s.disabled=!1,s.dispatcher=function(t,i){if(s.disabled)return;t=Ue(t);const n=s.handlers[t.type];if(n){const s=n.slice(0);for(let n=0,r=s.length;n<r&&!t.isImmediatePropagationStopped();n++)try{s[n].call(e,t,i)}catch(e){p.error(e)}}}),1===s.handlers[t].length)if(e.addEventListener){let i=!1;Be()&&Fe.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,s.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,s.dispatcher)}function $e(e,t,i){if(!Pe.has(e))return;const s=Pe.get(e);if(!s.handlers)return;if(Array.isArray(t))return Me($e,e,t,i);const n=function(e,t){s.handlers[t]=[],Re(e,t)};if(void 0===t){for(const t in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},t)&&n(e,t);return}const r=s.handlers[t];if(r)if(i){if(i.guid)for(let e=0;e<r.length;e++)r[e].guid===i.guid&&r.splice(e--,1);Re(e,t)}else n(e,t)}function He(e,t,i){const s=Pe.has(e)?Pe.get(e):{},n=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Ue(t),s.dispatcher&&s.dispatcher.call(e,t,i),n&&!t.isPropagationStopped()&&!0===t.bubbles)He.call(null,n,t,i);else if(!n&&!t.defaultPrevented&&t.target&&t.target[t.type]){Pe.has(t.target)||Pe.set(t.target,{});const e=Pe.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function qe(e,t,i){if(Array.isArray(t))return Me(qe,e,t,i);const s=function(){$e(e,t,s),i.apply(this,arguments)};s.guid=i.guid=i.guid||Ne(),je(e,t,s)}function Ve(e,t,i){const s=function(){$e(e,t,s),i.apply(this,arguments)};s.guid=i.guid=i.guid||Ne(),je(e,t,s)}var We=Object.freeze({__proto__:null,fixEvent:Ue,on:je,off:$e,trigger:He,one:qe,any:Ve});const Ge=30,ze=function(e,t,i){t.guid||(t.guid=Ne());const s=t.bind(e);return s.guid=i?i+"_"+t.guid:t.guid,s},Xe=function(e,t){let i=window.performance.now();return function(...s){const n=window.performance.now();n-i>=t&&(e(...s),i=n)}},Ke=function(e,t,i,s=window){let n;const r=()=>{s.clearTimeout(n),n=null},a=function(){const r=this,a=arguments;let o=function(){n=null,o=null,i||e.apply(r,a)};!n&&i&&e.apply(r,a),s.clearTimeout(n),n=s.setTimeout(o,t)};return a.cancel=r,a};var Ye=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Ge,bind_:ze,throttle:Xe,debounce:Ke});let Qe;class Je{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},je(this,e,t),this.addEventListener=i}off(e,t){$e(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},qe(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ve(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;"string"==typeof e&&(e={type:t}),e=Ue(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),He(this,e)}queueTrigger(e){Qe||(Qe=new Map);const t=e.type||e;let i=Qe.get(this);i||(i=new Map,Qe.set(this,i));const s=i.get(t);i.delete(t),window.clearTimeout(s);const n=window.setTimeout((()=>{i.delete(t),0===i.size&&(i=null,Qe.delete(this)),this.trigger(e)}),0);i.set(t,n)}}Je.prototype.allowedEvents_={},Je.prototype.addEventListener=Je.prototype.on,Je.prototype.removeEventListener=Je.prototype.off,Je.prototype.dispatchEvent=Je.prototype.trigger;const Ze=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,et=e=>e instanceof Je||!!e.eventBusEl_&&["on","one","off","trigger"].every((t=>"function"==typeof e[t])),tt=(e,t)=>{et(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},it=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,st=(e,t,i)=>{if(!e||!e.nodeName&&!et(e))throw new Error(`Invalid target for ${Ze(t)}#${i}; must be a DOM node or evented object.`)},nt=(e,t,i)=>{if(!it(e))throw new Error(`Invalid event type for ${Ze(t)}#${i}; must be a non-empty string or array.`)},rt=(e,t,i)=>{if("function"!=typeof e)throw new Error(`Invalid listener for ${Ze(t)}#${i}; must be a function.`)},at=(e,t,i)=>{const s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let n,r,a;return s?(n=e.eventBusEl_,t.length>=3&&t.shift(),[r,a]=t):[n,r,a]=t,st(n,e,i),nt(r,e,i),rt(a,e,i),a=ze(e,a),{isTargetingSelf:s,target:n,type:r,listener:a}},ot=(e,t,i,s)=>{st(e,e,t),e.nodeName?We[t](e,i,s):e[t](i,s)},lt={on(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=at(this,e,"on");if(ot(i,"on",s,n),!t){const e=()=>this.off(i,s,n);e.guid=n.guid;const t=()=>this.off("dispose",e);t.guid=n.guid,ot(this,"on","dispose",e),ot(i,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=at(this,e,"one");if(t)ot(i,"one",s,n);else{const e=(...t)=>{this.off(i,s,e),n.apply(null,t)};e.guid=n.guid,ot(i,"one",s,e)}},any(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=at(this,e,"any");if(t)ot(i,"any",s,n);else{const e=(...t)=>{this.off(i,s,e),n.apply(null,t)};e.guid=n.guid,ot(i,"any",s,e)}},off(e,t,i){if(!e||it(e))$e(this.eventBusEl_,e,t);else{const s=e,n=t;st(s,this,"off"),nt(n,this,"off"),rt(i,this,"off"),i=ze(this,i),this.off("dispose",i),s.nodeName?($e(s,n,i),$e(s,"dispose",i)):et(s)&&(s.off(n,i),s.off("dispose",i))}},trigger(e,t){st(this.eventBusEl_,this,"trigger");const i=e&&"string"!=typeof e?e.type:e;if(!it(i))throw new Error(`Invalid event type for ${Ze(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return He(this.eventBusEl_,e,t)}};function ut(e,t={}){const{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw new Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i]}else e.eventBusEl_=Q("span",{className:"vjs-event-bus"});return Object.assign(e,lt),e.eventedCallbacks&&e.eventedCallbacks.forEach((e=>{e()})),e.on("dispose",(()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&Pe.has(e)&&Pe.delete(e)})),window.setTimeout((()=>{e.eventBusEl_=null}),0)})),e}const dt={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),_(e,((e,i)=>{this.state[i]!==e&&(t=t||{},t[i]={from:this.state[i],to:e}),this.state[i]=e})),t&&et(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function ht(e,t){return Object.assign(e,dt),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&et(e)&&e.on("statechanged",e.handleStateChanged),e}const ct=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toLowerCase()))},pt=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},mt=function(e,t){return pt(e)===pt(t)};var ft=Object.freeze({__proto__:null,toLowerCase:ct,toTitleCase:pt,titleCaseEquals:mt}),gt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==m?m:"undefined"!=typeof self?self:{};function yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _t(e,t){return e(t={exports:{}},t.exports),t.exports}var vt=_t((function(e,t){function i(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return a[e];var i,r=String(e);return(i=s[r.toLowerCase()])?i:(i=n[r.toLowerCase()])||(1===r.length?r.charCodeAt(0):void 0)}i.isEventKey=function(e,t){if(e&&"object"==typeof e){var i=e.which||e.keyCode||e.charCode;if(null==i)return!1;if("string"==typeof t){var r;if(r=s[t.toLowerCase()])return r===i;if(r=n[t.toLowerCase()])return r===i}else if("number"==typeof t)return t===i;return!1}};var s=(t=e.exports=i).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},n=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};
/*!
* Programatically add the following
*/
for(r=97;r<123;r++)s[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)s[r-48]=r;for(r=1;r<13;r++)s["f"+r]=r+111;for(r=0;r<10;r++)s["numpad "+r]=r+96;var a=t.names=t.title={};for(r in s)a[s[r]]=r;for(var o in n)s[o]=n[o]}));vt.code,vt.codes,vt.aliases,vt.names,vt.title;class bt{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=S({},this.options_),t=this.options_=S(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${Ne()}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach((e=>this.addClass(e))),!1!==t.evented&&(ut(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),ht(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=S(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return Q(e,t,i)}localize(e,t,i=e){const s=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),r=n&&n[s],a=s&&s.split("-")[0],o=n&&n[a];let l=i;return r&&r[e]?l=r[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,i){const s=t[i-1];let n=s;return void 0===s&&(n=e),n}))),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce(((e,t)=>e.concat(t)),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}addChild(e,t={},i=this.children_.length){let s,n;if("string"==typeof e){n=pt(e);const i=t.componentClass||n;t.name=n;const r=bt.getComponent(i);if(!r)throw new Error(`Component ${i} does not exist`);if("function"!=typeof r)return null;s=new r(this.player_||this,t)}else s=e;if(s.parentComponent_&&s.parentComponent_.removeChild(s),this.children_.splice(i,0,s),s.parentComponent_=this,"function"==typeof s.id&&(this.childIndex_[s.id()]=s),n=n||s.name&&pt(s.name()),n&&(this.childNameIndex_[n]=s,this.childNameIndex_[ct(n)]=s),"function"==typeof s.el&&s.el()){let e=null;this.children_[i+1]&&(this.children_[i+1].el_?e=this.children_[i+1].el_:X(this.children_[i+1])&&(e=this.children_[i+1])),this.contentEl().insertBefore(s.el(),e)}return s}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[pt(e.name())]=null,this.childNameIndex_[ct(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=e=>{const i=e.name;let s=e.opts;if(void 0!==t[i]&&(s=t[i]),!1===s)return;!0===s&&(s={}),s.playerOptions=this.options_.playerOptions;const n=this.addChild(i,s);n&&(this[i]=n)};let s;const n=bt.getComponent("Tech");s=Array.isArray(e)?e:Object.keys(e),s.concat(Object.keys(this.options_).filter((function(e){return!s.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((t=>{let i,s;return"string"==typeof t?(i=t,s=e[i]||this.options_[i]||{}):(i=t.name,s=t),{name:i,opts:s}})).filter((e=>{const t=bt.getComponent(e.opts.componentClass||pt(e.name));return t&&!n.isTech(t)})).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout((function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)}$(e,t){return be(e,t||this.contentEl())}$$(e,t){return Te(e,t||this.contentEl())}hasClass(e){return ee(this.el_,e)}addClass(...e){te(this.el_,...e)}removeClass(...e){ie(this.el_,...e)}toggleClass(e,t){se(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return ae(this.el_,e)}setAttribute(e,t){oe(this.el_,e,t)}removeAttribute(e){le(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;const s=this.el_.style[e],n=s.indexOf("px");return-1!==n?parseInt(s.slice(0,n),10):parseInt(this.el_["offset"+pt(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Se(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){const i=`offset${pt(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(vt.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const i=10,s=200;let n;this.on("touchstart",(function(i){1===i.touches.length&&(t={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},e=window.performance.now(),n=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)n=!1;else if(t){const s=e.touches[0].pageX-t.pageX,r=e.touches[0].pageY-t.pageY;Math.sqrt(s*s+r*r)>i&&(n=!1)}}));const r=function(){n=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",(function(i){t=null,!0===n&&window.performance.now()-e<s&&(i.preventDefault(),this.trigger("tap"))}))}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=ze(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}));const i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=ze(this,e),this.clearTimersOnDispose_(),i=window.setTimeout((()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()}),t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),window.clearTimeout(e)),e}setInterval(e,t){e=ze(this,e),this.clearTimersOnDispose_();const i=window.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),window.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=ze(this,e),t=window.requestAnimationFrame((()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()})),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e))return;this.clearTimersOnDispose_(),t=ze(this,t);const i=this.requestAnimationFrame((()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)}));return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),window.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((([e,t])=>{this[e].forEach(((e,i)=>this[t](i)))})),this.clearingTimersOnDispose_=!1})))}static registerComponent(e,t){if("string"!=typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=bt.getComponent("Tech"),s=i&&i.isTech(t),n=bt===t||bt.prototype.isPrototypeOf(t.prototype);if(s||!n){let t;throw t=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=pt(e),bt.components_||(bt.components_={});const r=bt.getComponent("Player");if("Player"===e&&r&&r.players){const e=r.players,t=Object.keys(e);if(e&&t.length>0&&t.map((t=>e[t])).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return bt.components_[e]=t,bt.components_[ct(e)]=t,t}static getComponent(e){if(e&&bt.components_)return bt.components_[e]}}function Tt(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}function St(e,t,i,s){return Tt(e,s,i.length-1),i[s][t]}function wt(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:St.bind(null,"start",0,e),end:St.bind(null,"end",1,e)},window.Symbol&&window.Symbol.iterator&&(t[window.Symbol.iterator]=()=>(e||[]).values()),t}function Et(e,t){return Array.isArray(e)?wt(e):void 0===e||void 0===t?wt():wt([[e,t]])}bt.registerComponent("Component",bt);const kt=function(e,t){e=e<0?0:e;let i=Math.floor(e%60),s=Math.floor(e/60%60),n=Math.floor(e/3600);const r=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(n=s=i="-"),n=n>0||a>0?n+":":"",s=((n||r>=10)&&s<10?"0"+s:s)+":",i=i<10?"0"+i:i,n+s+i};let Ct=kt;function It(e){Ct=e}function xt(){Ct=kt}function At(e,t=e){return Ct(e,t)}var Ot=Object.freeze({__proto__:null,createTimeRanges:Et,createTimeRange:Et,setFormatTime:It,resetFormatTime:xt,formatTime:At});function Pt(e,t){let i,s,n=0;if(!t)return 0;e&&e.length||(e=Et(0,0));for(let r=0;r<e.length;r++)i=e.start(r),s=e.end(r),s>t&&(s=t),n+=s-i;return n/t}function Lt(e){if(e instanceof Lt)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:b(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=Lt.defaultMessages[this.code]||"")}Lt.prototype.code=0,Lt.prototype.message="",Lt.prototype.status=null,Lt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Lt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(let Jf=0;Jf<Lt.errorTypes.length;Jf++)Lt[Lt.errorTypes[Jf]]=Jf,Lt.prototype[Lt.errorTypes[Jf]]=Jf;var Dt=Nt;function Nt(e,t){var i,s=null;try{i=JSON.parse(e,t)}catch(e){s=e}return[s,i]}function Rt(e){return null!=e&&"function"==typeof e.then}function Mt(e){Rt(e)&&e.then(null,(e=>{}))}const Ut=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((t,i,s)=>(e[i]&&(t[i]=e[i]),t)),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})};var Bt={textTracksToJson:function(e){const t=e.$$("track"),i=Array.prototype.map.call(t,(e=>e.track));return Array.prototype.map.call(t,(function(e){const t=Ut(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(Ut))},jsonToTextTracks:function(e,t){return e.forEach((function(e){const i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((e=>i.addCue(e)))})),t.textTracks()},trackToJson_:Ut};const Ft="vjs-modal-dialog";class jt extends bt{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=Q("div",{className:`${Ft}-content`},{role:"document"}),this.descEl_=Q("p",{className:`${Ft}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),J(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Ft} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(!this.opened_){const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,s=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),_e(t,e),this.trigger("modalfill"),s?i.insertBefore(t,s):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_)}empty(){this.trigger("beforemodalempty"),fe(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){const e=document.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(e.stopPropagation(),vt.isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(!vt.isEventKey(e,"Tab"))return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let s;for(let e=0;e<t.length;e++)if(i===t[e]){s=e;break}document.activeElement===this.el_&&(s=0),e.shiftKey&&0===s?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||s!==t.length-1||(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(e=>(e instanceof window.HTMLAnchorElement||e instanceof window.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof window.HTMLIFrameElement||e instanceof window.HTMLObjectElement||e instanceof window.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")))}}jt.prototype.options_={pauseOnOpen:!0,temporary:!0},bt.registerComponent("ModalDialog",jt);class $t extends Je{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},et(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,s=this.length;i<s;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===e){t=s;break}}return t}}$t.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const Zf in $t.prototype.allowedEvents_)$t.prototype["on"+Zf]=null;const Ht=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)};class qt extends $t{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Ht(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Ht(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Ht(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Vt=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)};class Wt extends $t{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Vt(e,e[t]);break}super(e),this.changing_=!1,Object.de