UNPKG

video.js

Version:

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

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