easyplayer-my
Version:
rtmp, hls, flv and websocket player
1 lines • 1.26 MB
JavaScript
!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,d=void 0,c="info",h=[],f=function(e,t){var i=d.levels[c],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)}};(d=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:c},d.level=function(e){if("string"==typeof e){if(!d.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');c=e}return c},d.history=function(){return h?[].concat(h):[]},d.history.clear=function(){h&&(h.length=0)},d.history.disable=function(){null!==h&&(h.length=0,h=null)},d.history.enable=function(){null===h&&(h=[])},d.error=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return f("error",t)},d.warn=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return f("warn",t)},d.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=d;function m(e){return e.replace(/\n\r?\s*/g,"")}var g=function(e){for(var t="",i=0;i<arguments.length;i++)t+=m(e[i])+(arguments[i+1]||"");return t},v="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")},_=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)},b=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},T=function(e,t){return e.raw=t,e},S=Object.prototype.toString,E=function(e){return A(e)?Object.keys(e):[]};function k(e,t){E(e).forEach(function(i){return t(e[i],i)})}function w(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&&k(t,function(t,i){e[i]=t})}),e)}function A(e){return!!e&&"object"===(void 0===e?"undefined":v(e))}function L(e){return A(e)&&"[object Object]"===S.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 O=T(["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 D(e){if(/\s/.test(e))throw new Error("class has illegal whitespace characters")}function I(){return l===n.document}function P(e){return A(e)&&1===e.nodeType}function x(){try{return n.parent!==n.self}catch(e){return!0}}function M(e){return function(t,i){if(!R(t))return l[e](null);R(i)&&(i=l.querySelector(i));var r=P(i)?i:l;return r[e]&&r[e](t)}}function U(){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(g(O,e,i)),n.setAttribute(e,i)):"textContent"===e?B(n,i):n[e]=i}),Object.getOwnPropertyNames(i).forEach(function(e){n.setAttribute(e,i[e])}),r&&ie(n,r),n}function B(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 F(e,t){return D(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i}function j(e,t){return e.classList?e.classList.add(t):F(e,t)||(e.className=(e.className+" "+t).trim()),e}function G(e,t){return e.classList?e.classList.remove(t):(D(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e}function H(e,t,i){var r=F(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!r),i!==r)return i?j(e,t):G(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 q(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 K(e,t){e.removeAttribute(t)}function Y(){l.body.focus(),l.onselectstart=function(){return!1}}function X(){l.onselectstart=function(){return!0}}function $(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 Q(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,d=n.pageYOffset||r.scrollTop,c=t.top+d-u;return{left:Math.round(o),top:Math.round(c)}}function J(e,t){var i={},r=Q(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 Z(e){return A(e)&&3===e.nodeType}function ee(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function te(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),P(e)||Z(e)?e:"string"==typeof e&&/\S/.test(e)?l.createTextNode(e):void 0}).filter(function(e){return e})}function ie(e,t){return te(t).forEach(function(t){return e.appendChild(t)}),e}function re(e,t){return ie(ee(e),t)}function ne(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||0===e.button&&1===e.buttons)}var ae=M("querySelector"),se=M("querySelectorAll"),oe=Object.freeze({isReal:I,isEl:P,isInFrame:x,createEl:U,textContent:B,prependTo:N,hasClass:F,addClass:j,removeClass:G,toggleClass:H,setAttributes:V,getAttributes:q,getAttribute:z,setAttribute:W,removeAttribute:K,blockTextSelection:Y,unblockTextSelection:X,getBoundingClientRect:$,findPosition:Q,getPointerPosition:J,isTextNode:Z,emptyEl:ee,normalizeContent:te,appendContent:ie,insertContent:re,isSingleLeftClick:ne,$:ae,$$:se}),ue=1;function le(){return ue++}var de={},ce="vdata"+(new Date).getTime();function he(e){var t=e[ce];return t||(t=e[ce]=le()),de[t]||(de[t]={}),de[t]}function fe(e){var t=e[ce];return!!t&&!!Object.getOwnPropertyNames(de[t]).length}function pe(e){var t=e[ce];if(t){delete de[t];try{delete e[ce]}catch(t){e.removeAttribute?e.removeAttribute(ce):e[ce]=null}}}function me(e,t){var i=he(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&pe(e)}function ge(e,t,i,r){i.forEach(function(i){e(t,i,r)})}function ve(e){function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var r=e||n.event;for(var a in e={},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 _e=["touchstart","touchmove"];function be(e,t,i){if(Array.isArray(t))return ge(be,e,t,i);var r=he(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),i.guid||(i.guid=le()),r.handlers[t].push(i),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,i){if(!r.disabled){t=ve(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&&_e.indexOf(t)>-1&&(n={passive:!0}),e.addEventListener(t,r.dispatcher,n)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function Te(e,t,i){if(fe(e)){var r=he(e);if(r.handlers){if(Array.isArray(t))return ge(Te,e,t,i);var n=function(e,t){r.handlers[t]=[],me(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);me(e,t)}else n(e,t)}else for(var o in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},o)&&n(e,o)}}}function Se(e,t,i){var r=fe(e)?he(e):{},n=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=ve(t),r.dispatcher&&r.dispatcher.call(e,t,i),n&&!t.isPropagationStopped()&&!0===t.bubbles)Se.call(null,n,t,i);else if(!n&&!t.defaultPrevented){var a=he(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 Ee(e,t,i){if(Array.isArray(t))return ge(Ee,e,t,i);var r=function r(){Te(e,t,r),i.apply(this,arguments)};r.guid=i.guid=i.guid||le(),be(e,t,r)}var ke=Object.freeze({fixEvent:ve,on:be,off:Te,trigger:Se,one:Ee}),we=!1,Ae=void 0,Le=function(){if(I()&&!1!==Ae.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}void 0===s.player&&null!==s.getAttribute("data-setup")&&Ae(s)}else we||Ce(1)}};function Ce(e,t){t&&(Ae=t),n.setTimeout(Le,e)}I()&&"complete"===l.readyState?we=!0:Ee(n,"load",function(){we=!0});var Oe=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},De=function(e,t,i){t.guid||(t.guid=le());var r=function(){return t.apply(e,arguments)};return r.guid=i?i+"_"+t.guid:t.guid,r},Ie=function(e,t){var i=Date.now();return function(){var r=Date.now();r-i>=t&&(e.apply(void 0,arguments),i=r)}},Pe=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(){},be(this,e,t),this.addEventListener=i},xe.prototype.addEventListener=xe.prototype.on,xe.prototype.off=function(e,t){Te(this,e,t)},xe.prototype.removeEventListener=xe.prototype.off,xe.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Ee(this,e,t),this.addEventListener=i},xe.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=ve(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Se(this,e)},xe.prototype.dispatchEvent=xe.prototype.trigger;var Me=void 0;xe.prototype.queueTrigger=function(e){var t=this;Me||(Me=new Map);var i=e.type||e,r=Me.get(this);r||(r=new Map,Me.set(this,r));var a=r.get(i);r.delete(i),n.clearTimeout(a);var s=n.setTimeout(function(){0===r.size&&(r=null,Me.delete(t)),t.trigger(e)},0);r.set(i,s)};var Ue=function(e){return e instanceof xe||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},Be=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Ne=function(e){if(!e.nodeName&&!Ue(e))throw new Error("Invalid target; must be a DOM node or evented object.")},Fe=function(e){if(!Be(e))throw new Error("Invalid event type; must be a non-empty string or array.")},je=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},Ge=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),Fe(n),je(a),{isTargetingSelf:i,target:r,type:n,listener:a=De(e,a)}},He=function(e,t,i,r){Ne(e),e.nodeName?ke[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=Ge(this,i),a=n.isTargetingSelf,s=n.target,o=n.type,u=n.listener;if(He(s,"on",o,u),!a){var l=function(){return e.off(s,o,u)};l.guid=u.guid;var d=function(){return e.off("dispose",l)};d.guid=u.guid,He(this,"on","dispose",l),He(s,"on","dispose",d)}},one:function(){for(var e=this,t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];var n=Ge(this,i),a=n.isTargetingSelf,s=n.target,o=n.type,u=n.listener;if(a)He(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,He(s,"one",o,l)}},off:function(e,t,i){if(!e||Be(e))Te(this.eventBusEl_,e,t);else{var r=e,n=t;Ne(r),Fe(n),je(i),i=De(this,i),this.off("dispose",i),r.nodeName?(Te(r,n,i),Te(r,"dispose",i)):Ue(r)&&(r.off(n,i),r.off("dispose",i))}},trigger:function(e,t){return Se(this.eventBusEl_,e,t)}};function qe(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_=U("span",{className:"vjs-event-bus"});return w(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 k(e,function(e,r){t.state[r]!==e&&((i=i||{})[r]={from:t.state[r],to:e}),t.state[r]=e}),i&&Ue(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function We(e,t){return w(e,ze),e.state=w({},e.state,t),"function"==typeof e.handleStateChanged&&Ue(e)&&e.on("statechanged",e.handleStateChanged),e}function Ke(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function Ye(){for(var e={},t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];return i.forEach(function(t){t&&k(t,function(t,i){L(t)?(L(e[i])||(e[i]={}),e[i]=Ye(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_=Ye({},this.options_),i=this.options_=Ye(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_"+le()}this.name_=i.name||null,i.el?this.el_=i.el:!1!==i.createEl&&(this.el_=this.createEl()),!1!==i.evented&&qe(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_),pe(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_=Ye(this.options_,e),this.options_):this.options_},e.prototype.el=function(){return this.el_},e.prototype.createEl=function(e,t,i){return U(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=Ke(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=Ke(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&&Ke(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=void 0,a=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(e){return!n.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||Ke(t.name));return i&&!a.isTech(i)}).forEach(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)}})}},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 ae(e,t||this.contentEl())},e.prototype.$$=function(e,t){return se(e,t||this.contentEl())},e.prototype.hasClass=function(e){return F(this.el_,e)},e.prototype.addClass=function(e){j(this.el_,e)},e.prototype.removeClass=function(e){G(this.el_,e)},e.prototype.toggleClass=function(e,t){H(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){K(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"+Ke(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"+Ke(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){(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=De(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=De(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=De(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=De(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=Ke(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=Ke(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 $e,Qe=n.navigator&&n.navigator.userAgent||"",Je=/AppleWebKit\/([\d.]+)/i.exec(Qe),Ze=Je?parseFloat(Je.pop()):null,et=/iPad/i.test(Qe),tt=/iPhone/i.test(Qe)&&!et,it=/iPod/i.test(Qe),rt=tt||et||it,nt=($e=Qe.match(/OS (\d+)_/i))&&$e[1]?$e[1]:null,at=/Android/i.test(Qe),st=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}(),ot=at&&st<5&&Ze<537,ut=/Firefox/i.test(Qe),lt=/Edge/i.test(Qe),dt=!lt&&(/Chrome/i.test(Qe)||/CriOS/i.test(Qe)),ct=function(){var e=Qe.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),ht=function(){var e=/MSIE\s(\d+)\.\d/.exec(Qe),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Qe)&&/rv:11.0/.test(Qe)&&(t=11),t}(),ft=/Safari/i.test(Qe)&&!dt&&!at&&!lt,pt=(ft||rt)&&!dt,mt=I()&&("ontouchstart"in n||n.navigator.maxTouchPoints||n.DocumentTouch&&n.document instanceof n.DocumentTouch),gt=Object.freeze({IS_IPAD:et,IS_IPHONE:tt,IS_IPOD:it,IS_IOS:rt,IOS_VERSION:nt,IS_ANDROID:at,ANDROID_VERSION:st,IS_NATIVE_ANDROID:ot,IS_FIREFOX:ut,IS_EDGE:lt,IS_CHROME:dt,CHROME_VERSION:ct,IE_VERSION:ht,IS_SAFARI:ft,IS_ANY_SAFARI:pt,TOUCH_ENABLED:mt});function vt(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 yt(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:vt.bind(null,"start",0,e),end:vt.bind(null,"end",1,e)}}function _t(e,t){return Array.isArray(e)?yt(e):void 0===e||void 0===t?yt():yt([[e,t]])}function bt(e,t){var i=0,r=void 0,n=void 0;if(!t)return 0;e&&e.length||(e=_t(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 Tt={},St=[["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"]],Et=St[0],kt=void 0,wt=0;wt<St.length;wt++)if(St[wt][1]in l){kt=St[wt];break}if(kt)for(var At=0;At<kt.length;At++)Tt[Et[At]]=kt[At];function Lt(e){if(e instanceof Lt)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:A(e)&&("number"==typeof e.code&&(this.code=e.code),w(this,e)),this.message||(this.message=Lt.defaultMessages[this.code]||"")}Lt.prototype.code=0,Lt.prototype.message="",Lt.prototype.status=null,Lt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Lt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Ct=0;Ct<Lt.errorTypes.length;Ct++)Lt[Lt.errorTypes[Ct]]=Ct,Lt.prototype[Lt.errorTypes[Ct]]=Ct;var Ot=function(e,t){var i,r=null;try{i=JSON.parse(e,t)}catch(e){r=e}return[r,i]};function Rt(e){return void 0!==e&&null!==e&&"function"==typeof e.then}function Dt(e){Rt(e)&&e.then(null,function(e){})}var It=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}})})},Pt=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=It(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(It))},xt=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()},Mt="vjs-modal-dialog",Ut=function(e){function t(i,r){y(this,t);var n=b(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_=U("div",{className:Mt+"-content"},{role:"document"}),n.descEl_=U("p",{className:Mt+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),B(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}return _(t,e),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 Mt+" 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",De(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",De(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(),re(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"),ee(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);Ut.prototype.options_={pauseOnOpen:!0,temporary:!0},Xe.registerComponent("ModalDialog",Ut);var Bt=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];y(this,t);var r=b(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,e),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);for(var Nt in Bt.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},Bt.prototype.allowedEvents_)Bt.prototype["on"+Nt]=null;var Ft=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)},jt=function(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){Ft(i,i[r]);break}var n=b(this,e.call(this,i));return n.changing_=!1,n}return _(t,e),t.prototype.addTrack=function(t){var i=this;t.enabled&&Ft(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",function(){i.changing_||(i.changing_=!0,Ft(i,t),i.changing_=!1,i.trigger("change"))})},t}(Bt),Gt=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)},Ht=function(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){Gt(i,i[r]);break}var n=b(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,e),t.prototype.addTrack=function(t){var i=this;t.selected&&Gt(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("selectedchange",function(){i.changing_||(i.changing_=!0,Gt(i,t),i.changing_=!1,i.trigger("change"))})},t}(Bt),Vt=function(e){function t(){return y(this,t),b(this,e.apply(this,arguments))}return _(t,e),t.prototype.addTrack=function(t){e.prototype.addTrack.call(this,t),t.addEventListener("modechange",De(this,function(){this.queueTrigger("change")}));-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",De(this,function(){this.trigger("selectedlanguagechange")}))},t}(Bt),qt=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}(),zt=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}(),Wt={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Kt={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Yt={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Xt={disabled:"disabled",hidden:"hidden",showing:"showing"},$t=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};y(this,t);var r=b(this,e.call(this)),n={id:i.id||"vjs_track_"+le(),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,e),t}(xe),Qt=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},Jt=function(e){if(!e.match(/^https?:\/\//)){var t=l.createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},Zt=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(e);if(t)return t.pop().toLowerCase()}return""},ei=function(e){var t=n.location,i=Qt(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host},ti=Object.freeze({parseUrl:Qt,getAbsoluteURL:Jt,getFileExtension:Zt,isCrossOrigin:ei}),ii=function(e){var t=ri.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)},ri=Object.prototype.toString;var ni=Object.freeze({default:ii,__moduleExports:ii}),ai=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*$/,"")}}),si=ai.left,oi=ai.right,ui=Object.freeze({default:ai,__moduleExports:ai,left:si,right:oi}),li=ni&&ii||ni,di=function(e,t,i){if(!li(t))throw new TypeError("iterator must be a function");arguments.length<3&&(i=this);"[object Array]"===ci.call(e)?function(e,t,i){for(var r=0,n=e.length;r<n;r++)hi.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)hi.call(e,r)&&t.call(i,e[r],r,e)}(e,t,i)},ci=Object.prototype.toString,hi=Object.prototype.hasOwnProperty;var fi=Object.freeze({default:di,__moduleExports:di}),pi=ui&&ai||ui,mi=fi&&di||fi,gi=function(e){if(!e)return{};var t={};return mi(pi(e).split("\n"),function(e){var i,r=e.indexOf(":"),n=pi(e.slice(0,r)).toLowerCase(),a=pi(e.slice(r+1));void 0===t[n]?t[n]=a:(i=t[n],"[object Array]"===Object.prototype.toString.call(i)?t[n].push(a):t[n]=[t[n],a])}),t},vi=Object.freeze({default:gi,__moduleExports:gi}),yi=function(){for(var e={},t=0;t<arguments.length;t++){var i=arguments[t];for(var r in i)_i.call(i,r)&&(e[r]=i[r])}return e},_i=Object.prototype.hasOwnProperty;var bi=Object.freeze({default:yi,__moduleExports:yi}),Ti=vi&&gi||vi,Si=bi&&yi||bi,Ei=wi;function ki(e,t,i){var r=e;return li(t)?(i=t,"string"==typeof e&&(r={uri:e})):r=Si(t,{uri:e}),r.callback=i,r}function wi(e,t,i){return Ai(t=ki(e,t,i))}function Ai(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(!s){var t;clearTimeout(u),t=e.useXDR&&void 0===o.status?200:1223===o.status?204:o.status;var r=m,n=null;return 0!==t?(r={body:function(){var e=void 0;if(e=o.response?o.response:o.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}(o),p)try{e=JSON.parse(e)}catch(e){}return e}(),statusCode:t,method:d,headers:{},url:l,rawRequest:o},o.getAllResponseHeaders&&(r.headers=Ti(o.getAllResponseHeaders()))):n=new Error("Internal XMLHttpRequest Error"),i(n,r,r.body)}}var a,s,o=e.xhr||null;o||(o=e.cors||e.useXDR?new wi.XDomainRequest:new wi.XMLHttpRequest);var u,l=o.url=e.uri||e.url,d=o.method=e.method||"GET",c=e.body||e.data,h=o.headers=e.headers||{},f=!!e.sync,p=!1,m={body:void 0,headers:{},statusCode:0,method:d,url:l,rawRequest:o};if("json"in e&&!1!==e.json&&(p=!0,h.accept||h.Accept||(h.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(h["content-type"]||h["Content-Type"]||(h["Content-Type"]="application/json"),c=JSON.stringify(!0===e.json?c:e.json))),o.onreadystatechange=function(){4===o.readyState&&setTimeout(n,0)},o.onload=n,o.onerror=r,o.onprogress=function(){},o.onabort=function(){s=!0},o.ontimeout=r,o.open(d,l,!f,e.username,e.password),f||(o.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(u=setTimeout(function(){if(!s){s=!0,o.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}},e.timeout)),o.setRequestHeader)for(a in h)h.hasOwnProperty(a)&&o.setRequestHeader(a,h[a]);else e.headers&&function(e){for(var t in e)if(e.hasOwnProperty(t))return!1}(e.headers);return"responseType"in e&&(o.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(o),o.send(c||null),o}wi.XMLHttpRequest=n.XMLHttpRequest||function(){},wi.XDomainRequest="withCredentials"in new wi.XMLHttpRequest?wi.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){wi["delete"===e?"del":e]=function(t,i,r){return(i=ki(t,i,r)).method=e.toUpperCase(),Ai(i)}});var Li=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()},Ci=function(e,t){var i={uri:e},r=ei(e);r&&(i.cors=r),Ei(i,De(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 Li(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 Li(r,t)}))},Oi=function(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=Ye(i,{kind:Yt[i.kind]||"subtitles",language:i.language||i.srclang||""}),n=Xt[r.mode]||"disabled",a=r.default;"metadata"!==r.kind&&"chapters"!==r.kind||(n="hidden");var s=b(this,e.call(this,r));s.tech_=r.tech,s.cues_=[],s.activeCues_=[];var o=new zt(s.cues_),u=new zt(s.activeCues_),l=!1,d=De(s,function(){this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1)});return"disabled"!==n&&s.tech_.ready(function(){s.tech_.on("timeupdate",d)},!0),Object.defineProperties(s,{default:{get:function(){return a},set:function(){}},mode:{get:function(){return n},set:function(e){var t=this;Xt[e]&&("disabled"!==(n=e)?this.tech_.ready(function(){t.tech_.on("timeupdate",d)},!0):this.tech_.off("timeupdate",d),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,Ci(r.src,s)):s.loaded_=!0,s}return _(t,e),t.prototype.addCue=function(e){var t=e;if(n.vttjs&&!(e instanceof n.vttjs.VTTCue)){for(var i in t=new n.vttjs.VTTCue(e.startTime,e.endTime,e.text),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}($t);Oi.prototype.allowedEvents_={cuechange:"cuechange"};var Ri=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};y(this,t);var r=Ye(i,{kind:Kt[i.kind]||""}),n=b(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,e),t}($t),Di=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};y(this,t);var r=Ye(i,{kind:Wt[i.kind]||""}),n=b(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&&(n.selected=r.selected),n}return _(t,e),t}($t),Ii=0,Pi=2,xi=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};y(