UNPKG

@blacklol/webplayer

Version:

rtmp, hls, flv and websocket player

1 lines 901 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.videojs=t()}(this,function(){var e="7.2.4",t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e,t){return e(t={exports:{}},t.exports),t.exports}var r,n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},a={},s=Object.freeze({default:a}),o=s&&a||s,u=void 0!==t?t:"undefined"!=typeof window?window:{};"undefined"!=typeof document?r=document:(r=u["__GLOBAL_DOCUMENT_CACHE@4"])||(r=u["__GLOBAL_DOCUMENT_CACHE@4"]=o);var l=r,c=void 0,d="info",h=[],f=function(e,t){var i=c.levels[d],r=new RegExp("^("+i+")$");if("log"!==e&&t.unshift(e.toUpperCase()+":"),h&&h.push([].concat(t)),t.unshift("VIDEOJS:"),n.console){var a=n.console[e];a||"debug"!==e||(a=n.console.info||n.console.log),a&&i&&r.test(e)&&a[Array.isArray(t)?"apply":"call"](n.console,t)}};(c=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];f("log",t)}).levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:d},c.level=function(e){if("string"==typeof e){if(!c.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');d=e}return d},c.history=function(){return h?[].concat(h):[]},c.history.clear=function(){h&&(h.length=0)},c.history.disable=function(){null!==h&&(h.length=0,h=null)},c.history.enable=function(){null===h&&(h=[])},c.error=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return f("error",t)},c.warn=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return f("warn",t)},c.debug=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return f("debug",t)};var p=c;var m=function(e){for(var t="",i=0;i<arguments.length;i++)t+=(r=e[i],r.replace(/\n\r?\s*/g,"")+(arguments[i+1]||""));var r;return t},g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},v=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},_=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},b=function(e,t){return e.raw=t,e},T=Object.prototype.toString,S=function(e){return w(e)?Object.keys(e):[]};function E(e,t){S(e).forEach(function(i){return t(e[i],i)})}function k(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return Object.assign?Object.assign.apply(Object,[e].concat(i)):(i.forEach(function(t){t&&E(t,function(t,i){e[i]=t})}),e)}function w(e){return!!e&&"object"===(void 0===e?"undefined":g(e))}function A(e){return w(e)&&"[object Object]"===T.call(e)&&e.constructor===Object}function C(e,t){if(!e||!t)return"";if("function"==typeof n.getComputedStyle){var i=n.getComputedStyle(e);return i?i[t]:""}return""}var L=b(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."],["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]);function R(e){return"string"==typeof e&&/\S/.test(e)}function O(e){if(/\s/.test(e))throw new Error("class has illegal whitespace characters")}function D(){return l===n.document}function I(e){return w(e)&&1===e.nodeType}function x(){try{return n.parent!==n.self}catch(e){return!0}}function P(e){return function(t,i){if(!R(t))return l[e](null);R(i)&&(i=l.querySelector(i));var r=I(i)?i:l;return r[e]&&r[e](t)}}function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments[3],n=l.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(p.warn(m(L,e,i)),n.setAttribute(e,i)):"textContent"===e?U(n,i):n[e]=i}),Object.getOwnPropertyNames(i).forEach(function(e){n.setAttribute(e,i[e])}),r&&te(n,r),n}function U(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function N(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function B(e,t){return O(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i}function F(e,t){return e.classList?e.classList.add(t):B(e,t)||(e.className=(e.className+" "+t).trim()),e}function j(e,t){return e.classList?e.classList.remove(t):(O(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e}function G(e,t,i){var r=B(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!r),i!==r)return i?F(e,t):j(e,t),e}function V(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var r=t[i];null===r||void 0===r||!1===r?e.removeAttribute(i):e.setAttribute(i,!0===r?"":r)})}function H(e){var t={},i=",autoplay,stretch,fluent,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var r=e.attributes,n=r.length-1;n>=0;n--){var a=r[n].name,s=r[n].value;"boolean"!=typeof e[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),t[a]=s}return t}function z(e,t){return e.getAttribute(t)}function W(e,t,i){e.setAttribute(t,i)}function q(e,t){e.removeAttribute(t)}function K(){l.body.focus(),l.onselectstart=function(){return!1}}function X(){l.onselectstart=function(){return!0}}function Y(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(C(e,"height"))),i.width||(i.width=parseFloat(C(e,"width"))),i}}function $(e){var t=void 0;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var i=l.documentElement,r=l.body,a=i.clientLeft||r.clientLeft||0,s=n.pageXOffset||r.scrollLeft,o=t.left+s-a,u=i.clientTop||r.clientTop||0,c=n.pageYOffset||r.scrollTop,d=t.top+c-u;return{left:Math.round(o),top:Math.round(d)}}function Q(e,t){var i={},r=$(e),n=e.offsetWidth,a=e.offsetHeight,s=r.top,o=r.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(s-u+a)/a)),i.x=Math.max(0,Math.min(1,(l-o)/n)),i}function J(e){return w(e)&&3===e.nodeType}function Z(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function ee(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),I(e)||J(e)?e:"string"==typeof e&&/\S/.test(e)?l.createTextNode(e):void 0}).filter(function(e){return e})}function te(e,t){return ee(t).forEach(function(t){return e.appendChild(t)}),e}function ie(e,t){return te(Z(e),t)}function re(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||0===e.button&&1===e.buttons)}var ne=P("querySelector"),ae=P("querySelectorAll"),se=Object.freeze({isReal:D,isEl:I,isInFrame:x,createEl:M,textContent:U,prependTo:N,hasClass:B,addClass:F,removeClass:j,toggleClass:G,setAttributes:V,getAttributes:H,getAttribute:z,setAttribute:W,removeAttribute:q,blockTextSelection:K,unblockTextSelection:X,getBoundingClientRect:Y,findPosition:$,getPointerPosition:Q,isTextNode:J,emptyEl:Z,normalizeContent:ee,appendContent:te,insertContent:ie,isSingleLeftClick:re,$:ne,$$:ae}),oe=1;function ue(){return oe++}var le={},ce="vdata"+(new Date).getTime();function de(e){var t=e[ce];return t||(t=e[ce]=ue()),le[t]||(le[t]={}),le[t]}function he(e){var t=e[ce];return!!t&&!!Object.getOwnPropertyNames(le[t]).length}function fe(e){var t=e[ce];if(t){delete le[t];try{delete e[ce]}catch(t){e.removeAttribute?e.removeAttribute(ce):e[ce]=null}}}function pe(e,t){var i=de(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&&fe(e)}function me(e,t,i,r){i.forEach(function(i){e(t,i,r)})}function ge(e){function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var r=e||n.event;e={};for(var a in r)"layerX"!==a&&"layerY"!==a&&"keyLocation"!==a&&"webkitMovementX"!==a&&"webkitMovementY"!==a&&("returnValue"===a&&r.preventDefault||(e[a]=r[a]));if(e.target||(e.target=e.srcElement||l),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){var s=l.documentElement,o=l.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}var ye=!1;!function(){try{var e=Object.defineProperty({},"passive",{get:function(){ye=!0}});n.addEventListener("test",null,e),n.removeEventListener("test",null,e)}catch(e){}}();var ve=["touchstart","touchmove"];function _e(e,t,i){if(Array.isArray(t))return me(_e,e,t,i);var r=de(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),i.guid||(i.guid=ue()),r.handlers[t].push(i),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,i){if(!r.disabled){t=ge(t);var n=r.handlers[t.type];if(n)for(var a=n.slice(0),s=0,o=a.length;s<o&&!t.isImmediatePropagationStopped();s++)try{a[s].call(e,t,i)}catch(e){p.error(e)}}}),1===r.handlers[t].length)if(e.addEventListener){var n=!1;ye&&ve.indexOf(t)>-1&&(n={passive:!0}),e.addEventListener(t,r.dispatcher,n)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function be(e,t,i){if(he(e)){var r=de(e);if(r.handlers){if(Array.isArray(t))return me(be,e,t,i);var n=function(e,t){r.handlers[t]=[],pe(e,t)};if(void 0!==t){var a=r.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);pe(e,t)}else n(e,t)}else for(var o in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},o)&&n(e,o)}}}function Te(e,t,i){var r=he(e)?de(e):{},n=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=ge(t),r.dispatcher&&r.dispatcher.call(e,t,i),n&&!t.isPropagationStopped()&&!0===t.bubbles)Te.call(null,n,t,i);else if(!n&&!t.defaultPrevented){var a=de(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 Se(e,t,i){if(Array.isArray(t))return me(Se,e,t,i);var r=function r(){be(e,t,r),i.apply(this,arguments)};r.guid=i.guid=i.guid||ue(),_e(e,t,r)}var Ee=Object.freeze({fixEvent:ge,on:_e,off:be,trigger:Te,one:Se}),ke=!1,we=void 0,Ae=function(){if(D()&&!1!==we.options.autoSetup){var e=Array.prototype.slice.call(l.getElementsByTagName("video")),t=Array.prototype.slice.call(l.getElementsByTagName("audio")),i=Array.prototype.slice.call(l.getElementsByTagName("video-js")),r=e.concat(t,i);if(r&&r.length>0)for(var n=0,a=r.length;n<a;n++){var s=r[n];if(!s||!s.getAttribute){Ce(1);break}if(void 0===s.player){null!==s.getAttribute("data-setup")&&we(s)}}else ke||Ce(1)}};function Ce(e,t){t&&(we=t),n.setTimeout(Ae,e)}D()&&"complete"===l.readyState?ke=!0:Se(n,"load",function(){ke=!0});var Le=function(e){var t=l.createElement("style");return t.className=e,t},Re=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},Oe=function(e,t,i){t.guid||(t.guid=ue());var r=function(){return t.apply(e,arguments)};return r.guid=i?i+"_"+t.guid:t.guid,r},De=function(e,t){var i=Date.now();return function(){var r=Date.now();r-i>=t&&(e.apply(void 0,arguments),i=r)}},Ie=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,a=void 0,s=function(){var n=this,s=arguments,o=function(){a=null,o=null,i||e.apply(n,s)};!a&&i&&e.apply(n,s),r.clearTimeout(a),a=r.setTimeout(o,t)};return s.cancel=function(){r.clearTimeout(a),a=null},s},xe=function(){};xe.prototype.allowedEvents_={},xe.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},_e(this,e,t),this.addEventListener=i},xe.prototype.addEventListener=xe.prototype.on,xe.prototype.off=function(e,t){be(this,e,t)},xe.prototype.removeEventListener=xe.prototype.off,xe.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Se(this,e,t),this.addEventListener=i},xe.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=ge(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Te(this,e)},xe.prototype.dispatchEvent=xe.prototype.trigger;var Pe=void 0;xe.prototype.queueTrigger=function(e){var t=this;Pe||(Pe=new Map);var i=e.type||e,r=Pe.get(this);r||(r=new Map,Pe.set(this,r));var a=r.get(i);r.delete(i),n.clearTimeout(a);var s=n.setTimeout(function(){0===r.size&&(r=null,Pe.delete(t)),t.trigger(e)},0);r.set(i,s)};var Me=function(e){return e instanceof xe||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},Ue=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Ne=function(e){if(!e.nodeName&&!Me(e))throw new Error("Invalid target; must be a DOM node or evented object.")},Be=function(e){if(!Ue(e))throw new Error("Invalid event type; must be a non-empty string or array.")},Fe=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},je=function(e,t){var i=t.length<3||t[0]===e||t[0]===e.eventBusEl_,r=void 0,n=void 0,a=void 0;return i?(r=e.eventBusEl_,t.length>=3&&t.shift(),n=t[0],a=t[1]):(r=t[0],n=t[1],a=t[2]),Ne(r),Be(n),Fe(a),{isTargetingSelf:i,target:r,type:n,listener:a=Oe(e,a)}},Ge=function(e,t,i,r){Ne(e),e.nodeName?Ee[t](e,i,r):e[t](i,r)},Ve={on:function(){for(var e=this,t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];var n=je(this,i),a=n.isTargetingSelf,s=n.target,o=n.type,u=n.listener;if(Ge(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,Ge(this,"on","dispose",l),Ge(s,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];var n=je(this,i),a=n.isTargetingSelf,s=n.target,o=n.type,u=n.listener;if(a)Ge(s,"one",o,u);else{var l=function t(){for(var i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];e.off(s,o,t),u.apply(null,r)};l.guid=u.guid,Ge(s,"one",o,l)}},off:function(e,t,i){if(!e||Ue(e))be(this.eventBusEl_,e,t);else{var r=e,n=t;Ne(r),Be(n),Fe(i),i=Oe(this,i),this.off("dispose",i),r.nodeName?(be(r,n,i),be(r,"dispose",i)):Me(r)&&(r.off(n,i),r.off("dispose",i))}},trigger:function(e,t){return Te(this.eventBusEl_,e,t)}};function He(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).eventBusKey;if(t){if(!e[t].nodeName)throw new Error('The eventBusKey "'+t+'" does not refer to an element.');e.eventBusEl_=e[t]}else e.eventBusEl_=M("span",{className:"vjs-event-bus"});return k(e,Ve),e.on("dispose",function(){e.off(),n.setTimeout(function(){e.eventBusEl_=null},0)}),e}var ze={state:{},setState:function(e){var t=this;"function"==typeof e&&(e=e());var i=void 0;return E(e,function(e,r){t.state[r]!==e&&((i=i||{})[r]={from:t.state[r],to:e}),t.state[r]=e}),i&&Me(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function We(e,t){return k(e,ze),e.state=k({},e.state,t),"function"==typeof e.handleStateChanged&&Me(e)&&e.on("statechanged",e.handleStateChanged),e}function qe(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function Ke(){for(var e={},t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];return i.forEach(function(t){t&&E(t,function(t,i){A(t)?(A(e[i])||(e[i]={}),e[i]=Ke(e[i],t)):e[i]=t})}),e}var Xe=function(){function e(t,i,r){if(y(this,e),!t&&this.play?this.player_=t=this:this.player_=t,this.options_=Ke({},this.options_),i=this.options_=Ke(this.options_,i),this.id_=i.id||i.el&&i.el.id,!this.id_){var n=t&&t.id&&t.id()||"no_player";this.id_=n+"_component_"+ue()}this.name_=i.name||null,i.el?this.el_=i.el:!1!==i.createEl&&(this.el_=this.createEl()),!1!==i.evented&&He(this,{eventBusKey:this.el_?"el_":null}),We(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},!1!==i.initChildren&&this.initChildren(),this.ready(r),!1!==i.reportTouchActivity&&this.enableTouchActivity()}return e.prototype.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),fe(this.el_),this.el_=null),this.player_=null},e.prototype.player=function(){return this.player_},e.prototype.options=function(e){return p.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=Ke(this.options_,e),this.options_):this.options_},e.prototype.el=function(){return this.el_},e.prototype.createEl=function(e,t,i){return M(e,t,i)},e.prototype.localize=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],s=r&&r.split("-")[0],o=n&&n[s],u=i;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(e,i){var r=t[i-1],n=r;return void 0===r&&(n=e),n})),u},e.prototype.contentEl=function(){return this.contentEl_||this.el_},e.prototype.id=function(){return this.id_},e.prototype.name=function(){return this.name_},e.prototype.children=function(){return this.children_},e.prototype.getChildById=function(e){return this.childIndex_[e]},e.prototype.getChild=function(e){if(e)return e=qe(e),this.childNameIndex_[e]},e.prototype.addChild=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,n=void 0,a=void 0;if("string"==typeof t){a=qe(t);var s=i.componentClass||a;i.name=a;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;n=new o(this.player_||this,i)}else n=t;if(this.children_.splice(r,0,n),"function"==typeof n.id&&(this.childIndex_[n.id()]=n),(a=a||n.name&&qe(n.name()))&&(this.childNameIndex_[a]=n),"function"==typeof n.el&&n.el()){var u=this.contentEl().children[r]||null;this.contentEl().insertBefore(n.el(),u)}return n},e.prototype.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var r=e.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},e.prototype.initChildren=function(){var t=this,i=this.options_.children;if(i){var r=this.options_,n=function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var a=t.addChild(i,n);a&&(t[i]=a)}},a=void 0,s=e.getComponent("Tech");(a=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(e){return!a.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(e){var r=void 0,n=void 0;return"string"==typeof e?n=i[r=e]||t.options_[r]||{}:(r=e.name,n=e),{name:r,opts:n}}).filter(function(t){var i=e.getComponent(t.opts.componentClass||qe(t.name));return i&&!s.isTech(i)}).forEach(n)}},e.prototype.buildCSSClass=function(){return""},e.prototype.ready=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},e.prototype.$=function(e,t){return ne(e,t||this.contentEl())},e.prototype.$$=function(e,t){return ae(e,t||this.contentEl())},e.prototype.hasClass=function(e){return B(this.el_,e)},e.prototype.addClass=function(e){F(this.el_,e)},e.prototype.removeClass=function(e){j(this.el_,e)},e.prototype.toggleClass=function(e,t){G(this.el_,e,t)},e.prototype.show=function(){this.removeClass("vjs-hidden")},e.prototype.hide=function(){this.addClass("vjs-hidden")},e.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},e.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.prototype.getAttribute=function(e){return z(this.el_,e)},e.prototype.setAttribute=function(e,t){W(this.el_,e,t)},e.prototype.removeAttribute=function(e){q(this.el_,e)},e.prototype.width=function(e,t){return this.dimension("width",e,t)},e.prototype.height=function(e,t){return this.dimension("height",e,t)},e.prototype.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.prototype.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 r=this.el_.style[e],n=r.indexOf("px");return-1!==n?parseInt(r.slice(0,n),10):parseInt(this.el_["offset"+qe(e)],10)},e.prototype.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"==typeof n.getComputedStyle){var i=n.getComputedStyle(this.el_);t=i.getPropertyValue(e)||i[e]}if(0===(t=parseFloat(t))){var r="offset"+qe(e);t=this.el_[r]}return t},e.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.prototype.currentWidth=function(){return this.currentDimension("width")},e.prototype.currentHeight=function(){return this.currentDimension("height")},e.prototype.focus=function(){this.el_.focus()},e.prototype.blur=function(){this.el_.blur()},e.prototype.emitTapEvents=function(){var e=0,t=null,i=void 0;this.on("touchstart",function(r){1===r.touches.length&&(t={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},e=(new Date).getTime(),i=!0)}),this.on("touchmove",function(e){if(e.touches.length>1)i=!1;else if(t){var r=e.touches[0].pageX-t.pageX,n=e.touches[0].pageY-t.pageY;Math.sqrt(r*r+n*n)>10&&(i=!1)}});var r=function(){i=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",function(r){if(t=null,!0===i){(new Date).getTime()-e<200&&(r.preventDefault(),this.trigger("tap"))}})},e.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e=Oe(this.player(),this.player().reportUserActivity),t=void 0;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});var i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}},e.prototype.setTimeout=function(e,t){var i,r,a=this;return e=Oe(this,e),i=n.setTimeout(function(){a.off("dispose",r),e()},t),(r=function(){return a.clearTimeout(i)}).guid="vjs-timeout-"+i,this.on("dispose",r),i},e.prototype.clearTimeout=function(e){n.clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},e.prototype.setInterval=function(e,t){var i=this;e=Oe(this,e);var r=n.setInterval(e,t),a=function(){return i.clearInterval(r)};return a.guid="vjs-interval-"+r,this.on("dispose",a),r},e.prototype.clearInterval=function(e){n.clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},e.prototype.requestAnimationFrame=function(e){var t,i,r=this;return this.supportsRaf_?(e=Oe(this,e),t=n.requestAnimationFrame(function(){r.off("dispose",i),e()}),(i=function(){return r.cancelAnimationFrame(t)}).guid="vjs-raf-"+t,this.on("dispose",i),t):this.setTimeout(e,1e3/60)},e.prototype.cancelAnimationFrame=function(e){if(this.supportsRaf_){n.cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var r=e.getComponent("Tech"),n=r&&r.isTech(i),a=e===i||e.prototype.isPrototypeOf(i.prototype);if(n||!a){var s=void 0;throw s=n?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+s+".")}t=qe(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map(function(e){return u[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,i},e.getComponent=function(t){if(t)return t=qe(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();Xe.prototype.supportsRaf_="function"==typeof n.requestAnimationFrame&&"function"==typeof n.cancelAnimationFrame,Xe.registerComponent("Component",Xe);var Ye=n.navigator&&n.navigator.userAgent||"",$e=/AppleWebKit\/([\d.]+)/i.exec(Ye),Qe=$e?parseFloat($e.pop()):null,Je=/iPad/i.test(Ye),Ze=/iPhone/i.test(Ye)&&!Je,et=/iPod/i.test(Ye),tt=Ze||Je||et,it=function(){var e=Ye.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),rt=/Android/i.test(Ye),nt=function(){var e=Ye.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}(),at=rt&&nt<5&&Qe<537,st=/Firefox/i.test(Ye),ot=/Edge/i.test(Ye),ut=!ot&&(/Chrome/i.test(Ye)||/CriOS/i.test(Ye)),lt=function(){var e=Ye.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),ct=function(){var e=/MSIE\s(\d+)\.\d/.exec(Ye),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Ye)&&/rv:11.0/.test(Ye)&&(t=11),t}(),dt=/Safari/i.test(Ye)&&!ut&&!rt&&!ot,ht=(dt||tt)&&!ut,ft=D()&&("ontouchstart"in n||n.navigator.maxTouchPoints||n.DocumentTouch&&n.document instanceof n.DocumentTouch),pt=Object.freeze({IS_IPAD:Je,IS_IPHONE:Ze,IS_IPOD:et,IS_IOS:tt,IOS_VERSION:it,IS_ANDROID:rt,ANDROID_VERSION:nt,IS_NATIVE_ANDROID:at,IS_FIREFOX:st,IS_EDGE:ot,IS_CHROME:ut,CHROME_VERSION:lt,IE_VERSION:ct,IS_SAFARI:dt,IS_ANY_SAFARI:ht,TOUCH_ENABLED:ft});function mt(e,t,i,r){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,r,i.length-1),i[r][t]}function gt(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:mt.bind(null,"start",0,e),end:mt.bind(null,"end",1,e)}}function yt(e,t){return Array.isArray(e)?gt(e):void 0===e||void 0===t?gt():gt([[e,t]])}function vt(e,t){var i=0,r=void 0,n=void 0;if(!t)return 0;e&&e.length||(e=yt(0,0));for(var a=0;a<e.length;a++)r=e.start(a),(n=e.end(a))>t&&(n=t),i+=n-r;return i/t}for(var _t={},bt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Tt=bt[0],St=void 0,Et=0;Et<bt.length;Et++)if(bt[Et][1]in l){St=bt[Et];break}if(St)for(var kt=0;kt<St.length;kt++)_t[Tt[kt]]=St[kt];function wt(e){if(e instanceof wt)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:w(e)&&("number"==typeof e.code&&(this.code=e.code),k(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 At=0;At<wt.errorTypes.length;At++)wt[wt.errorTypes[At]]=At,wt.prototype[wt.errorTypes[At]]=At;var Ct=function(e,t){var i,r=null;try{i=JSON.parse(e,t)}catch(e){r=e}return[r,i]};function Lt(e){return void 0!==e&&null!==e&&"function"==typeof e.then}function Rt(e){Lt(e)&&e.then(null,function(e){})}var Ot=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(t,i,r){return e[i]&&(t[i]=e[i]),t},{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})},Dt=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))},It=function(e,t){return e.forEach(function(e){var i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(function(e){return i.addCue(e)})}),t.textTracks()},xt="vjs-modal-dialog",Pt=function(e){v(t,e);function t(i,r){y(this,t);var n=_(this,e.call(this,i,r));return n.opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=M("div",{className:xt+"-content"},{role:"document"}),n.descEl_=M("p",{className:xt+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),U(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}return t.prototype.createEl=function(){return e.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.prototype.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},t.prototype.buildCSSClass=function(){return xt+" vjs-hidden "+e.prototype.buildCSSClass.call(this)},t.prototype.handleKeyPress=function(e){27===e.which&&this.closeable()&&this.close()},t.prototype.label=function(){return this.localize(this.options_.label||"Modal Window")},t.prototype.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.prototype.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.closeable()&&this.on(this.el_.ownerDocument,"keydown",Oe(this,this.handleKeyPress)),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},t.prototype.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},t.prototype.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",Oe(this,this.handleKeyPress)),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},t.prototype.closeable=function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,i=this.getChild("closeButton");if(t&&!i){var r=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(i,"close",this.close)}!t&&i&&(this.off(i,"close",this.close),this.removeChild(i),i.dispose())}return this.closeable_},t.prototype.fill=function(){this.fillWith(this.content())},t.prototype.fillWith=function(e){var t=this.contentEl(),i=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),ie(t,e),this.trigger("modalfill"),r?i.insertBefore(t,r):i.appendChild(t);var n=this.getChild("closeButton");n&&i.appendChild(n.el_)},t.prototype.empty=function(){this.trigger("beforemodalempty"),Z(this.contentEl()),this.trigger("modalempty")},t.prototype.content=function(e){return void 0!==e&&(this.content_=e),this.content_},t.prototype.conditionalFocus_=function(){var e=l.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus(),this.on(l,"keydown",this.handleKeyDown))},t.prototype.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(l,"keydown",this.handleKeyDown)},t.prototype.handleKeyDown=function(e){if(9===e.which){for(var t=this.focusableEls_(),i=this.el_.querySelector(":focus"),r=void 0,n=0;n<t.length;n++)if(i===t[n]){r=n;break}l.activeElement===this.el_&&(r=0),e.shiftKey&&0===r?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||r!==t.length-1||(t[0].focus(),e.preventDefault())}},t.prototype.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(e){return(e instanceof n.HTMLAnchorElement||e instanceof n.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof n.HTMLInputElement||e instanceof n.HTMLSelectElement||e instanceof n.HTMLTextAreaElement||e instanceof n.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof n.HTMLIFrameElement||e instanceof n.HTMLObjectElement||e instanceof n.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")})},t}(Xe);Pt.prototype.options_={pauseOnOpen:!0,temporary:!0},Xe.registerComponent("ModalDialog",Pt);var Mt=function(e){v(t,e);function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];y(this,t);var r=_(this,e.call(this));r.tracks_=[],Object.defineProperty(r,"length",{get:function(){return this.tracks_.length}});for(var n=0;n<i.length;n++)r.addTrack(i[n]);return r}return t.prototype.addTrack=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack"}))},t.prototype.removeTrack=function(e){for(var t=void 0,i=0,r=this.length;i<r;i++)if(this[i]===e){(t=this[i]).off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack"})},t.prototype.getTrackById=function(e){for(var t=null,i=0,r=this.length;i<r;i++){var n=this[i];if(n.id===e){t=n;break}}return t},t}(xe);Mt.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"};for(var Ut in Mt.prototype.allowedEvents_)Mt.prototype["on"+Ut]=null;var Nt=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)},Bt=function(e){v(t,e);function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];y(this,t);for(var r=i.length-1;r>=0;r--)if(i[r].enabled){Nt(i,i[r]);break}var n=_(this,e.call(this,i));return n.changing_=!1,n}return t.prototype.addTrack=function(t){var i=this;t.enabled&&Nt(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",function(){i.changing_||(i.changing_=!0,Nt(i,t),i.changing_=!1,i.trigger("change"))})},t}(Mt),Ft=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)},jt=function(e){v(t,e);function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];y(this,t);for(var r=i.length-1;r>=0;r--)if(i[r].selected){Ft(i,i[r]);break}var n=_(this,e.call(this,i));return n.changing_=!1,Object.defineProperty(n,"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),n}return t.prototype.addTrack=function(t){var i=this;t.selected&&Ft(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("selectedchange",function(){i.changing_||(i.changing_=!0,Ft(i,t),i.changing_=!1,i.trigger("change"))})},t}(Mt),Gt=function(e){v(t,e);function t(){return y(this,t),_(this,e.apply(this,arguments))}return t.prototype.addTrack=function(t){e.prototype.addTrack.call(this,t),t.addEventListener("modechange",Oe(this,function(){this.queueTrigger("change")}));-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",Oe(this,function(){this.trigger("selectedlanguagechange")}))},t}(Mt),Vt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];y(this,e),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var i=0,r=t.length;i<r;i++)this.addTrackElement_(t[i])}return e.prototype.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)},e.prototype.getTrackElementByTrack_=function(e){for(var t=void 0,i=0,r=this.trackElements_.length;i<r;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t},e.prototype.removeTrackElement_=function(e){for(var t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_.splice(t,1);break}},e}(),Ht=function(){function e(t){y(this,e),e.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}return e.prototype.setCues_=function(e){var t=this.length||0,i=0,r=e.length;this.cues_=e,this.length_=e.length;var n=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<r)for(i=t;i<r;i++)n.call(this,i)},e.prototype.getCueById=function(e){for(var t=null,i=0,r=this.length;i<r;i++){var n=this[i];if(n.id===e){t=n;break}}return t},e}(),zt={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Wt={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},qt={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Kt={disabled:"disabled",hidden:"hidden",showing:"showing"},Xt=function(e){v(t,e);function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};y(this,t);var r=_(this,e.call(this)),n={id:i.id||"vjs_track_"+ue(),kind:i.kind||"",label:i.label||"",language:i.language||""},a=function(e){Object.defineProperty(r,e,{get:function(){return n[e]},set:function(){}})};for(var s in n)a(s);return r}return t}(xe),Yt=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=l.createElement("a");i.href=e;var r=""===i.host&&"file:"!==i.protocol,a=void 0;r&&((a=l.createElement("div")).innerHTML='<a href="'+e+'"></a>',i=a.firstChild,a.setAttribute("style","display:none; position:absolute;"),l.body.appendChild(a));for(var s={},o=0;o<t.length;o++)s[t[o]]=i[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=n.location.protocol),r&&l.body.removeChild(a),s},$t=function(e){if(!e.match(/^https?:\/\//)){var t=l.createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},Qt=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(e);if(t)return t.pop().toLowerCase()}return""},Jt=function(e){var t=n.location,i=Yt(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host},Zt=Object.freeze({parseUrl:Yt,getAbsoluteURL:$t,getFileExtension:Qt,isCrossOrigin:Jt}),ei=function(e){var t=ti.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)},ti=Object.prototype.toString;var ii=Object.freeze({default:ei,__moduleExports:ei}),ri=i(function(e,t){(t=e.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}}),ni=ri.left,ai=ri.right,si=Object.freeze({default:ri,__moduleExports:ri,left:ni,right:ai}),oi=ii&&ei||ii,ui=function(e,t,i){if(!oi(t))throw new TypeError("iterator must be a function");arguments.length<3&&(i=this);"[object Array]"===li.call(e)?function(e,t,i){for(var r=0,n=e.length;r<n;r++)ci.call(e,r)&&t.call(i,e[r],r,e)}(e,t,i):"string"==typeof e?function(e,t,i){for(var r=0,n=e.length;r<n;r++)t.call(i,e.charAt(r),r,e)}(e,t,i):function(e,t,i){for(var r in e)ci.call(e,r)&&t.call(i,e[r],r,e)}(e,t,i)},li=Object.prototype.toString,ci=Object.prototype.hasOwnProperty;var di=Object.freeze({default:ui,__moduleExports:ui}),hi=si&&ri||si,fi=di&&ui||di,pi=function(e){if(!e)return{};var t={};return fi(hi(e).split("\n"),function(e){var i=e.indexOf(":"),r=hi(e.slice(0,i)).toLowerCase(),n=hi(e.slice(i+1));void 0===t[r]?t[r]=n:(a=t[r],"[object Array]"===Object.prototype.toString.call(a)?t[r].push(n):t[r]=[t[r],n]);var a}),t},mi=Object.freeze({default:pi,__moduleExports:pi}),gi=function(){for(var e={},t=0;t<arguments.length;t++){var i=arguments[t];for(var r in i)yi.call(i,r)&&(e[r]=i[r])}return e},yi=Object.prototype.hasOwnProperty;var vi=Object.freeze({default:gi,__moduleExports:gi}),_i=mi&&pi||mi,bi=vi&&gi||vi,Ti=Ei;Ei.XMLHttpRequest=n.XMLHttpRequest||function(){},Ei.XDomainRequest="withCredentials"in new Ei.XMLHttpRequest?Ei.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],function(e){Ei["delete"===e?"del":e]=function(t,i,r){return(i=Si(t,i,r)).method=e.toUpperCase(),ki(i)}});function Si(e,t,i){var r=e;return oi(t)?(i=t,"string"==typeof e&&(r={uri:e})):r=bi(t,{uri:e}),r.callback=i,r}function Ei(e,t,i){return ki(t=Si(e,t,i))}function ki(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,r,n){t||(t=!0,e.callback(i,r,n))};function r(e){return clearTimeout(u),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,m)}function n(){if(!o){var t;clearTimeout(u),t=e.useXDR&&void 0===a.status?200:1223===a.status?204:a.status;var r=m,n=null;return 0!==t?(r={body:function(){var e=void 0;if(e=a.response?a.response:a.responseText||function(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}(a),p)try{e=JSON.parse(e)}catch(e){}return e}(),statusCode:t,method:c,headers:{},url:l,rawRequest:a},a.getAllResponseHeaders&&(r.headers=_i(a.getAllResponseHeaders()))):n=new Error("Internal XMLHttpRequest Error"),i(n,r,r.body)}}var a=e.xhr||null;a||(a=e.cors||e.useXDR?new Ei.XDomainRequest:new Ei.XMLHttpRequest);var s,o,u,l=a.url=e.uri||e.url,c=a.method=e.method||"GET",d=e.body||e.data,h=a.headers=e.headers||{},f=!!e.sync,p=!1,m={body:void 0,headers:{},statusCode:0,method:c,url:l,rawRequest:a};if("json"in e&&!1!==e.json&&(p=!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===e.json?d:e.json))),a.onreadystatechange=function(){4===a.readyState&&setTimeout(n,0)},a.onload=n,a.onerror=r,a.onprogress=function(){},a.onabort=function(){o=!0},a.ontimeout=r,a.open(c,l,!f,e.username,e.password),f||(a.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(u=setTimeout(function(){if(!o){o=!0,a.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}},e.timeout)),a.setRequestHeader)for(s in h)h.hasOwnProperty(s)&&a.setRequestHeader(s,h[s]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(a.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(a),a.send(d||null),a}var wi=function(e,t){var i=new n.WebVTT.Parser(n,n.vttjs,n.WebVTT.StringDecoder()),r=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){r.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),r.length>0&&(n.console&&n.console.groupCollapsed&&n.console.groupCollapsed("Text Track parsing errors for "+t.src),r.forEach(function(e){return p.error(e)}),n.console&&n.console.groupEnd&&n.console.groupEnd()),i.flush()},Ai=function(e,t){var i={uri:e},r=Jt(e);r&&(i.cors=r),Ti(i,Oe(this,function(e,i,r){if(e)return p.error(e,i);if(t.loaded_=!0,"function"!=typeof n.WebVTT){if(t.tech_){var a=function(){return wi(r,t)};t.tech_.on("vttjsloaded",a),t.tech_.on("vttjserror",function(){p.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",a)})}}else wi(r,t)}))},Ci=function(e){v(t,e);function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(y(this,t),!i.tech)throw new Error("A tech was not provided.");var r=Ke(i,{kind:qt[i.kind]||"subtitles",language:i.language||i.srclang||""}),n=Kt[r.mode]||"disabled",a=r.default;"metadata"!==r.kind&&"chapters"!==r.kind||(n="hidden");var s=_(this,e.call(this,r));s.tech_=r.tech,s.cues_=[],s.activeCues_=[];var o=new Ht(s.cues_),u=new Ht(s.activeCues_),l=!1,c=Oe(s,function(){this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1)});return"disabled"!==n&&s.tech_.ready(function(){s.tech_.on("timeupdate",c)},!0),Object.defineProperties(s,{default:{get:function(){return a},set:function(){}},mode:{get:function(){return n},set:function(e){var t=this;Kt[e]&&("disabled"!==(n=e)?this.tech_.ready(function(){t.tech_.on("timeupdate",c)},!0):this.tech_.off("timeupdate",c),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?o:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return u;for(var e=this.tech_.currentTime(),t=[],i=0,r=this.cues.length;i<r;i++){var n=this.cues[i];n.startTime<=e&&n.endTime>=e?t.push(n):n.startTime===n.endTime&&n.startTime<=e&&n.startTime+.5>=e&&t.push(n)}if(l=!1,t.length!==this.activeCues_.length)l=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(l=!0);return this.activeCues_=t,u.setCues_(this.activeCues_),u},set:function(){}}}),r.src?(s.src=r.src,Ai(r.src,s)):s.loaded_=!0,s}return t.prototype.addCue=function(e){var t=e;if(n.vttjs&&!(e instanceof n.vttjs.VTTCue)){t=new n.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(var i in e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}for(var r=this.tech_.textTracks(),a=0;a<r.length;a++)r[a]!==this&&r[a].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},t.prototype.removeCue=function(e){for(var t=this.cues_.length;t--;){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(Xt);Ci.prototype.allowedEvents_={cuechange:"cuechange"};var Li=function(e){v(t,e);function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};y(this,t);var r=Ke(i,{kind:Wt[i.kind]||""}),n=_(this,e.call(this,r)),a=!1;return Object.defineProperty(n,"enabled",{get:function(){return a},set:function(e){"boolean"==typeof e&&e!==a&&(a=e,this.trigger("enabledchange"))}}),r.enabled&&(n.enabled=r.enabled),n.loaded_=!0,n}return t}(Xt),Ri=function(e){v(t,e);function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};y(this,t);var r=Ke(i,{kind:zt[i.kind]||""}),n=_(this,e.call(this,r)),a=!1;return Object.defineProperty(n,"selected",{get:function(){return a},set:function(e){"boolean"==typeof e&&e!==a&&(a=e,this.trigger("selectedchange"))}}),r.selected&&