/*
Video.js 7.8.4
Copyright Brightcove, Inc.
Available under Apache License Version 2.0
Includes vtt.js
Available under Apache License Version 2.0
slighly modified parse-headers 2.0.2
Copyright (c) 2014 David Björklund
Available under the MIT license
2020 Brightcove, Inc
@license Apache-2.0
@name m3u8-parser @version 4.4.0 @license Apache-2.0 */
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(x){var J=0;return function(){return J=Object.getOwnPropertyNames(f.handlers).length&&(delete f.handlers,delete f.dispatcher,delete f.disabled);0===Object.getOwnPropertyNames(f).length&&Sa["delete"](g)}}function ne(g,c,f,b){f.forEach(function(a){g(c,a,b)})}function ud(g){function c(){return!0}function f(){return!1}if(g.fixed_)return g;if(!g||!g.isPropagationStopped){var b=g||x.event;for(a in g={},b)"layerX"!==a&&"layerY"!==a&&"keyLocation"!==a&&"webkitMovementX"!==a&&"webkitMovementY"!==a&&("returnValue"===
a&&b.preventDefault||(g[a]=b[a]));if(g.target||(g.target=g.srcElement||J),g.relatedTarget||(g.relatedTarget=g.fromElement===g.target?g.toElement:g.fromElement),g.preventDefault=function(){b.preventDefault&&b.preventDefault();g.returnValue=!1;b.returnValue=!1;g.defaultPrevented=!0},g.defaultPrevented=!1,g.stopPropagation=function(){b.stopPropagation&&b.stopPropagation();g.cancelBubble=!0;b.cancelBubble=!0;g.isPropagationStopped=c},g.isPropagationStopped=f,g.stopImmediatePropagation=function(){b.stopImmediatePropagation&&
b.stopImmediatePropagation();g.isImmediatePropagationStopped=c;g.stopPropagation()},g.isImmediatePropagationStopped=f,null!==g.clientX&&void 0!==g.clientX){var a=J.documentElement;var d=J.body;g.pageX=g.clientX+(a&&a.scrollLeft||d&&d.scrollLeft||0)-(a&&a.clientLeft||d&&d.clientLeft||0);g.pageY=g.clientY+(a&&a.scrollTop||d&&d.scrollTop||0)-(a&&a.clientTop||d&&d.clientTop||0)}g.which=g.charCode||g.keyCode;null!==g.button&&void 0!==g.button&&(g.button=1&g.button?0:4&g.button?1:2&g.button?2:0)}return g.fixed_=
!0,g}function kb(g,c,f){if(Array.isArray(c))return ne(kb,g,c,f);Sa.has(g)||Sa.set(g,{});var b=Sa.get(g);if(b.handlers||(b.handlers={}),b.handlers[c]||(b.handlers[c]=[]),f.guid||(f.guid=Lb++),b.handlers[c].push(f),b.dispatcher||(b.disabled=!1,b.dispatcher=function(a,d){if(!b.disabled){a=ud(a);var e=b.handlers[a.type];if(e){e=e.slice(0);for(var h=0,k=e.length;hc.length||c[0]===g||c[0]===g.eventBusEl_;return a=d?(f=g.eventBusEl_,3<=c.length&&c.shift(),b=c[0],c[1]):(f=c[0],b=c[1],c[2]),oe(f),zg(b),Ag(a),{isTargetingSelf:d,
target:f,type:b,listener:ka(g,a)}}function Xb(g,c,f,b){oe(g);g.nodeName?gk[c](g,f,b):g[c](f,b)}function qe(g,c){void 0===c&&(c={});var f=c.eventBusKey;if(f){if(!g[f].nodeName)throw Error('The eventBusKey "'+f+'" does not refer to an element.');g.eventBusEl_=g[f]}else g.eventBusEl_=X("span",{className:"vjs-event-bus"});return ca(g,hk),g.eventedCallbacks&&g.eventedCallbacks.forEach(function(b){b()}),g.on("dispose",function(){g.off();x.setTimeout(function(){g.eventBusEl_=null},0)}),g}function Bg(g,c){return ca(g,
ik),g.state=ca({},g.state,c),"function"==typeof g.handleStateChanged&&Wb(g)&&g.on("statechanged",g.handleStateChanged),g}function wd(g){return"string"!=typeof g?g:g.replace(/./,function(c){return c.toLowerCase()})}function Ca(g){return"string"!=typeof g?g:g.replace(/./,function(c){return c.toUpperCase()})}function ua(){for(var g={},c=arguments.length,f=Array(c),b=0;bb||a]*>?)?/);return w=B[1]?B[1]:B[2],c=c.substr(w.length),w}function b(w,B){var G=mk[w];if(!G)return null;G=g.document.createElement(G);var v=nk[w];return v&&B&&(G[v]=
B.trim()),G}for(var a,d,e,h,k=g.document.createElement("div"),l=k,m=[];null!==(a=f());)if("\x3c"!==a[0])l.appendChild(g.document.createTextNode((d=a,ze.innerHTML=d,d=ze.textContent,ze.textContent="",d)));else if("/"===a[1])m.length&&m[m.length-1]===a.substr(2).replace("\x3e","")&&(m.pop(),l=l.parentNode);else{var n=xe(a.substr(1,a.length-2));if(n){var q=g.document.createProcessingInstruction("timestamp",n);l.appendChild(q)}else(a=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/))&&(q=b(a[1],
a[3]))&&(e=l,!Mg[(h=q).localName]||Mg[h.localName]===e.localName)&&(a[2]&&(n=a[2].split("."),n.forEach(function(w){var B=/^bg_/.test(w);w=B?w.slice(3):w;Ng.hasOwnProperty(w)&&(q.style[B?"background-color":"color"]=Ng[w])}),q.className=n.join(" ")),m.push(a[1]),l.appendChild(q),l=q)}return k}function ok(g){for(var c=0;c=f[0]&&g<=f[1])return!0}return!1}function Ae(){}function Be(g,c,f){this.cue=c;this.cueDiv=Lg(g,c.text);var b={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",
position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===c.vertical?"horizontal-tb":"lr"===c.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(b,this.cueDiv);this.div=g.document.createElement("div");b={direction:function(a){function d(l,m){for(var n=m.childNodes.length-1;0<=n;n--)l.push(m.childNodes[n])}function e(l){if(!l||!l.length)return null;var m=l.pop(),n=m.textContent||m.innerText;return n?(m=n.match(/^.*(\n|\r)/))?m[l.length=0]:n:"ruby"===
m.tagName?e(l):m.childNodes?(d(l,m),e(l)):void 0}var h=[],k="";if(!a||!a.childNodes)return"ltr";for(d(h,a);k=e(h);)for(a=0;a=n.line))return n.line;if(!n.track||!n.track.textTrackList||!n.track.textTrackList.mediaElement)return-1;n=n.track;for(var q=n.textTrackList,w=0,B=0;Bh&&(l=0>l?-1:1,l*=Math.ceil(h/k)*k);0>d&&(l+=""===g.vertical?f.height:f.width,e=e.reverse());a.move(m,l)}else{a=a.lineHeight/f.height*100;switch(g.lineAlign){case "center":d-=a/2;break;case "end":d-=a}switch(g.vertical){case "":c.applyStyles({top:c.formatStyle(d,"%")});break;case "rl":c.applyStyles({left:c.formatStyle(d,"%")});break;case "lr":c.applyStyles({right:c.formatStyle(d,"%")})}e=["+y","-x","+x","-y"];a=new Va(c)}g=function(n,q){for(var w,B=new Va(n),G=1,v=0;vC||100C||100=g}function sk(){var g=100,c=3,f=0,b=100,a=0,d=100,e="";Object.defineProperties(this,
{width:{enumerable:!0,get:function(){return g},set:function(h){if(!Sc(h))throw Error("Width must be between 0 and 100.");g=h}},lines:{enumerable:!0,get:function(){return c},set:function(h){if("number"!=typeof h)throw new TypeError("Lines must be set to a number.");c=h}},regionAnchorY:{enumerable:!0,get:function(){return b},set:function(h){if(!Sc(h))throw Error("RegionAnchorX must be between 0 and 100.");b=h}},regionAnchorX:{enumerable:!0,get:function(){return f},set:function(h){if(!Sc(h))throw Error("RegionAnchorY must be between 0 and 100.");
f=h}},viewportAnchorY:{enumerable:!0,get:function(){return d},set:function(h){if(!Sc(h))throw Error("ViewportAnchorY must be between 0 and 100.");d=h}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(h){if(!Sc(h))throw Error("ViewportAnchorX must be between 0 and 100.");a=h}},scroll:{enumerable:!0,get:function(){return e},set:function(h){h="string"==typeof h&&!!tk[h.toLowerCase()]&&h.toLowerCase();!1===h||(e=h)}}})}function uk(g,c,f){g.setTimeout(function(){return function m(a,
d,e,h,k,l){void 0===a&&(a={});void 0===d&&(d=[]);void 0===k&&(k=[]);void 0===l&&(l=!1);var n=d[0],q=d.slice(1);if("string"==typeof n)m(a,$b[n],e,h,k,l);else if(n){var w=vk(h,n);if(!w.setSource)return k.push(w),m(a,q,e,h,k,l);w.setSource(ca({},a),function(B,G){if(B)return m(a,q,e,h,k,l);k.push(w);m(G,a.type===G.type?q:$b[G.type],e,h,k,l)})}else q.length?m(a,q,e,h,k,l):l?e(a,k):m(a,$b["*"],e,h,k,!0)}(c,$b[c.type],f,g)},1)}function Qg(g,c,f,b){void 0===b&&(b=null);var a="call"+Ca(f);a=g.reduce(De(a),
b);c=(b=a===yd)?null:c[f](a);for(a=g.length-1;0<=a;a--){var d=g[a];d[f]&&d[f](b,c)}return c}function De(g){return function(c,f){return c===yd?yd:f[g]?f[g](c):c}}function vk(g,c){var f=Ee[g.id()],b=null;if(null==f)return b=c(g),Ee[g.id()]=[[c,b]],b;for(var a=0;ag?0:g;var f=Math.floor(g%60),b=Math.floor(g/60%60),a=Math.floor(g/3600),d=Math.floor(c/60%60),e=Math.floor(c/3600);return!isNaN(g)&&g!==1/0||(a=b=f="-"),(a=0b?"0"+b:b)+":")+(10>f?"0"+f:f)}function kc(g,c){return void 0===c&&(c=g),Ge(g,c)}function Tc(g,c,f){return g=Number(g),Math.min(f,Math.max(c,isNaN(g)?c:g))}function Tg(g,c){if(c&&(g=c(g)),g&&"none"!==g)return g}function He(g){var c=g.el();if(c.hasAttribute("src"))return g.triggerSourceset(c.src),!0;c=g.$$("source");var f=[],b="";if(!c.length)return!1;for(var a=0;a=l)switch(k){case 0:f.setTagName(g.slice(c,h));k=6;break;case 1:e=g.slice(c,h);k=2;break;case 4:var m=g.slice(c,h).replace(/?\w+;/g,a);d.warning('attribute "'+
m+'" missed quot(")!!');f.add(e,m,c);case 5:k=6}else switch(k){case 2:f.tagName;"http://www.w3.org/1999/xhtml"===b[""]&&e.match(/^(?:disabled|checked|selected)$/i)||d.warning('attribute "'+e+'" missed value!! "'+e+'" instead2!!');f.add(e,e,c);c=h;k=1;break;case 5:d.warning('attribute space is required"'+e+'"!!');case 6:k=1;c=h;break;case 3:k=4;c=h;break;case 7:throw Error("elements closed character '/' and '\x3e' must be connected to");}}h++}}function bh(g,c,f){for(var b=g.tagName,a=null,d=g.length;d--;){var e=
g[d],h=e.qName,k=e.value;if(0<(n=h.indexOf(":"))){var l=e.prefix=h.slice(0,n);h=h.slice(n+1);var m="xmlns"===l&&h}else l=null,m="xmlns"===h&&"";e.localName=h;!1!==m&&(null==a&&(a={},ch(f,f={})),f[m]=a[m]=k,e.uri="http://www.w3.org/2000/xmlns/",c.startPrefixMapping(m,k))}for(d=g.length;d--;)(l=(e=g[d]).prefix)&&("xml"===l&&(e.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==l&&(e.uri=f[l||""]));var n;h=0<(n=b.indexOf(":"))?(l=g.prefix=b.slice(0,n),g.localName=b.slice(n+1)):(l=null,g.localName=
b);d=g.uri=f[l||""];if(c.startElement(d,h,b,g),!g.closed)return g.currentNSMap=f,g.localNSMap=a,!0;if(c.endElement(d,h,b),a)for(l in a)c.endPrefixMapping(l)}function Ck(g,c,f,b,a){if(/^(?:script|textarea)$/i.test(f)){var d=g.indexOf("\x3c/"+f+"\x3e",c);g=g.substring(c+1,d);if(/[&<]/.test(g))return/^script$/i.test(f)||(g=g.replace(/?\w+;/g,b)),a.characters(g,0,g.length),d}return c+1}function Dk(g,c,f,b){var a=b[f];return null==a&&((a=g.lastIndexOf("\x3c/"+f+"\x3e"))\/=]+=?|(\/?\s*>|<)/g;a.lastIndex=c;for(a.exec(g);c=a.exec(g);)if(b.push(c),c[1]){a=b;break a}a=void 0}var d=
a.length;if(1G.attributes.bandwidth)){var H,Q=G.attributes,aa=
G.segments,M=G.sidx;aa={attributes:(H={NAME:Q.id,BANDWIDTH:Q.bandwidth,CODECS:Q.codecs},H["PROGRAM-ID"]=1,H),uri:"",endList:"static"===(Q.type||"static"),timeline:Q.periodIndex,resolvedUri:"",targetDuration:Q.duration,segments:aa,mediaSequence:aa.length?aa[0].number:1};H=(Q.contentProtection&&(aa.contentProtection=Q.contentProtection),M&&(aa.sidx=M),aa);B[K]={language:C,autoselect:!0,"default":"main"===v,playlists:Ue([H],n),uri:""};"undefined"==typeof q&&"main"===v&&((q=G)["default"]=!0)}return B},
{});q||(w[Object.keys(w)[0]]["default"]=!0);return w}(b,c)),l.length&&(a.mediaGroups.SUBTITLES.subs=function(m,n){return void 0===n&&(n={}),m.reduce(function(q,w){var B=w.attributes.lang||"text";if(!q[B]){var G;var v=w.attributes;var C=w.segments;v=("undefined"==typeof C&&(C=[{uri:v.baseUrl,timeline:v.periodIndex,resolvedUri:v.baseUrl||"",duration:v.sourceDuration,number:0}],v.duration=v.sourceDuration),{attributes:(G={NAME:v.id,BANDWIDTH:v.bandwidth},G["PROGRAM-ID"]=1,G),uri:"",endList:"static"===
(v.type||"static"),timeline:v.periodIndex,resolvedUri:v.baseUrl||"",targetDuration:v.duration,segments:C,mediaSequence:C.length?C[0].number:1});q[B]={language:B,"default":!1,autoselect:!1,playlists:Ue([v],n),uri:""}}return q},{})}(l,c)),a}function Ch(g,c){var f,b,a,d,e,h,k,l,m,n,q,w,B=g.type;B=void 0===B?"static":B;var G=g.minimumUpdatePeriod;G=void 0===G?0:G;var v=g.media;v=void 0===v?"":v;var C=g.sourceDuration,K=g.timescale;K=void 0===K?1:K;var H=g.startNumber;H=void 0===H?1:H;for(var Q=g.periodIndex,
aa=[],M=-1,Z=0;ZM&&(M=S);S&&Mha?(ha=Z+1,ha=ha===c.length?"dynamic"===B&&0>>2,dependsOn:3&g[0],isDependedOn:(192&g[1])>>>6,hasRedundancy:(48&g[1])>>>4,paddingValue:(14&g[1])>>>1,isNonSyncSample:1&g[1],degradationPriority:g[2]<<8|g[3]}}function pc(g){var c="";return c+=String.fromCharCode(g[0]),c+=String.fromCharCode(g[1]),c+=String.fromCharCode(g[2]),c+String.fromCharCode(g[3])}function Gb(){this.init=
function(){var g={};this.on=function(c,f){g[c]||(g[c]=[]);g[c]=g[c].concat(f)};this.off=function(c,f){var b;return!!g[c]&&(b=g[c].indexOf(f),g[c]=g[c].slice(),g[c].splice(b,1),-1=v))switch(31&n[G]){case 6:var Q=n.subarray(G+1,G+1+v);a:{var aa=G;for(B=0;B>>4&&(c+=g[4]+1),c}function We(g){switch(g){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}}function Kh(g){return g[0]<<21|g[1]<<14|g[2]<<7|g[3]}function bl(g,c,f){for(var b,a,d,e,h=0,k=Ya,l=!1;k<=g.byteLength;)if(71!==g[h]||71!==g[k]&&k!==g.byteLength)h++,k++;else{switch(b=g.subarray(h,k),oa.ts.parseType(b,c.pid)){case "pes":a=
oa.ts.parsePesType(b,c.table),d=oa.ts.parsePayloadUnitStartIndicator(b),"audio"===a&&d&&(e=oa.ts.parsePesTime(b))&&(e.type="audio",f.audio.push(e),l=!0)}if(l)break;h+=Ya;k+=Ya}h=(k=g.byteLength)-Ya;for(l=!1;0<=h;)if(71!==g[h]||71!==g[k]&&k!==g.byteLength)h--,k--;else{switch(b=g.subarray(h,k),oa.ts.parseType(b,c.pid)){case "pes":a=oa.ts.parsePesType(b,c.table),d=oa.ts.parsePayloadUnitStartIndicator(b),"audio"===a&&d&&(e=oa.ts.parsePesTime(b))&&(e.type="audio",f.audio.push(e),l=!0)}if(l)break;h-=Ya;
k-=Ya}}function cl(g,c,f){var b,a,d,e,h,k,l=0,m=Ya,n=!1,q=[];for(h=0;me;e++)m[(l[e]=e<<1^283*(e>>7))^e]=e;for(h=k=0;!a[h];h^=n||1,k=m[k]||1){w=(w=k^k<<1^
k<<2^k<<3^k<<4)>>8^255&w^99;var B=16843009*l[q=l[n=l[d[a[h]=w]=h]]]^65537*q^257*n^16843008*h;var G=257*l[w]^16843008*w;for(e=0;4>e;e++)f[e][h]=G=G<<24^G>>>8,b[e][w]=B=B<<24^B>>>8}for(e=0;5>e;e++)f[e]=f[e].slice(0),b[e]=b[e].slice(0)}pb=c;this._tables=[[pb[0][0].slice(),pb[0][1].slice(),pb[0][2].slice(),pb[0][3].slice(),pb[0][4].slice()],[pb[1][0].slice(),pb[1][1].slice(),pb[1][2].slice(),pb[1][3].slice(),pb[1][4].slice()]];c=this._tables[0][4];f=this._tables[1];e=g.length;h=1;if(4!==e&&6!==e&&8!==
e)throw Error("Invalid aes key size");a=g.slice(0);d=[];this._key=[a,d];for(g=e;g<4*e+28;g++)b=a[g-1],(0==g%e||8===e&&4==g%e)&&(b=c[b>>>24]<<24^c[b>>16&255]<<16^c[b>>8&255]<<8^c[255&b],0==g%e&&(b=b<<8^b>>>24^h<<24,h=h<<1^283*(h>>7))),a[g]=a[g-e]^b;for(e=0;g;e++,g--)b=a[3&e?g:g-4],d[e]=4>=g||4>e?b:f[0][c[b>>>24]]^f[1][c[b>>16&255]]^f[2][c[b>>8&255]]^f[3][c[255&b]]}function bc(){Nd(this,bc);this.listeners={}}function ad(){Nd(this,ad);var g=Mh.call(this,Nh);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
g=!g||"object"!=typeof g&&"function"!=typeof g?this:g;return g.jobs=[],g.delay=1,g.timeout_=null,g}function qb(g){return g<<24|(65280&g)<<8|(16711680&g)>>8|g>>>24}function Oh(g,c,f){var b=new Int32Array(g.buffer,g.byteOffset,g.byteLength>>2);c=new el(Array.prototype.slice.call(c));g=new Uint8Array(g.byteLength);var a=new Int32Array(g.buffer),d;var e=f[0];var h=f[1];var k=f[2];f=f[3];for(d=0;dc){for(;cDate.now()}function af(g){return g.excludeUntil&&
g.excludeUntil===1/0}function Qd(g){var c=Zh(g);return!g.disabled&&!c}function $h(g,c){return c.attributes&&c.attributes[g]}function bf(g,c){if(1===g.playlists.length)return!0;var f=c.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===g.playlists.filter(function(b){return!!Qd(b)&&(b.attributes.BANDWIDTH||0)g?String.fromCharCode(g):"."}function bi(g){var c={};return Object.keys(g).forEach(function(f){var b=g[f];ArrayBuffer.isView(b)?c[f]={bytes:b.buffer,byteOffset:b.byteOffset,byteLength:b.byteLength}:c[f]=b}),c}
function Rd(g){var c=g.byterange||{length:1/0,offset:0};return[c.length,c.offset,g.resolvedUri].join()}function ci(g){g=Array.prototype.slice.call(g);for(var c="",f=0;fe+.25*k.duration)return null;h=k}return{segment:h,estimatedStart:h.videoTimingInfo?h.videoTimingInfo.transmuxedPresentationStart:e-h.duration,type:h.videoTimingInfo?
"accurate":"estimate"}}(f,c);if(!b)return g({message:"valid programTime was not found"});if("estimate"===b.type)return g({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:b.estimatedStart});c={mediaSeconds:f};f=function(a,d){if(!d.dateTimeObject)return null;var e=a-(d.videoTimingInfo.transmuxedPresentationStart+d.videoTimingInfo.transmuxerPrependedSeconds);return new Date(d.dateTimeObject.getTime()+1E3*e)}(f,b.segment);return f&&(c.programDateTime=
f.toISOString()),g(null,c)}function di(g){var c=g.programTime,f=g.playlist,b=g.retryCount,a=void 0===b?2:b,d=g.seekTo;b=g.pauseAfterSeek;var e=void 0===b||b,h=g.tech,k=g.callback;if(!k)throw Error("seekToProgramTime: callback must be provided");if("undefined"==typeof c||!f||!d)return k({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!f.endList&&!h.hasStarted_)return k({message:"player must be playing a live stream to start buffering"});if(!function(m){if(!m.segments||
0===m.segments.length)return!1;for(var n=0;n=g&&f.removeCue(a)}function ii(g){return isNaN(g)||Math.abs(g)===1/0?Number.MAX_VALUE:g}function ll(g,c,f){var b=x.WebKitDataCue||x.VTTCue;if(c&&c.forEach(function(h){this.inbandTextTracks_[h.stream].addCue(new b(h.startTime+this.timestampOffset,h.endTime+this.timestampOffset,h.text))},g),f){var a=ii(g.mediaSource_.duration);if(f.forEach(function(h){var k=h.cueTime+this.timestampOffset;!("number"!=typeof k||
x.isNaN(k)||0>k)&&k<1/0&&h.frames.forEach(function(l){var m=new b(k,k,l.value||l.url||l.data||"");m.frame=l;m.value=l;(function(n){Object.defineProperties(n.frame,{id:{get:function(){return D.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),n.value.key}},value:{get:function(){return D.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),n.value.data}},privateData:{get:function(){return D.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),
n.value.data}}})})(m);this.metadataTrack_.addCue(m)},this)},g),g.metadataTrack_&&g.metadataTrack_.cues&&g.metadataTrack_.cues.length){g=g.metadataTrack_.cues;c=[];for(f=0;fx.performance.now()-d&&(h.preventDefault(),
this.trigger("tap"))})},f.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var b,a=ka(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){a();this.clearInterval(b);b=this.setInterval(a,250)});var d=function(e){a();this.clearInterval(b)};this.on("touchmove",a);this.on("touchend",d);this.on("touchcancel",d)}},f.setTimeout=function(b,a){var d,e=this;return b=ka(this,b),this.clearTimersOnDispose_(),d=x.setTimeout(function(){e.setTimeoutIds_.has(d)&&
e.setTimeoutIds_["delete"](d);b()},a),this.setTimeoutIds_.add(d),d},f.clearTimeout=function(b){return this.setTimeoutIds_.has(b)&&(this.setTimeoutIds_["delete"](b),x.clearTimeout(b)),b},f.setInterval=function(b,a){b=ka(this,b);this.clearTimersOnDispose_();var d=x.setInterval(b,a);return this.setIntervalIds_.add(d),d},f.clearInterval=function(b){return this.setIntervalIds_.has(b)&&(this.setIntervalIds_["delete"](b),x.clearInterval(b)),b},f.requestAnimationFrame=function(b){var a,d=this;return this.supportsRaf_?
(this.clearTimersOnDispose_(),b=ka(this,b),a=x.requestAnimationFrame(function(){d.rafIds_.has(a)&&d.rafIds_["delete"](a);b()}),this.rafIds_.add(a),a):this.setTimeout(b,1E3/60)},f.cancelAnimationFrame=function(b){return this.supportsRaf_?(this.rafIds_.has(b)&&(this.rafIds_["delete"](b),x.cancelAnimationFrame(b)),b):this.clearTimeout(b)},f.clearTimersOnDispose_=function(){var b=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["rafIds_","cancelAnimationFrame"],
["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(a){b[a[0]].forEach(b[a[1]],b)});b.clearingTimersOnDispose_=!1}))},c.registerComponent=function(b,a){if("string"!=typeof b||!b)throw Error('Illegal component name, "'+b+'"; must be a non-empty string.');var d,e=c.getComponent("Tech");e=e&&e.isTech(a);var h=c===a||c.prototype.isPrototypeOf(a.prototype);if(e||!h)throw d=e?"techs must be registered using Tech.registerTech()":"must be a Component subclass",Error('Illegal component, "'+
b+'"; '+d+".");b=Ca(b);c.components_||(c.components_={});d=c.getComponent("Player");if("Player"===b&&d&&d.players){var k=d.players;d=Object.keys(k);if(k&&0wf&&537>Dl,Ki=/Firefox/i.test(Ja),id=/Edg/i.test(Ja),Jb=!id&&(/Chrome/i.test(Ja)||/CriOS/i.test(Ja)),Li=(tf=Ja.match(/(Chrome|CriOS)\/(\d+)/))&&tf[2]?parseFloat(tf[2]):null,jd=(uf=/MSIE\s(\d+)\.\d/.exec(Ja),!(vf=uf&&parseFloat(uf[1]))&&/Trident\/7.0/i.test(Ja)&&/rv:11.0/.test(Ja)&&(vf=11),vf),xf=/Safari/i.test(Ja)&&!Jb&&!Qb&&!id,Mi=/Windows/i.test(Ja),Bc=Fa()&&("ontouchstart"in
x||x.navigator.maxTouchPoints||x.DocumentTouch&&x.document instanceof x.DocumentTouch),yf=/iPad/i.test(Ja)||xf&&Bc&&!/iPhone/i.test(Ja),zf=/iPhone/i.test(Ja)&&!yf,ub=zf||yf||Ii,Af=(xf||ub)&&!Jb,Fl=Object.freeze({__proto__:null,IS_IPOD:Ii,IOS_VERSION:El,IS_ANDROID:Qb,ANDROID_VERSION:wf,IS_NATIVE_ANDROID:Ji,IS_FIREFOX:Ki,IS_EDGE:id,IS_CHROME:Jb,CHROME_VERSION:Li,IE_VERSION:jd,IS_SAFARI:xf,IS_WINDOWS:Mi,TOUCH_ENABLED:Bc,IS_IPAD:yf,IS_IPHONE:zf,IS_IOS:ub,IS_ANY_SAFARI:Af}),Bf={prefixed:!0},Wd=["requestFullscreen exitFullscreen fullscreenElement fullscreenEnabled fullscreenchange fullscreenerror fullscreen".split(" "),
"webkitRequestFullscreen webkitExitFullscreen webkitFullscreenElement webkitFullscreenEnabled webkitfullscreenchange webkitfullscreenerror -webkit-full-screen".split(" "),"mozRequestFullScreen mozCancelFullScreen mozFullScreenElement mozFullScreenEnabled mozfullscreenchange mozfullscreenerror -moz-full-screen".split(" "),"msRequestFullscreen msExitFullscreen msFullscreenElement msFullscreenEnabled MSFullscreenChange MSFullscreenError -ms-fullscreen".split(" ")],Ni=Wd[0],Xd=0;for(;Xde;e++)a[String.fromCharCode(e)]=e-32;for(var e=48;58>e;e++)a[e-
48]=e;for(e=1;13>e;e++)a["f"+e]=e+111;for(e=0;10>e;e++)a["numpad "+e]=e+96;var h=f.names=f.title={};for(e in a)h[a[e]]=e;for(var k in d)a[k]=d[k]}),Cf=(fa.code,fa.codes,fa.aliases,fa.names,fa.title,"vjs-modal-dialog"),Dc=function(c){function f(a,d){var e;return(e=c.call(this,a,d)||this).opened_=e.hasBeenOpened_=e.hasBeenFilled_=!1,e.closeable(!e.options_.uncloseable),e.content(e.options_.content),e.contentEl_=X("div",{className:Cf+"-content"},{role:"document"}),e.descEl_=X("p",{className:Cf+"-description vjs-control-text",
id:e.el().getAttribute("aria-describedby")}),sa(e.descEl_,e.description()),e.el_.appendChild(e.descEl_),e.el_.appendChild(e.contentEl_),e}T(f,c);var b=f.prototype;return b.createEl=function(){return c.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},b.dispose=function(){this.previouslyActiveEl_=this.descEl_=this.contentEl_=null;c.prototype.dispose.call(this)},
b.buildCSSClass=function(){return Cf+" vjs-hidden "+c.prototype.buildCSSClass.call(this)},b.label=function(){return this.localize(this.options_.label||"Modal Window")},b.description=function(){var a=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(a+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),a},b.open=function(){if(!this.opened_){var a=this.player();this.trigger("beforemodalopen");this.opened_=
!0;!this.options_.fillAlways&&(this.hasBeenOpened_||this.hasBeenFilled_)||this.fill();this.wasPlaying_=!a.paused();this.options_.pauseOnOpen&&this.wasPlaying_&&a.pause();this.on("keydown",this.handleKeyDown);this.hadControls_=a.controls();a.controls(!1);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen");this.hasBeenOpened_=!0}},b.opened=function(a){return"boolean"==typeof a&&this[a?"open":"close"](),this.opened_},b.close=function(){if(this.opened_){var a=
this.player();this.trigger("beforemodalclose");this.opened_=!1;this.wasPlaying_&&this.options_.pauseOnOpen&&a.play();this.off("keydown",this.handleKeyDown);this.hadControls_&&a.controls(!0);this.hide();this.el().setAttribute("aria-hidden","true");this.trigger("modalclose");this.conditionalBlur_();this.options_.temporary&&this.dispose()}},b.closeable=function(a){if("boolean"==typeof a){a=this.closeable_=!!a;var d=this.getChild("closeButton");if(a&&!d){var e=this.contentEl_;this.contentEl_=this.el_;
d=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=e;this.on(d,"close",this.close)}!a&&d&&(this.off(d,"close",this.close),this.removeChild(d),d.dispose())}return this.closeable_},b.fill=function(){this.fillWith(this.content())},b.fillWith=function(a){var d=this.contentEl(),e=d.parentNode,h=d.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=!0;e.removeChild(d);this.empty();sg(d,a);this.trigger("modalfill");h?e.insertBefore(d,h):e.appendChild(d);(a=this.getChild("closeButton"))&&
e.appendChild(a.el_)},b.empty=function(){this.trigger("beforemodalempty");Nc(this.contentEl());this.trigger("modalempty")},b.content=function(a){return"undefined"!=typeof a&&(this.content_=a),this.content_},b.conditionalFocus_=function(){var a=J.activeElement,d=this.player_.el_;this.previouslyActiveEl_=null;!d.contains(a)&&d!==a||(this.previouslyActiveEl_=a,this.focus())},b.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},b.handleKeyDown=
function(a){if(a.stopPropagation(),fa.isEventKey(a,"Escape")&&this.closeable())return a.preventDefault(),void this.close();if(fa.isEventKey(a,"Tab")){for(var d,e=this.focusableEls_(),h=this.el_.querySelector(":focus"),k=0;k=q?w.push(v):v.startTime===v.endTime&&v.startTime<=q&&v.startTime+.5>=q&&w.push(v)}if(m=!1,w.length!==this.activeCues_.length)m=!0;else for(q=0;q=f)&&(this.set(c,f),!0)}};var ze=J.createElement("textarea"),mk={c:"span",i:"i",
b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Ng={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},nk={v:"title",lang:"lang"},Mg={rt:"ruby"},Og=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,
1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],
[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,
126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];Ae.prototype.applyStyles=function(c,f){for(var b in f=f||this.div,c)c.hasOwnProperty(b)&&(f.style[b]=c[b])};Ae.prototype.formatStyle=function(c,f){return 0===c?0:c+f};(Be.prototype=ye(Ae.prototype)).constructor=Be;Va.prototype.move=function(c,
f){switch(f=void 0!==f?f:this.lineHeight,c){case "+x":this.left+=f;this.right+=f;break;case "-x":this.left-=f;this.right-=f;break;case "+y":this.top+=f;this.bottom+=f;break;case "-y":this.top-=f,this.bottom-=f}};Va.prototype.overlaps=function(c){return this.leftc.left&&this.topc.top};Va.prototype.overlapsAny=function(c){for(var f=0;f=c.top&&this.bottom<=
c.bottom&&this.left>=c.left&&this.right<=c.right};Va.prototype.overlapsOppositeAxis=function(c,f){switch(f){case "+x":return this.leftc.right;case "+y":return this.topc.bottom}};Va.prototype.intersectPercentage=function(c){return Math.max(0,Math.min(this.right,c.right)-Math.max(this.left,c.left))*Math.max(0,Math.min(this.bottom,c.bottom)-Math.max(this.top,c.top))/(this.height*this.width)};Va.prototype.toCSSCompatValues=function(c){return{top:this.top-
c.top,bottom:c.bottom-this.bottom,left:this.left-c.left,right:c.right-this.right,height:this.height,width:this.width}};Va.getSimpleBoxPosition=function(c){var f=c.div?c.div.offsetHeight:c.tagName?c.offsetHeight:0,b=c.div?c.div.offsetWidth:c.tagName?c.offsetWidth:0,a=c.div?c.div.offsetTop:c.tagName?c.offsetTop:0;return{left:(c=c.div?c.div.getBoundingClientRect():c.tagName?c.getBoundingClientRect():c).left,right:c.right,top:c.top||a,height:c.height||f,bottom:c.bottom||a+(c.height||f),width:c.width||
b}};Rc.StringDecoder=function(){return{decode:function(c){if(!c)return"";if("string"!=typeof c)throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(c))}}};Rc.convertCueToDOMTree=function(c,f){return c&&f?Lg(c,f):null};Rc.processCues=function(c,f,b){if(!c||!f||!b)return null;for(;b.firstChild;)b.removeChild(b.firstChild);var a=c.document.createElement("div");if(a.style.position="absolute",a.style.left="0",a.style.right="0",a.style.top="0",a.style.bottom="0",a.style.margin=
"1.5%",b.appendChild(a),function(k){for(var l=0;lh.length;l--)d.el_.removeChild(e[l-1]);e.length=h.length})},f}(N);N.registerComponent("LoadProgressBar",Zl);var $l=function(c){function f(a,d){var e;return(e=c.call(this,a,d)||this).update=Vb(ka(ja(e),e.update),30),e}T(f,c);var b=f.prototype;return b.createEl=function(){return c.prototype.createEl.call(this,
"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},b.update=function(a,d,e){var h=ab(this.el_),k=ab(this.player_.el()),l=a.width*d;k&&h&&(d=a.left-k.left+l,a=a.width-l+(k.right-a.right),k=h.width/2,dk?k=0:k>h.width&&(k=h.width),this.el_.style.right="-"+k+"px",this.write(e))},b.write=function(a){sa(this.el_,a)},b.updateTime=function(a,d,e,h){var k=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_);this.rafId_=this.requestAnimationFrame(function(){var l=k.player_.duration();
if(k.player_.liveTracker&&k.player_.liveTracker.isLive()){l=k.player_.liveTracker.liveWindow();var m=l-d*l;l=(1>m?"":"-")+kc(m,l)}else l=kc(e,l);k.update(a,d,l);h&&h()})},f}(N);N.registerComponent("TimeTooltip",$l);var If=function(c){function f(a,d){var e;return(e=c.call(this,a,d)||this).update=Vb(ka(ja(e),e.update),30),e}T(f,c);var b=f.prototype;return b.createEl=function(){return c.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},b.update=
function(a,d){var e=this.getChild("timeTooltip");if(e){var h=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();e.updateTime(a,d,h)}},f}(N);If.prototype.options_={children:[]};ub||Qb||If.prototype.options_.children.push("timeTooltip");N.registerComponent("PlayProgressBar",If);var Yi=function(c){function f(a,d){var e;return(e=c.call(this,a,d)||this).update=Vb(ka(ja(e),e.update),30),e}T(f,c);var b=f.prototype;return b.createEl=function(){return c.prototype.createEl.call(this,
"div",{className:"vjs-mouse-display"})},b.update=function(a,d){var e=this,h=d*this.player_.duration();this.getChild("timeTooltip").updateTime(a,d,h,function(){e.el_.style.left=a.width*d+"px"})},f}(N);Yi.prototype.options_={children:["timeTooltip"]};N.registerComponent("MouseTimeDisplay",Yi);var Jf=function(c){function f(a,d){var e;return(e=c.call(this,a,d)||this).setEventHandlers_(),e}T(f,c);var b=f.prototype;return b.setEventHandlers_=function(){this.update_=ka(this,this.update);this.update=Vb(this.update_,
30);this.on(this.player_,["ended","durationchange","timeupdate"],this.update);this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update);this.updateInterval=null;this.on(this.player_,["playing"],this.enableInterval_);this.on(this.player_,["ended","pause","waiting"],this.disableInterval_);"hidden"in J&&"visibilityState"in J&&this.on(J,"visibilitychange",this.toggleVisibility_)},b.toggleVisibility_=function(a){J.hidden?this.disableInterval_(a):(this.enableInterval_(),this.update())},
b.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))},b.disableInterval_=function(a){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&a&&"ended"!==a.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},b.createEl=function(){return c.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},b.update=function(a){var d=this,e=c.prototype.update.call(this);
return this.requestAnimationFrame(function(){var h=d.player_.ended()?d.player_.duration():d.getCurrentTime_(),k=d.player_.liveTracker,l=d.player_.duration();k&&k.isLive()&&(l=d.player_.liveTracker.liveCurrentTime());d.percent_!==e&&(d.el_.setAttribute("aria-valuenow",(100*e).toFixed(2)),d.percent_=e);d.currentTime_===h&&d.duration_===l||(d.el_.setAttribute("aria-valuetext",d.localize("progress bar timing: currentTime\x3d{1} duration\x3d{2}",[kc(h,l),kc(l,l)],"{1} of {2}")),d.currentTime_=h,d.duration_=
l);d.bar&&d.bar.update(ab(d.el()),d.getProgress())}),e},b.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},b.getPercent=function(){var a,d=this.getCurrentTime_(),e=this.player_.liveTracker;return e&&e.isLive()?(a=(d-e.seekableStart())/e.liveWindow(),e.atLiveEdge()&&(a=1)):a=d/this.player_.duration(),a},b.handleMouseDown=function(a){ic(a)&&(a.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),
this.player_.pause(),c.prototype.handleMouseDown.call(this,a))},b.handleMouseMove=function(a){if(ic(a)){var d;a=this.calculateDistance(a);var e=this.player_.liveTracker;if(e&&e.isLive()){if(.99<=a)return void e.seekToLiveEdge();var h=e.seekableStart(),k=e.liveCurrentTime();if(k<=(d=h+a*e.liveWindow())&&(d=k),d<=h&&(d=h+.1),d===1/0)return}else(d=a*this.player_.duration())===this.player_.duration()&&(d-=.1);this.player_.currentTime(d)}},b.enable=function(){c.prototype.enable.call(this);var a=this.getChild("mouseTimeDisplay");
a&&a.show()},b.disable=function(){c.prototype.disable.call(this);var a=this.getChild("mouseTimeDisplay");a&&a.hide()},b.handleMouseUp=function(a){c.prototype.handleMouseUp.call(this,a);a&&a.stopPropagation();this.player_.scrubbing(!1);this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0});this.videoWasPlaying?Zb(this.player_.play()):this.update_()},b.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},b.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-
5)},b.handleAction=function(a){this.player_.paused()?this.player_.play():this.player_.pause()},b.handleKeyDown=function(a){fa.isEventKey(a,"Space")||fa.isEventKey(a,"Enter")?(a.preventDefault(),a.stopPropagation(),this.handleAction(a)):fa.isEventKey(a,"Home")?(a.preventDefault(),a.stopPropagation(),this.player_.currentTime(0)):fa.isEventKey(a,"End")?(a.preventDefault(),a.stopPropagation(),this.player_.currentTime(this.player_.duration())):/^[0-9]$/.test(fa(a))?(a.preventDefault(),a.stopPropagation(),
a=10*(fa.codes[fa(a)]-fa.codes[0])/100,this.player_.currentTime(this.player_.duration()*a)):fa.isEventKey(a,"PgDn")?(a.preventDefault(),a.stopPropagation(),this.player_.currentTime(this.player_.currentTime()-60)):fa.isEventKey(a,"PgUp")?(a.preventDefault(),a.stopPropagation(),this.player_.currentTime(this.player_.currentTime()+60)):c.prototype.handleKeyDown.call(this,a)},b.dispose=function(){this.disableInterval_();this.off(this.player_,["ended","durationchange","timeupdate"],this.update);this.player_.liveTracker&&
this.on(this.player_.liveTracker,"liveedgechange",this.update);this.off(this.player_,["playing"],this.enableInterval_);this.off(this.player_,["ended","pause","waiting"],this.disableInterval_);"hidden"in J&&"visibilityState"in J&&this.off(J,"visibilitychange",this.toggleVisibility_);c.prototype.dispose.call(this)},f}(Hf);Jf.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};ub||Qb||Jf.prototype.options_.children.splice(1,0,"mouseTimeDisplay");N.registerComponent("SeekBar",
Jf);var Zi=function(c){function f(a,d){var e;return(e=c.call(this,a,d)||this).handleMouseMove=Vb(ka(ja(e),e.handleMouseMove),30),e.throttledHandleMouseSeek=Vb(ka(ja(e),e.handleMouseSeek),30),e.enable(),e}T(f,c);var b=f.prototype;return b.createEl=function(){return c.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},b.handleMouseMove=function(a){var d=this.getChild("seekBar");if(d){var e=d.getChild("playProgressBar"),h=d.getChild("mouseTimeDisplay");if(e||h){var k=
d.el(),l=ab(k);a=Tb(k,a).x;a=Tc(0,1,a);h&&h.update(l,a);e&&e.update(l,d.getProgress())}}},b.handleMouseSeek=function(a){var d=this.getChild("seekBar");d&&d.handleMouseMove(a)},b.enabled=function(){return this.enabled_},b.disable=function(){this.children().forEach(function(a){return a.disable&&a.disable()});this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},
b.enable=function(){this.children().forEach(function(a){return a.enable&&a.enable()});this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},b.handleMouseDown=function(a){var d=this.el_.ownerDocument,e=this.getChild("seekBar");e&&e.handleMouseDown(a);this.on(d,"mousemove",this.throttledHandleMouseSeek);this.on(d,"touchmove",this.throttledHandleMouseSeek);this.on(d,"mouseup",this.handleMouseUp);
this.on(d,"touchend",this.handleMouseUp)},b.handleMouseUp=function(a){var d=this.el_.ownerDocument,e=this.getChild("seekBar");e&&e.handleMouseUp(a);this.off(d,"mousemove",this.throttledHandleMouseSeek);this.off(d,"touchmove",this.throttledHandleMouseSeek);this.off(d,"mouseup",this.handleMouseUp);this.off(d,"touchend",this.handleMouseUp)},f}(N);Zi.prototype.options_={children:["seekBar"]};N.registerComponent("ProgressControl",Zi);var $i=function(c){function f(a,d){var e;return(e=c.call(this,a,d)||
this).on(a,["enterpictureinpicture","leavepictureinpicture"],e.handlePictureInPictureChange),J.pictureInPictureEnabled||e.disable(),e}T(f,c);var b=f.prototype;return b.buildCSSClass=function(){return"vjs-picture-in-picture-control "+c.prototype.buildCSSClass.call(this)},b.handlePictureInPictureChange=function(a){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture")},b.handleClick=function(a){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():
this.player_.requestPictureInPicture()},f}(vb);$i.prototype.controlText_="Picture-in-Picture";N.registerComponent("PictureInPictureToggle",$i);var aj=function(c){function f(a,d){var e;return(e=c.call(this,a,d)||this).on(a,"fullscreenchange",e.handleFullscreenChange),!1===J[a.fsApi_.fullscreenEnabled]&&e.disable(),e}T(f,c);var b=f.prototype;return b.buildCSSClass=function(){return"vjs-fullscreen-control "+c.prototype.buildCSSClass.call(this)},b.handleFullscreenChange=function(a){this.player_.isFullscreen()?
this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},b.handleClick=function(a){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},f}(vb);aj.prototype.controlText_="Fullscreen";N.registerComponent("FullscreenToggle",aj);var am=function(c){function f(){return c.apply(this,arguments)||this}return T(f,c),f.prototype.createEl=function(){return c.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'\x3cspan class\x3d"vjs-control-text"\x3e\x3c/span\x3e'})},
f}(N);N.registerComponent("VolumeLevel",am);var Kf=function(c){function f(a,d){var e;return(e=c.call(this,a,d)||this).on("slideractive",e.updateLastVolume_),e.on(a,"volumechange",e.updateARIAAttributes),a.ready(function(){return e.updateARIAAttributes()}),e}T(f,c);var b=f.prototype;return b.createEl=function(){return c.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},b.handleMouseDown=function(a){ic(a)&&
c.prototype.handleMouseDown.call(this,a)},b.handleMouseMove=function(a){ic(a)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(a)))},b.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},b.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},b.stepForward=function(){this.checkMuted();this.player_.volume(this.player_.volume()+.1)},b.stepBack=function(){this.checkMuted();this.player_.volume(this.player_.volume()-.1)},b.updateARIAAttributes=function(a){a=
this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",a);this.el_.setAttribute("aria-valuetext",a+"%")},b.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},b.updateLastVolume_=function(){var a=this,d=this.player_.volume();this.one("sliderinactive",function(){0===a.player_.volume()&&a.player_.lastVolume_(d)})},f}(Hf);Kf.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};Kf.prototype.playerEvent="volumechange";N.registerComponent("VolumeBar",
Kf);var bj=function(c){function f(a,d){var e;return void 0===d&&(d={}),d.vertical=d.vertical||!1,"undefined"!=typeof d.volumeBar&&!yb(d.volumeBar)||(d.volumeBar=d.volumeBar||{},d.volumeBar.vertical=d.vertical),e=c.call(this,a,d)||this,function(h,k){k.tech_&&!k.tech_.featuresVolumeControl&&h.addClass("vjs-hidden");h.on(k,"loadstart",function(){k.tech_.featuresVolumeControl?h.removeClass("vjs-hidden"):h.addClass("vjs-hidden")})}(ja(e),a),e.throttledHandleMouseMove=Vb(ka(ja(e),e.handleMouseMove),30),
e.on("mousedown",e.handleMouseDown),e.on("touchstart",e.handleMouseDown),e.on(e.volumeBar,["focus","slideractive"],function(){e.volumeBar.addClass("vjs-slider-active");e.addClass("vjs-slider-active");e.trigger("slideractive")}),e.on(e.volumeBar,["blur","sliderinactive"],function(){e.volumeBar.removeClass("vjs-slider-active");e.removeClass("vjs-slider-active");e.trigger("sliderinactive")}),e}T(f,c);var b=f.prototype;return b.createEl=function(){var a="vjs-volume-horizontal";return this.options_.vertical&&
(a="vjs-volume-vertical"),c.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+a})},b.handleMouseDown=function(a){a=this.el_.ownerDocument;this.on(a,"mousemove",this.throttledHandleMouseMove);this.on(a,"touchmove",this.throttledHandleMouseMove);this.on(a,"mouseup",this.handleMouseUp);this.on(a,"touchend",this.handleMouseUp)},b.handleMouseUp=function(a){a=this.el_.ownerDocument;this.off(a,"mousemove",this.throttledHandleMouseMove);this.off(a,"touchmove",this.throttledHandleMouseMove);
this.off(a,"mouseup",this.handleMouseUp);this.off(a,"touchend",this.handleMouseUp)},b.handleMouseMove=function(a){this.volumeBar.handleMouseMove(a)},f}(N);bj.prototype.options_={children:["volumeBar"]};N.registerComponent("VolumeControl",bj);var cj=function(c){function f(a,d){var e;return e=c.call(this,a,d)||this,function(h,k){k.tech_&&!k.tech_.featuresMuteControl&&h.addClass("vjs-hidden");h.on(k,"loadstart",function(){k.tech_.featuresMuteControl?h.removeClass("vjs-hidden"):h.addClass("vjs-hidden")})}(ja(e),
a),e.on(a,["loadstart","volumechange"],e.update),e}T(f,c);var b=f.prototype;return b.buildCSSClass=function(){return"vjs-mute-control "+c.prototype.buildCSSClass.call(this)},b.handleClick=function(a){a=this.player_.volume();var d=this.player_.lastVolume_();0===a?(this.player_.volume(.1>d?.1:d),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())},b.update=function(a){this.updateIcon_();this.updateControlText_()},b.updateIcon_=function(){var a=this.player_.volume(),d=3;ub&&this.player_.tech_&&
this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted);0===a||this.player_.muted()?d=0:.33>a?d=1:.67>a&&(d=2);for(a=0;4>a;a++)Ka(this.el_,"vjs-vol-"+a);Y(this.el_,"vjs-vol-"+d)},b.updateControlText_=function(){var a=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==a&&this.controlText(a)},f}(vb);cj.prototype.controlText_="Mute";N.registerComponent("MuteToggle",cj);var dj=function(c){function f(a,d){var e;return void 0===d&&(d={}),"undefined"!=typeof d.inline?
d.inline=d.inline:d.inline=!0,"undefined"!=typeof d.volumeControl&&!yb(d.volumeControl)||(d.volumeControl=d.volumeControl||{},d.volumeControl.vertical=!d.inline),(e=c.call(this,a,d)||this).on(a,["loadstart"],e.volumePanelState_),e.on(e.muteToggle,"keyup",e.handleKeyPress),e.on(e.volumeControl,"keyup",e.handleVolumeControlKeyUp),e.on("keydown",e.handleKeyPress),e.on("mouseover",e.handleMouseOver),e.on("mouseout",e.handleMouseOut),e.on(e.volumeControl,["slideractive"],e.sliderActive_),e.on(e.volumeControl,
["sliderinactive"],e.sliderInactive_),e}T(f,c);var b=f.prototype;return b.sliderActive_=function(){this.addClass("vjs-slider-active")},b.sliderInactive_=function(){this.removeClass("vjs-slider-active")},b.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden");this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},b.createEl=function(){var a="vjs-volume-panel-horizontal";
return this.options_.inline||(a="vjs-volume-panel-vertical"),c.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+a})},b.dispose=function(){this.handleMouseOut();c.prototype.dispose.call(this)},b.handleVolumeControlKeyUp=function(a){fa.isEventKey(a,"Esc")&&this.muteToggle.focus()},b.handleMouseOver=function(a){this.addClass("vjs-hover");kb(J,"keyup",ka(this,this.handleKeyPress))},b.handleMouseOut=function(a){this.removeClass("vjs-hover");Pa(J,"keyup",ka(this,this.handleKeyPress))},
b.handleKeyPress=function(a){fa.isEventKey(a,"Esc")&&this.handleMouseOut()},f}(N);dj.prototype.options_={children:["muteToggle","volumeControl"]};N.registerComponent("VolumePanel",dj);var Lf=function(c){function f(a,d){var e;return e=c.call(this,a,d)||this,d&&(e.menuButton_=d.menuButton),e.focusedChild_=-1,e.on("keydown",e.handleKeyDown),e.boundHandleBlur_=ka(ja(e),e.handleBlur),e.boundHandleTapClick_=ka(ja(e),e.handleTapClick),e}T(f,c);var b=f.prototype;return b.addEventListenerForItem=function(a){a instanceof
N&&(this.on(a,"blur",this.boundHandleBlur_),this.on(a,["tap","click"],this.boundHandleTapClick_))},b.removeEventListenerForItem=function(a){a instanceof N&&(this.off(a,"blur",this.boundHandleBlur_),this.off(a,["tap","click"],this.boundHandleTapClick_))},b.removeChild=function(a){"string"==typeof a&&(a=this.getChild(a));this.removeEventListenerForItem(a);c.prototype.removeChild.call(this,a)},b.addItem=function(a){(a=this.addChild(a))&&this.addEventListenerForItem(a)},b.createEl=function(){this.contentEl_=
X(this.options_.contentElType||"ul",{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");var a=c.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return a.appendChild(this.contentEl_),kb(a,"click",function(d){d.preventDefault();d.stopImmediatePropagation()}),a},b.dispose=function(){this.boundHandleTapClick_=this.boundHandleBlur_=this.contentEl_=null;c.prototype.dispose.call(this)},b.handleBlur=function(a){var d=a.relatedTarget||J.activeElement;
this.children().some(function(e){return e.el()===d})||(a=this.menuButton_)&&a.buttonPressed_&&d!==a.el().firstChild&&a.unpressButton()},b.handleTapClick=function(a){if(this.menuButton_){this.menuButton_.unpressButton();var d=this.children();Array.isArray(d)&&(d=d.filter(function(e){return e.el()===a.target})[0])&&"CaptionSettingsMenuItem"!==d.name()&&this.menuButton_.focus()}},b.handleKeyDown=function(a){fa.isEventKey(a,"Left")||fa.isEventKey(a,"Down")?(a.preventDefault(),a.stopPropagation(),this.stepForward()):
(fa.isEventKey(a,"Right")||fa.isEventKey(a,"Up"))&&(a.preventDefault(),a.stopPropagation(),this.stepBack())},b.stepForward=function(){var a=0;void 0!==this.focusedChild_&&(a=this.focusedChild_+1);this.focus(a)},b.stepBack=function(){var a=0;void 0!==this.focusedChild_&&(a=this.focusedChild_-1);this.focus(a)},b.focus=function(a){void 0===a&&(a=0);var d=this.children().slice();d.length&&d[0].className&&/vjs-menu-title/.test(d[0].className)&&d.shift();0a?a=0:a>=d.length&&(a=d.length-1),
d[this.focusedChild_=a].el_.focus())},f}(N);N.registerComponent("Menu",Lf);var Mf=function(c){function f(a,d){var e;void 0===d&&(d={});(e=c.call(this,a,d)||this).menuButton_=new vb(a,d);e.menuButton_.controlText(e.controlText_);e.menuButton_.el_.setAttribute("aria-haspopup","true");var h=vb.prototype.buildCSSClass();return e.menuButton_.el_.className=e.buildCSSClass()+" "+h,e.menuButton_.removeClass("vjs-control"),e.addChild(e.menuButton_),e.update(),e.enabled_=!0,e.on(e.menuButton_,"tap",e.handleClick),
e.on(e.menuButton_,"click",e.handleClick),e.on(e.menuButton_,"keydown",e.handleKeyDown),e.on(e.menuButton_,"mouseenter",function(){e.addClass("vjs-hover");e.menu.show();kb(J,"keyup",ka(ja(e),e.handleMenuKeyUp))}),e.on("mouseleave",e.handleMouseLeave),e.on("keydown",e.handleSubmenuKeyDown),e}T(f,c);var b=f.prototype;return b.update=function(){var a=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu));this.menu=a;this.addChild(a);this.buttonPressed_=!1;this.menuButton_.el_.setAttribute("aria-expanded",
"false");this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},b.createMenu=function(){var a=new Lf(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var d=X("li",{className:"vjs-menu-title",innerHTML:Ca(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;d=new N(this.player_,{el:d});a.addItem(d)}if(this.items=this.createItems(),this.items)for(d=0;d=(d=c.call(this,b,a)||this).items.length&&d.hide(),!e)return ja(d);var h=ka(ja(d),d.update);return e.addEventListener("removetrack",h),e.addEventListener("addtrack",h),d.player_.on("ready",h),d.player_.on("dispose",function(){e.removeEventListener("removetrack",
h);e.removeEventListener("addtrack",h)}),d}return T(f,c),f}(Mf);N.registerComponent("TrackButton",Nf);var bm="Tab Esc Up Down Right Left".split(" "),md=function(c){function f(a,d){var e;return(e=c.call(this,a,d)||this).selectable=d.selectable,e.isSelected_=d.selected||!1,e.multiSelectable=d.multiSelectable,e.selected(e.isSelected_),e.selectable?e.multiSelectable?e.el_.setAttribute("role","menuitemcheckbox"):e.el_.setAttribute("role","menuitemradio"):e.el_.setAttribute("role","menuitem"),e}T(f,c);
var b=f.prototype;return b.createEl=function(a,d,e){return this.nonIconControl=!0,c.prototype.createEl.call(this,"li",ca({className:"vjs-menu-item",innerHTML:'\x3cspan class\x3d"vjs-menu-item-text"\x3e'+this.localize(this.options_.label)+"\x3c/span\x3e",tabIndex:-1},d),e)},b.handleKeyDown=function(a){bm.some(function(d){return fa.isEventKey(a,d)})||c.prototype.handleKeyDown.call(this,a)},b.handleClick=function(a){this.selected(!0)},b.selected=function(a){this.selectable&&(a?(this.addClass("vjs-selected"),
this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},f}($d);N.registerComponent("MenuItem",md);var nd=function(c){function f(a,d){function e(){for(var q=arguments.length,w=Array(q),B=0;Ba){e=d[h];break}this.player().playbackRate(e)},b.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},b.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0this.options_.liveTolerance;this.timeupdateSeen_&&a!==1/0||(d=!1);d!==this.behindLiveEdge_&&(this.behindLiveEdge_=d,this.trigger("liveedgechange"))}},b.handleDurationchange=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},b.startTracking=function(){this.isTracking()||
(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLive_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLive_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked):(this.one(this.player_,"play",this.handlePlay),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate)))},b.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0;this.on(this.player_,"seeked",this.handleSeeked)},b.handleSeeked=
function(){var a=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=!this.skipNextSeeked_&&2Li)return!1;try{var c=V.TEST_VID.playbackRate;return V.TEST_VID.playbackRate=c/2+.1,c!==V.TEST_VID.playbackRate}catch(f){return!1}};V.canOverrideAttributes=
function(){try{var c=function(){};Object.defineProperty(J.createElement("video"),"src",{get:c,set:c});Object.defineProperty(J.createElement("audio"),"src",{get:c,set:c});Object.defineProperty(J.createElement("video"),"innerHTML",{get:c,set:c});Object.defineProperty(J.createElement("audio"),"innerHTML",{get:c,set:c})}catch(f){return!1}return!0};V.supportsNativeTextTracks=function(){return Af||ub&&Jb};V.supportsNativeVideoTracks=function(){return!(!V.TEST_VID||!V.TEST_VID.videoTracks)};V.supportsNativeAudioTracks=
function(){return!(!V.TEST_VID||!V.TEST_VID.audioTracks)};V.Events="loadstart suspend abort error emptied stalled loadedmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate progress play pause ratechange resize volumechange".split(" ");[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],
["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(c){var f=c[1];Ie(V.prototype,c[0],function(){return V[f]()},!0)});V.prototype.movingMediaElementInDOM=!ub;V.prototype.featuresFullscreenResize=!0;V.prototype.featuresProgressEvents=!0;V.prototype.featuresTimeupdateEvents=!0;V.patchCanPlayType=function(){4<=wf&&!Ki&&!Jb&&(be=V.TEST_VID&&V.TEST_VID.constructor.prototype.canPlayType,V.TEST_VID.constructor.prototype.canPlayType=
function(c){return c&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(c)?"maybe":be.call(this,c)})};V.unpatchCanPlayType=function(){var c=V.TEST_VID.constructor.prototype.canPlayType;return be&&(V.TEST_VID.constructor.prototype.canPlayType=be),c};V.patchCanPlayType();V.disposeMediaElement=function(c){if(c){for(c.parentNode&&c.parentNode.removeChild(c);c.hasChildNodes();)c.removeChild(c.firstChild);c.removeAttribute("src");if("function"==typeof c.load)try{c.load()}catch(f){}}};V.resetMediaElement=
function(c){if(c){for(var f=c.querySelectorAll("source"),b=f.length;b--;)c.removeChild(f[b]);c.removeAttribute("src");if("function"==typeof c.load)try{c.load()}catch(a){}}};"muted defaultMuted autoplay controls loop playsinline".split(" ").forEach(function(c){V.prototype[c]=function(){return this.el_[c]||this.el_.hasAttribute(c)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(c){V.prototype["set"+Ca(c)]=function(f){(this.el_[c]=f)?this.el_.setAttribute(c,c):this.el_.removeAttribute(c)}});
"paused currentTime buffered volume poster preload error seeking seekable ended playbackRate defaultPlaybackRate played networkState readyState videoWidth videoHeight crossOrigin".split(" ").forEach(function(c){V.prototype[c]=function(){return this.el_[c]}});"volume src poster preload playbackRate defaultPlaybackRate crossOrigin".split(" ").forEach(function(c){V.prototype["set"+Ca(c)]=function(f){this.el_[c]=f}});["pause","load","play"].forEach(function(c){V.prototype[c]=function(){return this.el_[c]()}});
ta.withSourceHandlers(V);V.nativeSourceHandler={};V.nativeSourceHandler.canPlayType=function(c){try{return V.TEST_VID.canPlayType(c)}catch(f){return""}};V.nativeSourceHandler.canHandleSource=function(c,f){if(c.type)return V.nativeSourceHandler.canPlayType(c.type);if(c.src){var b=ve(c.src);return V.nativeSourceHandler.canPlayType("video/"+b)}return""};V.nativeSourceHandler.handleSource=function(c,f,b){f.setSrc(c.src)};V.nativeSourceHandler.dispose=function(){};V.registerSourceHandler(V.nativeSourceHandler);
ta.registerTech("Html5",V);var vj="progress abort suspend emptied stalled loadedmetadata loadeddata timeupdate resize volumechange texttrackchange".split(" "),Xf={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Yf="tiny xsmall small medium large xlarge huge".split(" "),ce={};Yf.forEach(function(c){var f="x"===c.charAt(0)?"x-"+c.substring(1):c;ce[c]="vjs-layout-"+f});var hm={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Da=function(c){function f(a,
d,e){var h;if(a.id=a.id||d.id||"vjs_video_"+Lb++,(d=ca(f.getTagSettings(a),d)).initChildren=!1,d.createEl=!1,d.evented=!1,d.reportTouchActivity=!1,!d.language)if("function"==typeof a.closest){var k=a.closest("[lang]");k&&k.getAttribute&&(d.language=k.getAttribute("lang"))}else for(k=a;k&&1===k.nodeType;){if(za(k).hasOwnProperty("lang")){d.language=k.getAttribute("lang");break}k=k.parentNode}if((h=c.call(this,null,d,e)||this).boundDocumentFullscreenChange_=ka(ja(h),h.documentFullscreenChange_),h.boundFullWindowOnEscKey_=
ka(ja(h),h.fullWindowOnEscKey),h.isFullscreen_=!1,h.log=Di(h.id_),h.fsApi_=Bf,h.isPosterFromTech_=!1,h.queuedCallbacks_=[],h.isReady_=!1,h.hasStarted_=!1,h.userActive_=!1,!h.options_||!h.options_.techOrder||!h.options_.techOrder.length)throw Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(h.tag=a,h.tagAttributes=a&&za(a),h.language(h.options_.language),d.languages){var l={};Object.getOwnPropertyNames(d.languages).forEach(function(m){l[m.toLowerCase()]=
d.languages[m]});h.languages_=l}else h.languages_=f.prototype.options_.languages;h.resetCache_();h.poster_=d.poster||"";h.controls_=!!d.controls;a.controls=!1;a.removeAttribute("controls");h.changingSrc_=!1;h.playCallbacks_=[];h.playTerminatedQueue_=[];a.hasAttribute("autoplay")?h.autoplay(!0):h.autoplay(h.options_.autoplay);d.plugins&&Object.keys(d.plugins).forEach(function(m){if("function"!=typeof h[m])throw Error('plugin "'+m+'" does not exist');});h.scrubbing_=!1;h.el_=h.createEl();qe(ja(h),{eventBusKey:"el_"});
h.fsApi_.requestFullscreen&&(kb(J,h.fsApi_.fullscreenchange,h.boundDocumentFullscreenChange_),h.on(h.fsApi_.fullscreenchange,h.boundDocumentFullscreenChange_));h.fluid_&&h.on("playerreset",h.updateStyleEl_);e=ua(h.options_);d.plugins&&Object.keys(d.plugins).forEach(function(m){h[m](d.plugins[m])});h.options_.playerOptions=e;h.middleware_=[];h.initChildren();h.isAudio("audio"===a.nodeName.toLowerCase());h.controls()?h.addClass("vjs-controls-enabled"):h.addClass("vjs-controls-disabled");h.el_.setAttribute("role",
"region");h.isAudio()?h.el_.setAttribute("aria-label",h.localize("Audio Player")):h.el_.setAttribute("aria-label",h.localize("Video Player"));h.isAudio()&&h.addClass("vjs-audio");h.flexNotSupported_()&&h.addClass("vjs-no-flex");Bc&&h.addClass("vjs-touch-enabled");ub||h.addClass("vjs-workinghover");f.players[h.id_]=ja(h);return h.addClass("vjs-v7"),h.userActive(!0),h.reportUserActivity(),h.one("play",h.listenForUserActivity_),h.on("stageclick",h.handleStageClick_),h.on("keydown",h.handleKeyDown),h.breakpoints(h.options_.breakpoints),
h.responsive(h.options_.responsive),h}T(f,c);var b=f.prototype;return b.dispose=function(){var a=this;this.trigger("dispose");this.off("dispose");Pa(J,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);Pa(J,"keydown",this.boundFullWindowOnEscKey_);this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null);f.players[this.id_]=null;this.tag&&this.tag.player&&(this.tag.player=null);this.el_&&this.el_.player&&(this.el_.player=null);
this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_="");this.playerElIngest_&&(this.playerElIngest_=null);this.tag&&(this.tag=null);Ee[this.id()]=null;Za.names.forEach(function(d){(d=a[Za[d].getterName]())&&d.off&&d.off()});c.prototype.dispose.call(this)},b.createEl=function(){var a,d=this.tag,e=this.playerElIngest_=d.parentNode&&d.parentNode.hasAttribute&&d.parentNode.hasAttribute("data-vjs-player"),h="video-js"===this.tag.tagName.toLowerCase();e?a=this.el_=d.parentNode:h||(a=
this.el_=c.prototype.createEl.call(this,"div"));var k=za(d);if(h){a=this.el_=d;for(d=this.tag=J.createElement("video");a.children.length;)d.appendChild(a.firstChild);Ga(a,"video-js")||Y(a,"video-js");a.appendChild(d);e=this.playerElIngest_=a;Object.keys(a).forEach(function(q){try{d[q]=a[q]}catch(w){}})}if(d.setAttribute("tabindex","-1"),k.tabindex="-1",(jd||Jb&&Mi)&&(d.setAttribute("role","application"),k.role="application"),d.removeAttribute("width"),d.removeAttribute("height"),"width"in k&&delete k.width,
"height"in k&&delete k.height,Object.getOwnPropertyNames(k).forEach(function(q){h&&"class"===q||a.setAttribute(q,k[q]);h&&d.setAttribute(q,k[q])}),d.playerId=d.id,d.id+="_html5_api",d.className="vjs-tech",d.player=a.player=this,this.addClass("vjs-paused"),!0!==x.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=ug("vjs-styles-dimensions");var l=Mb(".vjs-styles-defaults"),m=Mb("head");m.insertBefore(this.styleEl_,l?l.nextSibling:m.firstChild)}this.fluid_=this.fill_=!1;this.width(this.options_.width);this.height(this.options_.height);
this.fill(this.options_.fill);this.fluid(this.options_.fluid);this.aspectRatio(this.options_.aspectRatio);this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);l=d.getElementsByTagName("a");for(m=0;ma&&(a=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",a),void(this.cache_.initTime=0)):(this.cache_.initTime=a,this.off("canplay",this.applyInitTime_),void this.one("canplay",this.applyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},
b.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},b.duration=function(a){if(void 0===a)return void 0!==this.cache_.duration?this.cache_.duration:NaN;0>(a=parseFloat(a))&&(a=1/0);a!==this.cache_.duration&&((this.cache_.duration=a)===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(a)||this.trigger("durationchange"))},b.remainingTime=function(){return this.duration()-this.currentTime()},b.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},
b.buffered=function(){var a=this.techGet_("buffered");return a&&a.length||(a=Yb(0,0)),a},b.bufferedPercent=function(){return Dg(this.buffered(),this.duration())},b.bufferedEnd=function(){var a=this.buffered(),d=this.duration();a=a.end(a.length-1);return d=n||(l=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},n))}},250)},b.playbackRate=function(a){if(void 0===a)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",
a)},b.defaultPlaybackRate=function(a){return void 0!==a?this.techCall_("setDefaultPlaybackRate",a):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},b.isAudio=function(a){if(void 0===a)return!!this.isAudio_;this.isAudio_=!!a},b.addTextTrack=function(a,d,e){if(this.tech_)return this.tech_.addTextTrack(a,d,e)},b.addRemoteTextTrack=function(a,d){if(this.tech_)return this.tech_.addRemoteTextTrack(a,d)},b.removeRemoteTextTrack=function(a){void 0===a&&(a={});var d=a.track;
if(d=d||a,this.tech_)return this.tech_.removeRemoteTextTrack(d)},b.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},b.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},b.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},b.language=function(a){if(void 0===a)return this.language_;this.language_=String(a).toLowerCase()},b.languages=function(){return ua(f.prototype.options_.languages,
this.languages_)},b.toJSON=function(){var a=ua(this.options_),d=a.tracks;a.tracks=[];for(var e=0;e=b)&&(D.hooks_[c]=D.hooks_[c].slice(),D.hooks_[c].splice(b,1),!0)},!0!==x.VIDEOJS_NO_DYNAMIC_STYLE&&Fa()){var de=Mb(".vjs-styles-defaults");if(!de){de=ug("vjs-styles-defaults");var Zf=Mb("head");Zf&&Zf.insertBefore(de,Zf.firstChild);vg(de,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}ke(1,D);D.VERSION=
"7.8.4";D.options=Da.prototype.options_;D.getPlayers=function(){return Da.players};D.getPlayer=function(c){var f=Da.players;if("string"==typeof c){c=Xg(c);var b=f[c];if(b)return b;c=Mb("#"+c)}if(O(c)&&(b=c,c=b.player,b=b.playerId,c||f[b]))return c||f[b]};D.getAllPlayers=function(){return Object.keys(Da.players).map(function(c){return Da.players[c]}).filter(Boolean)};D.players=Da.players;D.getComponent=N.getComponent;D.registerComponent=function(c,f){ta.isTech(f)&&ma.warn("The "+c+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)");
N.registerComponent.call(N,c,f)};D.getTech=ta.getTech;D.registerTech=ta.registerTech;D.use=function(c,f){$b[c]=$b[c]||[];$b[c].push(f)};Object.defineProperty(D,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(D.middleware,"TERMINATOR",{value:yd,writeable:!1,enumerable:!0});D.browser=Fl;D.TOUCH_ENABLED=Bc;D.extend=function(c,f){void 0===f&&(f={});var b=function(){c.apply(this,arguments)},a={},d;for(d in"object"==typeof f?(f.constructor!==Object.prototype.constructor&&(b=f.constructor),
a=f):"function"==typeof f&&(b=f),jm(b,c),c&&(b.super_=c),a)a.hasOwnProperty(d)&&(b.prototype[d]=a[d]);return b};D.mergeOptions=ua;D.bind=ka;D.registerPlugin=Bb.registerPlugin;D.deregisterPlugin=Bb.deregisterPlugin;D.plugin=function(c,f){return ma.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Bb.registerPlugin(c,f)};D.getPlugins=Bb.getPlugins;D.getPlugin=Bb.getPlugin;D.getPluginVersion=Bb.getPluginVersion;D.addLanguage=function(c,f){var b;return c=(""+c).toLowerCase(),
D.options.languages=ua(D.options.languages,((b={})[c]=f,b)),D.options.languages[c]};D.log=ma;D.createLogger=Di;D.createTimeRange=D.createTimeRanges=Yb;D.formatTime=kc;D.setFormatTime=function(c){Ge=c};D.resetFormatTime=function(){Ge=Sg};D.parseUrl=ue;D.isCrossOrigin=xd;D.EventTarget=Ta;D.on=kb;D.one=vd;D.off=Pa;D.trigger=jc;D.xhr=we;D.TextTrack=kd;D.AudioTrack=Si;D.VideoTrack=Ti;"isEl isTextNode createEl hasClass addClass removeClass toggleClass setAttributes getAttributes emptyEl appendContent insertContent".split(" ").forEach(function(c){D[c]=
function(){return ma.warn("videojs."+c+"() is deprecated; use videojs.dom."+c+"() instead"),Fi[c].apply(null,arguments)}});D.computedStyle=hc;D.dom=Fi;D.url=Ol;D.defineLazyProperty=Ie;var Ye=ia(function(c,f){var b=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/;var a=/^([^\/?#]*)(.*)$/;var d=/(?:\/|^)\.(?=\/)/g;var e=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g;var h={buildAbsoluteURL:function(k,l,m){if(m=m||{},k=k.trim(),!(l=l.trim())){if(!m.alwaysNormalize)return k;
m=h.parseURL(k);if(!m)throw Error("Error trying to parse base URL.");return m.path=h.normalizePath(m.path),h.buildURLFromParts(m)}var n=h.parseURL(l);if(!n)throw Error("Error trying to parse relative URL.");if(n.scheme)return m.alwaysNormalize?(n.path=h.normalizePath(n.path),h.buildURLFromParts(n)):l;l=h.parseURL(k);if(!l)throw Error("Error trying to parse base URL.");!l.netLoc&&l.path&&"/"!==l.path[0]&&(k=a.exec(l.path),l.netLoc=k[1],l.path=k[2]);l.netLoc&&!l.path&&(l.path="/");k={scheme:l.scheme,
netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};n.netLoc||(k.netLoc=l.netLoc,"/"===n.path[0])||(n.path?(l=l.path,l=l.substring(0,l.lastIndexOf("/")+1)+n.path,k.path=h.normalizePath(l)):(k.path=l.path,n.params||(k.params=l.params,n.query||(k.query=l.query))));return null===k.path&&(k.path=m.alwaysNormalize?h.normalizePath(n.path):n.path),h.buildURLFromParts(k)},parseURL:function(k){return(k=b.exec(k))?{scheme:k[1]||"",netLoc:k[2]||"",path:k[3]||"",params:k[4]||"",query:k[5]||
"",fragment:k[6]||""}:null},normalizePath:function(k){for(k=k.split("").reverse().join("").replace(d,"");k.length!==(k=k.replace(e,"")).length;);return k.split("").reverse().join("")},buildURLFromParts:function(k){return k.scheme+k.netLoc+k.path+k.params+k.query+k.fragment}};c.exports=h}),$f=function(){function c(){this.listeners={}}var f=c.prototype;return f.on=function(b,a){this.listeners[b]||(this.listeners[b]=[]);this.listeners[b].push(a)},f.off=function(b,a){if(!this.listeners[b])return!1;var d=
this.listeners[b].indexOf(a);return this.listeners[b].splice(d,1),-1q.duration?this.trigger("warn",{message:"ignoring invalid target duration: "+q.duration}):this.manifest.targetDuration=q.duration},totalduration:function(){!isFinite(q.duration)||0>q.duration?this.trigger("warn",
{message:"ignoring invalid total duration: "+q.duration}):this.manifest.totalDuration=q.duration},start:function(){q.attributes&&!isNaN(q.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:q.attributes["TIME-OFFSET"],precise:q.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){l.cueOut=q.data},"cue-out-cont":function(){l.cueOutCont=q.data},"cue-in":function(){l.cueIn=q.data}}[q.tagType]||function(){}).call(h)},
uri:function(){l.uri=q.uri;k.push(l);!this.manifest.targetDuration||"duration"in l||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),l.duration=this.manifest.targetDuration);e&&(l.key=e);l.timeline=n;d&&(l.map=d);l={}},comment:function(){},custom:function(){q.segment?(l.custom=l.custom||{},l.custom[q.customType]=q.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[q.customType]=q.data)}})[q.type].call(h)}),a}Je(f,c);var b=f.prototype;return b.push=
function(a){this.lineStream.push(a)},b.end=function(){this.lineStream.push("\n")},b.addParser=function(a){this.parseStream.addParser(a)},b.addTagMapper=function(a){this.parseStream.addTagMapper(a)},f}($f),yj=Zg(Ye),zj=Zg(x),Se=function(c,f){return/^[a-z]+:/i.test(f)?f:(/\/\//i.test(c)||(c=yj.buildAbsoluteURL(zj.location&&zj.location.href||"",c)),yj.buildAbsoluteURL(c,f))},pd,Fh=(pd=x)&&"object"==typeof pd&&"default"in pd?pd["default"]:pd,ag=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,
Aj=new RegExp("[\\-\\.0-9"+ag.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Bj=new RegExp("^"+ag.source+Aj.source+"*(?::"+ag.source+Aj.source+"*)?$");$g.prototype={parse:function(c,f,b){var a=this.domBuilder;a.startDocument();ch(f,f={});(function(d,e,h,k,l){function m(W){var gb=W.slice(1,-1);gb in h?W=h[gb]:"#"===gb.charAt(0)?(W=parseInt(gb.substr(1).replace("x","0x")),65535>10),W=String.fromCharCode(gb,56320+(1023&W))):W=String.fromCharCode(W)):W=(l.error("entity not found:"+
W),W);return W}function n(W){if(KH){if(!d.substr(K).match(/^\s*$/)){var Q=k.doc,aa=Q.createTextNode(d.substr(K));Q.appendChild(aa);k.currentElement=aa}break}switch(KM?(Z=d.substring(H+2).replace(/[\s<].*/,""),l.error("end tag name: "+Z+" is not complete:"+S.tagName),M=H+1+Z.length):Z.match(/\s)&&(Z=Z.replace(/[\s<].*/,""),l.error("end tag name: "+Z+" maybe not complete"),M=H+1+Z.length);var ea=S.localNSMap,ha=S.tagName==Z;if(ha||S.tagName&&S.tagName.toLowerCase()==Z.toLowerCase()){if(k.endElement(S.uri,S.localName,Z),ea)for(var va in ea)k.endPrefixMapping(va);ha||l.fatalError("end tag name: "+
Z+" is not match the current start tagName:"+S.tagName)}else e.push(S);M++;break;case "?":v&&q(H);M=Fk(d,H,k);break;case "!":v&&q(H);M=Ek(d,H,k,l);break;default:v&&q(H);var pa=new dh,wa=e[e.length-1].currentNSMap,Ma=(M=Bk(d,H,pa,wa,m,l),pa.length);if(!pa.closed&&Dk(d,M,pa.tagName,C)&&(pa.closed=!0,h.nbsp||l.warning("unclosed xml attribute")),v&&Ma){for(var Qa=ah(v,{}),wb=0;wb=n+q||n?new java.lang.String(m,n,q)+"":m}function h(m,n){m.currentElement?m.currentElement.appendChild(n):m.doc.appendChild(n)}b.prototype.parseFromString=function(m,n){var q=this.options,w=new k,B=q.domBuilder||new a,G=q.errorHandler,v=q.locator,C=q.xmlns||{},K={lt:"\x3c",gt:"\x3e",amp:"\x26",quot:'"',apos:"'"};return v&&B.setDocumentLocator(v),w.errorHandler=function(H,Q,aa){function M(ea){var ha=H[ea];!ha&&S&&(ha=2==H.length?function(va){H(ea,va)}:H);Z[ea]=ha&&function(va){var pa=ha;
var wa=aa?"\n@"+(aa.systemId||"")+"#[line:"+aa.lineNumber+",col:"+aa.columnNumber+"]":void 0;pa("[xmldom "+ea+"]\t"+va+wa)}||function(){}}if(!H){if(Q instanceof a)return Q;H=Q}var Z={},S=H instanceof Function;return aa=aa||{},M("warning"),M("error"),M("fatalError"),Z}(G,B,v),w.domBuilder=q.domBuilder||B,/\/x?html?$/.test(n)&&(K.nbsp="\u00a0",K.copy="\u00a9",C[""]="http://www.w3.org/1999/xhtml"),C.xml=C.xml||"http://www.w3.org/XML/1998/namespace",m?w.parse(m,C,K):w.errorHandler.error("invalid doc source"),
B.doc};a.prototype={startDocument:function(){this.doc=(new l).createDocument(null,null,null);this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(m,n,q,w){var B=this.doc;n=B.createElementNS(m,q||n);var G=w.length;h(this,n);this.currentElement=n;this.locator&&d(this.locator,n);for(var v=0;v>>2&63,bufferSize:c[13]<<16|c[14]<<8|c[15],maxBitrate:c[16]<<24|c[17]<<16|c[18]<<8|c[19],avgBitrate:c[20]<<24|c[21]<<16|c[22]<<8|c[23],decoderConfigDescriptor:{tag:c[24],length:c[25],audioObjectType:c[26]>>>3&31,samplingFrequencyIndex:(7&c[26])<<1|c[27]>>>7&1,channelConfiguration:c[27]>>>
3&15}}}},ftyp:function(c){var f=new DataView(c.buffer,c.byteOffset,c.byteLength);f={majorBrand:pc(c.subarray(0,4)),minorVersion:f.getUint32(4),compatibleBrands:[]};for(var b=8;b=a)e.push("\x3cspan style\x3d'color:red;'\x3eMALFORMED DATA\x3c/span\x3e");else switch(31&c[b]){case 1:e.push("slice_layer_without_partitioning_rbsp");break;case 5:e.push("slice_layer_without_partitioning_rbsp_idr");
break;case 6:e.push("sei_rbsp");break;case 7:e.push("seq_parameter_set_rbsp");break;case 8:e.push("pic_parameter_set_rbsp");break;case 9:e.push("access_unit_delimiter_rbsp");break;default:e.push("UNKNOWN NAL - "+c[b]&31)}return{byteLength:f,nals:e}},mdhd:function(c){var f,b=new DataView(c.buffer,c.byteOffset,c.byteLength),a=4;c={version:b.getUint8(0),flags:new Uint8Array(c.subarray(1,4)),language:""};return 1===c.version?(a+=4,c.creationTime=nb(b.getUint32(a)),a+=8,c.modificationTime=nb(b.getUint32(a)),
a+=4,c.timescale=b.getUint32(a),a+=8):(c.creationTime=nb(b.getUint32(a)),a+=4,c.modificationTime=nb(b.getUint32(a)),a+=4,c.timescale=b.getUint32(a),a+=4),c.duration=b.getUint32(a),a+=4,f=b.getUint16(a),c.language+=String.fromCharCode(96+(f>>10)),c.language+=String.fromCharCode(96+((992&f)>>5)),c.language+=String.fromCharCode(96+(31&f)),c},mdia:function(c){return{boxes:ib(c)}},mfhd:function(c){return{version:c[0],flags:new Uint8Array(c.subarray(1,4)),sequenceNumber:c[4]<<24|c[5]<<16|c[6]<<8|c[7]}},
minf:function(c){return{boxes:ib(c)}},mp4a:function(c){var f=new DataView(c.buffer,c.byteOffset,c.byteLength);f={dataReferenceIndex:f.getUint16(6),channelcount:f.getUint16(16),samplesize:f.getUint16(18),samplerate:f.getUint16(24)+f.getUint16(26)/65536};return 28>4,isDependedOn:(12&c[f])>>2,hasRedundancy:3&c[f]});return b},sidx:function(c){var f,b=new DataView(c.buffer,c.byteOffset,
c.byteLength),a={version:c[0],flags:new Uint8Array(c.subarray(1,4)),references:[],referenceId:b.getUint32(4),timescale:b.getUint32(8),earliestPresentationTime:b.getUint32(12),firstOffset:b.getUint32(16)},d=b.getUint16(22);for(f=24;d;f+=12,d--)a.references.push({referenceType:(128&c[f])>>>7,referencedSize:2147483647&b.getUint32(f),subsegmentDuration:b.getUint32(f+4),startsWithSap:!!(128&c[f+8]),sapType:(112&c[f+8])>>>4,sapDeltaTime:268435455&b.getUint32(f+8)});return a},smhd:function(c){return{version:c[0],
flags:new Uint8Array(c.subarray(1,4)),balance:c[4]+c[5]/256}},stbl:function(c){return{boxes:ib(c)}},stco:function(c){var f=new DataView(c.buffer,c.byteOffset,c.byteLength),b={version:c[0],flags:new Uint8Array(c.subarray(1,4)),chunkOffsets:[]},a=f.getUint32(4);for(c=8;a;c+=4,a--)b.chunkOffsets.push(f.getUint32(c));return b},stsc:function(c){var f=new DataView(c.buffer,c.byteOffset,c.byteLength),b=f.getUint32(4),a={version:c[0],flags:new Uint8Array(c.subarray(1,4)),sampleToChunks:[]};for(c=8;b;c+=12,
b--)a.sampleToChunks.push({firstChunk:f.getUint32(c),samplesPerChunk:f.getUint32(c+4),sampleDescriptionIndex:f.getUint32(c+8)});return a},stsd:function(c){return{version:c[0],flags:new Uint8Array(c.subarray(1,4)),sampleDescriptions:ib(c.subarray(8))}},stsz:function(c){var f,b=new DataView(c.buffer,c.byteOffset,c.byteLength),a={version:c[0],flags:new Uint8Array(c.subarray(1,4)),sampleSize:b.getUint32(4),entries:[]};for(f=12;f>>0};return 1===f.version&&(f.baseMediaDecodeTime*=Math.pow(2,32),f.baseMediaDecodeTime+=(c[8]<<
24|c[9]<<16|c[10]<<8|c[11])>>>0),f},tfhd:function(c){var f,b=new DataView(c.buffer,c.byteOffset,c.byteLength);c={version:c[0],flags:new Uint8Array(c.subarray(1,4)),trackId:b.getUint32(4)};var a=1&c.flags[2],d=2&c.flags[2],e=8&c.flags[2],h=16&c.flags[2],k=32&c.flags[2],l=65536&c.flags[0],m=131072&c.flags[0];return f=8,a&&(f+=4,c.baseDataOffset=b.getUint32(12),f+=4),d&&(c.sampleDescriptionIndex=b.getUint32(f),f+=4),e&&(c.defaultSampleDuration=b.getUint32(f),f+=4),h&&(c.defaultSampleSize=b.getUint32(f),
f+=4),k&&(c.defaultSampleFlags=b.getUint32(f)),l&&(c.durationIsEmpty=!0),!a&&m&&(c.baseDataOffsetIsMoof=!0),c},tkhd:function(c){var f=new DataView(c.buffer,c.byteOffset,c.byteLength),b=4,a={version:f.getUint8(0),flags:new Uint8Array(c.subarray(1,4))};return 1===a.version?(b+=4,a.creationTime=nb(f.getUint32(b)),b+=8,a.modificationTime=nb(f.getUint32(b)),b+=4,a.trackId=f.getUint32(b),b+=4,b+=8):(a.creationTime=nb(f.getUint32(b)),b+=4,a.modificationTime=nb(f.getUint32(b)),b+=4,a.trackId=f.getUint32(b),
b+=4,b+=4),a.duration=f.getUint32(b),b+=4,b+=8,a.layer=f.getUint16(b),b+=2,a.alternateGroup=f.getUint16(b),b+=2,a.volume=f.getUint8(b)+f.getUint8(b+1)/8,b+=2,b+=2,a.matrix=new Uint32Array(c.subarray(b,b+36)),b+=36,a.width=f.getUint16(b)+f.getUint16(b+2)/16,b+=4,a.height=f.getUint16(b)+f.getUint16(b+2)/16,a},traf:function(c){return{boxes:ib(c)}},trak:function(c){return{boxes:ib(c)}},trex:function(c){var f=new DataView(c.buffer,c.byteOffset,c.byteLength);return{version:c[0],flags:new Uint8Array(c.subarray(1,
4)),trackId:f.getUint32(4),defaultSampleDescriptionIndex:f.getUint32(8),defaultSampleDuration:f.getUint32(12),defaultSampleSize:f.getUint32(16),sampleDependsOn:3&c[20],sampleIsDependedOn:(192&c[21])>>6,sampleHasRedundancy:(48&c[21])>>4,samplePaddingValue:(14&c[21])>>1,sampleIsDifferenceSample:!!(1&c[21]),sampleDegradationPriority:f.getUint16(22)}},trun:function(c){var f,b={version:c[0],flags:new Uint8Array(c.subarray(1,4)),samples:[]},a=new DataView(c.buffer,c.byteOffset,c.byteLength),d=1&b.flags[2],
e=4&b.flags[2],h=1&b.flags[1],k=2&b.flags[1],l=4&b.flags[1],m=8&b.flags[1],n=a.getUint32(4),q=8;d&&(b.dataOffset=a.getInt32(q),q+=4);for(e&&n&&(f={flags:Ih(c.subarray(q,q+4))},q+=4,h&&(f.duration=a.getUint32(q),q+=4),k&&(f.size=a.getUint32(q),q+=4),m&&(f.compositionTimeOffset=a.getUint32(q),q+=4),b.samples.push(f),n--);n--;)f={},h&&(f.duration=a.getUint32(q),q+=4),k&&(f.size=a.getUint32(q),q+=4),l&&(f.flags=Ih(c.subarray(q,q+4)),q+=4),m&&(f.compositionTimeOffset=a.getUint32(q),q+=4),b.samples.push(f);
return b},"url ":function(c){return{version:c[0],flags:new Uint8Array(c.subarray(1,4))}},vmhd:function(c){var f=new DataView(c.buffer,c.byteOffset,c.byteLength);return{version:c[0],flags:new Uint8Array(c.subarray(1,4)),graphicsmode:f.getUint16(4),opcolor:new Uint16Array([f.getUint16(6),f.getUint16(8),f.getUint16(10)])}}},qa={inspect:ib=function(c){var f;var b=0;var a=[];var d=new ArrayBuffer(c.length);var e=new Uint8Array(d);for(f=0;f>>0;var l=pc(f.subarray(d+4,d+8));k=1>>0,(l=qa.findBox(a,["mdia","mdhd"])[0])?(h=0===l[0]?12:20,b[k]=(l[h]<<24|l[h+1]<<16|l[h+2]<<8|l[h+3])>>>0,b):null):null},{})},startTime:function(f,b){var a,d,e;return a=qa.findBox(b,["moof","traf"]),d=[].concat.apply([],a.map(function(h){return qa.findBox(h,["tfhd"]).map(function(k){var l,m;return l=(k[4]<<24|k[5]<<16|k[6]<<8|k[7])>>>0,m=f[l]||9E4,(qa.findBox(h,["tfdt"]).map(function(n){var q,
w;return q=n[0],w=(n[4]<<24|n[5]<<16|n[6]<<8|n[7])>>>0,1===q&&(w*=Math.pow(2,32),w+=(n[8]<<24|n[9]<<16|n[10]<<8|n[11])>>>0),w})[0]||1/0)/m})})),e=Math.min.apply(null,d),isFinite(e)?e:0},compositionStartTime:function(f,b){var a,d=qa.findBox(b,["moof","traf"]),e=0,h=0;if(d&&d.length){d=qa.parseTraf(d[0]);for(var k=0;k>>2&63).replace(/^0/,"")):h.codec="mp4a.40.2"))}(a=qa.findBox(a,["mdia","mdhd"])[0])&&k&&(e=0===e?12:20,h.timescale=(a[e]<<24|a[1+e]<<16|a[2+e]<<8|a[3+e])>>>0);b.push(h)}),b}};Gb.prototype.pipe=function(f){return this.on("data",function(b){f.push(b)}),this.on("done",function(b){f.flush(b)}),
this.on("partialdone",function(b){f.partialFlush(b)}),this.on("endedtimeline",function(b){f.endTimeline(b)}),this.on("reset",function(b){f.reset(b)}),f};Gb.prototype.push=function(f){this.trigger("data",f)};Gb.prototype.flush=function(f){this.trigger("done",f)};Gb.prototype.partialFlush=function(f){this.trigger("partialdone",f)};Gb.prototype.endTimeline=function(f){this.trigger("endedtimeline",f)};Gb.prototype.reset=function(f){this.trigger("reset",f)};(ob.prototype=new Gb).push=function(f){var b;
if(b="sei_rbsp"===f.nalUnitType){var a=f.escapedRBSP;b=0;for(var d={payloadType:-1,payloadSize:0},e=0,h=0;bb.type&&this.dispatchCea608Packet(b)},this),this.captionPackets_.length=
0);this.flushCCStreams(f)};ob.prototype.flush=function(){return this.flushStream("flush")};ob.prototype.partialFlush=function(){return this.flushStream("partialFlush")};ob.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=!1;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(f){f.reset()})};ob.prototype.dispatchCea608Packet=function(f){this.setsTextOrXDSActive(f)?this.activeCea608Channel_[f.type]=null:this.setsChannel1Active(f)?this.activeCea608Channel_[f.type]=
0:this.setsChannel2Active(f)&&(this.activeCea608Channel_[f.type]=1);null!==this.activeCea608Channel_[f.type]&&this.ccStreams_[(f.type<<1)+this.activeCea608Channel_[f.type]].push(f)};ob.prototype.setsChannel1Active=function(f){return 4096==(30720&f.ccData)};ob.prototype.setsChannel2Active=function(f){return 6144==(30720&f.ccData)};ob.prototype.setsTextOrXDSActive=function(f){return 256==(28928&f.ccData)||4138==(30974&f.ccData)||6186==(30974&f.ccData)};var $k={42:225,92:233,94:237,95:243,96:250,123:231,
124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,
810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},pm=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ba=function d(b,a){d.prototype.init.call(this);this.field_=b||0;this.dataChannel_=a||0;this.name_="CC"+(1+(this.field_<<1|this.dataChannel_));this.setConstants();this.reset();this.push=function(e){var h,k,l;if((h=32639&e.ccData)!==this.lastControlCode_){if(4096==
(61440&h)?this.lastControlCode_=h:h!==this.PADDING_&&(this.lastControlCode_=null),k=h>>>8,l=255&h,h!==this.PADDING_)if(h===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(h===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),h=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=h,this.startPts_=e.pts;else if(h===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(h===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);
else if(h===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(h===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(h===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(h===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=ac();else if(h===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=
ac();else if(h===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=ac()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(k,l)){var m=Kd((3&k)<<8|l);this[this.mode_](e.pts,m);this.column_++}else this.isExtCharacter(k,l)?("popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),m=Kd((3&k)<<8|l),this[this.mode_](e.pts,m),this.column_++):
this.isMidRowCode(k,l)?(this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&l)&&this.addFormatting(e.pts,["i"]),1==(1&l)&&this.addFormatting(e.pts,["u"])):this.isOffsetControlCode(k,l)?this.column_+=3&l:this.isPAC(k,l)?(k=pm.indexOf(7968&h),"rollUp"===this.mode_&&(0>k-this.rollUpRows_+1&&(k=this.rollUpRows_-1),this.setRollUp(e.pts,k)),k!==this.row_&&(this.clearFormatting(e.pts),this.row_=k),1&l&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&
h)&&(this.column_=4*((14&h)>>1)),this.isColorPAC(l)&&14==(14&l)&&this.addFormatting(e.pts,["i"])):this.isNormalChar(k)&&(0===l&&(l=null),m=Kd(k),m+=Kd(l),this[this.mode_](e.pts,m),this.column_+=m.length)}else this.lastControlCode_=null}};Ba.prototype=new Gb;Ba.prototype.flushDisplayed=function(b){var a=this.displayed_.map(function(d){try{return d.trim()}catch(e){return""}}).join("\n").replace(/^\n+|\n+$/g,"");a.length&&this.trigger("data",{startPts:this.startPts_,endPts:b,text:a,stream:this.name_})};
Ba.prototype.reset=function(){this.mode_="popOn";this.startPts_=this.topRow_=0;this.displayed_=ac();this.nonDisplayed_=ac();this.lastControlCode_=null;this.column_=0;this.row_=14;this.rollUpRows_=2;this.formatting_=[]};Ba.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31);this.PADDING_=0;this.RESUME_CAPTION_LOADING_=
32|this.CONTROL_;this.END_OF_CAPTION_=47|this.CONTROL_;this.ROLL_UP_2_ROWS_=37|this.CONTROL_;this.ROLL_UP_3_ROWS_=38|this.CONTROL_;this.ROLL_UP_4_ROWS_=39|this.CONTROL_;this.CARRIAGE_RETURN_=45|this.CONTROL_;this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_;this.BACKSPACE_=33|this.CONTROL_;this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_;this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_};Ba.prototype.isSpecialCharacter=function(b,a){return b===this.EXT_&&48<=a&&63>=a};Ba.prototype.isExtCharacter=function(b,
a){return(b===this.EXT_+1||b===this.EXT_+2)&&32<=a&&63>=a};Ba.prototype.isMidRowCode=function(b,a){return b===this.EXT_&&32<=a&&47>=a};Ba.prototype.isOffsetControlCode=function(b,a){return b===this.OFFSET_&&33<=a&&35>=a};Ba.prototype.isPAC=function(b,a){return b>=this.BASE_&&b=a};Ba.prototype.isColorPAC=function(b){return 64<=b&&79>=b||96<=b&&127>=b};Ba.prototype.isNormalChar=function(b){return 32<=b&&127>=b};Ba.prototype.setRollUp=function(b,a){if("rollUp"!==this.mode_&&
(this.row_=14,this.mode_="rollUp",this.flushDisplayed(b),this.nonDisplayed_=ac(),this.displayed_=ac()),void 0!==a&&a!==this.row_)for(var d=0;db;b++)this.displayed_[b]=
"";for(b=this.topRow_;b=b.byteLength)return null;var d,e=null;return 192&(d=b[a+7])&&((e={}).pts=(14&b[a+9])<<27|(255&b[a+10])<<20|(254&b[a+11])<<12|(255&b[a+12])<<5|(254&b[a+13])>>>3,e.pts*=4,
e.pts+=(6&b[a+13])>>>1,e.dts=e.pts,64&d&&(e.dts=(14&b[a+14])<<27|(255&b[a+15])<<20|(254&b[a+16])<<12|(255&b[a+17])<<5|(254&b[a+18])>>>3,e.dts*=4,e.dts+=(6&b[a+18])>>>1)),e},videoPacketContainsKeyFrame:function(b){var a=4+Md(b);b=b.subarray(a);for(var d=a=0,e=!1;d>4?20+d:10+d},parseAdtsSize:function(b,a){return 6144&
b[a+3]|b[a+4]<<3|(224&b[a+5])>>5},parseType:function(b,a){return 73===b[a]&&68===b[a+1]&&51===b[a+2]?"timed-metadata":1&b[a]&&240==(240&b[a+1])?"audio":null},parseSampleRate:function(b){for(var a=0;a+5>>2];a++}return null},parseAacTimestamp:function(b){var a;var d=10;64&b[5]&&(d+=4,d+=Kh(b.subarray(10,14)));do{if(1>(a=Kh(b.subarray(d+4,d+8))))break;if("PRIV"===String.fromCharCode(b[d],b[d+1],b[d+2],b[d+3])){var e=b.subarray(d+10,d+
a+10);for(var h=0;h>>2;return d*=4,d+(3&b[7])}}d+=10;d+=a}while(d>>24]^G[e>>16&255]^v[d>>8&255]^C[255&a]^l[q];var H=B[e>>>24]^G[d>>16&255]^v[a>>8&255]^C[255&b]^l[q+1];var Q=B[d>>>24]^G[a>>16&255]^v[b>>8&255]^C[255&e]^l[q+2];a=B[a>>>24]^G[b>>16&255]^v[e>>8&255]^C[255&d]^l[q+3];q+=4;b=w;e=H;d=Q}for(n=0;4>n;n++)h[(3&-n)+k]=K[b>>>24]<<24^K[e>>16&255]<<16^K[d>>8&255]<<8^K[255&a]^l[q++],w=b,b=e,e=d,d=a,a=w},Xe),Nh=(bc.prototype.on=function(b,a){this.listeners[b]||(this.listeners[b]=[]);this.listeners[b].push(a)},
bc.prototype.off=function(b,a){if(!this.listeners[b])return!1;var d=this.listeners[b].indexOf(a);return this.listeners[b].splice(d,1),-1m){if(0d){for(h=d;0>h;h++)if(0>(m-=b.targetDuration))return{mediaIndex:0,startTime:a};d=0}for(h=d;h(m-=sm(k.duration)))return{mediaIndex:h,startTime:e+cd(b,d,h)};return{mediaIndex:l-1,startTime:a}},isEnabled:Qd,isDisabled:function(b){return b.disabled},isBlacklisted:Zh,isIncompatible:af,playlistEnd:Xh,isAes:function(b){for(var a=0;a>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))};var xm=function(t){return W(H.hdlr,ea[t])};var ym=function(t){var p=new Uint8Array([0,
0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,85,196,0,0]);return t.samplerate&&(p[12]=t.samplerate>>>24&255,p[13]=t.samplerate>>>16&255,p[14]=t.samplerate>>>8&255,p[15]=255&t.samplerate),W(H.mdhd,p)};var Am=function(t){return W(H.mdia,ym(t),xm(t.type),zm(t))};var Bm=function(t){return W(H.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))};var zm=function(t){return W(H.minf,"video"===t.type?W(H.vmhd,
ha):W(H.smhd,va),gb(),Cm(t))};var Hj=function(t,p){for(var r=[],u=p.length;u--;)r[u]=Dm(p[u]);return W.apply(null,[H.moof,Bm(t)].concat(r))};var Hm=function(t){for(var p=t.length,r=[];p--;)r[p]=Em(t[p]);return W.apply(null,[H.moov,Fm(4294967295)].concat(r).concat(Gm(t)))};var Gm=function(t){for(var p=t.length,r=[];p--;)r[p]=Im(t[p]);return W.apply(null,[H.mvex].concat(r))};var Fm=function(t){t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&
t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return W(H.mvhd,t)};var Jm=function(t){var p,r=t.samples||[],u=new Uint8Array(4+r.length);for(p=0;p>>8),A.push(255&r[p].byteLength),A=A.concat(Array.prototype.slice.call(r[p]));for(p=0;p>>8),y.push(255&u[p].byteLength),y=y.concat(Array.prototype.slice.call(u[p]));if(p=[H.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&t.width)>>8,255&t.width,(65280&
t.height)>>8,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),W(H.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([r.length],A,[u.length],y))),W(H.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],t.sarRatio)r=t.sarRatio[0],t=t.sarRatio[1],p.push(W(H.pasp,new Uint8Array([(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r,(4278190080&t)>>24,(16711680&
t)>>16,(65280&t)>>8,255&t])));return W.apply(null,p)};var Mm=function(t){return W(H.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&t.channelcount)>>8,255&t.channelcount,(65280&t.samplesize)>>8,255&t.samplesize,0,0,0,0,(65280&t.samplerate)>>8,255&t.samplerate,0,0]),wm(t))};var Nm=function(t){t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,0,(4278190080&t.duration)>>24,(16711680&t.duration)>>16,(65280&t.duration)>>8,255&
t.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&t.width)>>8,255&t.width,0,0,(65280&t.height)>>8,255&t.height,0,0]);return W(H.tkhd,t)};var Dm=function(t){var p,r,u,A,y,z;return p=W(H.tfhd,new Uint8Array([0,0,0,58,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),y=Math.floor(t.baseMediaDecodeTime/(1+fc)),z=Math.floor(t.baseMediaDecodeTime%(1+fc)),r=W(H.tfdt,new Uint8Array([1,
0,0,0,y>>>24&255,y>>>16&255,y>>>8&255,255&y,z>>>24&255,z>>>16&255,z>>>8&255,255&z])),92,"audio"===t.type?(u=Ij(t,92),W(H.traf,p,r,u)):(A=Jm(t),u=Ij(t,A.length+92),W(H.traf,p,r,u,A))};var Em=function(t){return t.duration=t.duration||4294967295,W(H.trak,Nm(t),Am(t))};var Im=function(t){var p=new Uint8Array([0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==t.type&&(p[p.length-1]=0),W(H.trex,p)};var Jj=function(t,p){var r=0,u=
0,A=0,y=0;return t.length&&(void 0!==t[0].duration&&(r=1),void 0!==t[0].size&&(u=2),void 0!==t[0].flags&&(A=4),void 0!==t[0].compositionTimeOffset&&(y=8)),[0,0,r|u|A|y,1,(4278190080&t.length)>>>24,(16711680&t.length)>>>16,(65280&t.length)>>>8,255&t.length,(4278190080&p)>>>24,(16711680&p)>>>16,(65280&p)>>>8,255&p]};var Om=function(t,p){var r,u;p+=20+16*(r=t.samples||[]).length;var A=Jj(r,p);for(u=0;u>>24,(16711680&y.duration)>>>16,(65280&
y.duration)>>>8,255&y.duration,(4278190080&y.size)>>>24,(16711680&y.size)>>>16,(65280&y.size)>>>8,255&y.size,y.flags.isLeading<<2|y.flags.dependsOn,y.flags.isDependedOn<<6|y.flags.hasRedundancy<<4|y.flags.paddingValue<<1|y.flags.isNonSyncSample,61440&y.flags.degradationPriority,15&y.flags.degradationPriority,(4278190080&y.compositionTimeOffset)>>>24,(16711680&y.compositionTimeOffset)>>>16,(65280&y.compositionTimeOffset)>>>8,255&y.compositionTimeOffset])}return W(H.trun,new Uint8Array(A))};var Pm=
function(t,p){var r,u;p+=20+8*(r=t.samples||[]).length;var A=Jj(r,p);for(u=0;u>>24,(16711680&y.duration)>>>16,(65280&y.duration)>>>8,255&y.duration,(4278190080&y.size)>>>24,(16711680&y.size)>>>16,(65280&y.size)>>>8,255&y.size])}return W(H.trun,new Uint8Array(A))};var Ij=function(t,p){return"audio"===t.type?Pm(t,p):Om(t,p)};var Qm=function(){return W(H.ftyp,Q,aa,Q,M)};var dg,Kj,Lj,eg,Mj,Rm=function(t){var p,r=Qm();t=Hm(t);return(p=new Uint8Array(r.byteLength+
t.byteLength)).set(r),p.set(t,r.byteLength),p},Sm=function(t){var p,r,u=[],A=[];A.byteLength=0;A.nalCount=0;A.duration=0;for(p=u.byteLength=0;p=u.duration)&&(u.duration=A[A.length-1].duration),A.byteLength+=u.byteLength,A.nalCount+=u.length,A.duration+=u.duration,A.push(u),A},Tm=function(t){var p,r,u=[],A=[];u.byteLength=0;u.nalCount=0;u.duration=0;u.pts=t[0].pts;u.dts=t[0].dts;A.byteLength=0;A.nalCount=0;A.duration=0;A.pts=t[0].pts;A.dts=t[0].dts;for(p=0;p=u.duration&&(u.duration=A[A.length-1].duration),A.byteLength+=u.byteLength,A.nalCount+=u.nalCount,A.duration+=u.duration,A.push(u),A},Um=function(t){var p;return!t[0][0].keyFrame&&1=r?t:(p.minSegmentDts=1/0,t.filter(function(u){return u.dts>=r&&(p.minSegmentDts=Math.min(p.minSegmentDts,u.dts),p.minSegmentPts=p.minSegmentDts,!0)}))},Kc=function(t){delete t.minSegmentDts;
delete t.maxSegmentDts;delete t.minSegmentPts;delete t.maxSegmentPts},Nj=function(t,p){var r,u=t.minSegmentDts;return p||(u-=t.timelineStartInfo.dts),r=t.timelineStartInfo.baseMediaDecodeTime,r+=u,r=Math.max(0,r),"audio"===t.type&&(r*=t.samplerate/9E4,r=Math.floor(r)),r},hg=function(t,p){"number"==typeof p.pts&&(void 0===t.timelineStartInfo.pts&&(t.timelineStartInfo.pts=p.pts),void 0===t.minSegmentPts?t.minSegmentPts=p.pts:t.minSegmentPts=Math.min(t.minSegmentPts,p.pts),void 0===t.maxSegmentPts?t.maxSegmentPts=
p.pts:t.maxSegmentPts=Math.max(t.maxSegmentPts,p.pts));"number"==typeof p.dts&&(void 0===t.timelineStartInfo.dts&&(t.timelineStartInfo.dts=p.dts),void 0===t.minSegmentDts?t.minSegmentDts=p.dts:t.minSegmentDts=Math.min(t.minSegmentDts,p.dts),void 0===t.maxSegmentDts?t.maxSegmentDts=p.dts:t.maxSegmentDts=Math.max(t.maxSegmentDts,p.dts))};(k.prototype=new e).push=function(t){var p;if(p="sei_rbsp"===t.nalUnitType){var r=t.escapedRBSP;p=0;for(var u={payloadType:-1,payloadSize:0},A=0,y=0;pp.type&&this.dispatchCea608Packet(p)},this),this.captionPackets_.length=0);this.flushCCStreams(t)};k.prototype.flush=function(){return this.flushStream("flush")};k.prototype.partialFlush=function(){return this.flushStream("partialFlush")};
k.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=!1;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(t){t.reset()})};k.prototype.dispatchCea608Packet=function(t){this.setsTextOrXDSActive(t)?this.activeCea608Channel_[t.type]=null:this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1);null!==this.activeCea608Channel_[t.type]&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)};
k.prototype.setsChannel1Active=function(t){return 4096==(30720&t.ccData)};k.prototype.setsChannel2Active=function(t){return 6144==(30720&t.ccData)};k.prototype.setsTextOrXDSActive=function(t){return 256==(28928&t.ccData)||4138==(30974&t.ccData)||6186==(30974&t.ccData)};var vm={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,
547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},$m=[4352,
4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Aa=function u(p,r){u.prototype.init.call(this);this.field_=p||0;this.dataChannel_=r||0;this.name_="CC"+(1+(this.field_<<1|this.dataChannel_));this.setConstants();this.reset();this.push=function(A){var y,z,F;if((y=32639&A.ccData)!==this.lastControlCode_){if(4096==(61440&y)?this.lastControlCode_=y:y!==this.PADDING_&&(this.lastControlCode_=null),z=y>>>8,F=255&y,y!==this.PADDING_)if(y===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";
else if(y===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(A.pts),this.flushDisplayed(A.pts),y=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=y,this.startPts_=A.pts;else if(y===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(A.pts);else if(y===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(A.pts);else if(y===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(A.pts);else if(y===this.CARRIAGE_RETURN_)this.clearFormatting(A.pts),this.flushDisplayed(A.pts),
this.shiftRowsUp_(),this.startPts_=A.pts;else if(y===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(y===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(A.pts),this.displayed_=m();else if(y===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=m();else if(y===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(A.pts),this.displayed_=m()),this.mode_=
"paintOn",this.startPts_=A.pts;else if(this.isSpecialCharacter(z,F)){var I=l((3&z)<<8|F);this[this.mode_](A.pts,I);this.column_++}else this.isExtCharacter(z,F)?("popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),I=l((3&z)<<8|F),this[this.mode_](A.pts,I),this.column_++):this.isMidRowCode(z,F)?(this.clearFormatting(A.pts),this[this.mode_](A.pts," "),this.column_++,14==(14&F)&&this.addFormatting(A.pts,
["i"]),1==(1&F)&&this.addFormatting(A.pts,["u"])):this.isOffsetControlCode(z,F)?this.column_+=3&F:this.isPAC(z,F)?(z=$m.indexOf(7968&y),"rollUp"===this.mode_&&(0>z-this.rollUpRows_+1&&(z=this.rollUpRows_-1),this.setRollUp(A.pts,z)),z!==this.row_&&(this.clearFormatting(A.pts),this.row_=z),1&F&&-1===this.formatting_.indexOf("u")&&this.addFormatting(A.pts,["u"]),16==(16&y)&&(this.column_=4*((14&y)>>1)),this.isColorPAC(F)&&14==(14&F)&&this.addFormatting(A.pts,["i"])):this.isNormalChar(z)&&(0===F&&(F=
null),I=l(z),I+=l(F),this[this.mode_](A.pts,I),this.column_+=I.length)}else this.lastControlCode_=null}};Aa.prototype=new e;Aa.prototype.flushDisplayed=function(p){var r=this.displayed_.map(function(u){try{return u.trim()}catch(A){return""}}).join("\n").replace(/^\n+|\n+$/g,"");r.length&&this.trigger("data",{startPts:this.startPts_,endPts:p,text:r,stream:this.name_})};Aa.prototype.reset=function(){this.mode_="popOn";this.startPts_=this.topRow_=0;this.displayed_=m();this.nonDisplayed_=m();this.lastControlCode_=
null;this.column_=0;this.row_=14;this.rollUpRows_=2;this.formatting_=[]};Aa.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31);this.PADDING_=0;this.RESUME_CAPTION_LOADING_=32|this.CONTROL_;this.END_OF_CAPTION_=47|this.CONTROL_;this.ROLL_UP_2_ROWS_=37|this.CONTROL_;this.ROLL_UP_3_ROWS_=38|this.CONTROL_;this.ROLL_UP_4_ROWS_=
39|this.CONTROL_;this.CARRIAGE_RETURN_=45|this.CONTROL_;this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_;this.BACKSPACE_=33|this.CONTROL_;this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_;this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_};Aa.prototype.isSpecialCharacter=function(p,r){return p===this.EXT_&&48<=r&&63>=r};Aa.prototype.isExtCharacter=function(p,r){return(p===this.EXT_+1||p===this.EXT_+2)&&32<=r&&63>=r};Aa.prototype.isMidRowCode=function(p,r){return p===this.EXT_&&32<=r&&47>=r};Aa.prototype.isOffsetControlCode=
function(p,r){return p===this.OFFSET_&&33<=r&&35>=r};Aa.prototype.isPAC=function(p,r){return p>=this.BASE_&&p=r};Aa.prototype.isColorPAC=function(p){return 64<=p&&79>=p||96<=p&&127>=p};Aa.prototype.isNormalChar=function(p){return 32<=p&&127>=p};Aa.prototype.setRollUp=function(p,r){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(p),this.nonDisplayed_=m(),this.displayed_=m()),void 0!==r&&r!==this.row_)for(var u=0;up;p++)this.displayed_[p]="";for(p=this.topRow_;pF.data.length||73!==F.data[0]||68!==F.data[1]||51!==F.data[2]))r;else if(y.push(F),z+=F.data.byteLength,1===y.length&&(A=B(F.data.subarray(6,10)),A+=10),!(z(L=B(F.data.subarray(I+4,I+8))))return;
if((E={id:String.fromCharCode(F.data[I],F.data[I+1],F.data[I+2],F.data[I+3]),data:F.data.subarray(I+10,I+L+10)}).key=E.id,Oj[E.id]&&(Oj[E.id](E),"com.apple.streaming.transportStreamTimestamp"===E.owner)){var P=E.data,U=(1&P[3])<<30|P[4]<<22|P[5]<<14|P[6]<<6|P[7]>>>2;U*=4;U+=3&P[7];E.timeStamp=U;void 0===F.pts&&void 0===F.dts&&(F.pts=E.timeStamp,F.dts=E.timeStamp);this.trigger("timestamp",E)}F.frames.push(E);I+=10;I+=L}while(I>>4&&(F+=y[F]+1),0===z.pid)z.type="pat",r(y.subarray(F),z),this.trigger("data",z);else if(z.pid===this.pmtPid)for(z.type="pmt",r(y.subarray(F),z),this.trigger("data",z);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([y,F,z]):this.processPes_(y,F,z)};this.processPes_=function(y,z,F){F.pid===this.programMapTable.video?F.streamType=lb.H264_STREAM_TYPE:F.pid===
this.programMapTable.audio?F.streamType=lb.ADTS_STREAM_TYPE:F.streamType=this.programMapTable["timed-metadata"][F.pid];F.type="pes";F.data=y.subarray(z);this.trigger("data",F)}}).prototype=new e;ee.STREAM_TYPES={h264:27,adts:15};(kg=function(){function p(F,I,L){var E=new Uint8Array(F.size),P={type:I},U,ba=0;if(F.data.length&&!(9>F.size)){P.trackId=F.data[0].pid;for(U=0;U>>3,P.pts*=4,P.pts+=(6&E[13])>>>1,P.dts=P.pts,64&na&&(P.dts=(14&E[14])<<27|(255&E[15])<<20|(254&E[16])<<12|(255&E[17])<<5|(254&E[18])>>>3,P.dts*=4,P.dts+=(6&E[18])>>>1));P.data=E.subarray(9+E[8]);!0;I="video"===I||P.packetLength<=F.size;(L||I)&&(F.size=0,F.data.length=0);I&&u.trigger("data",P)}}var r,u=this,A={data:[],size:0},y={data:[],size:0},z={data:[],size:0};kg.prototype.init.call(this);
this.push=function(F){({pat:function(){},pes:function(){switch(F.streamType){case lb.H264_STREAM_TYPE:case lb.H264_STREAM_TYPE:var I=A;var L="video";break;case lb.ADTS_STREAM_TYPE:I=y;L="audio";break;case lb.METADATA_STREAM_TYPE:I=z;L="timed-metadata";break;default:return}F.payloadUnitStartIndicator&&p(I,L,!0);I.data.push(F);I.size+=F.data.byteLength},pmt:function(){var I={type:"metadata",tracks:[]};null!==(r=F.programMapTable).video&&I.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.video,
codec:"avc",type:"video"});null!==r.audio&&I.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.audio,codec:"adts",type:"audio"});u.trigger("data",I)}})[F.type]()};this.reset=function(){A.size=0;A.data.length=0;y.size=0;y.data.length=0;this.trigger("reset")};this.flushStreams_=function(){p(A,"video");p(y,"audio");p(z,"timed-metadata")};this.flush=function(){this.flushStreams_();this.trigger("done")}}).prototype=new e;var Cb={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:jg,TransportParseStream:ee,
ElementaryStream:kg,TimestampRolloverStream:q,CaptionStream:k,Cea608Stream:an,MetadataStream:ig},fe;for(fe in lb)lb.hasOwnProperty(fe)&&(Cb[fe]=lb[fe]);var ge,Pj=[96E3,88200,64E3,48E3,44100,32E3,24E3,22050,16E3,12E3,11025,8E3,7350];(ge=function(p){var r,u=0;ge.prototype.init.call(this);this.push=function(A){var y,z,F,I,L,E=0;if(p||(u=0),"audio"===A.type)for(r?(z=r,(r=new Uint8Array(z.byteLength+A.data.byteLength)).set(z),r.set(A.data,z.byteLength)):r=A.data;E+5>5,L=9E4*(I=1024*(1+(3&r[E+6])))/Pj[(60&r[E+2])>>>2],F=E+y,r.byteLength>>6&3),channelcount:(1&r[E+2])<<2|(192&r[E+3])>>>6,samplerate:Pj[(60&r[E+2])>>>2],samplingfrequencyindex:(60&r[E+2])>>>2,samplesize:16,data:r.subarray(E+7+z,F)}),u++,r.byteLength===F)return void(r=void 0);r=r.subarray(F)}else E++};this.flush=function(){u=0;this.trigger("done")};
this.reset=function(){r=void 0;this.trigger("reset")};this.endTimeline=function(){r=void 0;this.trigger("endedtimeline")}}).prototype=new e;var lg,mg,bn=function(p){var r=p.byteLength,u=0,A=0;this.length=function(){return 8*r};this.bitsAvailable=function(){return 8*r+A};this.loadWord=function(){var y=p.byteLength-r,z=new Uint8Array(4),F=Math.min(4,r);if(0===F)throw Error("no bytes available");z.set(p.subarray(y,y+F));u=(new DataView(z.buffer)).getUint32(0);A=8*F;r-=F};this.skipBits=function(y){var z;
y>>32-z;return 0<(A-=z)?u<<=z:0>>y))return u<<=y,A-=y,y;return this.loadWord(),y+this.skipLeadingZeros()};this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};
this.readUnsignedExpGolomb=function(){var y=this.skipLeadingZeros();return this.readBits(y+1)-1};this.readExpGolomb=function(){var y=this.readUnsignedExpGolomb();return 1&y?1+y>>>1:-1*(y>>>1)};this.readBoolean=function(){return 1===this.readBits(1)};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};(mg=function(){var p,r,u=0;mg.prototype.init.call(this);this.push=function(A){var y;for(A=(r=r?((y=new Uint8Array(r.byteLength+A.data.byteLength)).set(r),y.set(A.data,r.byteLength),
y):A.data).byteLength;uba?16:64,E)}if(E.skipUnsignedExpGolomb(),0===(ba=E.readUnsignedExpGolomb()))E.readUnsignedExpGolomb();else if(1===
ba)for(E.skipBits(1),E.skipExpGolomb(),E.skipExpGolomb(),rd=E.readUnsignedExpGolomb(),ba=0;bap.length-y)break;if(y+(u=
6144&p[y+3]|p[y+4]<<3|(224&p[y+5])>>5)>p.length)break;A={type:"audio",data:p.subarray(y,y+u),pts:r,dts:r};this.trigger("data",A);y+=u}else{if(10>p.length-y)break;u=p[y+6]<<21|p[y+7]<<14|p[y+8]<<7|p[y+9];if(y+(u=(16&p[y+5])>>4?20+u:10+u)>p.length)break;A={type:"timed-metadata",data:p.subarray(y,y+u)};this.trigger("data",A);y+=u}p=0L||45E3=L&&(!E||LP.pts?L++:(E++,xa-=U.byteLength,na-=U.nalCount,Kb-=U.duration);return 0===E?I:E===I.length?null:((ba=I.slice(E)).byteLength=xa,ba.duration=Kb,ba.nalCount=na,ba.pts=ba[0].pts,ba.dts=ba[0].dts,ba)};this.alignGopsAtEnd_=function(I){var L,E,P;var U=F.length-1;var ba=I.length-1;var xa=null;for(P=!1;0<=U&&0<=ba;){if(L=F[U],E=I[ba],L.pts===E.pts){P=!0;break}L.pts>E.pts?U--:(U===F.length-1&&(xa=ba),ba--)}if(!P&&null===
xa)return null;if(0===(U=P?ba:xa))return I;I=I.slice(U);U=I.reduce(function(na,Kb){return na.byteLength+=Kb.byteLength,na.duration+=Kb.duration,na.nalCount+=Kb.nalCount,na},{byteLength:0,duration:0,nalCount:0});return I.byteLength=U.byteLength,I.duration=U.duration,I.nalCount=U.nalCount,I.pts=I[0].pts,I.dts=I[0].dts,I};this.alignGopsWith=function(I){F=I}}).prototype=new e;(Lc=function(p,r){this.numberOfTracks=0;this.metadataStream=r;"undefined"!=typeof(p=p||{}).remux?this.remuxTracks=!!p.remux:this.remuxTracks=
!0;"boolean"==typeof p.keepOriginalTimestamps?this.keepOriginalTimestamps=p.keepOriginalTimestamps:this.keepOriginalTimestamps=!1;this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.emittedTracks=this.pendingBytes=0;Lc.prototype.init.call(this);this.push=function(u){return u.text?this.pendingCaptions.push(u):u.frames?this.pendingMetadata.push(u):(this.pendingTracks.push(u.track),this.pendingBytes+=u.boxes.byteLength,"video"===u.track.type&&
(this.videoTrack=u.track,this.pendingBoxes.push(u.boxes)),void("audio"===u.track.type&&(this.audioTrack=u.track,this.pendingBoxes.unshift(u.boxes))))}}).prototype=new e;Lc.prototype.flush=function(p){var r,u,A=0,y={captions:[],captionStreams:{},metadata:[],info:{}},z=0;if(this.pendingTracks.length=this.numberOfTracks&&
(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(z=this.videoTrack.timelineStartInfo.pts,Uj.forEach(function(F){y.info[F]=this.videoTrack[F]},this)):this.audioTrack&&(z=this.audioTrack.timelineStartInfo.pts,Tj.forEach(function(F){y.info[F]=this.audioTrack[F]},this)),this.videoTrack||this.audioTrack){1===this.pendingTracks.length?y.type=this.pendingTracks[0].type:y.type="combined";this.emittedTracks+=this.pendingTracks.length;p=Rm(this.pendingTracks);y.initSegment=new Uint8Array(p.byteLength);
y.initSegment.set(p);y.data=new Uint8Array(this.pendingBytes);for(p=0;p=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)};Lc.prototype.setRemux=
function(p){this.remuxTracks=p};(pg=function(p){var r,u,A=this,y=!0;pg.prototype.init.call(this);p=p||{};this.baseMediaDecodeTime=p.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var z={};(this.transmuxPipeline_=z).type="aac";z.metadataStream=new Cb.MetadataStream;z.aacStream=new ng;z.audioTimestampRolloverStream=new Cb.TimestampRolloverStream("audio");z.timedMetadataTimestampRolloverStream=new Cb.TimestampRolloverStream("timed-metadata");z.adtsStream=new ge;z.coalesceStream=
new Lc(p,z.metadataStream);z.headOfPipeline=z.aacStream;z.aacStream.pipe(z.audioTimestampRolloverStream).pipe(z.adtsStream);z.aacStream.pipe(z.timedMetadataTimestampRolloverStream).pipe(z.metadataStream).pipe(z.coalesceStream);z.metadataStream.on("timestamp",function(F){z.aacStream.setTimestamp(F.timeStamp)});z.aacStream.on("data",function(F){"timed-metadata"!==F.type||z.audioSegmentStream||(u=u||{timelineStartInfo:{baseMediaDecodeTime:A.baseMediaDecodeTime},codec:"adts",type:"audio"},z.coalesceStream.numberOfTracks++,
z.audioSegmentStream=new he(u,p),z.audioSegmentStream.on("timingInfo",A.trigger.bind(A,"audioTimingInfo")),z.adtsStream.pipe(z.audioSegmentStream).pipe(z.coalesceStream));A.trigger("trackinfo",{hasAudio:!!u,hasVideo:!!r})});z.coalesceStream.on("data",this.trigger.bind(this,"data"));z.coalesceStream.on("done",this.trigger.bind(this,"done"))};this.setupTsPipeline=function(){var z={};(this.transmuxPipeline_=z).type="ts";z.metadataStream=new Cb.MetadataStream;z.packetStream=new Cb.TransportPacketStream;
z.parseStream=new Cb.TransportParseStream;z.elementaryStream=new Cb.ElementaryStream;z.timestampRolloverStream=new Cb.TimestampRolloverStream;z.adtsStream=new ge;z.h264Stream=new lg;z.captionStream=new Cb.CaptionStream;z.coalesceStream=new Lc(p,z.metadataStream);z.headOfPipeline=z.packetStream;z.packetStream.pipe(z.parseStream).pipe(z.elementaryStream).pipe(z.timestampRolloverStream);z.timestampRolloverStream.pipe(z.h264Stream);z.timestampRolloverStream.pipe(z.adtsStream);z.timestampRolloverStream.pipe(z.metadataStream).pipe(z.coalesceStream);
z.h264Stream.pipe(z.captionStream).pipe(z.coalesceStream);z.elementaryStream.on("data",function(F){var I;if("metadata"===F.type){for(I=F.tracks.length;I--;)r||"video"!==F.tracks[I].type?u||"audio"!==F.tracks[I].type||((u=F.tracks[I]).timelineStartInfo.baseMediaDecodeTime=A.baseMediaDecodeTime):(r=F.tracks[I]).timelineStartInfo.baseMediaDecodeTime=A.baseMediaDecodeTime;r&&!z.videoSegmentStream&&(z.coalesceStream.numberOfTracks++,z.videoSegmentStream=new og(r,p),z.videoSegmentStream.on("timelineStartInfo",
function(L){u&&(u.timelineStartInfo=L,z.audioSegmentStream.setEarliestDts(L.dts))}),z.videoSegmentStream.on("processedGopsInfo",A.trigger.bind(A,"gopInfo")),z.videoSegmentStream.on("segmentTimingInfo",A.trigger.bind(A,"videoSegmentTimingInfo")),z.videoSegmentStream.on("baseMediaDecodeTime",function(L){u&&z.audioSegmentStream.setVideoBaseMediaDecodeTime(L)}),z.videoSegmentStream.on("timingInfo",A.trigger.bind(A,"videoTimingInfo")),z.h264Stream.pipe(z.videoSegmentStream).pipe(z.coalesceStream));u&&
!z.audioSegmentStream&&(z.coalesceStream.numberOfTracks++,z.audioSegmentStream=new he(u,p),z.audioSegmentStream.on("timingInfo",A.trigger.bind(A,"audioTimingInfo")),z.adtsStream.pipe(z.audioSegmentStream).pipe(z.coalesceStream));A.trigger("trackinfo",{hasAudio:!!u,hasVideo:!!r})}});z.coalesceStream.on("data",this.trigger.bind(this,"data"));z.coalesceStream.on("id3Frame",function(F){F.dispatchType=z.metadataStream.dispatchType;A.trigger("id3Frame",F)});z.coalesceStream.on("caption",this.trigger.bind(this,
"caption"));z.coalesceStream.on("done",this.trigger.bind(this,"done"))};this.setBaseMediaDecodeTime=function(z){var F=this.transmuxPipeline_;p.keepOriginalTimestamps||(this.baseMediaDecodeTime=z);u&&(u.timelineStartInfo.dts=void 0,u.timelineStartInfo.pts=void 0,Kc(u),p.keepOriginalTimestamps||(u.timelineStartInfo.baseMediaDecodeTime=z),F.audioTimestampRolloverStream&&F.audioTimestampRolloverStream.discontinuity());r&&(F.videoSegmentStream&&(F.videoSegmentStream.gopCache_=[]),r.timelineStartInfo.dts=
void 0,r.timelineStartInfo.pts=void 0,Kc(r),F.captionStream.reset(),p.keepOriginalTimestamps||(r.timelineStartInfo.baseMediaDecodeTime=z));F.timestampRolloverStream&&F.timestampRolloverStream.discontinuity()};this.setAudioAppendStart=function(z){u&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(z)};this.setRemux=function(z){var F=this.transmuxPipeline_;p.remux=z;F&&F.coalesceStream&&F.coalesceStream.setRemux(z)};this.alignGopsWith=function(z){r&&this.transmuxPipeline_.videoSegmentStream&&
this.transmuxPipeline_.videoSegmentStream.alignGopsWith(z)};this.push=function(z){if(y){var F=73===z[0]&&68===z[1]&&51===z[2];F&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():F||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline();y=!1}this.transmuxPipeline_.headOfPipeline.push(z)};this.flush=function(){y=!0;this.transmuxPipeline_.headOfPipeline.flush()};this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()};this.reset=function(){this.transmuxPipeline_.headOfPipeline&&
this.transmuxPipeline_.headOfPipeline.reset()};this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new e;var Vj=(function(p,r,u){return r&&C(p.prototype,r),u&&C(p,u),p}(K,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose();this.transmuxer=new pg(this.options);(function(p,r){r.on("data",function(u){var A=u.initSegment;u.initSegment={data:A.buffer,byteOffset:A.byteOffset,byteLength:A.byteLength};A=u.data;
u.data=A.buffer;p.postMessage({action:"data",segment:u,byteOffset:A.byteOffset,byteLength:A.byteLength},[u.data])});r.captionStream&&r.captionStream.on("data",function(u){p.postMessage({action:"caption",data:u})});r.on("done",function(u){p.postMessage({action:"done"})});r.on("gopInfo",function(u){p.postMessage({action:"gopInfo",gopInfo:u})});r.on("videoSegmentTimingInfo",function(u){p.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:u})})})(this.self,this.transmuxer)}},{key:"push",
value:function(p){p=new Uint8Array(p.data,p.byteOffset,p.byteLength);this.transmuxer.push(p)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(p){this.transmuxer.setBaseMediaDecodeTime(Math.round(9E4*(p.timestampOffset||0)))}},{key:"setAudioAppendStart",value:function(p){this.transmuxer.setAudioAppendStart(Math.ceil(9E4*p.appendStart))}},{key:"flush",value:function(p){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},
{key:"alignGopsWith",value:function(p){this.transmuxer.alignGopsWith(p.gopsToAlignWith.slice())}}]),K);new function(p){p.onmessage=function(r){"init"===r.data.action&&r.data.options?this.messageHandlers=new Vj(p,r.data.options):(this.messageHandlers||(this.messageHandlers=new Vj(p)),r.data&&r.data.action&&"init"!==r.data.action&&this.messageHandlers[r.data.action]&&this.messageHandlers[r.data.action](r.data))}}(d)}()}),mi={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},dn=
(Ib(uc,D.EventTarget),xb(uc,[{key:"data_",value:function(b){var a=b.data.segment;a.data=new Uint8Array(a.data,b.data.byteOffset,b.data.byteLength);a.initSegment=new Uint8Array(a.initSegment.data,a.initSegment.byteOffset,a.initSegment.byteLength);b=this.mediaSource_.player_;if(a.captions&&a.captions.length)for(var d in this.inbandTextTracks_||(this.inbandTextTracks_={}),a.captionStreams)if(!this.inbandTextTracks_[d]){b.tech_.trigger({type:"usage",name:"hls-608"});var e=b.textTracks().getTrackById(d);
this.inbandTextTracks_[d]=e||b.addRemoteTextTrack({kind:"captions",id:d,label:d},!1).track}a.metadata&&a.metadata.length&&!this.metadataTrack_&&(this.metadataTrack_=b.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,this.metadataTrack_.inBandMetadataTrackDispatchType=a.metadata.dispatchType);this.pendingBuffers_.push(a)}},{key:"done_",value:function(b){"closed"!==this.mediaSource_.readyState?this.processPendingSegments_():this.pendingBuffers_.length=0}},{key:"videoSegmentTimingInfo_",
value:function(b){var a={start:{decode:b.start.dts/9E4,presentation:b.start.pts/9E4},end:{decode:b.end.dts/9E4,presentation:b.end.pts/9E4},baseMediaDecodeTime:b.baseMediaDecodeTime/9E4};b.prependedContentDuration&&(a.prependedContentDuration=b.prependedContentDuration/9E4);this.trigger({type:"videoSegmentTimingInfo",videoSegmentTimingInfo:a})}},{key:"createRealSourceBuffers_",value:function(){var b=this,a=["audio","video"];a.forEach(function(d){if(b[d+"Codec_"]&&!b[d+"Buffer_"]){var e=null;b.mediaSource_[d+
"Buffer_"]?(e=b.mediaSource_[d+"Buffer_"]).updating=!1:(e=function(h,k){function l(w){"function"==typeof m[w]?n[w]=function(){return m[w].apply(m,arguments)}:"undefined"==typeof n[w]&&Object.defineProperty(n,w,{get:function(){return m[w]},set:function(B){return m[w]=B}})}var m=h.addSourceBuffer(k),n=Object.create(null),q;for(q in n.updating=!1,n.realBuffer_=m)l(q);return n}(b.mediaSource_.nativeMediaSource_,d+'/mp4;codecs\x3d"'+b[d+"Codec_"]+'"'),b.mediaSource_[d+"Buffer_"]=e);b[d+"Buffer_"]=e;["update",
"updatestart","updateend"].forEach(function(h){e.addEventListener(h,function(){if("audio"!==d||!b.audioDisabled_)return"updateend"===h&&(b[d+"Buffer_"].updating=!1),a.every(function(k){return!("audio"!==k||!b.audioDisabled_)||d===k||!b[k+"Buffer_"]||!b[k+"Buffer_"].updating})?b.trigger(h):void 0})})}})}},{key:"appendBuffer",value:function(b){if(this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length){var a=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",
appendStart:a.end(a.length-1)})}if(this.videoBuffer_){a=this.transmuxer_;var d=a.postMessage;var e=this.gopBuffer_;var h=this.mediaSource_.player_?this.mediaSource_.player_.currentTime():null;if("undefined"!=typeof h&&null!==h&&e.length){h=Math.ceil(9E4*(h-this.timeMapping_+3));var k;for(k=0;kh);k++);e=e.slice(k)}else e=[];d.call(a,{action:"alignGopsWith",gopsToAlignWith:e})}this.transmuxer_.postMessage({action:"push",data:b.buffer,byteOffset:b.byteOffset,byteLength:b.byteLength},
[b.buffer]);this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function(b){var a=this.gopBuffer_;b=b.data.gopInfo;if(b.length)if(this.safeAppend_)a=b.slice();else{for(var d=b[0].pts,e=0;e=d);e++);a=a.slice(0,e).concat(b)}this.gopBuffer_=a}},{key:"remove",value:function(b,a){if(this.videoBuffer_){this.videoBuffer_.updating=!0;this.videoBuffer_.remove(b,a);var d=this.gopBuffer_;var e=this.timeMapping_,h=Math.ceil(9E4*(b-e)),k=Math.ceil(9E4*(a-e));e=d.slice();
for(var l=d.length;l--&&!(d[l].pts<=k););if(-1===l)d=e;else{for(k=l+1;k--&&!(d[k].pts<=h););d=(k=Math.max(k,0),e.splice(k,l-k+1),e)}this.gopBuffer_=d}if(!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(b,a)),rc(b,a,this.metadataTrack_),this.inbandTextTracks_)for(var m in this.inbandTextTracks_)rc(b,a,this.inbandTextTracks_[m])}},{key:"processPendingSegments_",value:function(){var b={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],
metadata:[]};if(!this.pendingBuffers_.length)return this.trigger("updateend"),void(this.bufferUpdating_=!1);b=this.pendingBuffers_.reduce(function(d,e){var h=e.type,k=e.data,l=e.initSegment;return d[h].segments.push(k),d[h].bytes+=k.byteLength,d[h].initSegment=l,e.captions&&(d.captions=d.captions.concat(e.captions)),e.info&&(d[h].info=e.info),e.metadata&&(d.metadata=d.metadata.concat(e.metadata)),d},b);this.videoBuffer_||this.audioBuffer_||(0===b.video.bytes&&(this.videoCodec_=null),0===b.audio.bytes&&
(this.audioCodec_=null),this.createRealSourceBuffers_());b.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:b.audio.info});b.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:b.video.info});this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(b.audio.segments.unshift(b.audio.initSegment),b.audio.bytes+=b.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1);var a=!1;this.videoBuffer_&&b.video.bytes?(b.video.segments.unshift(b.video.initSegment),
b.video.bytes+=b.video.initSegment.byteLength,this.concatAndAppendSegments_(b.video,this.videoBuffer_)):!this.videoBuffer_||!this.audioDisabled_&&this.audioBuffer_||(a=!0);ll(this,b.captions,b.metadata);!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(b.audio,this.audioBuffer_);this.pendingBuffers_.length=0;a&&this.trigger("updateend");this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(b,a){var d=0,e=void 0;if(b.bytes){e=new Uint8Array(b.bytes);b.segments.forEach(function(h){e.set(h,
d);d+=h.byteLength});try{a.updating=!0,a.appendBuffer(e)}catch(h){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:h.message,originalError:h})}}}},{key:"abort",value:function(){this.videoBuffer_&&this.videoBuffer_.abort();!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.abort();this.transmuxer_&&this.transmuxer_.postMessage({action:"reset"});this.pendingBuffers_.length=0;this.bufferUpdating_=!1}},{key:"dispose",value:function(){this.transmuxer_&&
this.transmuxer_.terminate();this.trigger("dispose");this.off()}}]),uc),kf=(Ib(dc,D.EventTarget),xb(dc,[{key:"addSeekableRange_",value:function(b,a){var d=void 0;if(this.duration!==1/0)throw(d=Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity")).name="InvalidStateError",d.code=11,d;(a>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=a)}},{key:"addSourceBuffer",value:function(b){var a=void 0;a=ni(b);
/^(video|audio)\/mp2t$/i.test(a.type)?(b=[],a.parameters&&a.parameters.codecs&&(b=a.parameters.codecs.split(","),b=(b=li(b)).filter(function(d){return gf(d)||hf(d)})),0===b.length&&(b=["avc1.4d400d","mp4a.40.2"]),a=new dn(this,b),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),a.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)):a=this.nativeMediaSource_.addSourceBuffer(b);return this.sourceBuffers.push(a),a}},{key:"dispose",value:function(){this.trigger("dispose");
this.off();this.sourceBuffers.forEach(function(b){b.dispose&&b.dispose()});this.sourceBuffers.length=0}}]),dc),Wj=0;D.mediaSources={};ed.open=oi;ed.supportsNativeMediaSources=jf;var Xj={createObjectURL:function(b){var a=void 0;return b instanceof kf?(a=x.URL.createObjectURL(b.nativeMediaSource_),b.url_=a):b instanceof kf?(a="blob:vjs-media-source/"+Wj,Wj++,D.mediaSources[a]=b,a):(a=x.URL.createObjectURL(b),b.url_=a)}};D.MediaSource=ed;D.URL=Xj;var qi=D.mergeOptions,pf=(Ib(vc,D.EventTarget),xb(vc,
[{key:"setupChildLoader",value:function(b,a){this.masterPlaylistLoader_=b;this.childPlaylist_=a}},{key:"dispose",value:function(){this.trigger("dispose");this.stopRequest();this.loadedPlaylists_={};x.clearTimeout(this.minimumUpdatePeriodTimeout_);x.clearTimeout(this.mediaRequest_);x.clearTimeout(this.mediaUpdateTimeout);this.off()}},{key:"hasPendingRequest",value:function(){return this.request||this.mediaRequest_}},{key:"stopRequest",value:function(){if(this.request){var b=this.request;this.request=
null;b.onreadystatechange=null;b.abort()}}},{key:"sidxRequestFinished_",value:function(b,a,d,e){var h=this;return function(k,l){if(h.request){if(h.request=null,k)return h.error={status:l.status,message:"DASH playlist request error at URL: "+b.uri,response:l.response,code:2},d&&(h.state=d),h.trigger("error"),e(a,null);var m=new Uint8Array(l.response);m=qa.parseSidx(m.subarray(8));return e(a,m)}}}},{key:"media",value:function(b){var a=this;if(!b)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+
this.state);var d=this.state;if("string"==typeof b){if(!this.master.playlists[b])throw Error("Unknown playlist URI: "+b);b=this.master.playlists[b]}var e=!this.media_||b.id!==this.media_.id;if(e&&this.loadedPlaylists_[b.id]&&this.loadedPlaylists_[b.id].endList)return this.state="HAVE_METADATA",this.media_=b,void(e&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(e)if(this.media_&&this.trigger("mediachanging"),b.sidx){var h=e=void 0;h=this.masterPlaylistLoader_?(e=this.masterPlaylistLoader_.master,
this.masterPlaylistLoader_.sidxMapping_):(e=this.master,this.sidxMapping_);var k=lf(b.sidx);h[k]={sidxInfo:b.sidx};this.request=si(b.sidx,b,this.hls_.xhr,{handleManifestRedirects:this.handleManifestRedirects},this.sidxRequestFinished_(b,e,d,function(l,m){if(!l||!m)throw Error("failed to request sidx");h[k].sidx=m;a.haveMetadata({startingState:d,playlist:l.playlists[b.id]})}))}else this.mediaRequest_=x.setTimeout(this.haveMetadata.bind(this,{startingState:d,playlist:b}),0)}},{key:"haveMetadata",value:function(b){var a=
b.startingState;b=b.playlist;this.state="HAVE_METADATA";this.loadedPlaylists_[b.id]=b;this.mediaRequest_=null;this.refreshMedia_(b.id);"HAVE_MASTER"===a?this.trigger("loadedmetadata"):this.trigger("mediachange")}},{key:"pause",value:function(){this.stopRequest();x.clearTimeout(this.mediaUpdateTimeout);x.clearTimeout(this.minimumUpdatePeriodTimeout_);"HAVE_NOTHING"===this.state&&(this.started=!1)}},{key:"load",value:function(b){var a=this;x.clearTimeout(this.mediaUpdateTimeout);x.clearTimeout(this.minimumUpdatePeriodTimeout_);
var d=this.media();b?this.mediaUpdateTimeout=x.setTimeout(function(){return a.load()},d?d.targetDuration/2*1E3:5E3):this.started?d&&!d.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"parseMasterXml",value:function(){var b=Hh(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_,sidxMapping:this.sidxMapping_});b.uri=this.srcUrl;for(var a=0;athis.mediaSource.sourceBuffers.length)?a.on("sourcebufferadded",function(){d.start_()}):this.start_()}},{key:"start_",value:function(){var b=this;this.started_=!0;this.onUpdateendCallback_=function(){var a=b.pendingCallback_;b.pendingCallback_=null;b.sourceBuffer_.removing=!1;b.logger_("buffered ["+df(b.buffered())+"]");a&&a();b.runCallback_()};this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_);this.runCallback_()}},
{key:"abort",value:function(b){var a=this;this.processedAppend_&&this.queueCallback_(function(){a.sourceBuffer_.abort()},b)}},{key:"appendBuffer",value:function(b,a){var d=this;this.processedAppend_=!0;this.queueCallback_(function(){b.videoSegmentTimingInfoCallback&&d.sourceBuffer_.addEventListener("videoSegmentTimingInfo",b.videoSegmentTimingInfoCallback);d.sourceBuffer_.appendBuffer(b.bytes)},function(){b.videoSegmentTimingInfoCallback&&d.sourceBuffer_.removeEventListener("videoSegmentTimingInfo",
b.videoSegmentTimingInfoCallback);a()})}},{key:"buffered",value:function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:D.createTimeRanges()}},{key:"remove",value:function(b,a,d){var e=this,h=2=this.goalBufferLength_()||!e&&1<=b)return null;if(null===k)return d=this.getSyncSegmentCandidate_(a),this.generateSegmentInfo_(a,d,null,!0);if(null!==d)return a.segments[d],m=l,this.generateSegmentInfo_(a,d+1,m,!1);this.fetchAtBuffer_?(e=eb.getMediaInfoForTime(a,
l,k.segmentIndex,k.time),d=e.mediaIndex,m=e.startTime):(e=eb.getMediaInfoForTime(a,h,k.segmentIndex,k.time),d=e.mediaIndex,m=e.startTime);return this.generateSegmentInfo_(a,d,m,!1)}},{key:"getSyncSegmentCandidate_",value:function(b){var a=this;if(-1===this.currentTimeline_)return 0;var d=b.segments.map(function(e,h){return{timeline:e.timeline,segmentIndex:h}}).filter(function(e){return e.timeline===a.currentTimeline_});return d.length?d[Math.min(d.length-1,1)].segmentIndex:Math.max(b.segments.length-
1,0)}},{key:"generateSegmentInfo_",value:function(b,a,d,e){if(0>a||a>=b.segments.length)return null;var h=b.segments[a];return{requestId:"segment-loader-"+Math.random(),uri:h.resolvedUri,mediaIndex:a,isSyncRequest:e,startOfSegment:d,playlist:b,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:h.timeline,duration:h.duration,segment:h}}},{key:"abortRequestEarly_",value:function(b){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||1E3>Date.now()-
(b.firstBytesReceivedAt||Date.now()))return!1;var a=this.currentTime_(),d=b.bandwidth,e=this.pendingSegment_.duration,h=eb.estimateSegmentRequestTime(e,d,this.playlist_,b.bytesReceived);b=function(k,l,m){var n=2=C.rebufferingImpact});return gd(v,function(C,K){return of(K.playlist,C.playlist)}),v.length?v[0]:(gd(k,function(C,K){return C.rebufferingImpact-
K.rebufferingImpact}),k[0]||null)}({master:this.hls_.playlists.master,currentTime:a,bandwidth:d,duration:this.duration_(),segmentDuration:e,timeUntilRebuffer:b,currentTimeline:this.currentTimeline_,syncController:this.syncController_}))return d=h-b-a.rebufferingImpact,e=.5,b<=1/30&&(e=1),!(!a.playlist||a.playlist.uri===this.playlist_.uri||d3*b.playlist.targetDuration?this.resetEverything():(d&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.isEndOfStream_(b.mediaIndex+1,b.playlist)&&this.endOfStream(),this.paused()||this.monitorBuffer_())}},{key:"recordThroughput_",value:function(b){var a=this.throughput.rate,d=Date.now()-
b.endOfAllRequests+1;this.throughput.rate+=(Math.floor(b.byteLength/d*8E3)-a)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function(b){if(this.segmentMetadataTrack_){var a=b.segment,d=a.start,e=a.end;"number"==typeof d&&isFinite(d)&&"number"==typeof e&&isFinite(e)&&(rc(d,e,this.segmentMetadataTrack_),b={custom:a.custom,dateTimeObject:a.dateTimeObject,dateTimeString:a.dateTimeString,bandwidth:b.playlist.attributes.BANDWIDTH,resolution:b.playlist.attributes.RESOLUTION,codecs:b.playlist.attributes.CODECS,
byteLength:b.byteLength,uri:b.uri,timeline:b.timeline,playlist:b.playlist.id,start:d,end:e},d=new (x.WebKitDataCue||x.VTTCue)(d,e,JSON.stringify(b)),d.value=b,this.segmentMetadataTrack_.addCue(d))}}}]),xc),Yj=new Uint8Array(["\n","\n"].map(function(b){return b.charCodeAt(0)})),yl=(Ib(yc,qf),xb(yc,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return D.createTimeRanges();var b=this.subtitlesTrack_.cues;return D.createTimeRanges([[b[0].startTime,b[b.length-
1].startTime]])}},{key:"initSegment",value:function(b,a){var d=1e.length-w){k=!0;break}if((q=oa.aac.parseId3TagSize(e,
w))>e.length){k=!0;break}null===n&&(h=e.subarray(w,w+q),n=oa.aac.parseAacTimestamp(h));w+=q;break;case "audio":if(7>e.length-w){k=!0;break}if((q=oa.aac.parseAdtsSize(e,w))>e.length){k=!0;break}null===m&&(h=e.subarray(w,w+q),m=oa.aac.parseSampleRate(h));l++;w+=q;break;default:w++}if(k)return null}if(null===m||null===n)return null;e=9E4/m;return{audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+1024*l*e,pts:n+1024*l*e}]}}(b):dl(b))&&(d.audio||d.video)?(function(e,h){if(e.audio&&e.audio.length){var k=
h;"undefined"==typeof k&&(k=e.audio[0].dts);e.audio.forEach(function(n){n.dts=Jc(n.dts,k);n.pts=Jc(n.pts,k);n.dtsTime=n.dts/9E4;n.ptsTime=n.pts/9E4})}if(e.video&&e.video.length){var l=h;if("undefined"==typeof l&&(l=e.video[0].dts),e.video.forEach(function(n){n.dts=Jc(n.dts,l);n.pts=Jc(n.pts,l);n.dtsTime=n.dts/9E4;n.ptsTime=n.pts/9E4}),e.firstKeyFrame){var m=e.firstKeyFrame;m.dts=Jc(m.dts,l);m.pts=Jc(m.pts,l);m.dtsTime=m.dts/9E4;m.ptsTime=m.dts/9E4}}}(d,a),d):null},Zj=[{name:"VOD",run:function(b,a,
d,e,h){return d===1/0?null:{time:0,segmentIndex:0}}},{name:"ProgramDateTime",run:function(b,a,d,e,h){if(!b.datetimeToDisplayTime)return null;a=a.segments||[];e=d=null;h=h||0;for(var k=0;km)h=0>l?d.start-cd(a,b.mediaIndex,h):d.end+cd(a,b.mediaIndex+1,h),this.discontinuities[k]={time:h,accuracy:m}}}},{key:"dispose",
value:function(){this.trigger("dispose");this.off()}}]),zc),xl=new ji("./decrypter-worker.worker.js",function(b,a){function d(v,C){if(!(v instanceof C))throw new TypeError("Cannot call a class as a function");}function e(v,C){for(var K=0;KM;M++)ha[(ea[M]=M<<1^283*(M>>7))^M]=M;for(Z=S=0;!Q[Z];Z^=va||1,S=ha[S]||1){wa=(wa=S^S<<1^S<<2^S<<3^S<<4)>>8^255&wa^99;var Ma=16843009*ea[pa=ea[va=ea[aa[Q[Z]=wa]=Z]]]^65537*pa^257*va^16843008*Z;var Qa=257*ea[wa]^16843008*wa;for(M=0;4>M;M++)K[M][Z]=Qa=Qa<<24^Qa>>>8,H[M][wa]=Ma=Ma<<24^Ma>>>8}for(M=0;5>M;M++)K[M]=K[M].slice(0),H[M]=H[M].slice(0)}B=C;this._tables=[[B[0][0].slice(),B[0][1].slice(),B[0][2].slice(),B[0][3].slice(),B[0][4].slice()],[B[1][0].slice(),
B[1][1].slice(),B[1][2].slice(),B[1][3].slice(),B[1][4].slice()]];C=this._tables[0][4];K=this._tables[1];M=v.length;Z=1;if(4!==M&&6!==M&&8!==M)throw Error("Invalid aes key size");Q=v.slice(0);aa=[];this._key=[Q,aa];for(v=M;v<4*M+28;v++)H=Q[v-1],(0==v%M||8===M&&4==v%M)&&(H=C[H>>>24]<<24^C[H>>16&255]<<16^C[H>>8&255]<<8^C[255&H],0==v%M&&(H=H<<8^H>>>24^Z<<24,Z=Z<<1^283*(Z>>7))),Q[v]=Q[v-M]^H;for(M=0;v;M++,v--)H=Q[3&M?v:v-4],aa[M]=4>=v||4>M?H:K[0][C[H>>>24]]^K[1][C[H>>16&255]]^K[2][C[H>>8&255]]^K[3][C[255&
H]]}function k(){d(this,k);this.listeners={}}function l(){d(this,l);var v=w.call(this,q);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");v=!v||"object"!=typeof v&&"function"!=typeof v?this:v;return v.jobs=[],v.delay=1,v.timeout_=null,v}function m(v){return v<<24|(65280&v)<<8|(16711680&v)>>8|v>>>24}function n(v,C,K,H){d(this,n);var Q=n.STEP,aa=new Int32Array(v.buffer),M=new Uint8Array(v.byteLength);v=0;this.asyncStream_=new G;this.asyncStream_.push(this.decryptChunk_(aa.subarray(v,
v+Q),C,K,M));for(v=Q;v>>24]^
pa[H>>16&255]^wa[K>>8&255]^Ma[255&C]^M[ea];var wb=va[H>>>24]^pa[K>>16&255]^wa[C>>8&255]^Ma[255&v]^M[ea+1];var fc=va[K>>>24]^pa[C>>16&255]^wa[v>>8&255]^Ma[255&H]^M[ea+2];C=va[C>>>24]^pa[v>>16&255]^wa[H>>8&255]^Ma[255&K]^M[ea+3];ea+=4;v=ha;H=wb;K=fc}for(S=0;4>S;S++)Q[(3&-S)+aa]=Qa[v>>>24]<<24^Qa[H>>16&255]<<16^Qa[K>>8&255]<<8^Qa[255&C]^M[ea++],ha=v,v=H,H=K,K=C,C=ha};k.prototype.on=function(v,C){this.listeners[v]||(this.listeners[v]=[]);this.listeners[v].push(C)};k.prototype.off=function(v,C){if(!this.listeners[v])return!1;
var K=this.listeners[v].indexOf(C);return this.listeners[v].splice(K,1),-1>2),aa=new h(Array.prototype.slice.call(C)),M=new Uint8Array(v.byteLength),Z=new Int32Array(M.buffer),S;var ea=K[0];var ha=K[1];var va=K[2];var pa=K[3];for(S=0;S=b-a;d=d.end(d.length-1);return.1>=d-a&&.1>=b-d}},{key:"blacklistCurrentPlaylist",value:function(b,a){var d,e=0h.end(0)||h.start(0)>b.end(0)?this.seekable_=h:this.seekable_=D.createTimeRanges([[b.start(0)>h.start(0)?b.start(0):h.start(0),b.end(0)(b=nl(this.masterPlaylistLoader_.master,a)).length)return this.error="No compatible SourceBuffer configuration for the variant stream:"+
a.resolvedUri,this.mediaSource.endOfStream("decode");this.configureLoaderMimeTypes_(b);this.excludeIncompatibleVariants_(a)}}},{key:"configureLoaderMimeTypes_",value:function(b){var a=1=G.adStartTime&&w<=G.adEndTime){w=G;break a}}w=null}if(m=w){if("cueIn"in q){m.endTime=l;m.adEndTime=l;l+=q.duration;m=null;continue}if(l=a.end(a.length-1)))return this.techWaiting_();5<=this.consecutiveUpdates&&b===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):b===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=b)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=
0;this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_));this.timer_=null}},{key:"fixesBadSeeks_",value:function(){if(!this.tech_.seeking())return!1;var b=this.seekable(),a=this.tech_.currentTime(),d=void 0;return this.afterSeekableWindow_(b,a,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(d=b.end(b.length-1)),this.beforeSeekableWindow_(b,a)&&(d=b.start(0)+.1),"undefined"!=typeof d&&(this.logger_("Trying to seek outside of seekable at time "+a+" with seekable range "+df(b)+". Seeking to "+
d+"."),this.tech_.setCurrentTime(d),!0)}},{key:"waiting_",value:function(){if(!this.techWaiting_()){var b=this.tech_.currentTime(),a=this.tech_.buffered();a=fi(a,b);return a.length&&b+3<=a.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(b),this.logger_("Stopped at "+b+" while inside a buffered region ["+a.start(0)+" -\x3e "+a.end(0)+"]. Attempting to resume playback by seeking to the current time."),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}}},{key:"techWaiting_",
value:function(){var b=this.seekable(),a=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_()||this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(b,a))return b=b.end(b.length-1),this.logger_("Fell out of live window at time "+a+". Seeking to live point (seekable end) "+b),this.cancelTimer_(),this.tech_.setCurrentTime(b),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0;var d=this.tech_.buffered();b=gi(d,a);return this.videoUnderflow_(b,d,
a)?(this.cancelTimer_(),this.tech_.setCurrentTime(a),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0):0b.length)var d=D.createTimeRanges();else{d=[];for(var e=1;ea-h&&2e||v.height>h})).filter(function(v){return v.width===w[0].width&&v.height===w[0].height}),n=B[B.length-1],G=B.filter(function(v){return v.bandwidth===n.bandwidth})[0]);return(a=G||m||q||l[0]||a[0])?a.playlist:null}(this.playlists.master,this.systemBandwidth,parseInt(wi(this.tech_.el(),"width"),10)*b,parseInt(wi(this.tech_.el(),"height"),
10)*b,this.limitRenditionByPlayerDimensions)},INITIAL_PLAYLIST_SELECTOR:function(){var b=this.playlists.master.playlists.filter(eb.isEnabled);return gd(b,function(a,d){return of(a,d)}),b.filter(function(a){return dd(a.attributes.CODECS).videoCodec})[0]||null},comparePlaylistBandwidth:of,comparePlaylistResolution:function(b,a){var d=void 0,e=void 0;return b.attributes.RESOLUTION&&b.attributes.RESOLUTION.width&&(d=b.attributes.RESOLUTION.width),d=d||x.Number.MAX_VALUE,a.attributes.RESOLUTION&&a.attributes.RESOLUTION.width&&
(e=a.attributes.RESOLUTION.width),d===(e=e||x.Number.MAX_VALUE)&&b.attributes.BANDWIDTH&&a.attributes.BANDWIDTH?b.attributes.BANDWIDTH-a.attributes.BANDWIDTH:d-e},xhr:ai()};"GOAL_BUFFER_LENGTH MAX_GOAL_BUFFER_LENGTH GOAL_BUFFER_LENGTH_RATE BUFFER_LOW_WATER_LINE MAX_BUFFER_LOW_WATER_LINE BUFFER_LOW_WATER_LINE_RATE BANDWIDTH_VARIANCE".split(" ").forEach(function(b){Object.defineProperty(jb,b,{get:function(){return D.log.warn("using Hls."+b+" is UNSAFE be sure you know what you are doing"),mb[b]},set:function(a){D.log.warn("using Hls."+
b+" is UNSAFE be sure you know what you are doing");"number"!=typeof a||0>a?D.log.warn("value of Hls."+b+" must be greater than or equal to 0"):mb[b]=a}})});jb.canPlaySource=function(){return D.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};jb.supportsNativeHls=function(){var b=J.createElement("video");return D.getTech("Html5").isSupported()?"application/vnd.apple.mpegurl audio/mpegurl audio/x-mpegurl application/x-mpegurl video/x-mpegurl video/mpegurl application/mpegurl".split(" ").some(function(a){return/maybe|probably/i.test(b.canPlayType(a))}):
!1}();jb.supportsNativeDash=!!D.getTech("Html5").isSupported()&&/maybe|probably/i.test(J.createElement("video").canPlayType("application/dash+xml"));jb.supportsTypeNatively=function(b){return"hls"===b?jb.supportsNativeHls:"dash"===b&&jb.supportsNativeDash};jb.isSupported=function(){return D.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var jn=D.getComponent("Component"),bk=(Ib(Pb,jn),xb(Pb,[{key:"setOptions_",value:function(){var b=this;if(this.options_.withCredentials=
this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage="undefined"!=typeof this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:
this.options_.useBandwidthFromLocalStorage||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var a=Ci();a&&a.bandwidth&&(this.options_.bandwidth=a.bandwidth,this.tech_.trigger({type:"usage",
name:"hls-bandwidth-from-local-storage"}));a&&a.throughput&&(this.options_.throughput=a.throughput,this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=mb.INITIAL_BANDWIDTH);this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===mb.INITIAL_BANDWIDTH;"withCredentials useDevicePixelRatio limitRenditionByPlayerDimensions bandwidth smoothQualityChange customTagParsers customTagMappers handleManifestRedirects cacheEncryptionKeys".split(" ").forEach(function(d){"undefined"!=
typeof b.source_[d]&&(b.options_[d]=b.source_[d])});this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions;this.useDevicePixelRatio=this.options_.useDevicePixelRatio}},{key:"src",value:function(b,a){var d=this;b&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=jb,this.options_.sourceType=Ai(a),this.options_.seekTo=function(e){d.tech_.setCurrentTime(e)},this.masterPlaylistController_=new gn(this.options_),this.playbackWatcher_=
new hn(D.mergeOptions(this.options_,{seekable:function(){return d.seekable()},media:function(){return d.masterPlaylistController_.media()}})),this.masterPlaylistController_.on("error",function(){D.players[d.tech_.options_.playerId].error(d.masterPlaylistController_.error)}),this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):jb.STANDARD_PLAYLIST_SELECTOR.bind(this),this.masterPlaylistController_.selectInitialPlaylist=jb.INITIAL_PLAYLIST_SELECTOR.bind(this),
this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=
e;this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e;this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e=1/(this.bandwidth||1),h=void 0;return h=0da?"0"+parseInt(da):parseInt(da);da=0O?"0"+parseInt(O)+":"+da:parseInt(O)+":"+da:"00:"+da;0R?"0"+parseInt(R)+
":"+da:parseInt(R)+":"+da);return da}function ca(O){var da=!1,R=O.controlBar.ProgressControl.seekBar;R.on(["mousedown","touchstart"],function(){da=!0});R.on(["mousemove","touchmove"],function(X){if(da){X=X.touches?X.touches[0]:X;var sa=R.el().getBoundingClientRect(),Oa=Math.max(Math.min(100*(X.clientX-(sa?sa.left:0))/(sa?sa.width:1),100),0);R.playProgressBar.el().style.width=Oa+"%";X=O.getChild("seekTip");sa=O.controlBar.ProgressControl.seekBar.duration_;Oa=sa*Oa/100;X.el().innerHTML=la(Oa)+" / "+
la(sa)}});R.on(["mouseup","touchend"],function(){da=!1});R.on(["mouseleave","touchcancel"],function(){da=!1})}function Na(O,da,R,X){var sa=O.controlBar.RotateToggle,Oa=O.getChild("CloseButton"),Ga=O.getChild("cover"),Y=O.getChild("roundPlayButton"),Ka=O.getChild("roundPauseButton");Y.hide();Ka.hide();if(sa)sa.on("touchstart",function(){O.hasClass("vjs-landscape")?J(O):ia(O)});Oa.on("click",function(){"popup"===X?(document.getElementById(Fa).classList.remove("active"),document.body.style.overflow=
"auto"):"spread"===X&&(document.getElementById(Fa).classList.remove("active"),document.body.style.overflow="auto");X&&O.removeClass("vjs-"+X);O.pause();O.currentTime(0)});Ga.on("click",function(ya){if(ya.target.classList.contains("vjs-cover-play-button")||ya.target.parentNode.classList.contains("vjs-cover-play-button"))if("youtube"===R&&"window"===X){ya="";for(var ra=O.options_.sources,za=0;zawindow.innerHeight;ab=0>bb.top+bb.height;sa()}var Ga=R?0:1+da,Y="video"===X||"clip"===X,Ka="clip"===X,ya=!1,ra=!1,za=null,La=!0,$a=!0,ab=!0;if(Ga||Y)1