UNPKG

video.js

Version:

An HTML5 video player that supports HLS and DASH with a common API and skin.

19 lines 206 kB
/** * @license * Video.js 7.11.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){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).videojs=t()}(this,function(){"use strict";var h="7.11.4",e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t){return e(t={exports:{}},t.exports),t.exports}var d="undefined"!=typeof window?window:"undefined"!=typeof e?e:"undefined"!=typeof self?self:{},n="undefined"!=typeof e?e:"undefined"!=typeof window?window:{},p="undefined"!=typeof document?document:n["__GLOBAL_DOCUMENT_CACHE@4"]||(n["__GLOBAL_DOCUMENT_CACHE@4"]={}),c=[],o=function(a,l){return function(e,t,n){var i=l.levels[t],r=new RegExp("^("+i+")$");if("log"!==e&&n.unshift(e.toUpperCase()+":"),n.unshift(a+":"),c){c.push([].concat(n));var s=c.length-1e3;c.splice(0,0<s?s:0)}if(d.console){var o=d.console[e];o||"debug"!==e||(o=d.console.info||d.console.log),o&&i&&r.test(e)&&o[Array.isArray(n)?"apply":"call"](d.console,n)}}};var f=function t(n){function i(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r("log",s,t)}var r,s="info";return r=o(n,i),i.createLogger=function(e){return t(n+": "+e)},i.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},i.level=function(e){if("string"==typeof e){if(!i.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');s=e}return s},(i.history=function(){return c?[].concat(c):[]}).filter=function(t){return(c||[]).filter(function(e){return new RegExp(".*"+t+".*").test(e[0])})},i.history.clear=function(){c&&(c.length=0)},i.history.disable=function(){null!==c&&(c.length=0,c=null)},i.history.enable=function(){null===c&&(c=[])},i.error=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r("error",s,t)},i.warn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r("warn",s,t)},i.debug=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r("debug",s,t)},i}("VIDEOJS"),v=f.createLogger,r=t(function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},t.apply(this,arguments)}e.exports=t}),i=Object.prototype.toString,s=function(e){return l(e)?Object.keys(e):[]};function a(t,n){s(t).forEach(function(e){return n(t[e],e)})}function g(n){for(var e=arguments.length,t=new Array(1<e?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Object.assign?r.apply(void 0,[n].concat(t)):(t.forEach(function(e){e&&a(e,function(e,t){n[t]=e})}),n)}function l(e){return!!e&&"object"==typeof e}function u(e){return l(e)&&"[object Object]"===i.call(e)&&e.constructor===Object}function _(e,t){if(!e||!t)return"";if("function"!=typeof d.getComputedStyle)return"";var n=d.getComputedStyle(e);return n?n.getPropertyValue(t)||n[t]:""}function y(e){return"string"==typeof e&&Boolean(e.trim())}function m(e){if(0<=e.indexOf(" "))throw new Error("class has illegal whitespace characters")}function b(){return p===d.document}function T(e){return l(e)&&1===e.nodeType}function k(){try{return d.parent!==d.self}catch(e){return!0}}function C(i){return function(e,t){if(!y(e))return p[i](null);y(t)&&(t=p.querySelector(t));var n=T(t)?t:p;return n[i]&&n[i](e)}}function E(e,n,t,i){void 0===e&&(e="div"),void 0===n&&(n={}),void 0===t&&(t={});var r=p.createElement(e);return Object.getOwnPropertyNames(n).forEach(function(e){var t=n[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(f.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+t+"."),r.setAttribute(e,t)):"textContent"===e?S(r,t):r[e]===t&&"tabIndex"!==e||(r[e]=t)}),Object.getOwnPropertyNames(t).forEach(function(e){r.setAttribute(e,t[e])}),i&&W(r,i),r}function S(e,t){return"undefined"==typeof e.textContent?e.innerText=t:e.textContent=t,e}function w(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function x(e,t){return m(t),e.classList?e.classList.contains(t):function(e){return new RegExp("(^|\\s)"+e+"($|\\s)")}(t).test(e.className)}function P(e,t){return e.classList?e.classList.add(t):x(e,t)||(e.className=(e.className+" "+t).trim()),e}function j(e,t){return e.classList?e.classList.remove(t):(m(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e}function A(e,t,n){var i=x(e,t);if("function"==typeof n&&(n=n(e,t)),"boolean"!=typeof n&&(n=!i),n!==i)return n?P(e,t):j(e,t),e}function I(n,i){Object.getOwnPropertyNames(i).forEach(function(e){var t=i[e];null===t||"undefined"==typeof t||!1===t?n.removeAttribute(e):n.setAttribute(e,!0===t?"":t)})}function L(e){var t={},n=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&0<e.attributes.length)for(var i=e.attributes,r=i.length-1;0<=r;r--){var s=i[r].name,o=i[r].value;"boolean"!=typeof e[s]&&-1===n.indexOf(","+s+",")||(o=null!==o),t[s]=o}return t}function N(e,t){return e.getAttribute(t)}function O(e,t,n){e.setAttribute(t,n)}function M(e,t){e.removeAttribute(t)}function D(){p.body.focus(),p.onselectstart=function(){return!1}}function F(){p.onselectstart=function(){return!0}}function R(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(n[e]=t[e])}),n.height||(n.height=parseFloat(_(e,"height"))),n.width||(n.width=parseFloat(_(e,"width"))),n}}function B(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,n=e.offsetHeight,i=0,r=0;i+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;);return{left:i,top:r,width:t,height:n}}function H(e,t){var n={},i=B(t.target),r=B(e),s=r.width,o=r.height,a=t.offsetY-(r.top-i.top),l=t.offsetX-(r.left-i.left);return t.changedTouches&&(l=t.changedTouches[0].pageX-r.left,a=t.changedTouches[0].pageY+r.top),n.y=1-Math.max(0,Math.min(1,a/o)),n.x=Math.max(0,Math.min(1,l/s)),n}function V(e){return l(e)&&3===e.nodeType}function K(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function z(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),T(e)||V(e)?e:"string"==typeof e&&/\S/.test(e)?p.createTextNode(e):void 0}).filter(function(e){return e})}function W(t,e){return z(e).forEach(function(e){return t.appendChild(e)}),t}function U(e,t){return W(K(e),t)}function q(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))}var X,G=C("querySelector"),$=C("querySelectorAll"),Y=Object.freeze({__proto__:null,isReal:b,isEl:T,isInFrame:k,createEl:E,textContent:S,prependTo:w,hasClass:x,addClass:P,removeClass:j,toggleClass:A,setAttributes:I,getAttributes:L,getAttribute:N,setAttribute:O,removeAttribute:M,blockTextSelection:D,unblockTextSelection:F,getBoundingClientRect:R,findPosition:B,getPointerPosition:H,isTextNode:V,emptyEl:K,normalizeContent:z,appendContent:W,insertContent:U,isSingleLeftClick:q,$:G,$$:$}),Q=!1,J=function(){if(b()&&!1!==X.options.autoSetup){var e=Array.prototype.slice.call(p.getElementsByTagName("video")),t=Array.prototype.slice.call(p.getElementsByTagName("audio")),n=Array.prototype.slice.call(p.getElementsByTagName("video-js")),i=e.concat(t,n);if(i&&0<i.length)for(var r=0,s=i.length;r<s;r++){var o=i[r];if(!o||!o.getAttribute){Z(1);break}void 0===o.player&&null!==o.getAttribute("data-setup")&&X(o)}else Q||Z(1)}};function Z(e,t){t&&(X=t),d.setTimeout(J,e)}function ee(){Q=!0,d.removeEventListener("load",ee)}b()&&("complete"===p.readyState?ee():d.addEventListener("load",ee));function te(e){var t=p.createElement("style");return t.className=e,t}function ne(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t}var ie,re=3;function se(){return re++}d.WeakMap||(ie=function(){function e(){this.vdata="vdata"+Math.floor(d.performance&&d.performance.now()||Date.now()),this.data={}}var t=e.prototype;return t.set=function(e,t){var n=e[this.vdata]||se();return e[this.vdata]||(e[this.vdata]=n),this.data[n]=t,this},t.get=function(e){var t=e[this.vdata];if(t)return this.data[t];f("We have no data for this element",e)},t.has=function(e){return e[this.vdata]in this.data},t.delete=function(e){var t=e[this.vdata];t&&(delete this.data[t],delete e[this.vdata])},e}());var oe,ae=d.WeakMap?new WeakMap:new ie;function le(e,t){if(ae.has(e)){var n=ae.get(e);0===n.handlers[t].length&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),0===Object.getOwnPropertyNames(n).length&&ae.delete(e)}}function ce(t,n,e,i){e.forEach(function(e){t(n,e,i)})}function ue(e){if(e.fixed_)return e;function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped){var i=e||d.event;for(var r in e={},i)"layerX"!==r&&"layerY"!==r&&"keyLocation"!==r&&"webkitMovementX"!==r&&"webkitMovementY"!==r&&("returnValue"===r&&i.preventDefault||(e[r]=i[r]));if(e.target||(e.target=e.srcElement||p),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){i.preventDefault&&i.preventDefault(),e.returnValue=!1,i.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),e.cancelBubble=!0,i.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){var s=p.documentElement,o=p.body;e.pageX=e.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=e.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.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}var he=function(){if("boolean"!=typeof oe){oe=!1;try{var e=Object.defineProperty({},"passive",{get:function(){oe=!0}});d.addEventListener("test",null,e),d.removeEventListener("test",null,e)}catch(e){}}return oe},de=["touchstart","touchmove"];function pe(o,e,t){if(Array.isArray(e))return ce(pe,o,e,t);ae.has(o)||ae.set(o,{});var a=ae.get(o);if(a.handlers||(a.handlers={}),a.handlers[e]||(a.handlers[e]=[]),t.guid||(t.guid=se()),a.handlers[e].push(t),a.dispatcher||(a.disabled=!1,a.dispatcher=function(e,t){if(!a.disabled){e=ue(e);var n=a.handlers[e.type];if(n)for(var i=n.slice(0),r=0,s=i.length;r<s&&!e.isImmediatePropagationStopped();r++)try{i[r].call(o,e,t)}catch(e){f.error(e)}}}),1===a.handlers[e].length)if(o.addEventListener){var n=!1;he()&&-1<de.indexOf(e)&&(n={passive:!0}),o.addEventListener(e,a.dispatcher,n)}else o.attachEvent&&o.attachEvent("on"+e,a.dispatcher)}function fe(e,t,n){if(ae.has(e)){var i=ae.get(e);if(i.handlers){if(Array.isArray(t))return ce(fe,e,t,n);var r=function(e,t){i.handlers[t]=[],le(e,t)};if(void 0!==t){var s=i.handlers[t];if(s)if(n){if(n.guid)for(var o=0;o<s.length;o++)s[o].guid===n.guid&&s.splice(o--,1);le(e,t)}else r(e,t)}else for(var a in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},a)&&r(e,a)}}}function ve(e,t,n){var i=ae.has(e)?ae.get(e):{},r=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=ue(t),i.dispatcher&&i.dispatcher.call(e,t,n),r&&!t.isPropagationStopped()&&!0===t.bubbles)ve.call(null,r,t,n);else if(!r&&!t.defaultPrevented&&t.target&&t.target[t.type]){ae.has(t.target)||ae.set(t.target,{});var s=ae.get(t.target);t.target[t.type]&&(s.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),s.disabled=!1)}return!t.defaultPrevented}function ge(e,t,n){if(Array.isArray(t))return ce(ge,e,t,n);function i(){fe(e,t,i),n.apply(this,arguments)}i.guid=n.guid=n.guid||se(),pe(e,t,i)}function _e(e,t,n){function i(){fe(e,t,i),n.apply(this,arguments)}i.guid=n.guid=n.guid||se(),pe(e,t,i)}function ye(e,t,n){t.guid||(t.guid=se());var i=t.bind(e);return i.guid=n?n+"_"+t.guid:t.guid,i}function me(t,n){var i=d.performance.now();return function(){var e=d.performance.now();n<=e-i&&(t.apply(void 0,arguments),i=e)}}function be(){}var Te,ke=Object.freeze({__proto__:null,fixEvent:ue,on:pe,off:fe,trigger:ve,one:ge,any:_e});be.prototype.allowedEvents_={},be.prototype.addEventListener=be.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},pe(this,e,t),this.addEventListener=n},be.prototype.removeEventListener=be.prototype.off=function(e,t){fe(this,e,t)},be.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},ge(this,e,t),this.addEventListener=n},be.prototype.any=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},_e(this,e,t),this.addEventListener=n},be.prototype.dispatchEvent=be.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=ue(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),ve(this,e)},be.prototype.queueTrigger=function(e){var t=this;Te=Te||new Map;var n=e.type||e,i=Te.get(this);i||(i=new Map,Te.set(this,i));var r=i.get(n);i.delete(n),d.clearTimeout(r);var s=d.setTimeout(function(){0===i.size&&(i=null,Te.delete(t)),t.trigger(e)},0);i.set(n,s)};function Ce(e){return"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}function Ee(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length}function Se(e,t,n){if(!e||!e.nodeName&&!Ae(e))throw new Error("Invalid target for "+Ce(t)+"#"+n+"; must be a DOM node or evented object.")}function we(e,t,n){if(!Ee(e))throw new Error("Invalid event type for "+Ce(t)+"#"+n+"; must be a non-empty string or array.")}function xe(e,t,n){if("function"!=typeof e)throw new Error("Invalid listener for "+Ce(t)+"#"+n+"; must be a function.")}function Pe(e,t,n){var i,r,s,o=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s=o?(i=e.eventBusEl_,3<=t.length&&t.shift(),r=t[0],t[1]):(i=t[0],r=t[1],t[2]),Se(i,e,n),we(r,e,n),xe(s,e,n),{isTargetingSelf:o,target:i,type:r,listener:s=ye(e,s)}}function je(e,t,n,i){Se(e,e,t),e.nodeName?ke[t](e,n,i):e[t](n,i)}var Ae=function(t){return t instanceof be||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(e){return"function"==typeof t[e]})},Ie={on:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=Pe(this,n,"on"),s=r.isTargetingSelf,o=r.target,a=r.type,l=r.listener;if(je(o,"on",a,l),!s){var c=function(){return e.off(o,a,l)};c.guid=l.guid;var u=function(){return e.off("dispose",c)};u.guid=l.guid,je(this,"on","dispose",c),je(o,"on","dispose",u)}},one:function(){for(var r=this,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=Pe(this,t,"one"),s=i.isTargetingSelf,o=i.target,a=i.type,l=i.listener;if(s)je(o,"one",a,l);else{var c=function e(){r.off(o,a,e);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];l.apply(null,n)};c.guid=l.guid,je(o,"one",a,c)}},any:function(){for(var r=this,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=Pe(this,t,"any"),s=i.isTargetingSelf,o=i.target,a=i.type,l=i.listener;if(s)je(o,"any",a,l);else{var c=function e(){r.off(o,a,e);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];l.apply(null,n)};c.guid=l.guid,je(o,"any",a,c)}},off:function(e,t,n){if(!e||Ee(e))fe(this.eventBusEl_,e,t);else{var i=e,r=t;Se(i,this,"off"),we(r,this,"off"),xe(n,this,"off"),n=ye(this,n),this.off("dispose",n),i.nodeName?(fe(i,r,n),fe(i,"dispose",n)):Ae(i)&&(i.off(r,n),i.off("dispose",n))}},trigger:function(e,t){Se(this.eventBusEl_,this,"trigger");var n=e&&"string"!=typeof e?e.type:e;if(!Ee(n)){var i="Invalid event type for "+Ce(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(!e)throw new Error(i);(this.log||f).error(i)}return ve(this.eventBusEl_,e,t)}};function Le(e,t){void 0===t&&(t={});var n=t.eventBusKey;if(n){if(!e[n].nodeName)throw new Error('The eventBusKey "'+n+'" does not refer to an element.');e.eventBusEl_=e[n]}else e.eventBusEl_=E("span",{className:"vjs-event-bus"});return g(e,Ie),e.eventedCallbacks&&e.eventedCallbacks.forEach(function(e){e()}),e.on("dispose",function(){e.off(),d.setTimeout(function(){e.eventBusEl_=null},0)}),e}var Ne={state:{},setState:function(e){var n,i=this;return"function"==typeof e&&(e=e()),a(e,function(e,t){i.state[t]!==e&&((n=n||{})[t]={from:i.state[t],to:e}),i.state[t]=e}),n&&Ae(this)&&this.trigger({changes:n,type:"statechanged"}),n}};function Oe(e,t){return g(e,Ne),e.state=g({},e.state,t),"function"==typeof e.handleStateChanged&&Ae(e)&&e.on("statechanged",e.handleStateChanged),e}function Me(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toLowerCase()})}function De(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toUpperCase()})}function Fe(){for(var n={},e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.forEach(function(e){e&&a(e,function(e,t){u(e)?(u(n[t])||(n[t]={}),n[t]=Fe(n[t],e)):n[t]=e})}),n}var Re=function(){function e(){this.map_={}}var t=e.prototype;return t.has=function(e){return e in this.map_},t.delete=function(e){var t=this.has(e);return delete this.map_[e],t},t.set=function(e,t){return this.map_[e]=t,this},t.forEach=function(e,t){for(var n in this.map_)e.call(t,this.map_[n],n,this)},e}(),Be=d.Map?d.Map:Re,He=function(){function e(){this.set_={}}var t=e.prototype;return t.has=function(e){return e in this.set_},t.delete=function(e){var t=this.has(e);return delete this.set_[e],t},t.add=function(e){return this.set_[e]=1,this},t.forEach=function(e,t){for(var n in this.set_)e.call(t,n,n,this)},e}(),Ve=d.Set?d.Set:He,Ke=function(){function c(e,t,n){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Fe({},this.options_),t=this.options_=Fe(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){var i=e&&e.id&&e.id()||"no_player";this.id_=i+"_component_"+se()}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),!1!==t.evented&&(Le(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Oe(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Ve,this.setIntervalIds_=new Ve,this.rafIds_=new Ve,this.namedRafs_=new Be,(this.clearingTimersOnDispose_=!1)!==t.initChildren&&this.initChildren(),this.ready(n),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var e=c.prototype;return e.dispose=function(){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var e=this.children_.length-1;0<=e;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&&this.el_.parentNode.removeChild(this.el_),ae.has(this.el_)&&ae.delete(this.el_),this.el_=null),this.player_=null}},e.isDisposed=function(){return Boolean(this.isDisposed_)},e.player=function(){return this.player_},e.options=function(e){return e&&(this.options_=Fe(this.options_,e)),this.options_},e.el=function(){return this.el_},e.createEl=function(e,t,n){return E(e,t,n)},e.localize=function(e,r,t){void 0===t&&(t=e);var n=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),s=i&&i[n],o=n&&n.split("-")[0],a=i&&i[o],l=t;return s&&s[e]?l=s[e]:a&&a[e]&&(l=a[e]),r&&(l=l.replace(/\{(\d+)\}/g,function(e,t){var n=r[t-1],i=n;return"undefined"==typeof n&&(i=e),i})),l},e.handleLanguagechange=function(){},e.contentEl=function(){return this.contentEl_||this.el_},e.id=function(){return this.id_},e.name=function(){return this.name_},e.children=function(){return this.children_},e.getChildById=function(e){return this.childIndex_[e]},e.getChild=function(e){if(e)return this.childNameIndex_[e]},e.getDescendant=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t=t.reduce(function(e,t){return e.concat(t)},[]);for(var i=this,r=0;r<t.length;r++)if(!(i=i.getChild(t[r]))||!i.getChild)return;return i},e.addChild=function(e,t,n){var i,r;if(void 0===t&&(t={}),void 0===n&&(n=this.children_.length),"string"==typeof e){r=De(e);var s=t.componentClass||r;t.name=r;var o=c.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;i=new o(this.player_||this,t)}else i=e;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(n,0,i),i.parentComponent_=this,"function"==typeof i.id&&(this.childIndex_[i.id()]=i),(r=r||i.name&&De(i.name()))&&(this.childNameIndex_[r]=i,this.childNameIndex_[Me(r)]=i),"function"==typeof i.el&&i.el()){var a=null;this.children_[n+1]&&(this.children_[n+1].el_?a=this.children_[n+1].el_:T(this.children_[n+1])&&(a=this.children_[n+1])),this.contentEl().insertBefore(i.el(),a)}return i},e.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;0<=n;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[De(e.name())]=null,this.childNameIndex_[Me(e.name())]=null;var i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},e.initChildren=function(){var r=this,i=this.options_.children;if(i){var e,s=this.options_,n=c.getComponent("Tech");(e=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(t){return!e.some(function(e){return"string"==typeof e?t===e:t===e.name})})).map(function(e){var t,n;return n="string"==typeof e?i[t=e]||r.options_[t]||{}:(t=e.name,e),{name:t,opts:n}}).filter(function(e){var t=c.getComponent(e.opts.componentClass||De(e.name));return t&&!n.isTech(t)}).forEach(function(e){var t=e.name,n=e.opts;if(void 0!==s[t]&&(n=s[t]),!1!==n){!0===n&&(n={}),n.playerOptions=r.options_.playerOptions;var i=r.addChild(t,n);i&&(r[t]=i)}})}},e.buildCSSClass=function(){return""},e.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&0<e.length&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},e.$=function(e,t){return G(e,t||this.contentEl())},e.$$=function(e,t){return $(e,t||this.contentEl())},e.hasClass=function(e){return x(this.el_,e)},e.addClass=function(e){P(this.el_,e)},e.removeClass=function(e){j(this.el_,e)},e.toggleClass=function(e,t){A(this.el_,e,t)},e.show=function(){this.removeClass("vjs-hidden")},e.hide=function(){this.addClass("vjs-hidden")},e.lockShowing=function(){this.addClass("vjs-lock-showing")},e.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.getAttribute=function(e){return N(this.el_,e)},e.setAttribute=function(e,t){O(this.el_,e,t)},e.removeAttribute=function(e){M(this.el_,e)},e.width=function(e,t){return this.dimension("width",e,t)},e.height=function(e,t){return this.dimension("height",e,t)},e.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.dimension=function(e,t,n){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(n||this.trigger("componentresize"));if(!this.el_)return 0;var i=this.el_.style[e],r=i.indexOf("px");return-1!==r?parseInt(i.slice(0,r),10):parseInt(this.el_["offset"+De(e)],10)},e.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=_(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var n="offset"+De(e);t=this.el_[n]}return t},e.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.currentWidth=function(){return this.currentDimension("width")},e.currentHeight=function(){return this.currentDimension("height")},e.focus=function(){this.el_.focus()},e.blur=function(){this.el_.blur()},e.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},e.handleKeyPress=function(e){this.handleKeyDown(e)},e.emitTapEvents=function(){var i,t=0,r=null;this.on("touchstart",function(e){1===e.touches.length&&(r={pageX:e.touches[0].pageX,pageY:e.touches[0].pageY},t=d.performance.now(),i=!0)}),this.on("touchmove",function(e){if(1<e.touches.length)i=!1;else if(r){var t=e.touches[0].pageX-r.pageX,n=e.touches[0].pageY-r.pageY;10<Math.sqrt(t*t+n*n)&&(i=!1)}});function e(){i=!1}this.on("touchleave",e),this.on("touchcancel",e),this.on("touchend",function(e){!(r=null)===i&&d.performance.now()-t<200&&(e.preventDefault(),this.trigger("tap"))})},e.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var t,n=ye(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){n(),this.clearInterval(t),t=this.setInterval(n,250)});var e=function(e){n(),this.clearInterval(t)};this.on("touchmove",n),this.on("touchend",e),this.on("touchcancel",e)}},e.setTimeout=function(e,t){var n,i=this;return e=ye(this,e),this.clearTimersOnDispose_(),n=d.setTimeout(function(){i.setTimeoutIds_.has(n)&&i.setTimeoutIds_.delete(n),e()},t),this.setTimeoutIds_.add(n),n},e.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),d.clearTimeout(e)),e},e.setInterval=function(e,t){e=ye(this,e),this.clearTimersOnDispose_();var n=d.setInterval(e,t);return this.setIntervalIds_.add(n),n},e.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),d.clearInterval(e)),e},e.requestAnimationFrame=function(e){var t,n=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=ye(this,e),t=d.requestAnimationFrame(function(){n.rafIds_.has(t)&&n.rafIds_.delete(t),e()}),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},e.requestNamedAnimationFrame=function(e,t){var n=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=ye(this,t);var i=this.requestAnimationFrame(function(){t(),n.namedRafs_.has(e)&&n.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}},e.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},e.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),d.cancelAnimationFrame(e)),e):this.clearTimeout(e)},e.clearTimersOnDispose_=function(){var i=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(e){var t=e[0],n=e[1];i[t].forEach(function(e,t){return i[n](t)})}),i.clearingTimersOnDispose_=!1}))},c.registerComponent=function(e,t){if("string"!=typeof e||!e)throw new Error('Illegal component name, "'+e+'"; must be a non-empty string.');var n,i=c.getComponent("Tech"),r=i&&i.isTech(t),s=c===t||c.prototype.isPrototypeOf(t.prototype);if(r||!s)throw n=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+e+'"; '+n+".");e=De(e),c.components_||(c.components_={});var o=c.getComponent("Player");if("Player"===e&&o&&o.players){var a=o.players,l=Object.keys(a);if(a&&0<l.length&&l.map(function(e){return a[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return c.components_[e]=t,c.components_[Me(e)]=t},c.getComponent=function(e){if(e&&c.components_)return c.components_[e]},c}();Ke.prototype.supportsRaf_="function"==typeof d.requestAnimationFrame&&"function"==typeof d.cancelAnimationFrame,Ke.registerComponent("Component",Ke);var ze=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};t(function(t){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(e){return typeof e}:t.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}t.exports=n}),t(function(t){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}t.exports=n});var We,Ue,qe,Xe,Ge=function(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t},$e=d.navigator&&d.navigator.userAgent||"",Ye=/AppleWebKit\/([\d.]+)/i.exec($e),Qe=Ye?parseFloat(Ye.pop()):null,Je=/iPod/i.test($e),Ze=(We=$e.match(/OS (\d+)_/i))&&We[1]?We[1]:null,et=/Android/i.test($e),tt=function(){var e=$e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),nt=et&&tt<5&&Qe<537,it=/Firefox/i.test($e),rt=/Edg/i.test($e),st=!rt&&(/Chrome/i.test($e)||/CriOS/i.test($e)),ot=(Ue=$e.match(/(Chrome|CriOS)\/(\d+)/))&&Ue[2]?parseFloat(Ue[2]):null,at=(qe=/MSIE\s(\d+)\.\d/.exec($e),!(Xe=qe&&parseFloat(qe[1]))&&/Trident\/7.0/i.test($e)&&/rv:11.0/.test($e)&&(Xe=11),Xe),lt=/Safari/i.test($e)&&!st&&!et&&!rt,ct=/Windows/i.test($e),ut=Boolean(b()&&("ontouchstart"in d||d.navigator.maxTouchPoints||d.DocumentTouch&&d.document instanceof d.DocumentTouch)),ht=/iPad/i.test($e)||lt&&ut&&!/iPhone/i.test($e),dt=/iPhone/i.test($e)&&!ht,pt=dt||ht||Je,ft=(lt||pt)&&!st,vt=Object.freeze({__proto__:null,IS_IPOD:Je,IOS_VERSION:Ze,IS_ANDROID:et,ANDROID_VERSION:tt,IS_NATIVE_ANDROID:nt,IS_FIREFOX:it,IS_EDGE:rt,IS_CHROME:st,CHROME_VERSION:ot,IE_VERSION:at,IS_SAFARI:lt,IS_WINDOWS:ct,TOUCH_ENABLED:ut,IS_IPAD:ht,IS_IPHONE:dt,IS_IOS:pt,IS_ANY_SAFARI:ft});function gt(e,t,n,i){return function(e,t,n){if("number"!=typeof t||t<0||n<t)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}(e,i,n.length-1),n[i][t]}function _t(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:gt.bind(null,"start",0,e),end:gt.bind(null,"end",1,e)}}function yt(e,t){return Array.isArray(e)?_t(e):void 0===e||void 0===t?_t():_t([[e,t]])}function mt(e,t){var n,i,r=0;if(!t)return 0;e&&e.length||(e=yt(0,0));for(var s=0;s<e.length;s++)n=e.start(s),t<(i=e.end(s))&&(i=t),r+=i-n;return r/t}for(var bt,Tt={prefixed:!0},kt=[["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"]],Ct=kt[0],Et=0;Et<kt.length;Et++)if(kt[Et][1]in p){bt=kt[Et];break}if(bt){for(var St=0;St<bt.length;St++)Tt[Ct[St]]=bt[St];Tt.prefixed=bt[0]!==Ct[0]}function wt(e){if(e instanceof wt)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:l(e)&&("number"==typeof e.code&&(this.code=e.code),g(this,e)),this.message||(this.message=wt.defaultMessages[this.code]||"")}wt.prototype.code=0,wt.prototype.message="",wt.prototype.status=null,wt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],wt.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(var xt=0;xt<wt.errorTypes.length;xt++)wt[wt.errorTypes[xt]]=xt,wt.prototype[wt.errorTypes[xt]]=xt;var Pt=function(e,t){var n,i=null;try{n=JSON.parse(e,t)}catch(e){i=e}return[i,n]};function jt(e){return null!=e&&"function"==typeof e.then}function At(e){jt(e)&&e.then(null,function(e){})}function It(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(e,t,n){return i[t]&&(e[t]=i[t]),e},{cues:i.cues&&Array.prototype.map.call(i.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})}var Lt=function(e){var t=e.$$("track"),n=Array.prototype.map.call(t,function(e){return e.track});return Array.prototype.map.call(t,function(e){var t=It(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return-1===n.indexOf(e)}).map(It))},Nt=function(e,n){return e.forEach(function(e){var t=n.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(function(e){return t.addCue(e)})}),n.textTracks()},Ot=t(function(e,t){function n(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return o[e];var n,i=String(e);return(n=r[i.toLowerCase()])?n:(n=s[i.toLowerCase()])||(1===i.length?i.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"==typeof e){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var i;if(i=r[t.toLowerCase()])return i===n;if(i=s[t.toLowerCase()])return i===n}else if("number"==typeof t)return t===n;return!1}};var r=(t=e.exports=n).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},s=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};for(i=97;i<123;i++)r[String.fromCharCode(i)]=i-32;for(var i=48;i<58;i++)r[i-48]=i;for(i=1;i<13;i++)r["f"+i]=i+111;for(i=0;i<10;i++)r["numpad "+i]=i+96;var o=t.names=t.title={};for(i in r)o[r[i]]=i;for(var a in s)r[a]=s[a]}),Mt=(Ot.code,Ot.codes,Ot.aliases,Ot.names,Ot.title,"vjs-modal-dialog"),Dt=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=E("div",{className:Mt+"-content"},{role:"document"}),n.descEl_=E("p",{className:Mt+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),S(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}Ge(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},t.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,i.prototype.dispose.call(this)},t.buildCSSClass=function(){return Mt+" vjs-hidden "+i.prototype.buildCSSClass.call(this)},t.label=function(){return this.localize(this.options_.label||"Modal Window")},t.description=function(){var 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},t.open=function(){if(!this.opened_){var 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}},t.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},t.close=function(){if(this.opened_){var 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()}},t.closeable=function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,n=this.getChild("closeButton");if(t&&!n){var i=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=i,this.on(n,"close",this.close)}!t&&n&&(this.off(n,"close",this.close),this.removeChild(n),n.dispose())}return this.closeable_},t.fill=function(){this.fillWith(this.content())},t.fillWith=function(e){var t=this.contentEl(),n=t.parentNode,i=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),U(t,e),this.trigger("modalfill"),i?n.insertBefore(t,i):n.appendChild(t);var r=this.getChild("closeButton");r&&n.appendChild(r.el_)},t.empty=function(){this.trigger("beforemodalempty"),K(this.contentEl()),this.trigger("modalempty")},t.content=function(e){return"undefined"!=typeof e&&(this.content_=e),this.content_},t.conditionalFocus_=function(){var e=p.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,!t.contains(e)&&t!==e||(this.previouslyActiveEl_=e,this.focus())},t.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},t.handleKeyDown=function(e){if(e.stopPropagation(),Ot.isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(Ot.isEventKey(e,"Tab")){for(var t,n=this.focusableEls_(),i=this.el_.querySelector(":focus"),r=0;r<n.length;r++)if(i===n[r]){t=r;break}p.activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||t!==n.length-1||(n[0].focus(),e.preventDefault())}},t.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(e){return(e instanceof d.HTMLAnchorElement||e instanceof d.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof d.HTMLInputElement||e instanceof d.HTMLSelectElement||e instanceof d.HTMLTextAreaElement||e instanceof d.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof d.HTMLIFrameElement||e instanceof d.HTMLObjectElement||e instanceof d.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")})},e}(Ke);Dt.prototype.options_={pauseOnOpen:!0,temporary:!0},Ke.registerComponent("ModalDialog",Dt);var Ft=function(i){function e(e){var t;void 0===e&&(e=[]),(t=i.call(this)||this).tracks_=[],Object.defineProperty(ze(t),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<e.length;n++)t.addTrack(e[n]);return t}Ge(e,i);var t=e.prototype;return t.addTrack=function(e){var t=this,n=this.tracks_.length;""+n in this||Object.defineProperty(this,n,{get:function(){return this.tracks_[n]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=function(){t.trigger({track:e,type:"labelchange",target:t})},Ae(e)&&e.addEventListener("labelchange",e.labelchange_)},t.removeTrack=function(e){for(var t,n=0,i=this.length;n<i;n++)if(this[n]===e){(t=this[n]).off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})},t.getTrackById=function(e){for(var t=null,n=0,i=this.length;n<i;n++){var r=this[n];if(r.id===e){t=r;break}}return t},e}(be);for(var Rt in Ft.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},Ft.prototype.allowedEvents_)Ft.prototype["on"+Rt]=null;function Bt(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].enabled=!1)}function Ht(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].selected=!1)}function Vt(e){var t=["protocol","hostname","port","pathname","search","hash","host"],n=p.createElement("a");n.href=e;var i,r=""===n.host&&"file:"!==n.protocol;r&&((i=p.createElement("div")).innerHTML='<a href="'+e+'"></a>',n=i.firstChild,i.setAttribute("style","display:none; position:absolute;"),p.body.appendChild(i));for(var s={},o=0;o<t.length;o++)s[t[o]]=n[t[o]];return"http:"===s.protocol&&(s.host=s.host.replace(/:80$/,"")),"https:"===s.protocol&&(s.host=s.host.replace(/:443$/,"")),s.protocol||(s.protocol=d.location.protocol),r&&p.body.removeChild(i),s}function Kt(e){if(!e.match(/^https?:\/\//)){var t=p.createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e}function zt(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""}function Wt(e,t){void 0===t&&(t=d.location);var n=Vt(e);return(":"===n.protocol?t.protocol:n.protocol)+n.host!==t.protocol+t.host}var Ut=function(i){function e(e){var t;void 0===e&&(e=[]);for(var n=e.length-1;0<=n;n--)if(e[n].enabled){Bt(e,e[n]);break}return(t=i.call(this,e)||this).changing_=!1,t}Ge(e,i);var t=e.prototype;return t.addTrack=function(e){var t=this;e.enabled&&Bt(this,e),i.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){t.changing_||(t.changing_=!0,Bt(t,e),t.changing_=!1,t.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},t.removeTrack=function(e){i.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},e}(Ft),qt=function(i){function e(e){var t;void 0===e&&(e=[]);for(var n=e.length-1;0<=n;n--)if(e[n].selected){Ht(e,e[n]);break}return(t=i.call(this,e)||this).changing_=!1,Object.defineProperty(ze(t),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),t}Ge(e,i);var t=e.prototype;return t.addTrack=function(e){var t=this;e.selected&&Ht(this,e),i.prototype.addTrack.call(this,e),e.addEventListener&&(e.selectedChange_=function(){t.changing_||(t.changing_=!0,Ht(t,e),t.changing_=!1,t.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))},t.removeTrack=function(e){i.prototype.removeTrack.call(this,e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)},e}(Ft),Xt=function(n){function e(){return n.apply(this,arguments)||this}Ge(e,n);var t=e.prototype;return t.addTrack=function(e){var t=this;n.prototype.addTrack.call(this,e),this.queueChange_||(this.queueChange_=function(){return t.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return t.trigger("selectedlanguagechange")}),e.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)},t.removeTrack=function(e){n.prototype.removeTrack.call(this,e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},e}(Ft),Gt=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,n=0,i=this.trackElements_.length;n<i;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t},t.removeTrackElement_=function(e){for(var t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}},e}(),$t=function(){function t(e){t.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var e=t.prototype;return e.setCues_=function(e){var t=this.length||0,n=0,i=e.length;this.cues_=e,this.length_=e.length;function r(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})}if(t<i)for(n=t;n<i;n++)r.call(this,n)},e.getCueById=function(e){for(var t=null,n=0,i=this.length;n<i;n++){var r=this[n];if(r.id===e){t=r;break}}return t},t}(),Yt={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Qt={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Jt={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Zt={disabled:"disabled",hidden:"hidden",showing:"showing"},en=function(o){function e(e){var t;void 0===e&&(e={}),t=o.call(this)||this;function n(e){Object.defineProperty(ze(t),e,{get:function(){return i[e]},set:function(){}})}var i={id:e.id||"vjs_track_"+se(),kind:e.kind||"",language:e.language||""},r=e.label||"";for(var s in i)n(s);return Object.defineProperty(ze(t),"label",{get:function(){return r},set:function(e){e!==r&&(r=e,this.trigger("labelchange"))}}),t}return Ge(e,o),e}(be),tn=Object.freeze({__proto__:null,parseUrl:Vt,getAbsoluteURL:Kt,getFileExtension:zt,isCrossOrigin:Wt}),nn="undefined"!=typeof window?window:"undefined"!=typeof e?e:"undefined"!=typeof self?self:{},rn=function(e){var t=sn.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)} /** * @license * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/> * Copyright (c) 2014 David Björklund * Available under the MIT license * <https://github.com/kesla/parse-headers/blob/master/LICENCE> */,sn=Object.prototype.toString;var on=function(e){var r={};return e&&e.trim().split("\n").forEach(function(e){var t=e.indexOf(":"),n=e.slice(0,t).trim().toLowerCase(),i=e.slice(t+1).trim();"undefined"==typeof r[n]?r[n]=i:Array.isArray(r[n])?r[n].push(i):r[n]=[r[n],i]}),r},an=un,ln=un;function cn(e,t,n){var i=e;return rn(t)?(n=t,"string"==typeof e&&(i={uri:e})):i=r({},t,{uri:e}),i.callback=n,i}function un(e,t,n){return hn(t=cn(e,t,n))}function hn(i){if("undefined"==typeof i.callback)throw new Error("callback argument missing");var r=!1,s=function(e,t,n){r||(r=!0,i.callback(e,t,n))};function t(e){return clearTimeout(a),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,s(e,v)}function e(){if(!o){var e;clearTimeout(a),e=i.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var t=v,n=null;return 0!==e?(t={body:function(){var e=void 0;if(e=l.response?l.response:l.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(l),f)try{e=JSON.parse(e)}catch(e){}return e}(),statusCode:e,method:u,headers:{},url:c,rawRequest:l},l.getAllResponseHeaders&&(t.headers=on(l.getAllResponseHeaders()))):n=new Error("Internal XMLHttpRequest Error"),s(n,t,t.body)}}var n,o,a,l=i.xhr||null,c=(l=l||(i.cors||i.useXDR?new un.XDomainRequest:new un.XMLHttpRequest)).url=i.uri||i.url,u=l.method=i.method||"GET",h=i.body||i.data,d=l.headers=i.headers||{},p=!!i.sync,f=!1,v={body:void 0,headers:{},statusCode:0,method:u,url:c,rawRequest:l};if("json"in i&&!1!==i.json&&(f=!0,d.accept||d.Accept||(d.Accept="application/json"),"GET"!==u&&"HEAD"!==u&&(d["content-type"]||d["Content-Type"]||(d["Content-Type"]="application/json"),h=JSON.stringify(!0===i.json?h:i.json))),l.onreadystatechange=function(){4===l.readyState&&setTimeout(e,0)},l.onload=e,l.onerror=t,l.onprogre