sync/www/js/videojs-contrib-hls.min.js

12 lines
166 KiB
JavaScript
Raw Normal View History

2016-08-07 04:14:52 +00:00
/**
* videojs-contrib-hls
* @version 3.4.0
* @copyright 2016 Brightcove, Inc
* @license Apache-2.0
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.videojsContribHls=e()}}(function(){return function e(t,i,r){function n(s,o){if(!i[s]){if(!t[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);var d=new Error("Cannot find module '"+s+"'");throw d.code="MODULE_NOT_FOUND",d}var l=i[s]={exports:{}};t[s][0].call(l.exports,function(e){var i=t[s][1][e];return n(i?i:e)},l,l.exports,e,t,i,r)}return i[s].exports}for(var a="function"==typeof require&&require,s=0;s<r.length;s++)n(r[s]);return n}({1:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=function(e,t){return e.start(t)+"-"+e.end(t)},n=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},a=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},s={hexDump:function(e){for(var t=Array.prototype.slice.call(e),i=16,r="",s=void 0,o=void 0,u=0;u<t.length/i;u++)s=t.slice(u*i,u*i+i).map(n).join(""),o=t.slice(u*i,u*i+i).map(a).join(""),r+=s+" "+o+"\n";return r},tagDump:function(e){return s.hexDump(e.bytes)},textRanges:function(e){var t="",i=void 0;for(i=0;i<e.length;i++)t+=r(e,i)+" ";return t}};i.default=s,t.exports=i.default},{}],2:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default={GOAL_BUFFER_LENGTH:30},t.exports=i.default},{}],3:[function(e,t,i){(function(r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),o=e("./ranges"),u=n(o),d="undefined"!=typeof window?window.videojs:"undefined"!=typeof r?r.videojs:null,l=n(d),f=["seeking","seeked","pause","playing","error"],c=function(){function e(t){var i=this;a(this,e),this.tech_=t.tech,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,t.debug&&(this.logger_=l.default.log.bind(l.default,"gap-skipper ->")),this.logger_("initialize");var r=function(){return i.waiting_()},n=function(){return i.timeupdate_()},s=function(){return i.cancelTimer_()};this.tech_.on("waiting",r),this.tech_.on("timeupdate",n),this.tech_.on(f,s),this.dispose=function(){i.logger_("dispose"),i.tech_.off("waiting",r),i.tech_.off("timeupdate",n),i.tech_.off(f,s),i.cancelTimer_()}}return s(e,[{key:"waiting_",value:function(){this.tech_.seeking()||this.setTimer_()}},{key:"timeupdate_",value:function(){if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime();5===this.consecutiveUpdates&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null}},{key:"skipTheGap_",value:function(e){var t=this.tech_.buffered(),i=this.tech_.currentTime(),r=u.default.findNextRange(t,i);this.consecutiveUpdates=0,this.timer_=null,0!==r.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+u.default.TIME_FUDGE_FACTOR))}},{key:"gapFromVideoUnderflow_",value:function(e,t){for(var i=u.default.findGaps(e),r=0;r<i.length;r++){var n=i.start(r),a=i.end(r);if(a-n<1&&t-n<4&&t-a>2)return{start:n,end:a}}return null}},{key:"setTimer_",value:function(){var e=this.tech_.buffered(),t=this.tech_.currentTime(),i=u.default.findNextRange(e,t);if(null===this.timer_){if(0===i.length){var r=this.gapFromVideoUnderflow_(e,t);return void(r&&(this.logger_("s
var o=i.attributes;if(o.RESOLUTION){var u=o.RESOLUTION;this.width=u.width,this.height=u.height}this.bandwidth=o.BANDWIDTH}this.id=a,this.enabled=n.bind(this,i,s)},s=function(e){var t=e.playlists;e.representations=function(){return t.master.playlists.map(function(t,i){return new a(e,t,i)})}};i.default=s,t.exports=i.default},{}],10:[function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(i,"__esModule",{value:!0});var n=e("global/document"),a=r(n),s=function(e,t){var i=a.default.querySelector("base"),r=a.default.querySelector("head"),n=a.default.createElement("a"),s=i,o=void 0,u=void 0;return i?o=i.href:s=r.appendChild(a.default.createElement("base")),s.href=e,n.href=t,u=n.href,i?i.href=o:r.removeChild(s),u};i.default=s,t.exports=i.default},{"global/document":24}],11:[function(e,t,i){(function(r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(i,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),u=function(e,t,i){for(var r=!0;r;){var n=e,a=t,s=i;r=!1,null===n&&(n=Function.prototype);var o=Object.getOwnPropertyDescriptor(n,a);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(s)}var d=Object.getPrototypeOf(n);if(null===d)return;e=d,t=a,i=s,r=!0,o=d=void 0}},d=e("./ranges"),l=n(d),f=e("./playlist"),c="undefined"!=typeof window?window.videojs:"undefined"!=typeof r?r.videojs:null,h=n(c),p=e("./source-updater"),m=n(p),g=e("aes-decrypter"),y=e("./config"),v=n(y),b=e("global/window"),_=n(b),w=500,T=function(e,t,i){if(!e)return!1;var r=e.segments[t],n=e.segments[t-1];return!(!i||!r)&&(r.end=i,n?n.end&&(r.duration=r.end-n.end):r.duration=r.end,!0)},S=function(e,t,i,r){if(!e)return!1;var n=e.segments,a=i===n.length-1,s=r.length&&n[n.length-1].end<=r.end(0);return e.endList&&"open"===t.readyState&&(a||s)},k=function(e){var t=void 0,i=void 0;return i=e.offset+e.length-1,t=e.offset,"bytes="+t+"-"+i},O=function(e){var t={};return"byterange"in e&&(t.Range=k(e.byterange)),t},P=function(e){function t(e){a(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var i=void 0;if(!e)throw new TypeError("Initialization options are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");i=h.default.mergeOptions(h.default.options.hls,e),this.state="INIT",this.bandwidth=i.bandwidth,this.roundTrip=NaN,this.resetStats_(),this.hasPlayed_=i.hasPlayed,this.currentTime_=i.currentTime,this.seekable_=i.seekable,this.seeking_=i.seeking,this.setCurrentTime_=i.setCurrentTime,this.mediaSource_=i.mediaSource,this.checkBufferTimeout_=null,this.error_=void 0,this.expired_=0,this.timeCorrection_=0,this.currentTimeline_=-1,this.xhr_=null,this.pendingSegment_=null,this.sourceUpdater_=null,this.hls_=i.hls,this.xhrOptions_=null}return s(t,e),o(t,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaTransferDuration=0}},{key:"dispose",value:function(){this.state="DISPOSED",this.abort_(),this.sourceUpdater_&&this.sourceUpdater_.dispose(),this.resetStats_()}},{key:"abort",value:function(){"WAITING"===this.state&&(this.abort_(),this.paused()||(this.state="READY",this.fillBuffer_()))}},{key:"error",value:function(e){return"undefined"!=typeof e&&(this.error_=e),this.pendingSegment_=null,this.error_}},{key:"load",value:function(){this.monitorBuffer_(),this.pl
}],55:[function(e,t,i){function r(e){return a(e)&&n(e.length)&&!!E[j.call(e)]}var n=e("../internal/isLength"),a=e("../internal/isObjectLike"),s="[object Arguments]",o="[object Array]",u="[object Boolean]",d="[object Date]",l="[object Error]",f="[object Function]",c="[object Map]",h="[object Number]",p="[object Object]",m="[object RegExp]",g="[object Set]",y="[object String]",v="[object WeakMap]",b="[object ArrayBuffer]",_="[object Float32Array]",w="[object Float64Array]",T="[object Int8Array]",S="[object Int16Array]",k="[object Int32Array]",O="[object Uint8Array]",P="[object Uint8ClampedArray]",x="[object Uint16Array]",A="[object Uint32Array]",E={};E[_]=E[w]=E[T]=E[S]=E[k]=E[O]=E[P]=E[x]=E[A]=!0,E[s]=E[o]=E[b]=E[u]=E[d]=E[l]=E[f]=E[c]=E[h]=E[p]=E[m]=E[g]=E[y]=E[v]=!1;var L=Object.prototype,j=L.toString;t.exports=r},{"../internal/isLength":44,"../internal/isObjectLike":45}],56:[function(e,t,i){function r(e){return n(e,a(e))}var n=e("../internal/baseCopy"),a=e("../object/keysIn");t.exports=r},{"../internal/baseCopy":29,"../object/keysIn":58}],57:[function(e,t,i){var r=e("../internal/getNative"),n=e("../internal/isArrayLike"),a=e("../lang/isObject"),s=e("../internal/shimKeys"),o=e("../support"),u=r(Object,"keys"),d=u?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||("function"==typeof e?o.enumPrototypes:n(e))?s(e):a(e)?u(e):[]}:s;t.exports=d},{"../internal/getNative":39,"../internal/isArrayLike":40,"../internal/shimKeys":46,"../lang/isObject":52,"../support":60}],58:[function(e,t,i){function r(e){if(null==e)return[];l(e)||(e=Object(e));var t=e.length;t=t&&d(t)&&(s(e)||a(e)||f(e))&&t||0;for(var i=e.constructor,r=-1,n=o(i)&&i.prototype||k,h=n===e,p=Array(t),m=t>0,y=c.enumErrorProps&&(e===S||e instanceof Error),v=c.enumPrototypes&&o(e);++r<t;)p[r]=r+"";for(var _ in e)v&&"prototype"==_||y&&("message"==_||"name"==_)||m&&u(_,t)||"constructor"==_&&(h||!P.call(e,_))||p.push(_);if(c.nonEnumShadows&&e!==k){var E=e===O?w:e===S?g:x.call(e),L=A[E]||A[b];for(E==b&&(n=k),t=T.length;t--;){_=T[t];var j=L[_];h&&j||(j?!P.call(e,_):e[_]===n[_])||p.push(_)}}return p}var n=e("../internal/arrayEach"),a=e("../lang/isArguments"),s=e("../lang/isArray"),o=e("../lang/isFunction"),u=e("../internal/isIndex"),d=e("../internal/isLength"),l=e("../lang/isObject"),f=e("../lang/isString"),c=e("../support"),h="[object Array]",p="[object Boolean]",m="[object Date]",g="[object Error]",y="[object Function]",v="[object Number]",b="[object Object]",_="[object RegExp]",w="[object String]",T=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],S=Error.prototype,k=Object.prototype,O=String.prototype,P=k.hasOwnProperty,x=k.toString,A={};A[h]=A[m]=A[v]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},A[p]=A[w]={constructor:!0,toString:!0,valueOf:!0},A[g]=A[y]=A[_]={constructor:!0,toString:!0},A[b]={constructor:!0},n(T,function(e){for(var t in A)if(P.call(A,t)){var i=A[t];i[e]=P.call(i,e)}}),t.exports=r},{"../internal/arrayEach":28,"../internal/isIndex":42,"../internal/isLength":44,"../lang/isArguments":48,"../lang/isArray":49,"../lang/isFunction":50,"../lang/isObject":52,"../lang/isString":54,"../support":60}],59:[function(e,t,i){var r=e("../internal/baseMerge"),n=e("../internal/createAssigner"),a=n(r);t.exports=a},{"../internal/baseMerge":32,"../internal/createAssigner":36}],60:[function(e,t,i){var r=Array.prototype,n=Error.prototype,a=Object.prototype,s=a.propertyIsEnumerable,o=r.splice,u={};!function(e){var t=function(){this.x=e},i={0:e,length:e},r=[];t.prototype={valueOf:e,y:e};for(var a in new t)r.push(a);u.enumErrorProps=s.call(n,"message")||s.call(n,"name"),u.enumPrototypes=s.call(t,"prototype"),u.nonEnumShadows=!/valueOf/.test(r),u.ownLast="x"!=r[0],u.spliceObjects=(o.call(i,0,1),!i[0]),u.unindexedChars="x"[0]+Object("x")[0]!="xx"}(1,0),t.exports=u},{}],61:[function(e,t,i){function r(e){return e}t.exports=r},{}],62:[function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(i,"__esModule",{value:!0});var n=e("./
e!==1/0)return void(this.nativeMediaSource_.duration=e)}}),Object.defineProperty(this,"seekable",{get:function(){return this.duration_===1/0?p.default.createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(this,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(this,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),this.sourceBuffers=[],this.activeSourceBuffers_=[],this.updateActiveSourceBuffers_=function(){e.activeSourceBuffers_.length=0;for(var t=!1,i=!0,r=0;r<e.player_.audioTracks().length;r++){var n=e.player_.audioTracks()[r];if(n.enabled&&"main"!==n.kind){t=!0,i=!1;break}}e.sourceBuffers.forEach(function(r){if(r.videoCodec_&&r.audioCodec_)r.audioDisabled_=t;else if(r.videoCodec_&&!r.audioCodec_)r.audioDisabled_=!0,i=!1;else if(!r.videoCodec_&&r.audioCodec_&&(r.audioDisabled_=i,i))return;e.activeSourceBuffers_.push(r)})},["sourceopen","sourceclose","sourceended"].forEach(function(e){this.nativeMediaSource_.addEventListener(e,this.trigger.bind(this))},this),this.on("sourceopen",function(t){var i=c.default.querySelector('[src="'+e.url_+'"]');i&&(e.player_=(0,p.default)(i.parentNode),e.player_.audioTracks&&e.player_.audioTracks()&&(e.player_.audioTracks().on("change",e.updateActiveSourceBuffers_),e.player_.audioTracks().on("addtrack",e.updateActiveSourceBuffers_),e.player_.audioTracks().on("removetrack",e.updateActiveSourceBuffers_)))}),this.on("sourceclose",function(e){this.sourceBuffers.forEach(function(e){e.transmuxer_&&e.transmuxer_.terminate()}),this.sourceBuffers.length=0,this.player_&&this.player_.audioTracks&&this.player_.audioTracks()&&(this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_))})}return s(t,e),o(t,[{key:"addSeekableRange_",value:function(e,t){var i=void 0;if(this.duration!==1/0)throw i=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity"),i.name="InvalidStateError",i.code=11,i;(t>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=t)}},{key:"addSourceBuffer",value:function(e){var t=void 0,i=(0,y.parseContentType)(e);if("video/mp2t"===i.type){var r=[];i.parameters&&i.parameters.codecs&&(r=i.parameters.codecs.split(","),r=v(r),r=r.filter(function(e){return(0,y.isAudioCodec)(e)||(0,y.isVideoCodec)(e)})),0===r.length&&(r=["avc1.4d400d","mp4a.40.2"]),t=new g.default(this,r),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),t.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)}else t=this.nativeMediaSource_.addSourceBuffer(e);return this.sourceBuffers.push(t),t}}]),t}(p.default.EventTarget);i.default=b,t.exports=i.default}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./codec-utils":68,"./virtual-source-buffer":77,"global/document":24,"global/window":25}],74:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=function(e,t,i){var r=void 0,n=void 0;if(i)for(r=i.cues.length;r--;)n=i.cues[r],n.startTime<=t&&n.endTime>=e&&i.removeCue(n)};i.default=r,t.exports=i.default},{}],75:[function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),s=e("global/window"),o=r(s),u=e("mux.js/lib/mp4"),d=r(u),l=function(e){e.on("data",function(e){var t=e.data;e.data=t.buffer,o.default.postMessage({action:"data",segment:e,byteOffset:t.byteOffset,byteLength:t.byteLength},[e.data])}),e
this.lastControlCode_=null,this.push=function(e){if(0===e.type){var t,i,r,n;if(t=32639&e.ccData,t===this.lastControlCode_)return void(this.lastControlCode_=null);switch(4096===(61440&t)?this.lastControlCode_=t:this.lastControlCode_=null,t){case c:break;case h:this.mode_="popOn";break;case p:this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;break;case m:this.topRow_=T-1,this.mode_="rollUp";break;case g:this.topRow_=T-2,this.mode_="rollUp";break;case y:this.topRow_=T-3,this.mode_="rollUp";break;case v:this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;break;case b:"popOn"===this.mode_?this.nonDisplayed_[T]=this.nonDisplayed_[T].slice(0,-1):this.displayed_[T]=this.displayed_[T].slice(0,-1);break;case _:this.flushDisplayed(e.pts),this.displayed_=S();break;case w:this.nonDisplayed_=S();break;default:if(r=t>>>8,n=255&t,r>=16&&r<=23&&n>=64&&n<=127&&(16!==r||n<96)&&(r=32,n=null),(17===r||25===r)&&n>=48&&n<=63&&(r=9834,n=""),16===(240&r))return;this[this.mode_](e.pts,r,n)}}}};k.prototype=new a,k.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){return e.trim()}).filter(function(e){return e.length}).join("\n");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t})},k.prototype.popOn=function(e,t,i){var r=this.nonDisplayed_[T];r+=f(t),r+=f(i),this.nonDisplayed_[T]=r},k.prototype.rollUp=function(e,t,i){var r=this.displayed_[T];""===r&&(this.flushDisplayed(e),this.startPts_=e),r+=f(t),r+=f(i),this.displayed_[T]=r},k.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.topRow_;e<T;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[T]=""},t.exports={CaptionStream:d,Cea608Stream:k}},{"../utils/stream":92}],85:[function(e,t,i){"use strict";var r,n,a,s=e("../utils/stream.js"),o=e("./caption-stream"),u=e("./stream-types"),d=e("./stream-types.js"),l=188,f=71;r=function(){var e=new Uint8Array(l),t=0;r.prototype.init.call(this),this.push=function(i){var r,n=0,a=l;for(t?(r=new Uint8Array(i.byteLength+t),r.set(e.subarray(0,t)),r.set(i,t),t=0):r=i;a<r.byteLength;)r[n]!==f||r[a]!==f?(n++,a++):(this.trigger("data",r.subarray(n,a)),n+=l,a+=l);n<r.byteLength&&(e.set(r.subarray(n),0),t=r.byteLength-n)},this.flush=function(){t===l&&e[0]===f&&(this.trigger("data",e),t=0),this.trigger("done")}},r.prototype=new s,n=function(){var e,t,i,r;n.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var n=0;r.payloadUnitStartIndicator&&(n+=e[n]+1),"pat"===r.type?t(e.subarray(n),r):i(e.subarray(n),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=r.pmtPid},i=function(e,t){var i,n,a,s;if(1&e[5]){for(r.programMapTable={},i=(15&e[1])<<8|e[2],n=3+i-4,a=(15&e[10])<<8|e[11],s=12+a;s<n;)r.programMapTable[(31&e[s+1])<<8|e[s+2]]=e[s],s+=((15&e[s+3])<<8|e[s+4])+5;for(t.programMapTable=r.programMapTable;r.packetsWaitingForPmt.length;)r.processPes_.apply(r,r.packetsWaitingForPmt.shift())}},this.push=function(t){var i={},r=4;i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(r+=t[r]+1),0===i.pid?(i.type="pat",e(t.subarray(r),i),this.trigger("data",i)):i.pid===this.pmtPid?(i.type="pmt",e(t.subarray(r),i),this.trigger("data",i)):void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,i]):this.processPes_(t,r,i)},this.processPes_=function(e,t,i){i.streamType=this.programMapTable[i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},n.prototype=new s,n.STREAM_TYPES={h264:27,adts:15},a=function(){var e=this,t={data:[],size:0},i={data:[],size:0},r={data:[],size:0},n=function(e,t){var i;t.dataAlignmentIndicator=0!==(4&e[6]),i=e[7],192&i&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8])},s=function(t,i){v
if(typeof e!=typeof t)return!0;if(Object.keys(e).length!==Object.keys(t).length)return!0;for(var i in e)if(!t[i]||e[i]!==t[i])return!0;return!1},I={PlaylistLoader:f.default,Playlist:h.default,Decrypter:g.Decrypter,AsyncStream:g.AsyncStream,decrypt:g.decrypt,utils:v.default,xhr:(0,m.default)()};Object.defineProperty(I,"GOAL_BUFFER_LENGTH",{get:function(){return S.default.log.warn("using Hls.GOAL_BUFFER_LENGTH is UNSAFE be sure you know what you are doing"),x.default.GOAL_BUFFER_LENGTH},set:function(e){return S.default.log.warn("using Hls.GOAL_BUFFER_LENGTH is UNSAFE be sure you know what you are doing"),"number"!=typeof e||e<=0?void S.default.log.warn("value passed to Hls.GOAL_BUFFER_LENGTH must be a number and greater than 0"):void(x.default.GOAL_BUFFER_LENGTH=e)}});var M=1.2,B=function(e,t){var i=void 0;return e?(i=U.default.getComputedStyle(e),i?i[t]:""):""};I.STANDARD_PLAYLIST_SELECTOR=function(){var e=void 0,t=this.playlists.master.playlists.slice(),i=[],r=+new Date,n=void 0,a=void 0,s=void 0,o=void 0,u=void 0,d=void 0,l=void 0,f=void 0;for(t.sort(I.comparePlaylistBandwidth),t=t.filter(function(e){return"undefined"==typeof e.excludeUntil||r>=e.excludeUntil}),n=t.length;n--;)a=t[n],a.attributes&&a.attributes.BANDWIDTH&&(e=a.attributes.BANDWIDTH*M,e<this.bandwidth&&(i.push(a),s||(s=a)));for(n=i.length,i.sort(I.comparePlaylistResolution),a=null,l=parseInt(B(this.tech_.el(),"width"),10),f=parseInt(B(this.tech_.el(),"height"),10);n--;)if(a=i[n],a.attributes&&a.attributes.RESOLUTION&&a.attributes.RESOLUTION.width&&a.attributes.RESOLUTION.height){var c=a.attributes.RESOLUTION;if(c.width===l&&c.height===f){o=null,d=a;break}if(c.width<l&&c.height<f)break;(!o||c.width<u.width&&c.height<u.height)&&(o=a,u=o.attributes.RESOLUTION)}return o||d||s||t[0]},I.canPlaySource=function(){return S.default.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")},I.supportsNativeHls=function(){var e=d.default.createElement("video");if(!S.default.getComponent("Html5").isSupported())return!1;var t=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return t.some(function(t){return/maybe|probably/i.test(e.canPlayType(t))})}(),I.isSupported=function(){return S.default.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var R=S.default.getComponent("Component"),N=function(e){function t(e,i,r){var a=this;if(n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,i),i.options_&&i.options_.playerId){var s=(0,S.default)(i.options_.playerId);s.hasOwnProperty("hls")||Object.defineProperty(s,"hls",{get:function(){return S.default.log.warn("player.hls is deprecated. Use player.tech.hls instead."),a}})}this.tech_=i,this.source_=e,this.stats={},this.options_=S.default.mergeOptions(S.default.options.hls||{},r.hls),this.setOptions_(),this.on(d.default,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(e){var t=d.default.fullscreenElement||d.default.webkitFullscreenElement||d.default.mozFullScreenElement||d.default.msFullscreenElement;t&&t.contains(a.tech_.el())&&a.masterPlaylistController_.fastQualityChange_()}),this.on(this.tech_,"seeking",function(){this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),this.audioTrackChange_=function(){a.masterPlaylistController_.useAudio()},this.on(this.tech_,"play",this.play)}return a(t,e),s(t,[{key:"setOptions_",value:function(){var e=this;this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.bandwidth=this.options_.bandwidth||4194304,["withCredentials","bandwidth"].forEach(function(t){"undefined"!=typeof e.source_[t]&&(e.options_[t]=e.source_[t])}),this.bandwidth=this.options_.bandwidth}},{key:"src",value:function(e){var t=this;e&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=I,this.masterPlaylistContr