UNPKG

avs-sdk

Version:

音视频服务前端sdk

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