-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideojs.hls.min.js
executable file
·5 lines (5 loc) · 102 KB
/
videojs.hls.min.js
1
2
3
4
5
/*! videojs-contrib-hls - v1.3.1 - 2015-12-16
* Copyright (c) 2015 Brightcove; Licensed */
!function(a,b,c){var d=function(){this.init=function(){var a={};this.on=function(b,c){a[b]||(a[b]=[]),a[b].push(c)},this.off=function(b,c){var d;return a[b]?(d=a[b].indexOf(c),a[b].splice(d,1),d>-1):!1},this.trigger=function(b){var c,d,e,f;if(c=a[b])if(2===arguments.length)for(e=c.length,d=0;e>d;++d)c[d].call(this,arguments[1]);else{for(f=[],d=arguments.length,d=1;d<arguments.length;++d)f.push(arguments[d]);for(e=c.length,d=0;e>d;++d)c[d].apply(this,f)}},this.dispose=function(){a={}}}};d.prototype.pipe=function(a){return this.on("data",function(b){a.push(b)}),this.on("done",function(){a.flush()}),a},d.prototype.push=function(a){this.trigger("data",a)},d.prototype.flush=function(){this.trigger("done")},a.muxjs=a.muxjs||{},a.muxjs.utils=a.muxjs.utils||{},a.muxjs.utils.Stream=d}(this,this.muxjs),function(a,b){var c;c=function(a){var b=a.byteLength,c=0,d=0;this.length=function(){return 8*b},this.bitsAvailable=function(){return 8*b+d},this.loadWord=function(){var e=a.byteLength-b,f=new Uint8Array(4),g=Math.min(4,b);if(0===g)throw new Error("no bytes available");f.set(a.subarray(e,e+g)),c=new DataView(f.buffer).getUint32(0),d=8*g,b-=g},this.skipBits=function(a){var e;d>a?(c<<=a,d-=a):(a-=d,e=Math.floor(a/8),a-=8*e,b-=e,this.loadWord(),c<<=a,d-=a)},this.readBits=function(a){var e=Math.min(d,a),f=c>>>32-e;return console.assert(32>a,"Cannot read more than 32 bits at a time"),d-=e,d>0?c<<=e:b>0&&this.loadWord(),e=a-e,e>0?f<<e|this.readBits(e):f},this.skipLeadingZeros=function(){var a;for(a=0;d>a;++a)if(0!==(c&2147483648>>>a))return c<<=a,d-=a,a;return this.loadWord(),a+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var a=this.skipLeadingZeros();return this.readBits(a+1)-1},this.readExpGolomb=function(){var a=this.readUnsignedExpGolomb();return 1&a?1+a>>>1:-1*(a>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},a.muxjs=b||{},b.utils=b.utils||{},b.utils.ExpGolomb=c}(this,this.muxjs),function(a,b){"use strict";var c,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];c=function(){var a,b;c.prototype.init.call(this),a=this,this.push=function(a){var c,e,f,g,h,i,j=0,k=0;if("audio"===a.type)for(b?(g=b,b=new Uint8Array(g.byteLength+a.data.byteLength),b.set(g),b.set(a.data,g.byteLength)):b=a.data;j+5<b.length;)if(255===b[j]&&240===(246&b[j+1])){if(e=2*(1&~b[j+1]),c=(3&b[j+3])<<11|b[j+4]<<3|(224&b[j+5])>>5,h=1024*((3&b[j+6])+1),i=9e4*h/d[(60&b[j+2])>>>2],f=j+c,b.byteLength<f)return;if(this.trigger("data",{pts:a.pts+k*i,dts:a.dts+k*i,sampleCount:h,audioobjecttype:(b[j+2]>>>6&3)+1,channelcount:(1&b[j+2])<<3|(192&b[j+3])>>>6,samplerate:d[(60&b[j+2])>>>2],samplingfrequencyindex:(60&b[j+2])>>>2,samplesize:16,data:b.subarray(j+7+e,f)}),b.byteLength===f)return void(b=void 0);k++,b=b.subarray(f)}else j++}},c.prototype=new b.utils.Stream,b.codecs=b.codecs||{},b.codecs.AacStream=c}(this,this.muxjs),function(a,b){"use strict";var c,d;d=function(){var a,b,c=0;d.prototype.init.call(this),this.push=function(d){var e;for(b?(e=new Uint8Array(b.byteLength+d.data.byteLength),e.set(b),e.set(d.data,b.byteLength),b=e):b=d.data;c<b.byteLength-3;c++)if(1===b[c+2]){a=c+5;break}for(;a<b.byteLength;)switch(b[a]){case 0:if(0!==b[a-1]){a+=2;break}if(0!==b[a-2]){a++;break}this.trigger("data",b.subarray(c+3,a-2));do a++;while(1!==b[a]&&a<b.length);c=a-2,a+=3;break;case 1:if(0!==b[a-1]||0!==b[a-2]){a+=3;break}this.trigger("data",b.subarray(c+3,a-2)),c=a-2,a+=3;break;default:a+=3}b=b.subarray(c),a-=c,c=0},this.flush=function(){b&&b.byteLength>3&&this.trigger("data",b.subarray(c+3)),b=null,c=0,this.trigger("done")}},d.prototype=new b.utils.Stream,c=function(){var a,e,f,g,h,i,j,k=new d;c.prototype.init.call(this),a=this,this.push=function(a){"video"===a.type&&(e=a.trackId,f=a.pts,g=a.dts,k.push(a))},k.on("data",function(b){var c={trackId:e,pts:f,dts:g,data:b};switch(31&b[0]){case 5:c.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:c.nalUnitType="sei_rbsp",c.escapedRBSP=h(b.subarray(1));break;case 7:c.nalUnitType="seq_parameter_set_rbsp",c.escapedRBSP=h(b.subarray(1)),c.config=i(c.escapedRBSP);break;case 8:c.nalUnitType="pic_parameter_set_rbsp";break;case 9:c.nalUnitType="access_unit_delimiter_rbsp"}a.trigger("data",c)}),k.on("done",function(){a.trigger("done")}),this.flush=function(){k.flush()},j=function(a,b){var c,d,e=8,f=8;for(c=0;a>c;c++)0!==f&&(d=b.readExpGolomb(),f=(e+d+256)%256),e=0===f?e:f},h=function(a){for(var b,c,d=a.byteLength,e=[],f=1;d-2>f;)0===a[f]&&0===a[f+1]&&3===a[f+2]?(e.push(f+2),f+=2):f++;if(0===e.length)return a;b=d-e.length,c=new Uint8Array(b);var g=0;for(f=0;b>f;g++,f++)g===e[0]&&(g++,e.shift()),c[f]=a[g];return c},i=function(a){var c,d,e,f,g,h,i,k,l,m,n,o,p=0,q=0,r=0,s=0;if(c=new b.utils.ExpGolomb(a),d=c.readUnsignedByte(),f=c.readUnsignedByte(),e=c.readUnsignedByte(),c.skipUnsignedExpGolomb(),(100===d||110===d||122===d||244===d||44===d||83===d||86===d||118===d||128===d||138===d||139===d||134===d)&&(g=c.readUnsignedExpGolomb(),3===g&&c.skipBits(1),c.skipUnsignedExpGolomb(),c.skipUnsignedExpGolomb(),c.skipBits(1),c.readBoolean()))for(n=3!==g?8:12,o=0;n>o;o++)c.readBoolean()&&(6>o?j(16,c):j(64,c));if(c.skipUnsignedExpGolomb(),h=c.readUnsignedExpGolomb(),0===h)c.readUnsignedExpGolomb();else if(1===h)for(c.skipBits(1),c.skipExpGolomb(),c.skipExpGolomb(),i=c.readUnsignedExpGolomb(),o=0;i>o;o++)c.skipExpGolomb();return c.skipUnsignedExpGolomb(),c.skipBits(1),k=c.readUnsignedExpGolomb(),l=c.readUnsignedExpGolomb(),m=c.readBits(1),0===m&&c.skipBits(1),c.skipBits(1),c.readBoolean()&&(p=c.readUnsignedExpGolomb(),q=c.readUnsignedExpGolomb(),r=c.readUnsignedExpGolomb(),s=c.readUnsignedExpGolomb()),{profileIdc:d,levelIdc:e,profileCompatibility:f,width:16*(k+1)-2*p-2*q,height:(2-m)*(l+1)*16-2*r-2*s}}},c.prototype=new b.utils.Stream,b.codecs=b.codecs||{},b.codecs.H264Stream=c,b.codecs.NalByteStream=d}(this,this.muxjs),function(a,b,c){"use strict";var d,e,f,g,h,i,j,k;g=188,k=71,h=27,i=15,j=21,d=function(){var a=new Uint8Array(g),b=0;d.prototype.init.call(this),this.push=function(c){var d,e=0,f=g;for(b?(d=new Uint8Array(c.byteLength+b),d.set(a.subarray(0,b)),d.set(c,b),b=0):d=c;f<d.byteLength;)d[e]!==k||d[f]!==k?(e++,f++):(this.trigger("data",d.subarray(e,f)),e+=g,f+=g);e<d.byteLength&&(a.set(d.subarray(e),0),b=d.byteLength-e)},this.flush=function(){b===g&&a[0]===k&&(this.trigger("data",a),b=0),this.trigger("done")}},d.prototype=new b.utils.Stream,e=function(){var a,b,d,f;e.prototype.init.call(this),f=this,this.packetsWaitingForPmt=[],this.programMapTable=c,a=function(a,c){var e=0;c.payloadUnitStartIndicator&&(e+=a[e]+1),"pat"===c.type?b(a.subarray(e),c):d(a.subarray(e),c)},b=function(a,b){b.section_number=a[7],b.last_section_number=a[8],f.pmtPid=(31&a[10])<<8|a[11],b.pmtPid=f.pmtPid},d=function(a,b){var c,d,e,g;if(1&a[5]){for(f.programMapTable={},c=(15&a[1])<<8|a[2],d=3+c-4,e=(15&a[10])<<8|a[11],g=12+e;d>g;)f.programMapTable[(31&a[g+1])<<8|a[g+2]]=a[g],g+=((15&a[g+3])<<8|a[g+4])+5;for(b.programMapTable=f.programMapTable;f.packetsWaitingForPmt.length;)f.processPes_.apply(f,f.packetsWaitingForPmt.shift())}},this.push=function(b){var d={},e=4;d.payloadUnitStartIndicator=!!(64&b[1]),d.pid=31&b[1],d.pid<<=8,d.pid|=b[2],(48&b[3])>>>4>1&&(e+=b[e]+1),0===d.pid?(d.type="pat",a(b.subarray(e),d),this.trigger("data",d)):d.pid===this.pmtPid?(d.type="pmt",a(b.subarray(e),d),this.trigger("data",d)):this.programMapTable===c?this.packetsWaitingForPmt.push([b,e,d]):this.processPes_(b,e,d)},this.processPes_=function(a,b,c){c.streamType=this.programMapTable[c.pid],c.type="pes",c.data=a.subarray(b),this.trigger("data",c)}},e.prototype=new b.utils.Stream,e.STREAM_TYPES={h264:27,adts:15},f=function(){var a,b={data:[],size:0},c={data:[],size:0},d={data:[],size:0},e=function(a,b){var c;b.dataAlignmentIndicator=0!==(4&a[6]),c=a[7],192&c&&(b.pts=(14&a[9])<<27|(255&a[10])<<20|(254&a[11])<<12|(255&a[12])<<5|(254&a[13])>>>3,b.pts*=4,b.pts+=(6&a[13])>>>1,b.dts=b.pts,64&c&&(b.dts=(14&a[14])<<27|(255&a[15])<<20|(254&a[16])<<12|(255&a[17])<<5|(254&a[18])>>>3,b.dts*=4,b.dts+=(6&a[18])>>>1)),b.data=a.subarray(9+a[8])},g=function(b,c){var d,f=new Uint8Array(b.size),g={type:c},h=0;if(b.data.length){for(g.trackId=b.data[0].pid;b.data.length;)d=b.data.shift(),f.set(d.data,h),h+=d.data.byteLength;e(f,g),b.size=0,a.trigger("data",g)}};f.prototype.init.call(this),a=this,this.push=function(e){({pat:function(){},pes:function(){var a,f;switch(e.streamType){case h:a=b,f="video";break;case i:a=c,f="audio";break;case j:a=d,f="timed-metadata";break;default:return}e.payloadUnitStartIndicator&&g(a,f),a.data.push(e),a.size+=e.data.byteLength},pmt:function(){var b,c,d={type:"metadata",tracks:[]},f=e.programMapTable;for(b in f)f.hasOwnProperty(b)&&(c={timelineStartInfo:{baseMediaDecodeTime:0}},c.id=+b,f[b]===h?(c.codec="avc",c.type="video"):f[b]===i&&(c.codec="adts",c.type="audio"),d.tracks.push(c));a.trigger("data",d)}})[e.type]()},this.flush=function(){g(b,"video"),g(c,"audio"),g(d,"timed-metadata"),this.trigger("done")}},f.prototype=new b.utils.Stream,b.mp2t=b.mp2t||{},b.mp2t.PAT_PID=0,b.mp2t.MP2T_PACKET_LENGTH=g,b.mp2t.H264_STREAM_TYPE=h,b.mp2t.ADTS_STREAM_TYPE=i,b.mp2t.METADATA_STREAM_TYPE=j,b.mp2t.TransportPacketStream=d,b.mp2t.TransportParseStream=e,b.mp2t.ElementaryStream=f}(this,this.muxjs),function(a,b){"use strict";var c;c=function(a,b){var d,e=0,f=16384,g=function(a,b){var c,d=a.position+b;d<a.bytes.byteLength||(c=new Uint8Array(2*d),c.set(a.bytes.subarray(0,a.position),0),a.bytes=c,a.view=new DataView(a.bytes.buffer))},h=c.widthBytes||new Uint8Array("width".length),i=c.heightBytes||new Uint8Array("height".length),j=c.videocodecidBytes||new Uint8Array("videocodecid".length);if(!c.widthBytes){for(d=0;d<"width".length;d++)h[d]="width".charCodeAt(d);for(d=0;d<"height".length;d++)i[d]="height".charCodeAt(d);for(d=0;d<"videocodecid".length;d++)j[d]="videocodecid".charCodeAt(d);c.widthBytes=h,c.heightBytes=i,c.videocodecidBytes=j}switch(this.keyFrame=!1,a){case c.VIDEO_TAG:this.length=16,f*=6;break;case c.AUDIO_TAG:this.length=13,this.keyFrame=!0;break;case c.METADATA_TAG:this.length=29,this.keyFrame=!0;break;default:throw"Error Unknown TagType"}this.bytes=new Uint8Array(f),this.view=new DataView(this.bytes.buffer),this.bytes[0]=a,this.position=this.length,this.keyFrame=b,this.pts=0,this.dts=0,this.writeBytes=function(a,b,c){var d,e=b||0;c=c||a.byteLength,d=e+c,g(this,c),this.bytes.set(a.subarray(e,d),this.position),this.position+=c,this.length=Math.max(this.length,this.position)},this.writeByte=function(a){g(this,1),this.bytes[this.position]=a,this.position++,this.length=Math.max(this.length,this.position)},this.writeShort=function(a){g(this,2),this.view.setUint16(this.position,a),this.position+=2,this.length=Math.max(this.length,this.position)},this.negIndex=function(a){return this.bytes[this.length-a]},this.nalUnitSize=function(){return 0===e?0:this.length-(e+4)},this.startNalUnit=function(){if(e>0)throw new Error("Attempted to create new NAL wihout closing the old one");e=this.length,this.length+=4,this.position=this.length},this.endNalUnit=function(a){var b,c;this.length===e+4?this.length-=4:e>0&&(b=e+4,c=this.length-b,this.position=e,this.view.setUint32(this.position,c),this.position=this.length,a&&a.push(this.bytes.subarray(b,b+c))),e=0},this.writeMetaDataDouble=function(a,b){var c;if(g(this,2+a.length+9),this.view.setUint16(this.position,a.length),this.position+=2,"width"===a)this.bytes.set(h,this.position),this.position+=5;else if("height"===a)this.bytes.set(i,this.position),this.position+=6;else if("videocodecid"===a)this.bytes.set(j,this.position),this.position+=12;else for(c=0;c<a.length;c++)this.bytes[this.position]=a.charCodeAt(c),this.position++;this.position++,this.view.setFloat64(this.position,b),this.position+=8,this.length=Math.max(this.length,this.position),++e},this.writeMetaDataBoolean=function(a,b){var c;for(g(this,2),this.view.setUint16(this.position,a.length),this.position+=2,c=0;c<a.length;c++)console.assert(a.charCodeAt(c)<255),g(this,1),this.bytes[this.position]=a.charCodeAt(c),this.position++;g(this,2),this.view.setUint8(this.position,1),this.position++,this.view.setUint8(this.position,b?1:0),this.position++,this.length=Math.max(this.length,this.position),++e},this.finalize=function(){var a,d;switch(this.bytes[0]){case c.VIDEO_TAG:this.bytes[11]=7|(this.keyFrame||b?16:32),this.bytes[12]=b?0:1,a=this.pts-this.dts,this.bytes[13]=(16711680&a)>>>16,this.bytes[14]=(65280&a)>>>8,this.bytes[15]=(255&a)>>>0;break;case c.AUDIO_TAG:this.bytes[11]=175,this.bytes[12]=b?0:1;break;case c.METADATA_TAG:this.position=11,this.view.setUint8(this.position,2),this.position++,this.view.setUint16(this.position,10),this.position+=2,this.bytes.set([111,110,77,101,116,97,68,97,116,97],this.position),this.position+=10,this.bytes[this.position]=8,this.position++,this.view.setUint32(this.position,e),this.position=this.length,this.bytes.set([0,0,9],this.position),this.position+=3,this.length=this.position}return d=this.length-11,this.bytes[1]=(16711680&d)>>>16,this.bytes[2]=(65280&d)>>>8,this.bytes[3]=(255&d)>>>0,this.bytes[4]=(16711680&this.dts)>>>16,this.bytes[5]=(65280&this.dts)>>>8,this.bytes[6]=(255&this.dts)>>>0,this.bytes[7]=(4278190080&this.dts)>>>24,this.bytes[8]=0,this.bytes[9]=0,this.bytes[10]=0,g(this,4),this.view.setUint32(this.length,this.length),this.length+=4,this.position+=4,this.bytes=this.bytes.subarray(0,this.length),this.frameTime=c.frameTime(this.bytes),console.assert(this.bytes.byteLength===this.length),this}},c.AUDIO_TAG=8,c.VIDEO_TAG=9,c.METADATA_TAG=18,c.isAudioFrame=function(a){return c.AUDIO_TAG===a[0]},c.isVideoFrame=function(a){return c.VIDEO_TAG===a[0]},c.isMetaData=function(a){return c.METADATA_TAG===a[0]},c.isKeyFrame=function(a){return c.isVideoFrame(a)?23===a[11]:c.isAudioFrame(a)?!0:c.isMetaData(a)?!0:!1},c.frameTime=function(a){var b=a[4]<<16;return b|=a[5]<<8,b|=a[6]<<0,b|=a[7]<<24},b.flv=b.flv||{},b.flv.FlvTag=c}(this,this.muxjs),function(a,b,c){"use strict";var d,e=function(a,b,c){var d,e="";for(d=b;c>d;d++)e+="%"+("00"+a[d].toString(16)).slice(-2);return e},f=function(b,c,d){return a.decodeURIComponent(e(b,c,d))},g=function(b,c,d){return a.unescape(e(b,c,d))},h=function(a){return a[0]<<21|a[1]<<14|a[2]<<7|a[3]},i={TXXX:function(a){var b;if(3===a.data[0]){for(b=1;b<a.data.length;b++)if(0===a.data[b]){a.description=f(a.data,1,b),a.value=f(a.data,b+1,a.data.length-1);break}a.data=a.value}},WXXX:function(a){var b;if(3===a.data[0])for(b=1;b<a.data.length;b++)if(0===a.data[b]){a.description=f(a.data,1,b),a.url=f(a.data,b+1,a.data.length);break}},PRIV:function(a){var b;for(b=0;b<a.data.length;b++)if(0===a.data[b]){a.owner=g(a.data,0,b);break}a.privateData=a.data.subarray(b+1),a.data=a.privateData}};d=function(a){var c,e={debug:!(!a||!a.debug),descriptor:a&&a.descriptor},f=0,g=[],j=0;if(d.prototype.init.call(this),this.dispatchType=b.mp2t.METADATA_STREAM_TYPE.toString(16),e.descriptor)for(c=0;c<e.descriptor.length;c++)this.dispatchType+=("00"+e.descriptor[c].toString(16)).slice(-2);this.push=function(a){var b,c,d,k,l;if("timed-metadata"===a.type){if(a.dataAlignmentIndicator&&(j=0,g.length=0),0===g.length&&(a.data.length<10||a.data[0]!=="I".charCodeAt(0)||a.data[1]!=="D".charCodeAt(0)||a.data[2]!=="3".charCodeAt(0)))return void(e.debug&&console.log("Skipping unrecognized metadata packet"));if(g.push(a),j+=a.data.byteLength,1===g.length&&(f=h(a.data.subarray(6,10)),f+=10),!(f>j)){for(b={data:new Uint8Array(f),frames:[],pts:g[0].pts,dts:g[0].dts},l=0;f>l;)b.data.set(g[0].data.subarray(0,f-l),l),l+=g[0].data.byteLength,j-=g[0].data.byteLength,g.shift();c=10,64&b.data[5]&&(c+=4,c+=h(b.data.subarray(10,14)),f-=h(b.data.subarray(16,20)));do{if(d=h(b.data.subarray(c+4,c+8)),1>d)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");k={id:String.fromCharCode(b.data[c],b.data[c+1],b.data[c+2],b.data[c+3]),data:b.data.subarray(c+10,c+d+10)},k.key=k.id,i[k.id]&&i[k.id](k),b.frames.push(k),c+=10,c+=d}while(f>c);this.trigger("data",b)}}}},d.prototype=new b.utils.Stream,b.mp2t=b.mp2t||{},b.mp2t.MetadataStream=d}(this,this.muxjs),function(a,b,c){"use strict";var d=4,e=128,f=function(a){for(var b=0,c={payloadType:-1,payloadSize:0},f=0,g=0;b<a.byteLength&&a[b]!==e;){for(;255===a[b];)f+=255,b++;for(f+=a[b++];255===a[b];)g+=255,b++;if(g+=a[b++],!c.payload&&f===d){c.payloadType=f,c.payloadSize=g,c.payload=a.subarray(b,b+g);break}b+=g,f=0,g=0}return c},g=function(a){return 181!==a.payload[0]?null:49!==(a.payload[1]<<8|a.payload[2])?null:"GA94"!==String.fromCharCode(a.payload[3],a.payload[4],a.payload[5],a.payload[6])?null:3!==a.payload[7]?null:a.payload.subarray(8,a.payload.length-1)},h=function(a,b){var c,d,e,f,g=[];if(!(64&b[0]))return g;for(d=31&b[0],c=0;d>c;c++)e=3*c,f={type:3&b[e+2],pts:a},4&b[e+2]&&(f.ccData=b[e+3]<<8|b[e+4],g.push(f));return g},i=function(){i.prototype.init.call(this),this.captionPackets_=[],this.field1_=new w,this.field1_.on("data",this.trigger.bind(this,"data")),this.field1_.on("done",this.trigger.bind(this,"done"))};i.prototype=new b.utils.Stream,i.prototype.push=function(a){var b,c;"sei_rbsp"===a.nalUnitType&&(b=f(a.escapedRBSP),b.payloadType===d&&(c=g(b),c&&(this.captionPackets_=this.captionPackets_.concat(h(a.pts,c)))))},i.prototype.flush=function(){return this.captionPackets_.length?(this.captionPackets_.sort(function(a,b){return a.pts-b.pts}),this.captionPackets_.forEach(this.field1_.push,this.field1_),this.captionPackets_.length=0,void this.field1_.flush()):void this.field1_.flush()};var j={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608},k=0,l=5152,m=5167,n=5157,o=5158,p=5159,q=5165,r=5153,s=5164,t=5166,u=14,v=function(){for(var a=[],b=u+1;b--;)a.push("");return a},w=function(){w.prototype.init.call(this),this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=v(),this.nonDisplayed_=v(),this.lastControlCode_=null,this.push=function(a){var b,c,d,e;if(b=32639&a.ccData,b===this.lastControlCode_)return void(this.lastControlCode_=null);switch(4096===(61440&b)?this.lastControlCode_=b:this.lastControlCode_=null,b){case k:break;case l:this.mode_="popOn";break;case m:this.flushDisplayed(a.pts),c=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=c,this.startPts_=a.pts;break;case n:this.topRow_=u-1,this.mode_="rollUp";break;case o:this.topRow_=u-2,this.mode_="rollUp";break;case p:this.topRow_=u-3,this.mode_="rollUp";break;case q:this.flushDisplayed(a.pts),this.shiftRowsUp_(),this.startPts_=a.pts;break;case r:"popOn"===this.mode_?this.nonDisplayed_[u]=this.nonDisplayed_[u].slice(0,-1):this.displayed_[u]=this.displayed_[u].slice(0,-1);break;case s:this.flushDisplayed(a.pts),this.displayed_=v();break;case t:this.nonDisplayed_=v();break;default:if(d=b>>>8,e=255&b,d>=16&&23>=d&&e>=64&&127>=e&&(16!==d||96>e)&&(d=e=32),16===(240&d))return;this[this.mode_](a.pts,d,e)}}};w.prototype=new b.utils.Stream,w.prototype.flushDisplayed=function(a){var b,c;for(c=0;c<this.displayed_.length;c++)b=this.displayed_[c],b.length&&this.trigger("data",{startPts:this.startPts_,endPts:a,text:b})},w.prototype.popOn=function(a,b,c){var d=this.nonDisplayed_[u];b=j[b]||b,d+=String.fromCharCode(b),c=j[c]||c,d+=String.fromCharCode(c),this.nonDisplayed_[u]=d},w.prototype.rollUp=function(a,b,c){var d=this.displayed_[u];""===d&&(this.flushDisplayed(a),this.startPts_=a),b=j[b]||b,d+=String.fromCharCode(b),c=j[c]||c,d+=String.fromCharCode(c),this.displayed_[u]=d},w.prototype.shiftRowsUp_=function(){var a;for(a=0;a<this.topRow_;a++)this.displayed_[a]="";for(a=this.topRow_;u>a;a++)this.displayed_[a]=this.displayed_[a+1];this.displayed_[u]=""},b.mp2t=b.mp2t||{},b.mp2t.CaptionStream=i,b.mp2t.Cea608Stream=w}(this,this.muxjs),function(a,b){"use strict";var c,d,e,f,g,h,i,j=b.flv.FlvTag;b.MetadataStream;g=function(a,b){"number"==typeof b.pts&&(void 0===a.timelineStartInfo.pts?a.timelineStartInfo.pts=b.pts:a.timelineStartInfo.pts=Math.min(a.timelineStartInfo.pts,b.pts)),"number"==typeof b.dts&&(void 0===a.timelineStartInfo.dts?a.timelineStartInfo.dts=b.dts:a.timelineStartInfo.dts=Math.min(a.timelineStartInfo.dts,b.dts))},h=function(a,b){var c=new j(j.METADATA_TAG);return c.dts=b,c.pts=b,c.writeMetaDataDouble("videocodecid",7),c.writeMetaDataDouble("width",a.width),c.writeMetaDataDouble("height",a.height),c},i=function(a,b){var c,d=new j(j.VIDEO_TAG,!0);for(d.dts=b,d.pts=b,d.writeByte(1),d.writeByte(a.profileIdc),d.writeByte(a.profileCompatibility),d.writeByte(a.levelIdc),d.writeByte(255),d.writeByte(225),d.writeShort(a.sps[0].length),d.writeBytes(a.sps[0]),d.writeByte(a.pps.length),c=0;c<a.pps.length;++c)d.writeShort(a.pps[c].length),d.writeBytes(a.pps[c]);return d},e=function(a){var b,c=[];e.prototype.init.call(this),this.push=function(b){g(a,b),a&&void 0===a.channelcount&&(a.audioobjecttype=b.audioobjecttype,a.channelcount=b.channelcount,a.samplerate=b.samplerate,a.samplingfrequencyindex=b.samplingfrequencyindex,a.samplesize=b.samplesize,a.extraData=a.audioobjecttype<<11|a.samplingfrequencyindex<<7|a.channelcount<<3),b.pts=Math.round(b.pts/90),b.dts=Math.round(b.dts/90),c.push(b)},this.flush=function(){var d,e,f,g=[];if(0===c.length)return void this.trigger("done");for(f=-(1/0);c.length;)d=c.shift(),(a.extraData!==b||d.pts-f>=1e3)&&(e=new j(j.METADATA_TAG),e.pts=d.pts,e.dts=d.dts,e.writeMetaDataDouble("audiocodecid",10),e.writeMetaDataBoolean("stereo",2===a.channelcount),e.writeMetaDataDouble("audiosamplerate",a.samplerate),e.writeMetaDataDouble("audiosamplesize",16),g.push(e),b=a.extraData,e=new j(j.AUDIO_TAG,!0),e.pts=d.pts,e.dts=d.dts,e.view.setUint16(e.position,a.extraData),e.position+=2,e.length=Math.max(e.length,e.position),g.push(e),f=d.pts),e=new j(j.AUDIO_TAG),e.pts=d.pts,e.dts=d.dts,e.writeBytes(d.data),g.push(e);b=null,this.trigger("data",{track:a,tags:g}),this.trigger("done")}},e.prototype=new b.utils.Stream,d=function(a){var b,c,e=[];d.prototype.init.call(this),this.finishFrame=function(c,d){d&&(a.newMetadata&&(d.keyFrame||0===c.length)&&(c.push(h(b,d.pts)),c.push(i(a,d.pts)),a.newMetadata=!1),d.endNalUnit(),c.push(d))},this.push=function(b){g(a,b),b.pts=Math.round(b.pts/90),b.dts=Math.round(b.dts/90),e.push(b)},this.flush=function(){for(var d,f=[];e.length&&"access_unit_delimiter_rbsp"!==e[0].nalUnitType;)e.shift();if(0===e.length)return void this.trigger("done");for(;e.length;)d=e.shift(),"seq_parameter_set_rbsp"===d.nalUnitType?(a.newMetadata=!0,b=d.config,a.width=b.width,a.height=b.height,a.sps=[d.data],a.profileIdc=b.profileIdc,a.levelIdc=b.levelIdc,a.profileCompatibility=b.profileCompatibility,c.endNalUnit()):"pic_parameter_set_rbsp"===d.nalUnitType?(a.newMetadata=!0,a.pps=[d.data],c.endNalUnit()):"access_unit_delimiter_rbsp"===d.nalUnitType?(c&&this.finishFrame(f,c),c=new j(j.VIDEO_TAG),c.pts=d.pts,c.dts=d.dts):("slice_layer_without_partitioning_rbsp_idr"===d.nalUnitType&&(c.keyFrame=!0),c.endNalUnit()),c.startNalUnit(),c.writeBytes(d.data);c&&this.finishFrame(f,c),this.trigger("data",{track:a,tags:f}),this.trigger("done")}},d.prototype=new b.utils.Stream,f=function(a){this.numberOfTracks=0,this.metadataStream=a.metadataStream,this.videoTags=[],this.audioTags=[],this.videoTrack=null,this.audioTrack=null,this.pendingCaptions=[],this.pendingMetadata=[],this.pendingTracks=0,f.prototype.init.call(this),this.push=function(a){return a.text?this.pendingCaptions.push(a):a.frames?this.pendingMetadata.push(a):("video"===a.track.type&&(this.videoTrack=a.track,this.videoTags=a.tags,this.pendingTracks++),void("audio"===a.track.type&&(this.audioTrack=a.track,this.audioTags=a.tags,this.pendingTracks++)))}},f.prototype=new b.utils.Stream,f.prototype.flush=function(){var a,b,c,d,e={tags:{},captions:[],metadata:[]};if(!(this.pendingTracks<this.numberOfTracks)){for(this.videoTrack?d=this.videoTrack.timelineStartInfo.pts:this.audioTrack&&(d=this.audioTrack.timelineStartInfo.pts),e.tags.videoTags=this.videoTags,e.tags.audioTags=this.audioTags,c=0;c<this.pendingCaptions.length;c++)b=this.pendingCaptions[c],b.startTime=b.startPts-d,b.startTime/=9e4,b.endTime=b.endPts-d,b.endTime/=9e4,e.captions.push(b);for(c=0;c<this.pendingMetadata.length;c++)a=this.pendingMetadata[c],a.cueTime=a.pts-d,a.cueTime/=9e4,e.metadata.push(a);e.metadata.dispatchType=this.metadataStream.dispatchType,this.videoTrack=null,this.audioTrack=null,this.videoTags=[],this.audioTags=[],this.pendingCaptions.length=0,this.pendingMetadata.length=0,this.pendingTracks=0,this.trigger("data",e),this.trigger("done")}},c=function(a){var g,h,i,k,l,m,n,o,p,q=this;c.prototype.init.call(this),a=a||{},this.metadataStream=new b.mp2t.MetadataStream,a.metadataStream=this.metadataStream,g=new b.mp2t.TransportPacketStream,h=new b.mp2t.TransportParseStream,i=new b.mp2t.ElementaryStream,k=new b.codecs.AacStream,l=new b.codecs.H264Stream,p=new f(a),g.pipe(h).pipe(i),i.pipe(l),i.pipe(k),i.pipe(this.metadataStream).pipe(p),b.mp2t.CaptionStream&&(o=new b.mp2t.CaptionStream,l.pipe(o).pipe(p)),i.on("data",function(a){var b,c,f;if("metadata"===a.type){for(b=a.tracks.length;b--;)"video"===a.tracks[b].type?c=a.tracks[b]:"audio"===a.tracks[b].type&&(f=a.tracks[b]);c&&!m&&(p.numberOfTracks++,m=new d(c),l.pipe(m).pipe(p)),f&&!n&&(p.numberOfTracks++,n=new e(f),k.pipe(n).pipe(p))}}),this.push=function(a){g.push(a)},this.flush=function(){g.flush()},p.on("data",function(a){q.trigger("data",a)}),p.on("done",function(){q.trigger("done")}),this.getFlvHeader=function(a,b,c){var d,e,f,g=new Uint8Array(9),h=new DataView(g.buffer);return a=a||0,b=void 0===b?!0:b,c=void 0===c?!0:c,h.setUint8(0,70),h.setUint8(1,76),h.setUint8(2,86),h.setUint8(3,1),h.setUint8(4,(b?4:0)|(c?1:0)),h.setUint32(5,g.byteLength),0>=a?(e=new Uint8Array(g.byteLength+4),e.set(g),e.set([0,0,0,0],g.byteLength),e):(d=new j(j.METADATA_TAG),d.pts=d.dts=0,d.writeMetaDataDouble("duration",a),f=d.finalize().length,e=new Uint8Array(g.byteLength+f),e.set(g),e.set(h.byteLength,f),e)}},c.prototype=new b.utils.Stream,b.flv=b.flv||{},b.flv.Transmuxer=c}(this,this.muxjs),function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m=0,n=videojs.EventTarget,o="blob:vjs-media-source/";i=function(a){Object.defineProperties(a.frame,{id:{get:function(){return videojs.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),a.value.key}},value:{get:function(){return videojs.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),a.value.data}},privateData:{get:function(){return videojs.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),a.value.data}}})},j=function(a,b,c){var d,e;if(c)for(d=c.cues.length;d--;)e=c.cues[d],e.startTime<=b&&e.endTime>=a&&c.removeCue(e)},k=function(a,b,c){c.captions&&c.captions.length&&!a.inbandTextTrack_&&(a.inbandTextTrack_=b.player_.addTextTrack("captions")),c.metadata&&c.metadata.length&&!a.metadataTrack_&&(a.metadataTrack_=b.player_.addTextTrack("metadata","Timed Metadata"),a.metadataTrack_.inBandMetadataTrackDispatchType=c.metadata.dispatchType)},l=function(b,c,d){h=a.WebKitDataCue||a.VTTCue,c&&c.forEach(function(a){this.inbandTextTrack_.addCue(new h(a.startTime+this.timestampOffset,a.endTime+this.timestampOffset,a.text))},b),d&&d.forEach(function(a){var b=a.cueTime+this.timestampOffset;a.frames.forEach(function(a){var c=new h(b,b,a.value||a.url||a.data||"");c.frame=a,c.value=a,i(c),this.metadataTrack_.addCue(c)},this)},b)},d={mode:"auto"},videojs.MediaSource=function(a){var b=videojs.mergeOptions(d,a);return"html5"===b.mode||"auto"===b.mode&&videojs.MediaSource.supportsNativeMediaSources()?new videojs.HtmlMediaSource:new videojs.FlashMediaSource},videojs.MediaSource.supportsNativeMediaSources=function(){return!!a.MediaSource},videojs.HtmlMediaSource=videojs.extend(n,{constructor:function(){var b,c=this;this.mediaSource_=new a.MediaSource;for(b in this.mediaSource_)b in videojs.HtmlMediaSource.prototype||"function"!=typeof this.mediaSource_[b]||(this[b]=this.mediaSource_[b].bind(this.mediaSource_));this.duration_=NaN,Object.defineProperty(this,"duration",{get:function(){return c.duration_},set:function(a){return c.duration_=a,a!==1/0?void(c.mediaSource_.duration=a):void 0}}),Object.defineProperty(this,"seekable",{get:function(){return this.duration_===1/0?videojs.createTimeRanges([[0,c.mediaSource_.duration]]):c.mediaSource_.seekable}}),Object.defineProperty(this,"readyState",{get:function(){return c.mediaSource_.readyState}}),this.sourceBuffers=[],this.mediaSource_.addEventListener("sourceopen",function(a){var b=document.querySelector('[src="'+c.url_+'"]');b&&(c.player_=videojs(b.parentNode),c.trigger(a))})},addSeekableRange_:function(a,b){var c;if(this.duration!==1/0)throw c=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity"),c.name="InvalidStateError",c.code=11,c;(b>this.mediaSource_.duration||isNaN(this.mediaSource_.duration))&&(this.mediaSource_.duration=b)},addSourceBuffer:function(a){var b,c,d,f,g=/avc1\.[\da-f]+/i,h=/mp4a\.\d+.\d+/i;return/^video\/mp2t/i.test(a)?(c=a.split(";").slice(1).join(";"),c=p(c),d=(c.match(g)||[])[0],f=(c.match(h)||[])[0],d&&d.length||(d="avc1.4d400d"),f&&f.length||(f="mp4a.40.2"),b=new e(this,[d,f]),this.sourceBuffers.push(b),b):(b=this.mediaSource_.addSourceBuffer(a),this.sourceBuffers.push(b),b)}});var p=function(a){return a.replace(/avc1\.(\d+)\.(\d+)/i,function(a,b,c){var d=("00"+Number(b).toString(16)).slice(-2),e=("00"+Number(c).toString(16)).slice(-2);return"avc1."+d+"00"+e})};f=function(a,b,c){return function(){return a[b]&&a[b].updating?void 0:a.trigger(c)}},e=videojs.extend(n,{constructor:function(a,b){var c=this;this.timestampOffset_=0,this.pendingBuffers_=[],this.bufferUpdating_=!1,this.mediaSource_=a,this.codecs_=b,this.transmuxer_=new Worker(URL.createObjectURL(new Blob(['var muxjs={},transmuxer,initOptions={};!function(a,b,c){var d=function(){this.init=function(){var a={};this.on=function(b,c){a[b]||(a[b]=[]),a[b].push(c)},this.off=function(b,c){var d;return a[b]?(d=a[b].indexOf(c),a[b].splice(d,1),d>-1):!1},this.trigger=function(b){var c,d,e,f;if(c=a[b])if(2===arguments.length)for(e=c.length,d=0;e>d;++d)c[d].call(this,arguments[1]);else{for(f=[],d=arguments.length,d=1;d<arguments.length;++d)f.push(arguments[d]);for(e=c.length,d=0;e>d;++d)c[d].apply(this,f)}},this.dispose=function(){a={}}}};d.prototype.pipe=function(a){return this.on("data",function(b){a.push(b)}),this.on("done",function(){a.flush()}),a},d.prototype.push=function(a){this.trigger("data",a)},d.prototype.flush=function(){this.trigger("done")},a.muxjs=a.muxjs||{},a.muxjs.utils=a.muxjs.utils||{},a.muxjs.utils.Stream=d}(this,this.muxjs),function(a,b){var c;c=function(a){var b=a.byteLength,c=0,d=0;this.length=function(){return 8*b},this.bitsAvailable=function(){return 8*b+d},this.loadWord=function(){var e=a.byteLength-b,f=new Uint8Array(4),g=Math.min(4,b);if(0===g)throw new Error("no bytes available");f.set(a.subarray(e,e+g)),c=new DataView(f.buffer).getUint32(0),d=8*g,b-=g},this.skipBits=function(a){var e;d>a?(c<<=a,d-=a):(a-=d,e=Math.floor(a/8),a-=8*e,b-=e,this.loadWord(),c<<=a,d-=a)},this.readBits=function(a){var e=Math.min(d,a),f=c>>>32-e;return console.assert(32>a,"Cannot read more than 32 bits at a time"),d-=e,d>0?c<<=e:b>0&&this.loadWord(),e=a-e,e>0?f<<e|this.readBits(e):f},this.skipLeadingZeros=function(){var a;for(a=0;d>a;++a)if(0!==(c&2147483648>>>a))return c<<=a,d-=a,a;return this.loadWord(),a+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var a=this.skipLeadingZeros();return this.readBits(a+1)-1},this.readExpGolomb=function(){var a=this.readUnsignedExpGolomb();return 1&a?1+a>>>1:-1*(a>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},a.muxjs=b||{},b.utils=b.utils||{},b.utils.ExpGolomb=c}(this,this.muxjs),function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P;O=a.Uint8Array,P=a.DataView,function(){var a;A={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]};for(a in A)A.hasOwnProperty(a)&&(A[a]=[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)]);B=new O(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),D=new O(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),C=new O([0,0,0,1]),E=new O([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),F=new O([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),G={video:E,audio:F},J=new O([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),I=new O([0,0,0,0,0,0,0,0]),K=new O([0,0,0,0,0,0,0,0]),L=K,M=new O([0,0,0,0,0,0,0,0,0,0,0,0]),N=K,H=new O([0,0,0,1,0,0,0,0,0,0,0,0])}(),d=function(a){var b,c,d,e=[],f=0;for(b=1;b<arguments.length;b++)e.push(arguments[b]);for(b=e.length;b--;)f+=e[b].byteLength;for(c=new O(f+8),d=new P(c.buffer,c.byteOffset,c.byteLength),d.setUint32(0,c.byteLength),c.set(a,4),b=0,f=8;b<e.length;b++)c.set(e[b],f),f+=e[b].byteLength;return c},e=function(){return d(A.dinf,d(A.dref,J))},f=function(a){return d(A.esds,new O([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,a.audioobjecttype<<3|a.samplingfrequencyindex>>>1,a.samplingfrequencyindex<<7|a.channelcount<<3,6,1,2]))},g=function(){return d(A.ftyp,B,C,B,D)},s=function(a){return d(A.hdlr,G[a])},h=function(a){return d(A.mdat,a)},r=function(a){var b=new O([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,a.duration>>>24&255,a.duration>>>16&255,a.duration>>>8&255,255&a.duration,85,196,0,0]);return a.samplerate&&(b[12]=a.samplerate>>>24&255,b[13]=a.samplerate>>>16&255,b[14]=a.samplerate>>>8&255,b[15]=255&a.samplerate),d(A.mdhd,b)},q=function(a){return d(A.mdia,r(a),s(a.type),j(a))},i=function(a){return d(A.mfhd,new O([0,0,0,0,(4278190080&a)>>24,(16711680&a)>>16,(65280&a)>>8,255&a]))},j=function(a){return d(A.minf,"video"===a.type?d(A.vmhd,H):d(A.smhd,I),e(),u(a))},k=function(a,b){for(var c=[],e=b.length;e--;)c[e]=x(b[e]);return d.apply(null,[A.moof,i(a)].concat(c))},l=function(a){for(var b=a.length,c=[];b--;)c[b]=o(a[b]);return d.apply(null,[A.moov,n(4294967295)].concat(c).concat(m(a)))},m=function(a){for(var b=a.length,c=[];b--;)c[b]=y(a[b]);return d.apply(null,[A.mvex].concat(c))},n=function(a){var b=new O([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&a)>>24,(16711680&a)>>16,(65280&a)>>8,255&a,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 d(A.mvhd,b)},t=function(a){var b,c,e=a.samples||[],f=new O(4+e.length);for(c=0;c<e.length;c++)b=e[c].flags,f[c+4]=b.dependsOn<<4|b.isDependedOn<<2|b.hasRedundancy;return d(A.sdtp,f)},u=function(a){return d(A.stbl,v(a),d(A.stts,N),d(A.stsc,L),d(A.stsz,M),d(A.stco,K))},function(){var a,b;v=function(c){return d(A.stsd,new O([0,0,0,0,0,0,0,1]),"video"===c.type?a(c):b(c))},a=function(a){var b,c=a.sps||[],e=a.pps||[],f=[],g=[];for(b=0;b<c.length;b++)f.push((65280&c[b].byteLength)>>>8),f.push(255&c[b].byteLength),f=f.concat(Array.prototype.slice.call(c[b]));for(b=0;b<e.length;b++)g.push((65280&e[b].byteLength)>>>8),g.push(255&e[b].byteLength),g=g.concat(Array.prototype.slice.call(e[b]));return d(A.avc1,new O([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&a.width)>>8,255&a.width,(65280&a.height)>>8,255&a.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]),d(A.avcC,new O([1,a.profileIdc,a.profileCompatibility,a.levelIdc,255].concat([c.length]).concat(f).concat([e.length]).concat(g))),d(A.btrt,new O([0,28,156,128,0,45,198,192,0,45,198,192])))},b=function(a){return d(A.mp4a,new O([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&a.channelcount)>>8,255&a.channelcount,(65280&a.samplesize)>>8,255&a.samplesize,0,0,0,0,(65280&a.samplerate)>>8,255&a.samplerate,0,0]),f(a))}}(),w=function(){return d(A.styp,B,C,B)},p=function(a){var b=new O([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&a.id)>>24,(16711680&a.id)>>16,(65280&a.id)>>8,255&a.id,0,0,0,0,(4278190080&a.duration)>>24,(16711680&a.duration)>>16,(65280&a.duration)>>8,255&a.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&a.width)>>8,255&a.width,0,0,(65280&a.height)>>8,255&a.height,0,0]);return d(A.tkhd,b)},x=function(a){var b,c,e,f,g;return b=d(A.tfhd,new O([0,0,0,58,(4278190080&a.id)>>24,(16711680&a.id)>>16,(65280&a.id)>>8,255&a.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),c=d(A.tfdt,new O([0,0,0,0,a.baseMediaDecodeTime>>>24&255,a.baseMediaDecodeTime>>>16&255,a.baseMediaDecodeTime>>>8&255,255&a.baseMediaDecodeTime])),g=88,"audio"===a.type?(e=z(a,g),d(A.traf,b,c,e)):(f=t(a),e=z(a,f.length+g),d(A.traf,b,c,e,f))},o=function(a){return a.duration=a.duration||4294967295,d(A.trak,p(a),q(a))},y=function(a){var b=new O([0,0,0,0,(4278190080&a.id)>>24,(16711680&a.id)>>16,(65280&a.id)>>8,255&a.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==a.type&&(b[b.length-1]=0),d(A.trex,b)},function(){var a,b,e;e=function(a,b){var d=0,e=0,f=0,g=0;return a.length&&(a[0].duration!==c&&(d=1),a[0].size!==c&&(e=2),a[0].flags!==c&&(f=4),a[0].compositionTimeOffset!==c&&(g=8)),[0,0,d|e|f|g,1,(4278190080&a.length)>>>24,(16711680&a.length)>>>16,(65280&a.length)>>>8,255&a.length,(4278190080&b)>>>24,(16711680&b)>>>16,(65280&b)>>>8,255&b]},b=function(a,b){var c,f,g,h;for(f=a.samples||[],b+=20+16*f.length,c=e(f,b),h=0;h<f.length;h++)g=f[h],c=c.concat([(4278190080&g.duration)>>>24,(16711680&g.duration)>>>16,(65280&g.duration)>>>8,255&g.duration,(4278190080&g.size)>>>24,(16711680&g.size)>>>16,(65280&g.size)>>>8,255&g.size,g.flags.isLeading<<2|g.flags.dependsOn,g.flags.isDependedOn<<6|g.flags.hasRedundancy<<4|g.flags.paddingValue<<1|g.flags.isNonSyncSample,61440&g.flags.degradationPriority,15&g.flags.degradationPriority,(4278190080&g.compositionTimeOffset)>>>24,(16711680&g.compositionTimeOffset)>>>16,(65280&g.compositionTimeOffset)>>>8,255&g.compositionTimeOffset]);return d(A.trun,new O(c))},a=function(a,b){var c,f,g,h;for(f=a.samples||[],b+=20+8*f.length,c=e(f,b),h=0;h<f.length;h++)g=f[h],c=c.concat([(4278190080&g.duration)>>>24,(16711680&g.duration)>>>16,(65280&g.duration)>>>8,255&g.duration,(4278190080&g.size)>>>24,(16711680&g.size)>>>16,(65280&g.size)>>>8,255&g.size]);return d(A.trun,new O(c))},z=function(c,d){return"audio"===c.type?a(c,d):b(c,d)}}(),b.mp4={ftyp:g,mdat:h,moof:k,moov:l,initSegment:function(a){var b,c=g(),d=l(a);return b=new O(c.byteLength+d.byteLength),b.set(c),b.set(d,c.byteLength),b}}}(this,this.muxjs),function(a,b){"use strict";var c,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];c=function(){var a,b;c.prototype.init.call(this),a=this,this.push=function(a){var c,e,f,g,h,i,j=0,k=0;if("audio"===a.type)for(b?(g=b,b=new Uint8Array(g.byteLength+a.data.byteLength),b.set(g),b.set(a.data,g.byteLength)):b=a.data;j+5<b.length;)if(255===b[j]&&240===(246&b[j+1])){if(e=2*(1&~b[j+1]),c=(3&b[j+3])<<11|b[j+4]<<3|(224&b[j+5])>>5,h=1024*((3&b[j+6])+1),i=9e4*h/d[(60&b[j+2])>>>2],f=j+c,b.byteLength<f)return;if(this.trigger("data",{pts:a.pts+k*i,dts:a.dts+k*i,sampleCount:h,audioobjecttype:(b[j+2]>>>6&3)+1,channelcount:(1&b[j+2])<<3|(192&b[j+3])>>>6,samplerate:d[(60&b[j+2])>>>2],samplingfrequencyindex:(60&b[j+2])>>>2,samplesize:16,data:b.subarray(j+7+e,f)}),b.byteLength===f)return void(b=void 0);k++,b=b.subarray(f)}else j++}},c.prototype=new b.utils.Stream,b.codecs=b.codecs||{},b.codecs.AacStream=c}(this,this.muxjs),function(a,b){"use strict";var c,d;d=function(){var a,b,c=0;d.prototype.init.call(this),this.push=function(d){var e;for(b?(e=new Uint8Array(b.byteLength+d.data.byteLength),e.set(b),e.set(d.data,b.byteLength),b=e):b=d.data;c<b.byteLength-3;c++)if(1===b[c+2]){a=c+5;break}for(;a<b.byteLength;)switch(b[a]){case 0:if(0!==b[a-1]){a+=2;break}if(0!==b[a-2]){a++;break}this.trigger("data",b.subarray(c+3,a-2));do a++;while(1!==b[a]&&a<b.length);c=a-2,a+=3;break;case 1:if(0!==b[a-1]||0!==b[a-2]){a+=3;break}this.trigger("data",b.subarray(c+3,a-2)),c=a-2,a+=3;break;default:a+=3}b=b.subarray(c),a-=c,c=0},this.flush=function(){b&&b.byteLength>3&&this.trigger("data",b.subarray(c+3)),b=null,c=0,this.trigger("done")}},d.prototype=new b.utils.Stream,c=function(){var a,e,f,g,h,i,j,k=new d;c.prototype.init.call(this),a=this,this.push=function(a){"video"===a.type&&(e=a.trackId,f=a.pts,g=a.dts,k.push(a))},k.on("data",function(b){var c={trackId:e,pts:f,dts:g,data:b};switch(31&b[0]){case 5:c.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:c.nalUnitType="sei_rbsp",c.escapedRBSP=h(b.subarray(1));break;case 7:c.nalUnitType="seq_parameter_set_rbsp",c.escapedRBSP=h(b.subarray(1)),c.config=i(c.escapedRBSP);break;case 8:c.nalUnitType="pic_parameter_set_rbsp";break;case 9:c.nalUnitType="access_unit_delimiter_rbsp"}a.trigger("data",c)}),k.on("done",function(){a.trigger("done")}),this.flush=function(){k.flush()},j=function(a,b){var c,d,e=8,f=8;for(c=0;a>c;c++)0!==f&&(d=b.readExpGolomb(),f=(e+d+256)%256),e=0===f?e:f},h=function(a){for(var b,c,d=a.byteLength,e=[],f=1;d-2>f;)0===a[f]&&0===a[f+1]&&3===a[f+2]?(e.push(f+2),f+=2):f++;if(0===e.length)return a;b=d-e.length,c=new Uint8Array(b);var g=0;for(f=0;b>f;g++,f++)g===e[0]&&(g++,e.shift()),c[f]=a[g];return c},i=function(a){var c,d,e,f,g,h,i,k,l,m,n,o,p=0,q=0,r=0,s=0;if(c=new b.utils.ExpGolomb(a),d=c.readUnsignedByte(),f=c.readUnsignedByte(),e=c.readUnsignedByte(),c.skipUnsignedExpGolomb(),(100===d||110===d||122===d||244===d||44===d||83===d||86===d||118===d||128===d||138===d||139===d||134===d)&&(g=c.readUnsignedExpGolomb(),3===g&&c.skipBits(1),c.skipUnsignedExpGolomb(),c.skipUnsignedExpGolomb(),c.skipBits(1),c.readBoolean()))for(n=3!==g?8:12,o=0;n>o;o++)c.readBoolean()&&(6>o?j(16,c):j(64,c));if(c.skipUnsignedExpGolomb(),h=c.readUnsignedExpGolomb(),0===h)c.readUnsignedExpGolomb();else if(1===h)for(c.skipBits(1),c.skipExpGolomb(),c.skipExpGolomb(),i=c.readUnsignedExpGolomb(),o=0;i>o;o++)c.skipExpGolomb();return c.skipUnsignedExpGolomb(),c.skipBits(1),k=c.readUnsignedExpGolomb(),l=c.readUnsignedExpGolomb(),m=c.readBits(1),0===m&&c.skipBits(1),c.skipBits(1),c.readBoolean()&&(p=c.readUnsignedExpGolomb(),q=c.readUnsignedExpGolomb(),r=c.readUnsignedExpGolomb(),s=c.readUnsignedExpGolomb()),{profileIdc:d,levelIdc:e,profileCompatibility:f,width:16*(k+1)-2*p-2*q,height:(2-m)*(l+1)*16-2*r-2*s}}},c.prototype=new b.utils.Stream,b.codecs=b.codecs||{},b.codecs.H264Stream=c,b.codecs.NalByteStream=d}(this,this.muxjs),function(a,b,c){"use strict";var d,e,f,g,h,i,j,k;g=188,k=71,h=27,i=15,j=21,d=function(){var a=new Uint8Array(g),b=0;d.prototype.init.call(this),this.push=function(c){var d,e=0,f=g;for(b?(d=new Uint8Array(c.byteLength+b),d.set(a.subarray(0,b)),d.set(c,b),b=0):d=c;f<d.byteLength;)d[e]!==k||d[f]!==k?(e++,f++):(this.trigger("data",d.subarray(e,f)),e+=g,f+=g);e<d.byteLength&&(a.set(d.subarray(e),0),b=d.byteLength-e)},this.flush=function(){b===g&&a[0]===k&&(this.trigger("data",a),b=0),this.trigger("done")}},d.prototype=new b.utils.Stream,e=function(){var a,b,d,f;e.prototype.init.call(this),f=this,this.packetsWaitingForPmt=[],this.programMapTable=c,a=function(a,c){var e=0;c.payloadUnitStartIndicator&&(e+=a[e]+1),"pat"===c.type?b(a.subarray(e),c):d(a.subarray(e),c)},b=function(a,b){b.section_number=a[7],b.last_section_number=a[8],f.pmtPid=(31&a[10])<<8|a[11],b.pmtPid=f.pmtPid},d=function(a,b){var c,d,e,g;if(1&a[5]){for(f.programMapTable={},c=(15&a[1])<<8|a[2],d=3+c-4,e=(15&a[10])<<8|a[11],g=12+e;d>g;)f.programMapTable[(31&a[g+1])<<8|a[g+2]]=a[g],g+=((15&a[g+3])<<8|a[g+4])+5;for(b.programMapTable=f.programMapTable;f.packetsWaitingForPmt.length;)f.processPes_.apply(f,f.packetsWaitingForPmt.shift())}},this.push=function(b){var d={},e=4;d.payloadUnitStartIndicator=!!(64&b[1]),d.pid=31&b[1],d.pid<<=8,d.pid|=b[2],(48&b[3])>>>4>1&&(e+=b[e]+1),0===d.pid?(d.type="pat",a(b.subarray(e),d),this.trigger("data",d)):d.pid===this.pmtPid?(d.type="pmt",a(b.subarray(e),d),this.trigger("data",d)):this.programMapTable===c?this.packetsWaitingForPmt.push([b,e,d]):this.processPes_(b,e,d)},this.processPes_=function(a,b,c){c.streamType=this.programMapTable[c.pid],c.type="pes",c.data=a.subarray(b),this.trigger("data",c)}},e.prototype=new b.utils.Stream,e.STREAM_TYPES={h264:27,adts:15},f=function(){var a,b={data:[],size:0},c={data:[],size:0},d={data:[],size:0},e=function(a,b){var c;b.dataAlignmentIndicator=0!==(4&a[6]),c=a[7],192&c&&(b.pts=(14&a[9])<<27|(255&a[10])<<20|(254&a[11])<<12|(255&a[12])<<5|(254&a[13])>>>3,b.pts*=4,b.pts+=(6&a[13])>>>1,b.dts=b.pts,64&c&&(b.dts=(14&a[14])<<27|(255&a[15])<<20|(254&a[16])<<12|(255&a[17])<<5|(254&a[18])>>>3,b.dts*=4,b.dts+=(6&a[18])>>>1)),b.data=a.subarray(9+a[8])},g=function(b,c){var d,f=new Uint8Array(b.size),g={type:c},h=0;if(b.data.length){for(g.trackId=b.data[0].pid;b.data.length;)d=b.data.shift(),f.set(d.data,h),h+=d.data.byteLength;e(f,g),b.size=0,a.trigger("data",g)}};f.prototype.init.call(this),a=this,this.push=function(e){({pat:function(){},pes:function(){var a,f;switch(e.streamType){case h:a=b,f="video";break;case i:a=c,f="audio";break;case j:a=d,f="timed-metadata";break;default:return}e.payloadUnitStartIndicator&&g(a,f),a.data.push(e),a.size+=e.data.byteLength},pmt:function(){var b,c,d={type:"metadata",tracks:[]},f=e.programMapTable;for(b in f)f.hasOwnProperty(b)&&(c={timelineStartInfo:{baseMediaDecodeTime:0}},c.id=+b,f[b]===h?(c.codec="avc",c.type="video"):f[b]===i&&(c.codec="adts",c.type="audio"),d.tracks.push(c));a.trigger("data",d)}})[e.type]()},this.flush=function(){g(b,"video"),g(c,"audio"),g(d,"timed-metadata"),this.trigger("done")}},f.prototype=new b.utils.Stream,b.mp2t=b.mp2t||{},b.mp2t.PAT_PID=0,b.mp2t.MP2T_PACKET_LENGTH=g,b.mp2t.H264_STREAM_TYPE=h,b.mp2t.ADTS_STREAM_TYPE=i,b.mp2t.METADATA_STREAM_TYPE=j,b.mp2t.TransportPacketStream=d,b.mp2t.TransportParseStream=e,b.mp2t.ElementaryStream=f}(this,this.muxjs),function(a,b,c){"use strict";var d=4,e=128,f=function(a){for(var b=0,c={payloadType:-1,payloadSize:0},f=0,g=0;b<a.byteLength&&a[b]!==e;){for(;255===a[b];)f+=255,b++;for(f+=a[b++];255===a[b];)g+=255,b++;if(g+=a[b++],!c.payload&&f===d){c.payloadType=f,c.payloadSize=g,c.payload=a.subarray(b,b+g);break}b+=g,f=0,g=0}return c},g=function(a){return 181!==a.payload[0]?null:49!==(a.payload[1]<<8|a.payload[2])?null:"GA94"!==String.fromCharCode(a.payload[3],a.payload[4],a.payload[5],a.payload[6])?null:3!==a.payload[7]?null:a.payload.subarray(8,a.payload.length-1)},h=function(a,b){var c,d,e,f,g=[];if(!(64&b[0]))return g;for(d=31&b[0],c=0;d>c;c++)e=3*c,f={type:3&b[e+2],pts:a},4&b[e+2]&&(f.ccData=b[e+3]<<8|b[e+4],g.push(f));return g},i=function(){i.prototype.init.call(this),this.captionPackets_=[],this.field1_=new w,this.field1_.on("data",this.trigger.bind(this,"data")),this.field1_.on("done",this.trigger.bind(this,"done"))};i.prototype=new b.utils.Stream,i.prototype.push=function(a){var b,c;"sei_rbsp"===a.nalUnitType&&(b=f(a.escapedRBSP),b.payloadType===d&&(c=g(b),c&&(this.captionPackets_=this.captionPackets_.concat(h(a.pts,c)))))},i.prototype.flush=function(){return this.captionPackets_.length?(this.captionPackets_.sort(function(a,b){return a.pts-b.pts}),this.captionPackets_.forEach(this.field1_.push,this.field1_),this.captionPackets_.length=0,void this.field1_.flush()):void this.field1_.flush()};var j={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608},k=0,l=5152,m=5167,n=5157,o=5158,p=5159,q=5165,r=5153,s=5164,t=5166,u=14,v=function(){for(var a=[],b=u+1;b--;)a.push("");return a},w=function(){w.prototype.init.call(this),this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=v(),this.nonDisplayed_=v(),this.lastControlCode_=null,this.push=function(a){var b,c,d,e;if(b=32639&a.ccData,b===this.lastControlCode_)return void(this.lastControlCode_=null);switch(4096===(61440&b)?this.lastControlCode_=b:this.lastControlCode_=null,b){case k:break;case l:this.mode_="popOn";break;case m:this.flushDisplayed(a.pts),c=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=c,this.startPts_=a.pts;break;case n:this.topRow_=u-1,this.mode_="rollUp";break;case o:this.topRow_=u-2,this.mode_="rollUp";break;case p:this.topRow_=u-3,this.mode_="rollUp";break;case q:this.flushDisplayed(a.pts),this.shiftRowsUp_(),this.startPts_=a.pts;break;case r:"popOn"===this.mode_?this.nonDisplayed_[u]=this.nonDisplayed_[u].slice(0,-1):this.displayed_[u]=this.displayed_[u].slice(0,-1);break;case s:this.flushDisplayed(a.pts),this.displayed_=v();break;case t:this.nonDisplayed_=v();break;default:if(d=b>>>8,e=255&b,d>=16&&23>=d&&e>=64&&127>=e&&(16!==d||96>e)&&(d=e=32),16===(240&d))return;this[this.mode_](a.pts,d,e)}}};w.prototype=new b.utils.Stream,w.prototype.flushDisplayed=function(a){var b,c;for(c=0;c<this.displayed_.length;c++)b=this.displayed_[c],b.length&&this.trigger("data",{startPts:this.startPts_,endPts:a,text:b})},w.prototype.popOn=function(a,b,c){var d=this.nonDisplayed_[u];b=j[b]||b,d+=String.fromCharCode(b),c=j[c]||c,d+=String.fromCharCode(c),this.nonDisplayed_[u]=d},w.prototype.rollUp=function(a,b,c){var d=this.displayed_[u];""===d&&(this.flushDisplayed(a),this.startPts_=a),b=j[b]||b,d+=String.fromCharCode(b),c=j[c]||c,d+=String.fromCharCode(c),this.displayed_[u]=d},w.prototype.shiftRowsUp_=function(){var a;for(a=0;a<this.topRow_;a++)this.displayed_[a]="";for(a=this.topRow_;u>a;a++)this.displayed_[a]=this.displayed_[a+1];this.displayed_[u]=""},b.mp2t=b.mp2t||{},b.mp2t.CaptionStream=i,b.mp2t.Cea608Stream=w}(this,this.muxjs),function(a,b,c){"use strict";var d,e=function(a,b,c){var d,e="";for(d=b;c>d;d++)e+="%"+("00"+a[d].toString(16)).slice(-2);return e},f=function(b,c,d){return a.decodeURIComponent(e(b,c,d))},g=function(b,c,d){return a.unescape(e(b,c,d))},h=function(a){return a[0]<<21|a[1]<<14|a[2]<<7|a[3]},i={TXXX:function(a){var b;if(3===a.data[0]){for(b=1;b<a.data.length;b++)if(0===a.data[b]){a.description=f(a.data,1,b),a.value=f(a.data,b+1,a.data.length-1);break}a.data=a.value}},WXXX:function(a){var b;if(3===a.data[0])for(b=1;b<a.data.length;b++)if(0===a.data[b]){a.description=f(a.data,1,b),a.url=f(a.data,b+1,a.data.length);break}},PRIV:function(a){var b;for(b=0;b<a.data.length;b++)if(0===a.data[b]){a.owner=g(a.data,0,b);break}a.privateData=a.data.subarray(b+1),a.data=a.privateData}};d=function(a){var c,e={debug:!(!a||!a.debug),descriptor:a&&a.descriptor},f=0,g=[],j=0;if(d.prototype.init.call(this),this.dispatchType=b.mp2t.METADATA_STREAM_TYPE.toString(16),e.descriptor)for(c=0;c<e.descriptor.length;c++)this.dispatchType+=("00"+e.descriptor[c].toString(16)).slice(-2);this.push=function(a){var b,c,d,k,l;if("timed-metadata"===a.type){if(a.dataAlignmentIndicator&&(j=0,g.length=0),0===g.length&&(a.data.length<10||a.data[0]!=="I".charCodeAt(0)||a.data[1]!=="D".charCodeAt(0)||a.data[2]!=="3".charCodeAt(0)))return void(e.debug&&console.log("Skipping unrecognized metadata packet"));if(g.push(a),j+=a.data.byteLength,1===g.length&&(f=h(a.data.subarray(6,10)),f+=10),!(f>j)){for(b={data:new Uint8Array(f),frames:[],pts:g[0].pts,dts:g[0].dts},l=0;f>l;)b.data.set(g[0].data.subarray(0,f-l),l),l+=g[0].data.byteLength,j-=g[0].data.byteLength,g.shift();c=10,64&b.data[5]&&(c+=4,c+=h(b.data.subarray(10,14)),f-=h(b.data.subarray(16,20)));do{if(d=h(b.data.subarray(c+4,c+8)),1>d)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");k={id:String.fromCharCode(b.data[c],b.data[c+1],b.data[c+2],b.data[c+3]),data:b.data.subarray(c+10,c+d+10)},k.key=k.id,i[k.id]&&i[k.id](k),b.frames.push(k),c+=10,c+=d}while(f>c);this.trigger("data",b)}}}},d.prototype=new b.utils.Stream,b.mp2t=b.mp2t||{},b.mp2t.MetadataStream=d}(this,this.muxjs),function(a,b,c){"use strict";var d,e,f,g,h,i,j,k=b.mp4;e=function(a){var b=[],c=0,d=0,f=0;e.prototype.init.call(this),this.push=function(d){h(a,d),a&&(a.audioobjecttype=d.audioobjecttype,a.channelcount=d.channelcount,a.samplerate=d.samplerate,a.samplingfrequencyindex=d.samplingfrequencyindex,a.samplesize=d.samplesize),b.push(d),c+=d.data.byteLength},this.setEarliestDts=function(b){f=b-a.timelineStartInfo.baseMediaDecodeTime},this.flush=function(){var e,g,h,l,m,n,o;if(0===c)return void this.trigger("done");for(a.minSegmentDts<f&&(a.minSegmentDts=1/0,b=b.filter(function(b){return b.dts>=f?(a.minSegmentDts=Math.min(a.minSegmentDts,b.dts),a.minSegmentPts=a.minSegmentDts,!0):(c-=b.data.byteLength,!1)})),h=new Uint8Array(c),a.samples=[],m=0;b.length;)g=b[0],l={size:g.data.byteLength,duration:1024},a.samples.push(l),h.set(g.data,m),m+=g.data.byteLength,b.shift();c=0,n=k.mdat(h),j(a),o=k.moof(d,[a]),e=new Uint8Array(o.byteLength+n.byteLength),d++,e.set(o),e.set(n,o.byteLength),i(a),this.trigger("data",{track:a,boxes:e}),this.trigger("done")}},e.prototype=new b.utils.Stream,d=function(a){var b,e,f=0,g=[],l=0;d.prototype.init.call(this),delete a.minPTS,this.push=function(c){h(a,c),"seq_parameter_set_rbsp"!==c.nalUnitType||b||(b=c.config,a.width=b.width,a.height=b.height,a.sps=[c.data],a.profileIdc=b.profileIdc,a.levelIdc=b.levelIdc,a.profileCompatibility=b.profileCompatibility),"pic_parameter_set_rbsp"!==c.nalUnitType||e||(e=c.data,a.pps=[c.data]),g.push(c),l+=c.data.byteLength},this.flush=function(){for(var d,h,m,n,o,p,q,r,s,t;g.length&&"access_unit_delimiter_rbsp"!==g[0].nalUnitType;)g.shift();if(0===l)return void this.trigger("done");for(q=new Uint8Array(l+4*g.length),r=new DataView(q.buffer),a.samples=[],s={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0}},p=0;g.length;)h=g[0],"access_unit_delimiter_rbsp"===h.nalUnitType&&(d&&(s.duration=h.dts-d.dts,a.samples.push(s)),s={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0},dataOffset:p,compositionTimeOffset:h.pts-h.dts},d=h),"slice_layer_without_partitioning_rbsp_idr"===h.nalUnitType&&(s.flags.dependsOn=2),s.size+=4,s.size+=h.data.byteLength,r.setUint32(p,h.data.byteLength),p+=4,q.set(h.data,p),p+=h.data.byteLength,g.shift();for(a.samples.length&&(s.duration=a.samples[a.samples.length-1].duration),a.samples.push(s),t=0;a.samples.length;){if(s=a.samples[0],2===s.flags.dependsOn){q=q.subarray(s.dataOffset),s.duration+=t;break}t+=s.duration,a.samples.shift()}l=0,n=k.mdat(q),j(a),this.trigger("timelineStartInfo",a.timelineStartInfo),m=k.moof(f,[a]),o=new Uint8Array(m.byteLength+n.byteLength),f++,o.set(m),o.set(n,m.byteLength),i(a),this.trigger("data",{track:a,boxes:o}),b=c,e=c,this.trigger("done")}},d.prototype=new b.utils.Stream,h=function(a,b){"number"==typeof b.pts&&(a.timelineStartInfo.pts===c&&(a.timelineStartInfo.pts=b.pts),a.minSegmentPts===c?a.minSegmentPts=b.pts:a.minSegmentPts=Math.min(a.minSegmentPts,b.pts),a.maxSegmentPts===c?a.maxSegmentPts=b.pts:a.maxSegmentPts=Math.max(a.maxSegmentPts,b.pts)),"number"==typeof b.dts&&(a.timelineStartInfo.dts===c&&(a.timelineStartInfo.dts=b.dts),a.minSegmentDts===c?a.minSegmentDts=b.dts:a.minSegmentDts=Math.min(a.minSegmentDts,b.dts),a.maxSegmentDts===c?a.maxSegmentDts=b.dts:a.maxSegmentDts=Math.max(a.maxSegmentDts,b.dts))},i=function(a){delete a.minSegmentDts,delete a.maxSegmentDts,delete a.minSegmentPts,delete a.maxSegmentPts},j=function(a){var b,c=9e4,d=a.minSegmentDts-a.timelineStartInfo.dts,e=a.minSegmentPts-a.minSegmentDts;a.baseMediaDecodeTime=a.timelineStartInfo.baseMediaDecodeTime,a.baseMediaDecodeTime+=d,a.baseMediaDecodeTime-=e,a.baseMediaDecodeTime=Math.max(0,a.baseMediaDecodeTime),"audio"===a.type&&(b=a.samplerate/c,a.baseMediaDecodeTime*=b,a.baseMediaDecodeTime=Math.floor(a.baseMediaDecodeTime))},g=function(a){this.numberOfTracks=0,this.metadataStream=a.metadataStream,"undefined"!=typeof a.remux?this.remuxTracks=!!a.remux:this.remuxTracks=!0,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,g.prototype.init.call(this),this.push=function(a){return a.text?this.pendingCaptions.push(a):a.frames?this.pendingMetadata.push(a):(this.pendingTracks.push(a.track),this.pendingBoxes.push(a.boxes),this.pendingBytes+=a.boxes.byteLength,"video"===a.track.type&&(this.videoTrack=a.track),void("audio"===a.track.type&&(this.audioTrack=a.track)))}},g.prototype=new b.utils.Stream,g.prototype.flush=function(){var a,c,d,e,f=0,g={captions:[],metadata:[]},h=0;if(!(0===this.pendingTracks.length||this.remuxTracks&&this.pendingTracks.length<this.numberOfTracks)){for(this.videoTrack?h=this.videoTrack.timelineStartInfo.pts:this.audioTrack&&(h=this.audioTrack.timelineStartInfo.pts),1===this.pendingTracks.length?g.type=this.pendingTracks[0].type:g.type="combined",this.emittedTracks+=this.pendingTracks.length,d=b.mp4.initSegment(this.pendingTracks),g.data=new Uint8Array(d.byteLength+this.pendingBytes),g.data.set(d),f+=d.byteLength,e=0;e<this.pendingBoxes.length;e++)g.data.set(this.pendingBoxes[e],f),f+=this.pendingBoxes[e].byteLength;for(e=0;e<this.pendingCaptions.length;e++)a=this.pendingCaptions[e],a.startTime=a.startPts-h,a.startTime/=9e4,a.endTime=a.endPts-h,a.endTime/=9e4,g.captions.push(a);for(e=0;e<this.pendingMetadata.length;e++)c=this.pendingMetadata[e],c.cueTime=c.pts-h,c.cueTime/=9e4,g.metadata.push(c);g.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",g),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)}},f=function(a){var h,j,k,l,m,n,o,p,q,r,s,t=this;f.prototype.init.call(this),a=a||{},this.baseMediaDecodeTime=a.baseMediaDecodeTime||0,this.metadataStream=new b.mp2t.MetadataStream,a.metadataStream=this.metadataStream,k=new b.mp2t.TransportPacketStream,l=new b.mp2t.TransportParseStream,m=new b.mp2t.ElementaryStream,n=new b.codecs.AacStream,o=new b.codecs.H264Stream,s=new g(a),k.pipe(l).pipe(m),m.pipe(o),m.pipe(n),m.pipe(this.metadataStream).pipe(s),b.mp2t.CaptionStream&&(r=new b.mp2t.CaptionStream,o.pipe(r).pipe(s)),m.on("data",function(a){var b;if("metadata"===a.type){for(b=a.tracks.length;b--;)h||"video"!==a.tracks[b].type?j||"audio"!==a.tracks[b].type||(j=a.tracks[b],j.timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime):(h=a.tracks[b],h.timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime);h&&!p&&(s.numberOfTracks++,p=new d(h),p.on("timelineStartInfo",function(a){j&&(j.timelineStartInfo=a,q.setEarliestDts(a.dts))}),o.pipe(p).pipe(s)),j&&!q&&(s.numberOfTracks++,q=new e(j),n.pipe(q).pipe(s))}}),this.setBaseMediaDecodeTime=function(a){this.baseMediaDecodeTime=a,j&&(j.timelineStartInfo.dts=c,j.timelineStartInfo.pts=c,i(j),j.timelineStartInfo.baseMediaDecodeTime=a),h&&(h.timelineStartInfo.dts=c,h.timelineStartInfo.pts=c,i(h),h.timelineStartInfo.baseMediaDecodeTime=a)},this.push=function(a){k.push(a)},this.flush=function(){k.flush()},s.on("data",function(a){t.trigger("data",a)}),s.on("done",function(){t.trigger("done")})},f.prototype=new b.utils.Stream,b.mp4=b.mp4||{},b.mp4.VideoSegmentStream=d,b.mp4.AudioSegmentStream=e,b.mp4.Transmuxer=f}(this,this.muxjs);var wireTransmuxerEvents=function(a){a.on("data",function(a){a.data=a.data.buffer,postMessage({action:"data",segment:a},[a.data])}),a.captionStream&&a.captionStream.on("data",function(a){postMessage({action:"caption",data:a})}),a.on("done",function(a){postMessage({action:"done"})})},messageHandlers={init:function(a){initOptions=a&&a.options||{},this.defaultInit()},defaultInit:function(){transmuxer=new muxjs.mp4.Transmuxer(initOptions),wireTransmuxerEvents(transmuxer)},push:function(a){var b=new Uint8Array(a.data);transmuxer.push(b)},reset:function(){this.defaultInit()},setTimestampOffset:function(a){var b=a.timestampOffset||0;transmuxer.setBaseMediaDecodeTime(Math.round(9e4*b))},flush:function(a){transmuxer.flush()}};onmessage=function(a){transmuxer||"init"===a.data.action||messageHandlers.defaultInit(),a.data&&a.data.action&&messageHandlers[a.data.action]&&messageHandlers[a.data.action](a.data)};'],{
type:"application/javascript"}))),this.transmuxer_.postMessage({action:"init",options:{remux:!1}}),this.transmuxer_.onmessage=function(a){return"data"===a.data.action?c.data_(a):"done"===a.data.action?c.done_(a):void 0},Object.defineProperty(this,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(a){"number"==typeof a&&a>=0&&(this.timestampOffset_=a,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:a}))}}),Object.defineProperty(this,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(a){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=a),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=a)}}),Object.defineProperty(this,"updating",{get:function(){return this.bufferUpdating_||this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating}}),Object.defineProperty(this,"buffered",{get:function(){var a=null,b=null,c=0,d=[],e=[];if(!(this.videoBuffer_&&0!==this.videoBuffer_.buffered.length||this.audioBuffer_&&0!==this.audioBuffer_.buffered.length))return videojs.createTimeRange();if(!this.videoBuffer_)return this.audioBuffer_.buffered;if(!this.audioBuffer_)return this.videoBuffer_.buffered;for(var f=this.videoBuffer_.buffered,g=this.audioBuffer_.buffered,h=f.length;h--;)d.push({time:f.start(h),type:"start"}),d.push({time:f.end(h),type:"end"});for(h=g.length;h--;)d.push({time:g.start(h),type:"start"}),d.push({time:g.end(h),type:"end"});for(d.sort(function(a,b){return a.time-b.time}),h=0;h<d.length;h++)"start"===d[h].type?(c++,2===c&&(a=d[h].time)):"end"===d[h].type&&(c--,1===c&&(b=d[h].time)),null!==a&&null!==b&&(e.push([a,b]),a=null,b=null);return videojs.createTimeRanges(e)}})},data_:function(a){var b=a.data.segment,c=this.mediaSource_.mediaSource_;b.data=new Uint8Array(b.data),"video"===b.type?this.videoBuffer_||(this.videoBuffer_=c.addSourceBuffer('video/mp4;codecs="'+this.codecs_[0]+'"'),this.videoBuffer_.addEventListener("updatestart",f(this,"audioBuffer_","updatestart")),this.videoBuffer_.addEventListener("update",f(this,"audioBuffer_","update")),this.videoBuffer_.addEventListener("updateend",f(this,"audioBuffer_","updateend"))):"audio"===b.type?this.audioBuffer_||(this.audioBuffer_=c.addSourceBuffer('audio/mp4;codecs="'+this.codecs_[1]+'"'),this.audioBuffer_.addEventListener("updatestart",f(this,"videoBuffer_","updatestart")),this.audioBuffer_.addEventListener("update",f(this,"videoBuffer_","update")),this.audioBuffer_.addEventListener("updateend",f(this,"videoBuffer_","updateend"))):"combined"===b.type&&(this.videoBuffer_||(this.videoBuffer_=c.addSourceBuffer('video/mp4;codecs="'+this.codecs_.join(",")+'"'),this.videoBuffer_.addEventListener("updatestart",f(this,"videoBuffer_","updatestart")),this.videoBuffer_.addEventListener("update",f(this,"videoBuffer_","update")),this.videoBuffer_.addEventListener("updateend",f(this,"videoBuffer_","updateend")))),k(this,this.mediaSource_,b),this.pendingBuffers_.push(b)},done_:function(){this.processPendingSegments_()},appendBuffer:function(a){this.bufferUpdating_=!0,this.transmuxer_.postMessage({action:"push",data:a.buffer},[a.buffer]),this.transmuxer_.postMessage({action:"flush"})},remove:function(a,b){this.videoBuffer_&&this.videoBuffer_.remove(a,b),this.audioBuffer_&&this.audioBuffer_.remove(a,b),j(a,b,this.metadataTrack_),j(a,b,this.inbandTextTrack_)},processPendingSegments_:function(){var a={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};a=this.pendingBuffers_.reduce(function(a,b){var c=b.type,d=b.data;return"combined"===c&&(c="video"),a[c].segments.push(d),a[c].bytes+=d.byteLength,b.captions&&(a.captions=a.captions.concat(b.captions)),b.metadata&&(a.metadata=a.metadata.concat(b.metadata)),a},a),l(this,a.captions,a.metadata),this.concatAndAppendSegments_(a.video,this.videoBuffer_),this.concatAndAppendSegments_(a.audio,this.audioBuffer_),this.pendingBuffers_.length=0,this.bufferUpdating_=!1},concatAndAppendSegments_:function(a,b){var c,d=0;a.bytes&&(c=new Uint8Array(a.bytes),a.segments.forEach(function(a){c.set(a,d),d+=a.byteLength}),b.appendBuffer(c))},abort:function(){this.videoBuffer_&&this.videoBuffer_.abort(),this.audioBuffer_&&this.audioBuffer_.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"reset"}),this.pendingBuffers_.length=0,this.bufferUpdating_=!1}}),videojs.FlashMediaSource=videojs.extend(n,{constructor:function(){var a=this;this.sourceBuffers=[],this.readyState="closed",this.on(["sourceopen","webkitsourceopen"],function(b){this.swfObj=document.getElementById(b.swfId),this.player_=videojs(this.swfObj.parentNode),this.tech_=this.swfObj.tech,this.readyState="open",this.tech_.on("seeking",function(){for(var b=a.sourceBuffers.length;b--;)a.sourceBuffers[b].abort()}),this.swfObj&&this.swfObj.vjs_load()})},addSeekableRange_:function(){}}),videojs.FlashMediaSource.TIME_BETWEEN_TICKS=Math.floor(1e3/480),videojs.FlashMediaSource.TIME_PER_TICK=Math.floor(1e3/240),videojs.FlashMediaSource.BYTES_PER_CHUNK=1024,videojs.FlashMediaSource.MIN_CHUNK=1024,videojs.FlashMediaSource.MAX_CHUNK=1048576,videojs.FlashMediaSource.prototype.addSourceBuffer=function(a){var b;if(0!==a.indexOf("video/mp2t"))throw new Error("NotSupportedError (Video.js)");return b=new videojs.FlashSourceBuffer(this),this.sourceBuffers.push(b),b};try{Object.defineProperty(videojs.FlashMediaSource.prototype,"duration",{get:function(){return this.swfObj?this.swfObj.vjs_getProperty("duration"):NaN},set:function(a){var b,c=this.swfObj.vjs_getProperty("duration");if(this.swfObj.vjs_setProperty("duration",a),c>a)for(b=0;b<this.sourceBuffers.length;b++)this.sourceBuffers[b].remove(a,c);return a}})}catch(q){videojs.FlashMediaSource.prototype.duration=NaN}videojs.FlashMediaSource.prototype.endOfStream=function(a){"network"===a?this.tech_.error(2):"decode"===a&&this.tech_.error(3),"ended"!==this.readyState&&(this.readyState="ended",this.swfObj.vjs_endOfStream())},videojs.mediaSources={},videojs.MediaSource.open=function(a,b){var c=videojs.mediaSources[a];if(!c)throw new Error("Media Source not found (Video.js)");c.trigger({type:"sourceopen",swfId:b})},g=function(b){a.setTimeout(b,videojs.FlashMediaSource.TIME_BETWEEN_TICKS)},videojs.FlashSourceBuffer=videojs.extend(n,{constructor:function(c){var d,e=this;this.chunkSize_=videojs.FlashMediaSource.BYTES_PER_CHUNK,this.buffer_=[],this.bufferSize_=0,this.basePtsOffset_=NaN,this.mediaSource=c,this.updating=!1,this.timestampOffset_=0,this.segmentParser_=new b.flv.Transmuxer,this.segmentParser_.on("data",this.receiveBuffer_.bind(this)),d=a.btoa(String.fromCharCode.apply(null,Array.prototype.slice.call(this.segmentParser_.getFlvHeader()))),this.mediaSource.swfObj.vjs_appendBuffer(d),Object.defineProperty(this,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(a){"number"==typeof a&&a>=0&&(this.timestampOffset_=a,this.segmentParser_=new b.flv.Transmuxer,this.segmentParser_.on("data",this.receiveBuffer_.bind(this)),this.mediaSource.swfObj.vjs_discontinuity(),this.basePtsOffset_=NaN)}}),Object.defineProperty(this,"buffered",{get:function(){return videojs.createTimeRanges(this.mediaSource.swfObj.vjs_getProperty("buffered"))}}),this.mediaSource.player_.on("seeked",function(){j(0,1/0,e.metadataTrack_),j(0,1/0,e.inbandTextTrack_)})},appendBuffer:function(a){var b,c=this;if(this.updating)throw b=new Error("SourceBuffer.append() cannot be called while an update is in progress"),b.name="InvalidStateError",b.code=11,b;this.updating=!0,this.mediaSource.readyState="open",this.trigger({type:"update"});var d=524288,e=0;!function f(){c.segmentParser_.push(a.subarray(e,e+d)),e+=d,g(e<a.byteLength?f:c.segmentParser_.flush.bind(c.segmentParser_))}()},abort:function(){this.buffer_=[],this.bufferSize_=0,this.mediaSource.swfObj.vjs_abort(),this.updating&&(this.updating=!1,this.trigger({type:"updateend"}))},remove:function(a,b){j(a,b,this.metadataTrack_),j(a,b,this.inbandTextTrack_),this.trigger({type:"update"}),this.trigger({type:"updateend"})},receiveBuffer_:function(a){var b=this;k(this,this.mediaSource,a),l(this,a.captions,a.metadata),g(function(){0===b.buffer_.length&&g(b.processBuffer_.bind(b));var c=b.convertTagsToData_(a);c&&(b.buffer_.push(c),b.bufferSize_+=c.byteLength)})},processBuffer_:function(){var b,c,d,e,f,h,i=0,j=0,k=+new Date;if(!this.buffer_.length)return void(this.updating!==!1&&(this.updating=!1,this.trigger({type:"updateend"})));do{for(j++,b=this.buffer_[0].subarray(i,i+this.chunkSize_),b.byteLength<this.chunkSize_||this.buffer_[0].byteLength===i+this.chunkSize_?(i=0,this.buffer_.shift()):i+=this.chunkSize_,this.bufferSize_-=b.byteLength,e="",d=b.byteLength,c=0;d>c;c++)e+=String.fromCharCode(b[c]);f=a.btoa(e),this.mediaSource.swfObj.CallFunction('<invoke name="vjs_appendBuffer"returntype="javascript"><arguments><string>'+f+"</string></arguments></invoke>"),h=new Date-k}while(this.buffer_.length&&h<videojs.FlashMediaSource.TIME_PER_TICK);this.buffer_.length&&i&&(this.buffer_[0]=this.buffer_[0].subarray(i)),h>=videojs.FlashMediaSource.TIME_PER_TICK&&(this.chunkSize_=Math.floor(this.chunkSize_*(j/4))),this.chunkSize_=Math.max(videojs.FlashMediaSource.MIN_CHUNK,Math.min(this.chunkSize_,videojs.FlashMediaSource.MAX_CHUNK)),0!==this.bufferSize_?g(this.processBuffer_.bind(this)):(this.updating=!1,this.trigger({type:"updateend"}))},convertTagsToData_:function(a){var b,c,d,e=0,f=this.mediaSource.tech_,g=0,h=[],i=this.getOrderedTags_(a);for(isNaN(this.basePtsOffset_)&&i.length&&(this.basePtsOffset_=i[0].pts),f.buffered().length&&(g=f.buffered().end(0)-this.timestampOffset),g=Math.max(g,f.currentTime()-this.timestampOffset),g*=1e3,g+=this.basePtsOffset_,b=0;b<i.length;b++)i[b].pts>=g&&h.push(i[b]);if(0!==h.length){for(b=0;b<h.length;b++)e+=h[b].bytes.byteLength;for(d=new Uint8Array(e),b=0,c=0;b<h.length;b++)d.set(h[b].bytes,c),c+=h[b].bytes.byteLength;return d}},getOrderedTags_:function(a){for(var b,c=a.tags.videoTags,d=a.tags.audioTags,e=[];c.length||d.length;)b=c.length?d.length&&d[0].dts<c[0].dts?d.shift():c.shift():d.shift(),e.push(b.finalize());return e}}),videojs.URL={createObjectURL:function(b){var c;return b instanceof videojs.HtmlMediaSource?(c=a.URL.createObjectURL(b.mediaSource_),b.url_=c,c):b instanceof videojs.FlashMediaSource?(c=o+m,m++,videojs.mediaSources[c]=b,c):(c=a.URL.createObjectURL(b),b.url_=c,c)}}}(this,this.muxjs),function(a,b,c,d){"use strict";var e,f,g=1.2,h=3e5,i=1/30,j=b.getComponent("Component"),k=500;e=function(a){return a.retries&&a.retries>=2},b.Hls={},b.HlsHandler=b.extend(j,{constructor:function(a,c){var d,e=this;j.call(this,a),a.options_&&a.options_.playerId&&(d=b(a.options_.playerId),d.hls||Object.defineProperty(d,"hls",{get:function(){return b.log.warn("player.hls is deprecated. Use player.tech.hls instead."),e}})),this.tech_=a,this.source_=c.source,this.mode_=c.mode,this.pendingSegment_=null,this.bandwidth=c.bandwidth||4194304,this.bytesReceived=0,this.loadingState_="none","none"!==this.tech_.preload()&&(this.loadingState_="meta"),this.startCheckingBuffer_(),this.on(this.tech_,"seeking",function(){this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.stopCheckingBuffer_()}),this.on(this.tech_,"play",this.play)}}),b.Hls.canPlaySource=function(){return b.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")},b.HlsSourceHandler=function(a){return{canHandleSource:function(a){return b.HlsSourceHandler.canPlayType(a.type)},handleSource:function(c,d){return"flash"===a&&d.setTimeout(function(){d.trigger("loadstart")},1),d.hls=new b.HlsHandler(d,{source:c,mode:a}),d.hls.src(c.src),d.hls},canPlayType:function(a){return b.HlsSourceHandler.canPlayType(a)}}},b.HlsSourceHandler.canPlayType=function(a){var c=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return b.Hls.supportsNativeHls?!1:c.test(a)},b.MediaSource.supportsNativeMediaSources()&&b.getComponent("Html5").registerSourceHandler(b.HlsSourceHandler("html5")),a.Uint8Array&&b.getComponent("Flash").registerSourceHandler(b.HlsSourceHandler("flash")),b.Hls.GOAL_BUFFER_LENGTH=30,b.HlsHandler.prototype.src=function(a){var c;a&&(this.mediaSource=new b.MediaSource({mode:this.mode_}),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen.bind(this)),this.options_={},this.source_.withCredentials!==d?this.options_.withCredentials=this.source_.withCredentials:b.options.hls&&(this.options_.withCredentials=b.options.hls.withCredentials),this.playlists=new b.Hls.PlaylistLoader(this.source_.src,this.options_.withCredentials),this.tech_.on("canplay",this.setupFirstPlay.bind(this)),this.playlists.on("loadedmetadata",function(){c=this.playlists.media(),c.endList&&"metadata"!==this.tech_.preload()&&"none"!==this.tech_.preload()&&(this.loadingState_="segments"),this.setupSourceBuffer_(),this.setupFirstPlay(),this.fillBuffer(),this.tech_.trigger("loadedmetadata")}.bind(this)),this.playlists.on("error",function(){this.blacklistCurrentPlaylist_(this.playlists.error)}.bind(this)),this.playlists.on("loadedplaylist",function(){var a,b=this.playlists.media();return b?(this.updateDuration(this.playlists.media()),a=this.seekable(),this.duration()===1/0&&0!==a.length&&this.mediaSource.addSeekableRange_(a.start(0),a.end(0)),void(c=b)):void this.playlists.media(this.selectPlaylist())}.bind(this)),this.playlists.on("mediachange",function(){this.tech_.trigger({type:"mediachange",bubbles:!0})}.bind(this)),this.tech_.el()&&this.tech_.src(b.URL.createObjectURL(this.mediaSource)))},b.HlsHandler.prototype.handleSourceOpen=function(){this.sourceBuffer||this.setupSourceBuffer_(),this.tech_.autoplay()&&this.play()},b.Hls.findSoleUncommonTimeRangesEnd_=function(a,b){var c,d,e,f=[],g=[],h=function(a){return a[0]<=e&&a[1]>=e};if(a)for(c=0;c<a.length;c++)d=a.start(c),e=a.end(c),g.push([d,e]);if(b)for(c=0;c<b.length;c++)d=b.start(c),e=b.end(c),g.some(h)||f.push(e);return 1!==f.length?null:f[0]};var l=function(a){var b={codecCount:0,videoCodec:null,audioProfile:null};return b.codecCount=a.split(",").length,b.codecCount=b.codecCount||2,b.videoCodec=/(^|\s|,)+(avc1)[^ ,]*/i.exec(a),b.videoCodec=b.videoCodec&&b.videoCodec[2],b.audioProfile=/(^|\s|,)+mp4a.\d+\.(\d+)/i.exec(a),b.audioProfile=b.audioProfile&&b.audioProfile[2],b};b.HlsHandler.prototype.excludeIncompatibleVariants_=function(a){var b,c=this.playlists.master,d=2,e=null,f=null;a.attributes&&a.attributes.CODECS&&(b=l(a.attributes.CODECS),e=b.videoCodec,f=b.audioProfile,d=b.codecCount),c.playlists.forEach(function(a){var b={codecCount:2,videoCodec:null,audioProfile:null};a.attributes&&a.attributes.CODECS&&(b=l(a.attributes.CODECS)),b.codecCount!==d&&(a.excludeUntil=1/0),b.videoCodec!==e&&(a.excludeUntil=1/0),("5"===b.audioProfile&&"5"!==f||"5"===f&&"5"!==b.audioProfile)&&(a.excludeUntil=1/0)})},b.HlsHandler.prototype.setupSourceBuffer_=function(){var a,b=this.playlists.media();b&&"open"===this.mediaSource.readyState&&(a="video/mp2t",b.attributes&&b.attributes.CODECS&&(a+='; codecs="'+b.attributes.CODECS+'"'),this.sourceBuffer=this.mediaSource.addSourceBuffer(a),this.excludeIncompatibleVariants_(b),this.sourceBuffer.addEventListener("updateend",this.updateEndHandler_.bind(this)))},b.HlsHandler.prototype.setupFirstPlay=function(){var a,b;b=this.playlists.media(),this.duration()===1/0&&0===this.tech_.played().length&&!this.tech_.paused()&&this.sourceBuffer&&b&&this.tech_.readyState>=3&&(a=this.seekable(),a.length&&this.tech_.setCurrentTime(a.end(0)))},b.HlsHandler.prototype.play=function(){return this.loadingState_="segments",this.tech_.ended()&&this.tech_.setCurrentTime(0),0===this.tech_.played().length?this.setupFirstPlay():void(this.duration()===1/0&&this.tech_.currentTime()<this.seekable().start(0)&&this.tech_.setCurrentTime(this.seekable().start(0)))},b.HlsHandler.prototype.setCurrentTime=function(a){var b=this.findBufferedRange_();return this.playlists&&this.playlists.media()&&this.playlists.media().segments?b&&b.length?a:this.pendingSegment_&&this.pendingSegment_.buffered?a:(this.lastSegmentLoaded_=null,this.cancelSegmentXhr(),this.keyXhr_&&(this.keyXhr_.aborted=!0,this.cancelKeyXhr()),void this.fillBuffer(this.playlists.getMediaIndexForTime_(a))):0},b.HlsHandler.prototype.duration=function(){var a=this.playlists;return a?b.Hls.Playlist.duration(a.media()):0},b.HlsHandler.prototype.seekable=function(){var a,c;return this.playlists&&(a=this.playlists.media())?(c=b.Hls.Playlist.seekable(a),0===c.length?c:0===c.start(0)?b.createTimeRanges([[this.playlists.expired_,this.playlists.expired_+c.end(0)]]):c):b.createTimeRanges()},b.HlsHandler.prototype.updateDuration=function(a){var c=this.mediaSource.duration,d=b.Hls.Playlist.duration(a),e=function(){this.mediaSource.duration=d,this.tech_.trigger("durationchange"),this.mediaSource.removeEventListener("sourceopen",e)}.bind(this);c!==d&&("open"!==this.mediaSource.readyState?this.mediaSource.addEventListener("sourceopen",e):this.sourceBuffer&&this.sourceBuffer.updating||(this.mediaSource.duration=d,this.tech_.trigger("durationchange")))},b.HlsHandler.prototype.resetSrc_=function(){this.cancelSegmentXhr(),this.cancelKeyXhr(),this.sourceBuffer&&"open"===this.mediaSource.readyState&&this.sourceBuffer.abort()},b.HlsHandler.prototype.cancelKeyXhr=function(){this.keyXhr_&&(this.keyXhr_.onreadystatechange=null,this.keyXhr_.abort(),this.keyXhr_=null)},b.HlsHandler.prototype.cancelSegmentXhr=function(){this.segmentXhr_&&(this.segmentXhr_.onreadystatechange=null,this.segmentXhr_.abort(),this.segmentXhr_=null),this.pendingSegment_=null},b.HlsHandler.prototype.dispose=function(){this.stopCheckingBuffer_(),this.playlists&&this.playlists.dispose(),this.resetSrc_(),j.prototype.dispose.call(this)},b.HlsHandler.prototype.selectPlaylist=function(){var a,c,e,f,h,i,j,k,l,m=this.playlists.master.playlists.slice(),n=[],o=+new Date;for(m.sort(b.Hls.comparePlaylistBandwidth),m=m.filter(function(a){return a.excludeUntil!==d?o>=a.excludeUntil:!0}),c=m.length;c--;)e=m[c],e.attributes&&e.attributes.BANDWIDTH&&(a=e.attributes.BANDWIDTH*g,a<this.bandwidth&&(n.push(e),h||(h=e)));for(c=n.length,n.sort(b.Hls.comparePlaylistResolution),e=null,k=parseInt(getComputedStyle(this.tech_.el()).width,10),l=parseInt(getComputedStyle(this.tech_.el()).height,10);c--;)if(f=e,e=n[c],e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&e.attributes.RESOLUTION.height){if(e.attributes.RESOLUTION.width===k&&e.attributes.RESOLUTION.height===l){i=null,j=e;break}if(e.attributes.RESOLUTION.width<k&&e.attributes.RESOLUTION.height<l){f&&f.attributes&&f.attributes.RESOLUTION&&f.attributes.RESOLUTION.width&&f.attributes.RESOLUTION.height&&(i=f),j=e;break}}return i||j||h||m[0]},b.HlsHandler.prototype.checkBuffer_=function(){this.checkBufferTimeout_&&(a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null),this.fillBuffer(),this.drainBuffer(),this.checkBufferTimeout_=a.setTimeout(this.checkBuffer_.bind(this),k)},b.HlsHandler.prototype.startCheckingBuffer_=function(){this.checkBuffer_()},b.HlsHandler.prototype.stopCheckingBuffer_=function(){this.checkBufferTimeout_&&(a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)};var m=function(a){return function(c){var e,f=[],g=this.tech_,h=g.buffered();if(c===d&&(c=g.currentTime()),h&&h.length)for(e=0;e<h.length;e++)a(h.start(e),h.end(e),c)&&f.push([h.start(e),h.end(e)]);return b.createTimeRanges(f)}};b.HlsHandler.prototype.findBufferedRange_=m(function(a,b,c){return c>=a-i&&b+i>=c}),b.HlsHandler.prototype.findNextBufferedRange_=m(function(a,b,c){return a-i>=c}),b.HlsHandler.prototype.fillBuffer=function(a){var c,e,f,g=this.tech_,h=g.currentTime(),i=0!==this.tech_.buffered().length,j=this.findBufferedRange_(),k=!(j&&j.length),l=0,m=0;if("segments"===this.loadingState_&&g.currentSrc()&&this.playlists&&!this.segmentXhr_&&!this.pendingSegment_&&"HAVE_NOTHING"!==this.playlists.state&&this.playlists.media()&&this.playlists.media().segments&&"SWITCHING_MEDIA"!==this.playlists.state){if(a===d)if(j&&j.length){if(l=j.end(0),a=this.playlists.getMediaIndexForTime_(l),m=Math.max(0,l-h),m>=b.Hls.GOAL_BUFFER_LENGTH)return}else a=this.playlists.getMediaIndexForTime_(this.tech_.currentTime());if(c=this.playlists.media().segments[a]){if(this.lastSegmentLoaded_&&this.lastSegmentLoaded_===this.playlistUriToUrl(c.uri))return this.fillBuffer(a+1);e={uri:this.playlistUriToUrl(c.uri),mediaIndex:a,mediaSequence:this.playlists.media().mediaSequence,playlist:this.playlists.media(),currentBufferedEnd:l,bytes:null,encryptedBytes:null,decrypter:null,buffered:null,timestampOffset:null},a>0&&(f=b.Hls.Playlist.duration(e.playlist,e.playlist.mediaSequence+a)+this.playlists.expired_),this.tech_.seeking()&&k?e.playlist.discontinuityStarts.length&&(e.timestampOffset=f):c.discontinuity&&j.length?e.timestampOffset=j.end(0):!i&&this.tech_.currentTime()>.05&&(e.timestampOffset=f),this.loadSegment(e)}}},b.HlsHandler.prototype.playlistUriToUrl=function(a){var b;return b=this.playlists.media().uri===this.source_.src?f(this.source_.src,a):f(f(this.source_.src,this.playlists.media().uri||""),a)},b.HlsHandler.prototype.setBandwidth=function(a){this.segmentXhrTime=a.roundTripTime,this.bandwidth=a.bandwidth,this.bytesReceived+=a.bytesReceived||0,this.tech_.trigger("bandwidthupdate")},b.HlsHandler.prototype.blacklistCurrentPlaylist_=function(a){var c,d;return(c=a.playlist||this.playlists.media())?(c.excludeUntil=Date.now()+h,d=this.selectPlaylist(),d?(b.log.warn("Problem encountered with the current HLS playlist. Switching to another playlist."),this.playlists.media(d)):(b.log.warn("Problem encountered with the current HLS playlist. No suitable alternatives found."),this.error=a,this.mediaSource.endOfStream("network"))):(this.error=a,this.mediaSource.endOfStream("network"))},b.HlsHandler.prototype.loadSegment=function(a){var c=this,d=a.playlist.segments[a.mediaIndex],e=0,f=this.seekable();this.sourceBuffer&&!this.sourceBuffer.updating&&(e=f.length&&f.start(0)>0?f.start(0):this.tech_.currentTime()-60,e>0&&this.sourceBuffer.remove(0,e)),d.key&&this.fetchKey_(d),this.segmentXhr_=b.Hls.xhr({uri:a.uri,responseType:"arraybuffer",withCredentials:this.source_.withCredentials,timeout:1.5*d.duration*1e3},function(b,e){return c.segmentXhr_&&e===c.segmentXhr_?(c.segmentXhr_=null,e.timedout?(c.bandwidth=1,c.playlists.media(c.selectPlaylist())):!e.aborted&&b?c.blacklistCurrentPlaylist_({status:e.status,message:"HLS segment request error at URL: "+a.uri,code:e.status>=500?4:2}):void(e.response&&(c.lastSegmentLoaded_=a.uri,c.setBandwidth(e),d.key?a.encryptedBytes=new Uint8Array(e.response):a.bytes=new Uint8Array(e.response),c.pendingSegment_=a,c.tech_.trigger("progress"),c.drainBuffer(),c.playlists.media(c.selectPlaylist())))):void 0})},b.HlsHandler.prototype.drainBuffer=function(){var a,c,d,f,g,h,i,j;if(this.pendingSegment_&&this.sourceBuffer&&!this.pendingSegment_.buffered&&!this.sourceBuffer.updating){if(a=this.pendingSegment_,c=a.mediaIndex,d=a.playlist,f=a.offset,g=a.bytes,h=d.segments[c],h.key&&!g)return e(h.key)?this.blacklistCurrentPlaylist_({message:"HLS segment key request error.",code:4}):h.key.bytes?a.decrypter?void 0:(j=h.key.iv||new Uint32Array([0,0,0,c+d.mediaSequence]),i=new b.Hls.Decrypter(a.encryptedBytes,h.key.bytes,j,function(b,c){a.bytes=c}),void(a.decrypter=i)):void 0;this.pendingSegment_.buffered=this.tech_.buffered(),null!==a.timestampOffset&&(this.sourceBuffer.timestampOffset=a.timestampOffset),this.sourceBuffer.appendBuffer(g)}},b.HlsHandler.prototype.updateEndHandler_=function(){var a,c,d,e,f,g,h,j=this.pendingSegment_;if(this.pendingSegment_=null,j){if(d=this.playlists.media(),c=d.segments,e=j.mediaIndex+(j.mediaSequence-d.mediaSequence),f=this.findBufferedRange_(),j.playlist.uri!==this.playlists.media().uri)return this.fillBuffer();if(a=d.segments[e],g=this.seekable(),this.tech_.seeking()&&0===f.length&&g.length&&this.tech_.currentTime()<g.start(0)){var k=this.findNextBufferedRange_();k.length&&(b.log("tried seeking to",this.tech_.currentTime(),"but that was too early, retrying at",k.start(0)),this.tech_.setCurrentTime(k.start(0)+i))}return h=b.Hls.findSoleUncommonTimeRangesEnd_(j.buffered,this.tech_.buffered()),h&&a&&(a.end=h),this.playlists.media().endList&&f.length&&c[c.length-1].end<=f.end(0)&&"open"===this.mediaSource.readyState?void this.mediaSource.endOfStream():null!==h||j.buffered.length!==this.tech_.buffered().length?(this.updateDuration(d),void this.fillBuffer()):void this.fillBuffer(e+1)}},b.HlsHandler.prototype.fetchKey_=function(a){var c,d,f,g;if(!this.keyXhr_&&(d=this,f=this.options_,g=function(b){return function(c,e){var f;return d.keyXhr_=null,c||!e.response||16!==e.response.byteLength?(b.retries=b.retries||0,b.retries++,void(e.aborted||d.fetchKey_(a))):(f=new DataView(e.response),b.bytes=new Uint32Array([f.getUint32(0),f.getUint32(4),f.getUint32(8),f.getUint32(12)]),void d.checkBuffer_())}},c=a.key))return c.bytes||e(c)?void 0:void(this.keyXhr_=b.Hls.xhr({uri:this.playlistUriToUrl(c.uri),responseType:"arraybuffer",withCredentials:f.withCredentials},g(c)))},b.Hls.supportsNativeHls=function(){var a,d,e=c.createElement("video");return b.getComponent("Html5").isSupported()?(a=e.canPlayType("application/x-mpegURL"),d=e.canPlayType("application/vnd.apple.mpegURL"),/probably|maybe/.test(a)||/probably|maybe/.test(d)):!1}(),b.Hls.isSupported=function(){return b.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")},b.Hls.comparePlaylistBandwidth=function(b,c){var d,e;return b.attributes&&b.attributes.BANDWIDTH&&(d=b.attributes.BANDWIDTH),d=d||a.Number.MAX_VALUE,c.attributes&&c.attributes.BANDWIDTH&&(e=c.attributes.BANDWIDTH),e=e||a.Number.MAX_VALUE,d-e},b.Hls.comparePlaylistResolution=function(b,c){var d,e;return b.attributes&&b.attributes.RESOLUTION&&b.attributes.RESOLUTION.width&&(d=b.attributes.RESOLUTION.width),d=d||a.Number.MAX_VALUE,c.attributes&&c.attributes.RESOLUTION&&c.attributes.RESOLUTION.width&&(e=c.attributes.RESOLUTION.width),e=e||a.Number.MAX_VALUE,d===e&&b.attributes.BANDWIDTH&&c.attributes.BANDWIDTH?b.attributes.BANDWIDTH-c.attributes.BANDWIDTH:d-e},f=b.Hls.resolveUrl=function(a,b){var d,e,f=c.querySelector("base"),g=c.querySelector("head"),h=c.createElement("a"),i=f;return f?d=f.href:i=g.appendChild(c.createElement("base")),i.href=a,h.href=b,e=h.href,f?f.href=d:g.removeChild(i),e}}(window,window.videojs,document),function(a){"use strict";a.Hls.xhr=function(b,c){b=a.mergeOptions({timeout:45e3},b);var d=a.xhr(b,function(a,b){!a&&d.response&&(d.responseTime=(new Date).getTime(),d.roundTripTime=d.responseTime-d.requestTime,d.bytesReceived=d.response.byteLength||d.response.length,d.bandwidth||(d.bandwidth=Math.floor(d.bytesReceived/d.roundTripTime*8*1e3))),a||d.timedout?d.timedout=d.timedout||"ETIMEDOUT"===a.code:d.timedout=!1,a||200===b.statusCode||0===b.statusCode||(a=new Error("XHR Failed with a response of: "+(d&&(d.response||d.responseText)))),c(a,d)});return d.requestTime=(new Date).getTime(),d}}(window.videojs),function(a,b){var c=function(){this.init=function(){var a={};this.on=function(b,c){a[b]||(a[b]=[]),a[b].push(c)},this.off=function(b,c){var d;return a[b]?(d=a[b].indexOf(c),a[b].splice(d,1),d>-1):!1},this.trigger=function(b){var c,d,e,f;if(c=a[b])if(2===arguments.length)for(e=c.length,d=0;e>d;++d)c[d].call(this,arguments[1]);else for(f=Array.prototype.slice.call(arguments,1),e=c.length,d=0;e>d;++d)c[d].apply(this,f)},this.dispose=function(){a={}}}};c.prototype.pipe=function(a){this.on("data",function(b){a.push(b)})},a.Hls.Stream=c}(window.videojs),function(a,b,c,d,e){var f,g,h,i=function(){},j=function(){var a="[^=]*",b='"[^"]*"|[^,]*',c="(?:"+a+")=(?:"+b+")";return new RegExp("(?:^|,)("+c+")")}(),k=function(a){for(var b,c=a.split(j),d=c.length,e={};d--;)""!==c[d]&&(b=/([^=]*)=(.*)/.exec(c[d]).slice(1),b[0]=b[0].replace(/^\s+|\s+$/g,""),b[1]=b[1].replace(/^\s+|\s+$/g,""),b[1]=b[1].replace(/^['"](.*)['"]$/g,"$1"),e[b[0]]=b[1]);return e},l=a.Hls.Stream;f=function(){var a="";f.prototype.init.call(this),this.push=function(b){var c;for(a+=b,c=a.indexOf("\n");c>-1;c=a.indexOf("\n"))this.trigger("data",a.substring(0,c)),a=a.substring(c+1)}},f.prototype=new l,g=function(){g.prototype.init.call(this)},g.prototype=new l,g.prototype.push=function(a){var c,d;return a=a.replace(/^[\u0000\s]+|[\u0000\s]+$/g,""),0!==a.length?"#"!==a[0]?void this.trigger("data",{type:"uri",uri:a}):0!==a.indexOf("#EXT")?void this.trigger("data",{type:"comment",text:a.slice(1)}):(a=a.replace("\r",""),(c=/^#EXTM3U/.exec(a))?void this.trigger("data",{type:"tag",tagType:"m3u"}):(c=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(a))?(d={type:"tag",tagType:"inf"},c[1]&&(d.duration=parseFloat(c[1])),c[2]&&(d.title=c[2]),void this.trigger("data",d)):(c=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(a))?(d={type:"tag",tagType:"targetduration"},c[1]&&(d.duration=b(c[1],10)),void this.trigger("data",d)):(c=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(a))?(d={type:"tag",tagType:"totalduration"},c[1]&&(d.duration=b(c[1],10)),void this.trigger("data",d)):(c=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(a))?(d={type:"tag",tagType:"version"},c[1]&&(d.version=b(c[1],10)),void this.trigger("data",d)):(c=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(a))?(d={type:"tag",tagType:"media-sequence"},c[1]&&(d.number=b(c[1],10)),void this.trigger("data",d)):(c=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(a))?(d={type:"tag",tagType:"discontinuity-sequence"},c[1]&&(d.number=b(c[1],10)),void this.trigger("data",d)):(c=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(a))?(d={type:"tag",tagType:"playlist-type"},c[1]&&(d.playlistType=c[1]),void this.trigger("data",d)):(c=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(a))?(d={type:"tag",tagType:"byterange"},c[1]&&(d.length=b(c[1],10)),c[2]&&(d.offset=b(c[2],10)),void this.trigger("data",d)):(c=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(a))?(d={type:"tag",tagType:"allow-cache"},c[1]&&(d.allowed=!/NO/.test(c[1])),void this.trigger("data",d)):(c=/^#EXT-X-STREAM-INF:?(.*)$/.exec(a))?(d={type:"tag",tagType:"stream-inf"},c[1]&&(d.attributes=k(c[1]),d.attributes.RESOLUTION&&!function(){var a=d.attributes.RESOLUTION.split("x"),c={};a[0]&&(c.width=b(a[0],10)),a[1]&&(c.height=b(a[1],10)),d.attributes.RESOLUTION=c}(),d.attributes.BANDWIDTH&&(d.attributes.BANDWIDTH=b(d.attributes.BANDWIDTH,10)),d.attributes["PROGRAM-ID"]&&(d.attributes["PROGRAM-ID"]=b(d.attributes["PROGRAM-ID"],10))),void this.trigger("data",d)):(c=/^#EXT-X-ENDLIST/.exec(a))?void this.trigger("data",{type:"tag",tagType:"endlist"}):(c=/^#EXT-X-DISCONTINUITY/.exec(a))?void this.trigger("data",{type:"tag",tagType:"discontinuity"}):(c=/^#EXT-X-KEY:?(.*)$/.exec(a))?(d={type:"tag",tagType:"key"},c[1]&&(d.attributes=k(c[1]),d.attributes.IV&&("0x"===d.attributes.IV.substring(0,2)&&(d.attributes.IV=d.attributes.IV.substring(2)),d.attributes.IV=d.attributes.IV.match(/.{8}/g),d.attributes.IV[0]=b(d.attributes.IV[0],16),d.attributes.IV[1]=b(d.attributes.IV[1],16),d.attributes.IV[2]=b(d.attributes.IV[2],16),d.attributes.IV[3]=b(d.attributes.IV[3],16),d.attributes.IV=new Uint32Array(d.attributes.IV))),void this.trigger("data",d)):void this.trigger("data",{type:"tag",data:a.slice(4,a.length)})):void 0},h=function(){var a,b=this,j=[],k={};h.prototype.init.call(this),this.lineStream=new f,this.parseStream=new g,this.lineStream.pipe(this.parseStream),this.manifest={allowCache:!0,discontinuityStarts:[]},this.parseStream.on("data",function(f){({tag:function(){(({"allow-cache":function(){this.manifest.allowCache=f.allowed,"allowed"in f||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var a={};"length"in f&&(k.byterange=a,a.length=f.length,"offset"in f||(this.trigger("info",{message:"defaulting offset to zero"}),f.offset=0)),"offset"in f&&(k.byterange=a,a.offset=f.offset)},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,
this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),f.duration>=0&&(k.duration=f.duration),this.manifest.segments=j},key:function(){return f.attributes?"NONE"===f.attributes.METHOD?void(a=null):f.attributes.URI?(f.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:f.attributes.METHOD||"AES-128",uri:f.attributes.URI},void(f.attributes.IV!==e&&(a.iv=f.attributes.IV))):void this.trigger("warn",{message:"ignoring key declaration without URI"}):void this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){return c(f.number)?void(this.manifest.mediaSequence=f.number):void this.trigger("warn",{message:"ignoring invalid media sequence: "+f.number})},"discontinuity-sequence":function(){return c(f.number)?void(this.manifest.discontinuitySequence=f.number):void this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+f.number})},"playlist-type":function(){return/VOD|EVENT/.test(f.playlistType)?void(this.manifest.playlistType=f.playlistType):void this.trigger("warn",{message:"ignoring unknown playlist type: "+f.playlist})},"stream-inf":function(){return this.manifest.playlists=j,f.attributes?(k.attributes||(k.attributes={}),void(k.attributes=d(k.attributes,f.attributes))):void this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},discontinuity:function(){k.discontinuity=!0,this.manifest.discontinuityStarts.push(j.length)},targetduration:function(){return!c(f.duration)||f.duration<0?void this.trigger("warn",{message:"ignoring invalid target duration: "+f.duration}):void(this.manifest.targetDuration=f.duration)},totalduration:function(){return!c(f.duration)||f.duration<0?void this.trigger("warn",{message:"ignoring invalid total duration: "+f.duration}):void(this.manifest.totalDuration=f.duration)}})[f.tagType]||i).call(b)},uri:function(){k.uri=f.uri,j.push(k),!this.manifest.targetDuration||"duration"in k||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),k.duration=this.manifest.targetDuration),a&&(k.key=a),k={}},comment:function(){}})[f.type].call(b)})},h.prototype=new l,h.prototype.push=function(a){this.lineStream.push(a)},h.prototype.end=function(){this.lineStream.push("\n")},window.videojs.m3u8={LineStream:f,ParseStream:g,Parser:h}}(window.videojs,window.parseInt,window.isFinite,window.videojs.mergeOptions),function(a,b){"use strict";var c,d,e,f,g;e=function(a,b){var c,d,e=0;if(d=b-a.mediaSequence,c=a.segments[d]){if(void 0!==c.start)return{result:c.start,precise:!0};if(void 0!==c.end)return{result:c.end-c.duration,precise:!0}}for(;d--;){if(c=a.segments[d],void 0!==c.end)return{result:e+c.end,precise:!0};if(e+=c.duration,void 0!==c.start)return{result:e+c.start,precise:!0}}return{result:e,precise:!1}},f=function(a,b){var c,d,e=0;for(d=b-a.mediaSequence;d<a.segments.length;d++){if(c=a.segments[d],void 0!==c.start)return{result:c.start-e,precise:!0};if(e+=c.duration,void 0!==c.end)return{result:c.end-e,precise:!0}}return{result:-1,precise:!1}},d=function(a,b){var c,d;return void 0===b&&(b=a.mediaSequence+a.segments.length),b<a.mediaSequence?0:(c=e(a,b),c.precise?c.result:(d=f(a,b),d.precise?d.result:c.result))},c=function(b,c,e){if(!b)return 0;if(void 0===e&&(e=!0),void 0===c){if(b.totalDuration)return b.totalDuration;if(!b.endList)return a.Infinity}return d(b,c,e)},g=function(a){var e,f;return a.segments?a.endList?b.createTimeRange(0,c(a)):(e=d(a,a.mediaSequence),f=d(a,a.mediaSequence+Math.max(0,a.segments.length-3)),b.createTimeRange(e,f)):b.createTimeRange()},b.Hls.Playlist={duration:c,seekable:g}}(window,window.videojs),function(a,b){"use strict";var c=b.Hls.resolveUrl,d=b.Hls.xhr,e=b.mergeOptions,f=function(a,b){var c,d,f=!1,h=e(a,{});for(c=a.playlists.length;c--;)if(d=h.playlists[c],d.uri===b.uri){if(d.segments&&b.segments&&d.segments.length===b.segments.length&&d.mediaSequence===b.mediaSequence)continue;h.playlists[c]=e(d,b),h.playlists[b.uri]=h.playlists[c],d.segments&&(h.playlists[c].segments=g(d.segments,b.segments,b.mediaSequence-d.mediaSequence)),f=!0}return f?h:null},g=function(a,b,c){var d,f,g=b.slice();for(c=c||0,d=Math.min(a.length,b.length+c),f=c;d>f;f++)g[f-c]=e(a[f],g[f-c]);return g},h=function(e,g){var i,j,k,l,m=this;if(h.prototype.init.call(this),!e)throw new Error("A non-empty playlist URL is required");l=function(c,d,e){var g,h,i;return m.setBandwidth(k||d),k=null,c?(m.error={playlist:m.master.playlists[e],status:d.status,message:"HLS playlist request error at URL: "+e,responseText:d.responseText,code:d.status>=500?4:2},m.trigger("error")):(m.state="HAVE_METADATA",g=new b.m3u8.Parser,g.push(d.responseText),g.end(),g.manifest.uri=e,i=f(m.master,g.manifest),h=1e3*(g.manifest.targetDuration||10),i?(m.master=i,m.updateMediaPlaylist_(g.manifest)):h/=2,m.media().endList||(a.clearTimeout(j),j=a.setTimeout(function(){m.trigger("mediaupdatetimeout")},h)),void m.trigger("loadedplaylist"))},m.state="HAVE_NOTHING",this.expired_=0,i=this.dispose,m.dispose=function(){k&&(k.onreadystatechange=null,k.abort(),k=null),a.clearTimeout(j),i.call(this)},m.media=function(a){var b,e=m.state;if(!a)return m.media_;if("HAVE_NOTHING"===m.state)throw new Error("Cannot switch media playlist from "+m.state);if("string"==typeof a){if(!m.master.playlists[a])throw new Error("Unknown playlist URI: "+a);a=m.master.playlists[a]}if(b=!m.media_||a.uri!==m.media_.uri,m.master.playlists[a.uri].endList)return k&&(k.onreadystatechange=null,k.abort(),k=null),m.state="HAVE_METADATA",m.media_=a,void(b&&m.trigger("mediachange"));if(b){if(m.state="SWITCHING_MEDIA",k){if(c(m.master.uri,a.uri)===k.url)return;k.onreadystatechange=null,k.abort(),k=null}k=d({uri:c(m.master.uri,a.uri),withCredentials:g},function(b,c){l(b,c,a.uri),b||("HAVE_MASTER"===e?m.trigger("loadedmetadata"):m.trigger("mediachange"))})}},m.setBandwidth=function(a){m.bandwidth=a.bandwidth},m.on("mediaupdatetimeout",function(){"HAVE_METADATA"===m.state&&(m.state="HAVE_CURRENT_METADATA",k=d({uri:c(m.master.uri,m.media().uri),withCredentials:g},function(a,b){l(a,b,m.media().uri)}))}),k=d({uri:e,withCredentials:g},function(c,d){var f,g;if(k=null,c)return m.error={status:d.status,message:"HLS playlist request error at URL: "+e,responseText:d.responseText,code:2},m.trigger("error");if(f=new b.m3u8.Parser,f.push(d.responseText),f.end(),m.state="HAVE_MASTER",f.manifest.uri=e,f.manifest.playlists){for(m.master=f.manifest,g=m.master.playlists.length;g--;)m.master.playlists[m.master.playlists[g].uri]=m.master.playlists[g];return m.trigger("loadedplaylist"),void(k||m.media(f.manifest.playlists[0]))}return m.master={uri:a.location.href,playlists:[{uri:e}]},m.master.playlists[e]=m.master.playlists[0],l(null,d,e),m.trigger("loadedmetadata")})};h.prototype=new b.Hls.Stream,h.prototype.updateMediaPlaylist_=function(a){var b,c,d;if(b=this.media_,this.media_=this.master.playlists[a.uri],b&&a.uri===b.uri){if(a.segments.length){if(void 0!==a.segments[0].start)return void(this.expired_=a.segments[0].start);if(void 0!==a.segments[0].end)return void(this.expired_=a.segments[0].end-a.segments[0].duration)}for(c=a.mediaSequence-b.mediaSequence-1;c>=0;c--)if(d=b.segments[c]){if(void 0!==d.end)return void(this.expired_=d.end);if(void 0!==d.start)return void(this.expired_=d.start+d.duration);this.expired_+=d.duration}else this.expired_+=b.targetDuration||10}},h.prototype.getMediaIndexForTime_=function(a){var b,c,d,e,f,g,h=a,i=this.media_.segments.length,j=i-1;if(!this.media_)return 0;if(0>a)return 0;for(b=0;i>b;b++)if(c=this.media_.segments[b],c.end){if(c.end>a){g=c.end,e=b;break}f=c.end,d=b+1}if(void 0!==d){for(a-=f,b=d;(e||i)>b;b++)if(c=this.media_.segments[b],a-=c.duration,0>a)return b;return b>=e?d+Math.floor((h-f)/(g-f)*(e-d)):j}if(void 0!==e){for(a=g-a,b=e;b>=0;b--)if(c=this.media_.segments[b],a-=c.duration,0>a)return b;return 0===a?0:-1}if(a-=this.expired_,0>a)return-1;for(b=0;i>b;b++)if(c=this.media_.segments[b],a-=c.duration,0>a)return b;return j},b.Hls.PlaylistLoader=h}(window,window.videojs),function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){(function(b){b.window.pkcs7={unpad:a("./unpad")}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./unpad":2}],2:[function(a,b,c){"use strict";b.exports=function(a){return a.subarray(0,a.byteLength-a[a.byteLength-1])}},{}]},{},[1]),function(a,b,c){"use strict";var d,e,f,g,h;h=function(a){return a<<24|(65280&a)<<8|(16711680&a)>>8|a>>>24},d=function(a){this._precompute();var b,c,d,e,f,g=this._tables[0][4],h=this._tables[1],i=a.length,j=1;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size");for(e=a.slice(0),f=[],this._key=[e,f],b=i;4*i+28>b;b++)d=e[b-1],(b%i===0||8===i&&b%i===4)&&(d=g[d>>>24]<<24^g[d>>16&255]<<16^g[d>>8&255]<<8^g[255&d],b%i===0&&(d=d<<8^d>>>24^j<<24,j=j<<1^283*(j>>7))),e[b]=e[b-i]^d;for(c=0;b;c++,b--)d=e[3&c?b:b-4],4>=b||4>c?f[c]=d:f[c]=h[0][g[d>>>24]]^h[1][g[d>>16&255]]^h[2][g[d>>8&255]]^h[3][g[255&d]]},d.prototype={_tables:[[[],[],[],[],[]],[[],[],[],[],[]]],_precompute:function(){var a,b,c,d,e,f,g,h,i,j=this._tables[0],k=this._tables[1],l=j[4],m=k[4],n=[],o=[];for(a=0;256>a;a++)o[(n[a]=a<<1^283*(a>>7))^a]=a;for(b=c=0;!l[b];b^=d||1,c=o[c]||1)for(g=c^c<<1^c<<2^c<<3^c<<4,g=g>>8^255&g^99,l[b]=g,m[g]=b,f=n[e=n[d=n[b]]],i=16843009*f^65537*e^257*d^16843008*b,h=257*n[g]^16843008*g,a=0;4>a;a++)j[a][b]=h=h<<24^h>>>8,k[a][g]=i=i<<24^i>>>8;for(a=0;5>a;a++)j[a]=j[a].slice(0),k[a]=k[a].slice(0)},decrypt:function(a,b,c,d,e,f){var g,h,i,j,k=this._key[1],l=a^k[0],m=d^k[1],n=c^k[2],o=b^k[3],p=k.length/4-2,q=4,r=this._tables[1],s=r[0],t=r[1],u=r[2],v=r[3],w=r[4];for(j=0;p>j;j++)g=s[l>>>24]^t[m>>16&255]^u[n>>8&255]^v[255&o]^k[q],h=s[m>>>24]^t[n>>16&255]^u[o>>8&255]^v[255&l]^k[q+1],i=s[n>>>24]^t[o>>16&255]^u[l>>8&255]^v[255&m]^k[q+2],o=s[o>>>24]^t[l>>16&255]^u[m>>8&255]^v[255&n]^k[q+3],q+=4,l=g,m=h,n=i;for(j=0;4>j;j++)e[(3&-j)+f]=w[l>>>24]<<24^w[m>>16&255]<<16^w[n>>8&255]<<8^w[255&o]^k[q++],g=l,l=m,m=n,n=o,o=g}},g=function(a,b,c){var e,f,g,i,j,k,l,m,n,o=new Int32Array(a.buffer,a.byteOffset,a.byteLength>>2),p=new d(Array.prototype.slice.call(b)),q=new Uint8Array(a.byteLength),r=new Int32Array(q.buffer);for(e=c[0],f=c[1],g=c[2],i=c[3],n=0;n<o.length;n+=4)j=h(o[n]),k=h(o[n+1]),l=h(o[n+2]),m=h(o[n+3]),p.decrypt(j,k,l,m,r,n),r[n]=h(r[n]^e),r[n+1]=h(r[n+1]^f),r[n+2]=h(r[n+2]^g),r[n+3]=h(r[n+3]^i),e=j,f=k,g=l,i=m;return q},e=function(){this.jobs=[],this.delay=1,this.timeout_=null},e.prototype=new b.Hls.Stream,e.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},e.prototype.push=function(a){this.jobs.push(a),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},f=function(a,b,d,g){var i=f.STEP,j=new Int32Array(a.buffer),k=new Uint8Array(a.byteLength),l=0;for(this.asyncStream_=new e,this.asyncStream_.push(this.decryptChunk_(j.subarray(l,l+i),b,d,k,l)),l=i;l<j.length;l+=i)d=new Uint32Array([h(j[l-4]),h(j[l-3]),h(j[l-2]),h(j[l-1])]),this.asyncStream_.push(this.decryptChunk_(j.subarray(l,l+i),b,d,k));this.asyncStream_.push(function(){g(null,c(k))})},f.prototype=new b.Hls.Stream,f.prototype.decryptChunk_=function(a,b,c,d){return function(){var e=g(a,b,c);d.set(e,a.byteOffset)}},f.STEP=32e3,b.Hls.decrypt=g,b.Hls.Decrypter=f,b.Hls.AsyncStream=e}(window,window.videojs,window.pkcs7.unpad);