(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"0yDM":function(e,t,r){"use strict";var n=r("284h"),a=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r("lwsE")),o=a(r("W8MJ")),s=a(r("a1gu")),l=a(r("Nsbk")),u=a(r("PJYZ")),d=a(r("7W2i")),c=a(r("17x9")),f=n(r("q1tI")),h=a(r("TSYQ")),p={actions:c.default.object,player:c.default.object,className:c.default.string},v=function(e){function t(e,r){var n;return(0,i.default)(this,t),(n=(0,s.default)(this,(0,l.default)(t).call(this,e,r))).handleClick=n.handleClick.bind((0,u.default)(n)),n}return(0,d.default)(t,e),(0,o.default)(t,[{key:"handleClick",value:function(){var e=this.props,t=e.actions;e.player.paused?t.play():t.pause()}},{key:"render",value:function(){var e=this,t=this.props,r=t.player,n=t.className,a=r.paused?"Play":"Pause";return f.default.createElement("button",{ref:function(t){e.button=t},className:(0,h.default)(n,{"video-react-play-control":!0,"video-react-control":!0,"video-react-button":!0,"video-react-paused":r.paused,"video-react-playing":!r.paused}),type:"button",tabIndex:"0",onClick:this.handleClick},f.default.createElement("span",{className:"video-react-control-text"},a))}}]),t}(f.Component);t.default=v,v.propTypes=p,v.displayName="PlayToggle"},"284h":function(e,t,r){var n=r("cDf5").default;function a(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}e.exports=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!==typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var l=o?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i},e.exports.__esModule=!0,e.exports.default=e.exports},"3nJo":function(e,t,r){"use strict";var n=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case i.OPERATE:return(0,a.default)({},e,{count:e.count+1,operation:(0,a.default)({},e.operation,t.operation)});default:return e}};var a=n(r("MVZn")),i=r("we7k"),o={count:0,operation:{action:"",source:""}}},"4FqI":function(e,t,r){"use strict";var n=r("284h"),a=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r("lwsE")),o=a(r("W8MJ")),s=a(r("a1gu")),l=a(r("Nsbk")),u=a(r("PJYZ")),d=a(r("7W2i")),c=a(r("17x9")),f=n(r("q1tI")),h={player:c.default.object,children:c.default.any},p=function(e){function t(e,r){var n;return(0,i.default)(this,t),(n=(0,s.default)(this,(0,l.default)(t).call(this,e,r))).handleClick=n.handleClick.bind((0,u.default)(n)),n}return(0,d.default)(t,e),(0,o.default)(t,[{key:"handleClick",value:function(e){e.preventDefault()}},{key:"render",value:function(){var e=this.props.children;return f.default.createElement("div",{className:"video-react-menu",onClick:this.handleClick},f.default.createElement("div",{className:"video-react-menu-content"},e))}}]),t}(f.Component);t.default=p,p.propTypes=h,p.displayName="Popup"},"4b3c":function(e,t,r){"use strict";var n=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=(0,n(r("8nKf")).default)("forward");a.displayName="ForwardControl";var i=a;t.default=i},"54lq":function(e,t,r){"use strict";var n=r("284h"),a=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r("lwsE")),o=a(r("W8MJ")),s=a(r("a1gu")),l=a(r("Nsbk")),u=a(r("PJYZ")),d=a(r("7W2i")),c=a(r("17x9")),f=n(r("q1tI")),h=a(r("TSYQ")),p={actions:c.default.object,player:c.default.object,className:c.default.string},v=function(e){function t(e,r){var n;return(0,i.default)(this,t),(n=(0,s.default)(this,(0,l.default)(t).call(this,e,r))).handleClick=n.handleClick.bind((0,u.default)(n)),n}return(0,d.default)(t,e),(0,o.default)(t,[{key:"handleClick",value:function(){var e=this.props,t=e.player;e.actions.toggleFullscreen(t)}},{key:"render",value:function(){var e=this,t=this.props,r=t.player,n=t.className;return f.default.createElement("button",{className:(0,h.default)(n,{"video-react-icon-fullscreen-exit":r.isFullscreen,"video-react-icon-fullscreen":!r.isFullscreen},"video-react-fullscreen-control video-react-control video-react-button video-react-icon"),ref:function(t){e.button=t},type:"button",tabIndex:"0",onClick:this.handleClick},f.default.createElement("span",{className:"video-react-control-text"},"Non-Fullscreen"))}}]),t}(f.Component);t.default=v,v.propTypes=p,v.displayName="FullscreenToggle"},"56F6":function(e,t,r){"use strict";var n=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case o.USER_ACTIVATE:return(0,a.default)({},e,{userActivity:t.activity});case o.PLAYER_ACTIVATE:return(0,a.default)({},e,{isActive:t.activity});case o.FULLSCREEN_CHANGE:return(0,a.default)({},e,{isFullscreen:!!t.isFullscreen});case i.SEEKING_TIME:return(0,a.default)({},e,{seekingTime:t.time});case i.END_SEEKING:return(0,a.default)({},e,{seekingTime:0});case i.LOAD_START:return(0,a.default)({},e,t.videoProps,{hasStarted:!1,ended:!1});case i.CAN_PLAY:return(0,a.default)({},e,t.videoProps,{waiting:!1});case i.WAITING:return(0,a.default)({},e,t.videoProps,{waiting:!0});case i.CAN_PLAY_THROUGH:case i.PLAYING:return(0,a.default)({},e,t.videoProps,{waiting:!1});case i.PLAY:return(0,a.default)({},e,t.videoProps,{ended:!1,paused:!1,autoPaused:!1,waiting:!1,hasStarted:!0});case i.PAUSE:return(0,a.default)({},e,t.videoProps,{paused:!0});case i.END:return(0,a.default)({},e,t.videoProps,{ended:!0});case i.SEEKING:return(0,a.default)({},e,t.videoProps,{seeking:!0});case i.SEEKED:return(0,a.default)({},e,t.videoProps,{seeking:!1});case i.ERROR:return(0,a.default)({},e,t.videoProps,{error:"UNKNOWN ERROR",ended:!0});case i.DURATION_CHANGE:case i.TIME_UPDATE:case i.VOLUME_CHANGE:case i.PROGRESS_CHANGE:case i.RATE_CHANGE:case i.SUSPEND:case i.ABORT:case i.EMPTIED:case i.STALLED:case i.LOADED_META_DATA:case i.LOADED_DATA:case i.RESIZE:return(0,a.default)({},e,t.videoProps);case i.ACTIVATE_TEXT_TRACK:return(0,a.default)({},e,{activeTextTrack:t.textTrack});default:return e}};var a=n(r("MVZn")),i=r("INgg"),o=r("we7k"),s={currentSrc:null,duration:0,currentTime:0,seekingTime:0,buffered:null,waiting:!1,seeking:!1,paused:!0,autoPaused:!1,ended:!1,playbackRate:1,muted:!1,volume:1,readyState:0,networkState:0,videoWidth:0,videoHeight:0,hasStarted:!1,userActivity:!0,isActive:!1,isFullscreen:!1,activeTextTrack:null}},"5Q0V":function(e,t,r){var n=r("cDf5").default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!==n(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},"7W2i":function(e,t,r){var n=r("SksO");e.exports=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},"8OQS":function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n=0||(a[r]=e[r]);return a},e.exports.__esModule=!0,e.exports.default=e.exports},"8nKf":function(e,t,r){"use strict";var n=r("284h"),a=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r("lwsE")),o=a(r("W8MJ")),s=a(r("a1gu")),l=a(r("Nsbk")),u=a(r("PJYZ")),d=a(r("7W2i")),c=a(r("17x9")),f=n(r("q1tI")),h={actions:c.default.object,className:c.default.string,seconds:c.default.oneOf([5,10,30])},p={seconds:10};t.default=function(e){var t=function(t){function r(e,t){var n;return(0,i.default)(this,r),(n=(0,s.default)(this,(0,l.default)(r).call(this,e,t))).handleClick=n.handleClick.bind((0,u.default)(n)),n}return(0,d.default)(r,t),(0,o.default)(r,[{key:"handleClick",value:function(){var t=this.props,r=t.actions,n=t.seconds;"forward"===e?r.forward(n):r.replay(n)}},{key:"render",value:function(){var t=this,r=this.props,n=r.seconds,a=r.className,i=["video-react-control","video-react-button","video-react-icon"];return i.push("video-react-icon-".concat(e,"-").concat(n),"video-react-".concat(e,"-control")),a&&i.push(a),f.default.createElement("button",{ref:function(e){t.button=e},className:i.join(" "),type:"button",onClick:this.handleClick},f.default.createElement("span",{className:"video-react-control-text"},"".concat(e," ").concat(n," seconds")))}}]),r}(f.Component);return t.propTypes=h,t.defaultProps=p,t}},AZ0a:function(e,t,r){"use strict";var n=r("284h"),a=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r("pVnL")),o=a(r("lwsE")),s=a(r("W8MJ")),l=a(r("a1gu")),u=a(r("Nsbk")),d=a(r("PJYZ")),c=a(r("7W2i")),f=a(r("17x9")),h=n(r("q1tI")),p=a(r("TSYQ")),v=a(r("QJtQ")),y=a(r("Qrqe")),g={player:f.default.object,actions:f.default.object,vertical:f.default.bool,className:f.default.string,alwaysShowVolume:f.default.bool},m=function(e){function t(e,r){var n;return(0,o.default)(this,t),(n=(0,l.default)(this,(0,u.default)(t).call(this,e,r))).state={active:!1},n.handleClick=n.handleClick.bind((0,d.default)(n)),n.handleFocus=n.handleFocus.bind((0,d.default)(n)),n.handleBlur=n.handleBlur.bind((0,d.default)(n)),n}return(0,c.default)(t,e),(0,s.default)(t,[{key:"handleClick",value:function(){var e=this.props,t=e.player;e.actions.mute(!t.muted)}},{key:"handleFocus",value:function(){this.setState({active:!0})}},{key:"handleBlur",value:function(){this.setState({active:!1})}},{key:"render",value:function(){var e=this.props,t=e.vertical,r=e.player,n=e.className,a=!t,o=this.volumeLevel;return h.default.createElement(v.default,{className:(0,p.default)(n,{"video-react-volume-menu-button-vertical":t,"video-react-volume-menu-button-horizontal":!t,"video-react-vol-muted":r.muted,"video-react-vol-0":0===o&&!r.muted,"video-react-vol-1":1===o,"video-react-vol-2":2===o,"video-react-vol-3":3===o,"video-react-slider-active":this.props.alwaysShowVolume||this.state.active,"video-react-lock-showing":this.props.alwaysShowVolume||this.state.active},"video-react-volume-menu-button"),onClick:this.handleClick,inline:a},h.default.createElement(y.default,(0,i.default)({onFocus:this.handleFocus,onBlur:this.handleBlur},this.props)))}},{key:"volumeLevel",get:function(){var e=this.props.player,t=e.volume,r=e.muted,n=3;return 0===t||r?n=0:t<.33?n=1:t<.67&&(n=2),n}}]),t}(h.Component);m.propTypes=g,m.defaultProps={vertical:!1},m.displayName="VolumeMenuButton";var b=m;t.default=b},Bnag:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},DGqw:function(e,t,r){"use strict";var n=r("284h"),a=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r("lwsE")),o=a(r("W8MJ")),s=a(r("a1gu")),l=a(r("Nsbk")),u=a(r("PJYZ")),d=a(r("7W2i")),c=a(r("17x9")),f=n(r("q1tI")),h=a(r("TSYQ")),p=a(r("U3K2")),v={player:c.default.object,actions:c.default.object,rates:c.default.array,className:c.default.string},y=function(e){function t(e,r){var n;return(0,i.default)(this,t),(n=(0,s.default)(this,(0,l.default)(t).call(this,e,r))).handleSelectItem=n.handleSelectItem.bind((0,u.default)(n)),n}return(0,d.default)(t,e),(0,o.default)(t,[{key:"handleSelectItem",value:function(e){var t=this.props,r=t.rates,n=t.actions;e>=0&&e0&&(this.video.currentTime=n),t.handleLoadedMetaData(this.getProperties()),r&&r.apply(void 0,arguments)}},{key:"handleLoadedData",value:function(){var e=this.props,t=e.actions,r=e.onLoadedData;t.handleLoadedData(this.getProperties()),r&&r.apply(void 0,arguments)}},{key:"handleTimeUpdate",value:function(){var e=this.props,t=e.actions,r=e.onTimeUpdate;t.handleTimeUpdate(this.getProperties()),r&&r.apply(void 0,arguments)}},{key:"handleRateChange",value:function(){var e=this.props,t=e.actions,r=e.onRateChange;t.handleRateChange(this.getProperties()),r&&r.apply(void 0,arguments)}},{key:"handleVolumeChange",value:function(){var e=this.props,t=e.actions,r=e.onVolumeChange;t.handleVolumeChange(this.getProperties()),r&&r.apply(void 0,arguments)}},{key:"handleError",value:function(){var e=this.props,t=e.actions,r=e.onError;t.handleError(this.getProperties()),r&&r.apply(void 0,arguments)}},{key:"handleResize",value:function(){var e=this.props,t=e.actions,r=e.onResize;t.handleResize(this.getProperties()),r&&r.apply(void 0,arguments)}},{key:"handleKeypress",value:function(){}},{key:"renderChildren",value:function(){var e=this,t=(0,i.default)({},this.props,{video:this.video});return this.video?h.default.Children.toArray(this.props.children).filter(v.isVideoChild).map(function(r){var n;if("string"===typeof r.type){if("source"===r.type){var a=(n=(0,i.default)({},r.props)).onError;n.onError=function(){a&&a.apply(void 0,arguments),e.handleError.apply(e,arguments)}}}else n=t;return h.default.cloneElement(r,n)}):null}},{key:"render",value:function(){var e=this,t=this.props,r=t.loop,n=t.poster,a=t.preload,i=t.src,o=t.autoPlay,s=t.playsInline,l=t.muted,u=t.crossOrigin,d=t.videoId;return h.default.createElement("video",{className:(0,p.default)("video-react-video",this.props.className),id:d,crossOrigin:u,ref:function(t){e.video=t},muted:l,preload:a,loop:r,playsInline:s,autoPlay:o,poster:n,src:i,onLoadStart:this.handleLoadStart,onWaiting:this.handleWaiting,onCanPlay:this.handleCanPlay,onCanPlayThrough:this.handleCanPlayThrough,onPlaying:this.handlePlaying,onEnded:this.handleEnded,onSeeking:this.handleSeeking,onSeeked:this.handleSeeked,onPlay:this.handlePlay,onPause:this.handlePause,onProgress:this.handleProgress,onDurationChange:this.handleDurationChange,onError:this.handleError,onSuspend:this.handleSuspend,onAbort:this.handleAbort,onEmptied:this.handleEmptied,onStalled:this.handleStalled,onLoadedMetadata:this.handleLoadedMetaData,onLoadedData:this.handleLoadedData,onTimeUpdate:this.handleTimeUpdate,onRateChange:this.handleRateChange,onVolumeChange:this.handleVolumeChange,tabIndex:"-1"},this.renderChildren())}},{key:"playbackRate",get:function(){return this.video.playbackRate},set:function(e){this.video.playbackRate=e}},{key:"muted",get:function(){return this.video.muted},set:function(e){this.video.muted=e}},{key:"volume",get:function(){return this.video.volume},set:function(e){e>1&&(e=1),e<0&&(e=0),this.video.volume=e}},{key:"videoWidth",get:function(){return this.video.videoWidth}},{key:"videoHeight",get:function(){return this.video.videoHeight}}]),t}(h.Component);t.default=g,g.propTypes=y,g.displayName="Video"},FcgA:function(e,t,r){"use strict";var n=r("284h"),a=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r("QILm")),o=a(r("lwsE")),s=a(r("W8MJ")),l=a(r("a1gu")),u=a(r("Nsbk")),d=a(r("PJYZ")),c=a(r("7W2i")),f=a(r("17x9")),h=n(r("q1tI")),p=a(r("TSYQ")),v=a(r("zHIc")),y=a(r("0yDM")),g=a(r("4b3c")),m=a(r("UXv2")),b=a(r("54lq")),E=a(r("Na29")),T=a(r("HI9P")),S=a(r("GdU9")),k=a(r("ruMa")),_=a(r("AZ0a")),A=a(r("DGqw")),R=r("tJTW"),w={children:f.default.any,autoHide:f.default.bool,autoHideTime:f.default.number,disableDefaultControls:f.default.bool,disableCompletely:f.default.bool,className:f.default.string},L=function(e){function t(e){var r;return(0,o.default)(this,t),(r=(0,l.default)(this,(0,u.default)(t).call(this,e))).getDefaultChildren=r.getDefaultChildren.bind((0,d.default)(r)),r.getFullChildren=r.getFullChildren.bind((0,d.default)(r)),r}return(0,c.default)(t,e),(0,s.default)(t,[{key:"getDefaultChildren",value:function(){return[h.default.createElement(y.default,{key:"play-toggle",order:1}),h.default.createElement(_.default,{key:"volume-menu-button",order:4}),h.default.createElement(T.default,{key:"current-time-display",order:5.1}),h.default.createElement(k.default,{key:"time-divider",order:5.2}),h.default.createElement(S.default,{key:"duration-display",order:5.3}),h.default.createElement(v.default,{key:"progress-control",order:6}),h.default.createElement(b.default,{key:"fullscreen-toggle",order:8})]}},{key:"getFullChildren",value:function(){return[h.default.createElement(y.default,{key:"play-toggle",order:1}),h.default.createElement(m.default,{key:"replay-control",order:2}),h.default.createElement(g.default,{key:"forward-control",order:3}),h.default.createElement(_.default,{key:"volume-menu-button",order:4}),h.default.createElement(T.default,{key:"current-time-display",order:5}),h.default.createElement(k.default,{key:"time-divider",order:6}),h.default.createElement(S.default,{key:"duration-display",order:7}),h.default.createElement(v.default,{key:"progress-control",order:8}),h.default.createElement(E.default,{key:"remaining-time-display",order:9}),h.default.createElement(A.default,{rates:[1,1.25,1.5,2],key:"playback-rate",order:10}),h.default.createElement(b.default,{key:"fullscreen-toggle",order:11})]}},{key:"getChildren",value:function(){var e=h.default.Children.toArray(this.props.children),t=this.props.disableDefaultControls?[]:this.getDefaultChildren(),r=this.props,n=(r.className,(0,i.default)(r,["className"]));return(0,R.mergeAndSortChildren)(t,e,n)}},{key:"render",value:function(){var e=this.props,t=e.autoHide,r=e.className,n=e.disableCompletely,a=this.getChildren();return n?null:h.default.createElement("div",{className:(0,p.default)("video-react-control-bar",{"video-react-control-bar-auto-hide":t},r)},a)}}]),t}(h.Component);t.default=L,L.propTypes=w,L.defaultProps={autoHide:!0,disableCompletely:!1},L.displayName="ControlBar"},GdU9:function(e,t,r){"use strict";var n=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r("17x9")),i=n(r("q1tI")),o=n(r("TSYQ")),s=r("tJTW"),l={player:a.default.object,className:a.default.string};function u(e){var t=e.player.duration,r=e.className,n=(0,s.formatTime)(t);return i.default.createElement("div",{className:(0,o.default)(r,"video-react-duration video-react-time-control video-react-control")},i.default.createElement("div",{className:"video-react-duration-display","aria-live":"off"},i.default.createElement("span",{className:"video-react-control-text"},"Duration Time "),n))}u.propTypes=l,u.displayName="DurationDisplay";var d=u;t.default=d},GuGs:function(e,t,r){"use strict";var n=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r("17x9")),i=n(r("q1tI")),o=n(r("TSYQ")),s=r("tJTW");function l(e){var t=e.duration,r=e.mouseTime,n=e.className,a=e.text;if(!r.time)return null;var l=a||(0,s.formatTime)(r.time,t);return i.default.createElement("div",{className:(0,o.default)("video-react-mouse-display",n),style:{left:"".concat(r.position,"px")},"data-current-time":l})}l.propTypes={duration:a.default.number,mouseTime:a.default.object,className:a.default.string},l.displayName="MouseTimeDisplay";var u=l;t.default=u},HI9P:function(e,t,r){"use strict";var n=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r("17x9")),i=n(r("q1tI")),o=n(r("TSYQ")),s=r("tJTW"),l={player:a.default.object,className:a.default.string};function u(e){var t=e.player,r=t.currentTime,n=t.duration,a=e.className,l=(0,s.formatTime)(r,n);return i.default.createElement("div",{className:(0,o.default)("video-react-current-time video-react-time-control video-react-control",a)},i.default.createElement("div",{className:"video-react-current-time-display","aria-live":"off"},i.default.createElement("span",{className:"video-react-control-text"},"Current Time "),l))}u.propTypes=l,u.displayName="CurrentTimeDisplay";var d=u;t.default=d},INgg:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleLoadStart=function(e){return{type:n,videoProps:e}},t.handleCanPlay=function(e){return{type:a,videoProps:e}},t.handleWaiting=function(e){return{type:i,videoProps:e}},t.handleCanPlayThrough=function(e){return{type:o,videoProps:e}},t.handlePlaying=function(e){return{type:s,videoProps:e}},t.handlePlay=function(e){return{type:l,videoProps:e}},t.handlePause=function(e){return{type:u,videoProps:e}},t.handleEnd=function(e){return{type:d,videoProps:e}},t.handleSeeking=function(e){return{type:c,videoProps:e}},t.handleSeeked=function(e){return{type:f,videoProps:e}},t.handleDurationChange=function(e){return{type:v,videoProps:e}},t.handleTimeUpdate=function(e){return{type:y,videoProps:e}},t.handleVolumeChange=function(e){return{type:g,videoProps:e}},t.handleProgressChange=function(e){return{type:m,videoProps:e}},t.handleRateChange=function(e){return{type:b,videoProps:e}},t.handleSuspend=function(e){return{type:E,videoProps:e}},t.handleAbort=function(e){return{type:T,videoProps:e}},t.handleEmptied=function(e){return{type:S,videoProps:e}},t.handleStalled=function(e){return{type:k,videoProps:e}},t.handleLoadedMetaData=function(e){return{type:_,videoProps:e}},t.handleLoadedData=function(e){return{type:A,videoProps:e}},t.handleResize=function(e){return{type:R,videoProps:e}},t.handleError=function(e){return{type:w,videoProps:e}},t.handleSeekingTime=function(e){return{type:h,time:e}},t.handleEndSeeking=function(e){return{type:p,time:e}},t.activateTextTrack=function(e){return{type:L,textTrack:e}},t.ACTIVATE_TEXT_TRACK=t.ERROR=t.RESIZE=t.LOADED_DATA=t.LOADED_META_DATA=t.STALLED=t.EMPTIED=t.ABORT=t.SUSPEND=t.RATE_CHANGE=t.PROGRESS_CHANGE=t.VOLUME_CHANGE=t.TIME_UPDATE=t.DURATION_CHANGE=t.END_SEEKING=t.SEEKING_TIME=t.SEEKED=t.SEEKING=t.END=t.PAUSE=t.PLAY=t.PLAYING=t.CAN_PLAY_THROUGH=t.WAITING=t.CAN_PLAY=t.LOAD_START=void 0;var n="video-react/LOAD_START";t.LOAD_START=n;var a="video-react/CAN_PLAY";t.CAN_PLAY=a;var i="video-react/WAITING";t.WAITING=i;var o="video-react/CAN_PLAY_THROUGH";t.CAN_PLAY_THROUGH=o;var s="video-react/PLAYING";t.PLAYING=s;var l="video-react/PLAY";t.PLAY=l;var u="video-react/PAUSE";t.PAUSE=u;var d="video-react/END";t.END=d;var c="video-react/SEEKING";t.SEEKING=c;var f="video-react/SEEKED";t.SEEKED=f;var h="video-react/SEEKING_TIME";t.SEEKING_TIME=h;var p="video-react/END_SEEKING";t.END_SEEKING=p;var v="video-react/DURATION_CHANGE";t.DURATION_CHANGE=v;var y="video-react/TIME_UPDATE";t.TIME_UPDATE=y;var g="video-react/VOLUME_CHANGE";t.VOLUME_CHANGE=g;var m="video-react/PROGRESS_CHANGE";t.PROGRESS_CHANGE=m;var b="video-react/RATE_CHANGE";t.RATE_CHANGE=b;var E="video-react/SUSPEND";t.SUSPEND=E;var T="video-react/ABORT";t.ABORT=T;var S="video-react/EMPTIED";t.EMPTIED=S;var k="video-react/STALLED";t.STALLED=k;var _="video-react/LOADED_META_DATA";t.LOADED_META_DATA=_;var A="video-react/LOADED_DATA";t.LOADED_DATA=A;var R="video-react/RESIZE";t.RESIZE=R;var w="video-react/ERROR";t.ERROR=w;var L="video-react/ACTIVATE_TEXT_TRACK";t.ACTIVATE_TEXT_TRACK=L},Ijbi:function(e,t,r){var n=r("WkPL");e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},LSTS:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));u.ref=function(t){e.scrollComponent=t,l&&l(t)};var d=[r];return a&&(s?o?d.unshift(s):d.push(s):this.defaultLoader&&(o?d.unshift(this.defaultLoader):d.push(this.defaultLoader))),i.default.createElement(n,u,d)}}]),t}();l.propTypes={children:o.default.node.isRequired,element:o.default.node,hasMore:o.default.bool,initialLoad:o.default.bool,isReverse:o.default.bool,loader:o.default.node,loadMore:o.default.func.isRequired,pageStart:o.default.number,ref:o.default.func,getScrollParent:o.default.func,threshold:o.default.number,useCapture:o.default.bool,useWindow:o.default.bool},l.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=l,e.exports=t.default},LgmY:function(e,t,r){"use strict";var n=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r("lSNA")),i=n(r("RIqP")),o=n(r("lwsE")),s=n(r("W8MJ")),l=n(r("a1gu")),u=n(r("Nsbk")),d=n(r("PJYZ")),c=n(r("7W2i")),f=r("q1tI"),h=n(r("17x9")),p=r("EVUy"),v={clickable:h.default.bool,dblclickable:h.default.bool,manager:h.default.object,actions:h.default.object,player:h.default.object,shortcuts:h.default.array},y=function(e){function t(e,r){var n;return(0,o.default)(this,t),(n=(0,l.default)(this,(0,u.default)(t).call(this,e,r))).defaultShortcuts=[{keyCode:32,handle:n.togglePlay},{keyCode:75,handle:n.togglePlay},{keyCode:70,handle:n.toggleFullscreen},{keyCode:37,handle:function(e,t){e.hasStarted&&t.replay(5,{action:"replay-5",source:"shortcut"})}},{keyCode:74,handle:function(e,t){e.hasStarted&&t.replay(10,{action:"replay-10",source:"shortcut"})}},{keyCode:39,handle:function(e,t){e.hasStarted&&t.forward(5,{action:"forward-5",source:"shortcut"})}},{keyCode:76,handle:function(e,t){e.hasStarted&&t.forward(10,{action:"forward-10",source:"shortcut"})}},{keyCode:36,handle:function(e,t){e.hasStarted&&t.seek(0)}},{keyCode:35,handle:function(e,t){e.hasStarted&&t.seek(e.duration)}},{keyCode:38,handle:function(e,t){var r=e.volume+.05;r>1&&(r=1),t.changeVolume(r,{action:"volume-up",source:"shortcut"})}},{keyCode:40,handle:function(e,t){var r=e.volume-.05;r<0&&(r=0);var n=r>0?"volume-down":"volume-off";t.changeVolume(r,{action:n,source:"shortcut"})}},{keyCode:190,shift:!0,handle:function(e,t){var r=e.playbackRate;r>=1.5?r=2:r>=1.25?r=1.5:r>=1?r=1.25:r>=.5?r=1:r>=.25?r=.5:r>=0&&(r=.25),t.changeRate(r,{action:"fast-forward",source:"shortcut"})}},{keyCode:188,shift:!0,handle:function(e,t){var r=e.playbackRate;r<=.5?r=.25:r<=1?r=.5:r<=1.25?r=1:r<=1.5?r=1.25:r<=2&&(r=1.5),t.changeRate(r,{action:"fast-rewind",source:"shortcut"})}}],n.shortcuts=(0,i.default)(n.defaultShortcuts),n.mergeShortcuts=n.mergeShortcuts.bind((0,d.default)(n)),n.handleKeyPress=n.handleKeyPress.bind((0,d.default)(n)),n.handleClick=n.handleClick.bind((0,d.default)(n)),n.handleDoubleClick=n.handleDoubleClick.bind((0,d.default)(n)),n}return(0,c.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){this.mergeShortcuts(),document.addEventListener("keydown",this.handleKeyPress),document.addEventListener("click",this.handleClick),document.addEventListener("dblclick",this.handleDoubleClick)}},{key:"componentDidUpdate",value:function(e){e.shortcuts!==this.props.shortcuts&&this.mergeShortcuts()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyPress),document.removeEventListener("click",this.handleClick),document.removeEventListener("dblclick",this.handleDoubleClick)}},{key:"mergeShortcuts",value:function(){var e=function(e){var t=e.keyCode,r=void 0===t?0:t,n=e.ctrl,a=void 0!==n&&n,i=e.shift,o=void 0!==i&&i,s=e.alt,l=void 0!==s&&s;return"".concat(r,":").concat(a,":").concat(o,":").concat(l)},t=this.defaultShortcuts.reduce(function(t,r){return Object.assign(t,(0,a.default)({},e(r),r))},{}),r=(this.props.shortcuts||[]).reduce(function(t,r){var n=r.keyCode,i=r.handle;return n&&"function"===typeof i?Object.assign(t,(0,a.default)({},e(r),r)):t},t),n=function(e){var t=0;return["ctrl","shift","alt"].forEach(function(r){e[r]&&t++}),t};this.shortcuts=Object.keys(r).map(function(e){return r[e]}).sort(function(e,t){return n(t)-n(e)})}},{key:"togglePlay",value:function(e,t){e.paused?t.play({action:"play",source:"shortcut"}):t.pause({action:"pause",source:"shortcut"})}},{key:"toggleFullscreen",value:function(e,t){t.toggleFullscreen(e)}},{key:"handleKeyPress",value:function(e){var t=this.props,r=t.player,n=t.actions;if(r.isActive&&(!document.activeElement||!((0,p.hasClass)(document.activeElement,"video-react-control")||(0,p.hasClass)(document.activeElement,"video-react-menu-button-active")||(0,p.hasClass)(document.activeElement,"video-react-big-play-button")))){var a=e.keyCode||e.which,i=e.ctrlKey||e.metaKey,o=e.shiftKey,s=e.altKey,l=this.shortcuts.filter(function(e){return!(!e.keyCode||e.keyCode-a!==0)&&!(void 0!==e.ctrl&&e.ctrl!==i||void 0!==e.shift&&e.shift!==o||void 0!==e.alt&&e.alt!==s)})[0];l&&(l.handle(r,n),e.preventDefault())}}},{key:"canBeClicked",value:function(e,t){return!(!e.isActive||"VIDEO"!==t.target.nodeName||4!==e.readyState)}},{key:"handleClick",value:function(e){var t=this.props,r=t.player,n=t.actions,a=t.clickable;this.canBeClicked(r,e)&&a&&this.togglePlay(r,n)}},{key:"handleDoubleClick",value:function(e){var t=this.props,r=t.player,n=t.actions,a=t.dblclickable;this.canBeClicked(r,e)&&a&&this.toggleFullscreen(r,n)}},{key:"render",value:function(){return null}}]),t}(f.Component);t.default=y,y.propTypes=v,y.defaultProps={clickable:!0,dblclickable:!0},y.displayName="Shortcut"},MVZn:function(e,t,r){var n=r("lSNA");e.exports=function(e){for(var t=1;t=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},QJtQ:function(e,t,r){"use strict";var n=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var a=n(r("pVnL")),i=n(r("MVZn")),o=n(r("17x9")),s=n(r("q1tI")),l=n(r("TSYQ")),u=n(r("mJvV")),d=n(r("4FqI")),c={inline:o.default.bool,onClick:o.default.func.isRequired,onFocus:o.default.func,onBlur:o.default.func,className:o.default.string};function f(e){var t=e.inline,r=e.className,n=(0,i.default)({},e);return delete n.children,delete n.inline,delete n.className,s.default.createElement(u.default,(0,a.default)({className:(0,l.default)(r,{"video-react-menu-button-inline":!!t,"video-react-menu-button-popup":!t},"video-react-control video-react-button video-react-menu-button")},n),s.default.createElement(d.default,e))}f.propTypes=c,f.defaultProps={inline:!0},f.displayName="PopupButton"},Qrqe:function(e,t,r){"use strict";var n=r("284h"),a=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r("pVnL")),o=a(r("lwsE")),s=a(r("W8MJ")),l=a(r("a1gu")),u=a(r("Nsbk")),d=a(r("PJYZ")),c=a(r("7W2i")),f=a(r("17x9")),h=n(r("q1tI")),p=a(r("TSYQ")),v=a(r("kXlQ")),y=a(r("jSMv")),g={actions:f.default.object,player:f.default.object,className:f.default.string,onFocus:f.default.func,onBlur:f.default.func},m=function(e){function t(e,r){var n;return(0,o.default)(this,t),(n=(0,l.default)(this,(0,u.default)(t).call(this,e,r))).state={percentage:"0%"},n.handleMouseMove=n.handleMouseMove.bind((0,d.default)(n)),n.handlePercentageChange=n.handlePercentageChange.bind((0,d.default)(n)),n.checkMuted=n.checkMuted.bind((0,d.default)(n)),n.getPercent=n.getPercent.bind((0,d.default)(n)),n.stepForward=n.stepForward.bind((0,d.default)(n)),n.stepBack=n.stepBack.bind((0,d.default)(n)),n.handleFocus=n.handleFocus.bind((0,d.default)(n)),n.handleBlur=n.handleBlur.bind((0,d.default)(n)),n.handleClick=n.handleClick.bind((0,d.default)(n)),n}return(0,c.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){}},{key:"getPercent",value:function(){var e=this.props.player;return e.muted?0:e.volume}},{key:"checkMuted",value:function(){var e=this.props,t=e.player,r=e.actions;t.muted&&r.mute(!1)}},{key:"handleMouseMove",value:function(e){var t=this.props.actions;this.checkMuted();var r=this.slider.calculateDistance(e);t.changeVolume(r)}},{key:"stepForward",value:function(){var e=this.props,t=e.player,r=e.actions;this.checkMuted(),r.changeVolume(t.volume+.1)}},{key:"stepBack",value:function(){var e=this.props,t=e.player,r=e.actions;this.checkMuted(),r.changeVolume(t.volume-.1)}},{key:"handleFocus",value:function(e){this.props.onFocus&&this.props.onFocus(e)}},{key:"handleBlur",value:function(e){this.props.onBlur&&this.props.onBlur(e)}},{key:"handlePercentageChange",value:function(e){e!==this.state.percentage&&this.setState({percentage:e})}},{key:"handleClick",value:function(e){e.stopPropagation()}},{key:"render",value:function(){var e=this,t=this.props,r=t.player,n=t.className,a=(100*r.volume).toFixed(2);return h.default.createElement(v.default,(0,i.default)({ref:function(t){e.slider=t},label:"volume level",valuenow:a,valuetext:"".concat(a,"%"),onMouseMove:this.handleMouseMove,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleClick,sliderActive:this.handleFocus,sliderInactive:this.handleBlur,getPercent:this.getPercent,onPercentageChange:this.handlePercentageChange,stepForward:this.stepForward,stepBack:this.stepBack},this.props,{className:(0,p.default)(n,"video-react-volume-bar video-react-slider-bar")}),h.default.createElement(y.default,this.props))}}]),t}(h.Component);m.propTypes=g,m.displayName="VolumeBar";var b=m;t.default=b},RIqP:function(e,t,r){var n=r("Ijbi"),a=r("EbDI"),i=r("ZhPi"),o=r("Bnag");e.exports=function(e){return n(e)||a(e)||i(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},RotF:function(e,t,r){e.exports=r("LSTS")},TSYQ:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t=t.length&&(r=0),this.activateMenuItem(r)}}},{key:"handleTab",value:function(e){this.state.active&&(e.preventDefault(),this.commitSelection(this.state.activateIndex))}},{key:"handleReturn",value:function(e){e.preventDefault(),this.state.active?this.commitSelection(this.state.activateIndex):this.setState({active:!0})}},{key:"handleEscape",value:function(){this.setState({active:!1,activateIndex:0})}},{key:"handleKeyPress",value:function(e){27===e.which?this.handleEscape(e):9===e.which?this.handleTab(e):13===e.which?this.handleReturn(e):38===e.which?this.handleUpArrow(e):40===e.which&&this.handleDownArrow(e)}},{key:"handleSelectItem",value:function(e){this.commitSelection(e)}},{key:"renderMenu",value:function(){var e=this;if(!this.state.active)return null;var t=this.props.items;return f.default.createElement(p.default,null,t.map(function(t,r){return f.default.createElement(v.default,{item:t,index:r,onSelectItem:e.handleSelectItem,activateIndex:e.state.activateIndex,key:"item-".concat(r++)})}))}},{key:"render",value:function(){var e=this,t=this.props,r=t.inline,n=t.className;return f.default.createElement(y.default,{className:(0,h.default)(n,{"video-react-menu-button-inline":!!r,"video-react-menu-button-popup":!r,"video-react-menu-button-active":this.state.active},"video-react-control video-react-button video-react-menu-button"),role:"button",tabIndex:"0",ref:function(t){e.menuButton=t},onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur},this.props.children,this.renderMenu())}}]),t}(f.Component);t.default=m,m.propTypes=g,m.displayName="MenuButton"},UXv2:function(e,t,r){"use strict";var n=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=(0,n(r("8nKf")).default)("replay");a.displayName="ReplayControl";var i=a;t.default=i},W8MJ:function(e,t,r){var n=r("o5UB");function a(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=1?1:r),"%")}a>r&&(a=r),s.width=l(a,r);for(var u=[],d=0;d0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=Math.floor(e%60),n=Math.floor(e/60%60),a=Math.floor(e/3600),i=Math.floor(t/60%60),o=Math.floor(t/3600);(l(e)||e===1/0)&&(a="-",n="-",r="-");return a=a>0||o>0?"".concat(a,":"):"",n="".concat((a||i>=10)&&n<10?"0".concat(n):n,":"),r=r<10?"0".concat(r):r,a+n+r},t.isVideoChild=function(e){if(e.props&&e.props.isVideoChild)return!0;return"source"===e.type||"track"===e.type},t.mergeAndSortChildren=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=s.default.Children.toArray(t),l=(r.order,(0,o.default)(r,["order"]));return a.filter(function(e){return!e.props.disabled}).concat(e.filter(function(e){return!u(a,function(t){return d(t,e)})})).map(function(t){var r=u(e,function(e){return d(e,t)}),n=r?r.props:{},a=(0,i.default)({},l,n,t.props),o=s.default.cloneElement(t,a,t.props.children);return o}).sort(function(e,t){return(e.props.order||n)-(t.props.order||n)})},t.deprecatedWarning=function(e,t){},t.throttle=function(e,t){var r=arguments,n=!1;return function(){n||(e.apply(void 0,(0,a.default)(r)),n=!0,setTimeout(function(){n=!1},t))}},t.mediaProperties=void 0;var a=n(r("RIqP")),i=n(r("MVZn")),o=n(r("QILm")),s=n(r("q1tI")),l=Number.isNaN||function(e){return e!==e};var u=function(e,t){return e.filter(t)[0]},d=function(e,t){var r=e.type,n=t.type;return"string"===typeof r||"string"===typeof n?r===n:"function"===typeof r&&"function"===typeof n&&r.displayName===n.displayName};t.mediaProperties=["error","src","srcObject","currentSrc","crossOrigin","networkState","preload","buffered","readyState","seeking","currentTime","duration","paused","defaultPlaybackRate","playbackRate","played","seekable","ended","autoplay","loop","mediaGroup","controller","controls","volume","muted","defaultMuted","audioTracks","videoTracks","textTracks","width","height","videoWidth","videoHeight","poster"]},tPgb:function(e,t,r){"use strict";var n=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r("17x9")),i=n(r("q1tI")),o=n(r("TSYQ")),s={poster:a.default.string,player:a.default.object,actions:a.default.object,className:a.default.string};function l(e){var t=e.poster,r=e.player,n=e.actions,a=e.className;return!t||r.hasStarted?null:i.default.createElement("div",{className:(0,o.default)("video-react-poster",a),style:{backgroundImage:'url("'.concat(t,'")')},onClick:function(){r.paused&&n.play()}})}l.propTypes=s,l.displayName="PosterImage";var u=l;t.default=u},udzn:function(e,t,r){"use strict";var n=r("284h"),a=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Player",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"Video",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"BigPlayButton",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"LoadingSpinner",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"PosterImage",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"Slider",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"Bezel",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"Shortcut",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"ControlBar",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"PlayToggle",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"ForwardControl",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"ReplayControl",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"FullscreenToggle",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"ProgressControl",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"SeekBar",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"PlayProgressBar",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"LoadProgressBar",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"MouseTimeDisplay",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"VolumeMenuButton",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"PlaybackRateMenuButton",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"PlaybackRate",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"ClosedCaptionButton",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"RemainingTimeDisplay",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"CurrentTimeDisplay",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"DurationDisplay",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"TimeDivider",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"MenuButton",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"playerReducer",{enumerable:!0,get:function(){return x.playerReducer}}),Object.defineProperty(t,"operationReducer",{enumerable:!0,get:function(){return x.operationReducer}}),t.videoActions=t.playerActions=void 0;var i=a(r("vcz5")),o=a(r("Edwz")),s=a(r("vu4D")),l=a(r("X2cd")),u=a(r("tPgb")),d=a(r("kXlQ")),c=a(r("zFvY")),f=a(r("LgmY")),h=a(r("FcgA")),p=a(r("0yDM")),v=a(r("4b3c")),y=a(r("UXv2")),g=a(r("54lq")),m=a(r("zHIc")),b=a(r("xFFL")),E=a(r("q+t5")),T=a(r("rsAN")),S=a(r("GuGs")),k=a(r("AZ0a")),_=a(r("DGqw")),A=a(r("wXLL")),R=a(r("yYHT")),w=a(r("Na29")),L=a(r("HI9P")),P=a(r("GdU9")),D=a(r("ruMa")),C=a(r("U3K2")),I=n(r("we7k"));t.playerActions=I;var O=n(r("INgg"));t.videoActions=O;var x=r("ulZL")},ulZL:function(e,t,r){"use strict";var n=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{player:(0,a.default)(e.player,t),operation:(0,i.default)(e.operation,t)}},t.operationReducer=t.playerReducer=void 0;var a=n(r("56F6")),i=n(r("3nJo"));var o=a.default;t.playerReducer=o;var s=i.default;t.operationReducer=s},ulZh:function(e,t,r){var n;"undefined"!==typeof window&&(n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s=11)}([function(e,t,r){"use strict";r.d(t,"a",function(){return d}),r.d(t,"b",function(){return c});var n=r(4),a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i(){}var o={trace:i,debug:i,log:i,warn:i,info:i,error:i},s=o;var l=Object(n.a)();function u(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n "+t}(e,n[0])),t.apply(l.console,n)}:i}(t)})}var d=function(e){if(!0===e||"object"===("undefined"===typeof e?"undefined":a(e))){u(e,"debug","log","info","warn","error");try{s.log()}catch(e){s=o}}else s=o},c=s},function(e,t,r){"use strict";t.a={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"}},function(e,t,r){"use strict";r.d(t,"b",function(){return n}),r.d(t,"a",function(){return a});var n={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",KEY_SYSTEM_ERROR:"keySystemError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},a={KEY_SYSTEM_NO_KEYS:"keySystemNoKeys",KEY_SYSTEM_NO_ACCESS:"keySystemNoAccess",KEY_SYSTEM_NO_SESSION:"keySystemNoSession",KEY_SYSTEM_LICENSE_REQUEST_FAILED:"keySystemLicenseRequestFailed",MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException"}},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=Number.isFinite||function(e){return"number"===typeof e&&isFinite(e)}},function(e,t,r){"use strict";t.a=function(){return"undefined"===typeof window?self:window}},function(e,t,r){var n,a,i,o,s;n=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,a=/^([^\/;?#]*)(.*)$/,i=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var n=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");return n.path=s.normalizePath(n.path),s.buildURLFromParts(n)}var i=this.parseURL(t);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return r.alwaysNormalize?(i.path=s.normalizePath(i.path),s.buildURLFromParts(i)):t;var o=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=a.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var u={scheme:o.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(u.netLoc=o.netLoc,"/"!==i.path[0]))if(i.path){var d=o.path,c=d.substring(0,d.lastIndexOf("/")+1)+i.path;u.path=s.normalizePath(c)}else u.path=o.path,i.params||(u.params=o.params,i.query||(u.query=o.query));return null===u.path&&(u.path=r.alwaysNormalize?s.normalizePath(i.path):i.path),s.buildURLFromParts(u)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(i,"");e.length!==(e=e.replace(o,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=s},function(e,t,r){"use strict";r.d(t,"b",function(){return a});var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.isHeader=function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},e.isFooter=function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},e.getID3Data=function(t,r){for(var n=r,a=0;e.isHeader(t,r);){a+=10,a+=e._readSize(t,r+6),e.isFooter(t,r+10)&&(a+=10),r+=a}if(a>0)return t.subarray(n,n+a)},e._readSize=function(e,t){var r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,r|=(127&e[t+2])<<7,r|=127&e[t+3]},e.getTimeStamp=function(t){for(var r=e.getID3Frames(t),n=0;n1&&void 0!==arguments[1]&&arguments[1],r=e.length,n=void 0,a=void 0,i=void 0,o="",s=0;s>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(n);break;case 12:case 13:a=e[s++],o+=String.fromCharCode((31&n)<<6|63&a);break;case 14:a=e[s++],i=e[s++],o+=String.fromCharCode((15&n)<<12|(63&a)<<6|(63&i)<<0)}}return o},e}(),a=n._utf8ArrayToStr;t.a=n},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"===typeof e}function a(e){return"object"===typeof e&&null!==e}function i(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,o,s,l,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var d=new Error('Uncaught, unspecified "error" event. ('+t+")");throw d.context=t,d}if(i(r=this._events[e]))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),o=(u=r.slice()).length,l=0;l0&&this._events[e].length>o&&(this._events[e].warned=!0,console.trace),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=!1;function a(){this.removeListener(e,a),r||(r=!0,t.apply(this,arguments))}return a.listener=t,this.on(e,a),this},r.prototype.removeListener=function(e,t){var r,i,o,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(o=(r=this._events[e]).length,i=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){"use strict";var n=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.subtle=t,this.aesIV=r}return e.prototype.decrypt=function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)},e}();var a=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.subtle=t,this.key=r}return e.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},e}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return e.prototype.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),r=new Uint32Array(4),n=0;n<4;n++)r[n]=t.getUint32(4*n);return r},e.prototype.initTable=function(){var e=this.sBox,t=this.invSBox,r=this.subMix,n=r[0],a=r[1],i=r[2],o=r[3],s=this.invSubMix,l=s[0],u=s[1],d=s[2],c=s[3],f=new Uint32Array(256),h=0,p=0,v=0;for(v=0;v<256;v++)f[v]=v<128?v<<1:v<<1^283;for(v=0;v<256;v++){var y=p^p<<1^p<<2^p<<3^p<<4;y=y>>>8^255&y^99,e[h]=y,t[y]=h;var g=f[h],m=f[g],b=f[m],E=257*f[y]^16843008*y;n[h]=E<<24|E>>>8,a[h]=E<<16|E>>>16,i[h]=E<<8|E>>>24,o[h]=E,E=16843009*b^65537*m^257*g^16843008*h,l[y]=E<<24|E>>>8,u[y]=E<<16|E>>>16,d[y]=E<<8|E>>>24,c[y]=E,h?(h=g^f[f[f[b^g]]],p^=f[f[p]]):h=p=1}},e.prototype.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,n=0;n0},e.bin2str=function(e){return String.fromCharCode.apply(null,e)},e.readUint16=function(e,t){e.data&&(t+=e.start,e=e.data);var r=e[t]<<8|e[t+1];return r<0?65536+r:r},e.readUint32=function(e,t){e.data&&(t+=e.start,e=e.data);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return r<0?4294967296+r:r},e.writeUint32=function(e,t,r){e.data&&(t+=e.start,e=e.data),e[t]=r>>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r},e.findBox=function(t,r){var n=[],a=void 0,i=void 0,o=void 0,s=void 0,l=void 0,u=void 0,d=void 0;if(t.data?(u=t.start,s=t.end,t=t.data):(u=0,s=t.byteLength),!r.length)return null;for(a=u;a1?a+i:s,o===r[0]&&(1===r.length?n.push({data:t,start:a+8,end:d}):(l=e.findBox({data:t,start:a+8,end:d},r.slice(1))).length&&(n=n.concat(l))),a=d;return n},e.parseSegmentIndex=function(t){var r=e.findBox(t,["moov"])[0],n=r?r.end:null,a=0,i=e.findBox(t,["sidx"]),o=void 0;if(!i||!i[0])return null;o=[];var s=(i=i[0]).data[0];a=0===s?8:16;var l=e.readUint32(i,a);a+=4;a+=0===s?8:16,a+=2;var u=i.end+0,d=e.readUint16(i,a);a+=2;for(var c=0;c>>31)return;var v=e.readUint32(i,f);f+=4,o.push({referenceSize:p,subsegmentDuration:v,info:{duration:v/l,start:u,end:u+p-1}}),u+=p,a=f+=4}return{earliestPresentationTime:0,timescale:l,version:s,referencesCount:d,references:o,moovEndOffset:n}},e.parseInitSegment=function(t){var r=[];return e.findBox(t,["moov","trak"]).forEach(function(t){var a=e.findBox(t,["tkhd"])[0];if(a){var i=a.data[a.start],o=0===i?12:20,s=e.readUint32(a,o),l=e.findBox(t,["mdia","mdhd"])[0];if(l){o=0===(i=l.data[l.start])?12:20;var u=e.readUint32(l,o),d=e.findBox(t,["mdia","hdlr"])[0];if(d){var c={soun:"audio",vide:"video"}[e.bin2str(d.data.subarray(d.start+8,d.start+12))];if(c){var f=e.findBox(t,["mdia","minf","stbl","stsd"]);if(f.length){f=f[0];var h=e.bin2str(f.data.subarray(f.start+12,f.start+16));n.b.log("MP4Demuxer:"+c+":"+h+" found")}r[s]={timescale:u,type:c},r[c]={timescale:u,id:s}}}}}}),r},e.getStartDTS=function(t,r){var n,a,i=void 0;return i=e.findBox(r,["moof","traf"]),n=[].concat.apply([],i.map(function(r){return e.findBox(r,["tfhd"]).map(function(n){var a,i;return a=e.readUint32(n,4),i=t[a].timescale||9e4,e.findBox(r,["tfdt"]).map(function(t){var r,n=void 0;return r=t.data[t.start],n=e.readUint32(t,4),1===r&&(n*=Math.pow(2,32),n+=e.readUint32(t,8)),n})[0]/i})})),a=Math.min.apply(null,n),isFinite(a)?a:0},e.offsetStartDTS=function(t,r,n){e.findBox(r,["moof","traf"]).map(function(r){return e.findBox(r,["tfhd"]).map(function(a){var o=e.readUint32(a,4),s=t[o].timescale||9e4;e.findBox(r,["tfdt"]).map(function(t){var r=t.data[t.start],a=e.readUint32(t,4);if(0===r)e.writeUint32(t,4,a-n*s);else{a*=Math.pow(2,32),a+=e.readUint32(t,8),a-=n*s,a=Math.max(a,0);var o=Math.floor(a/(i+1)),l=Math.floor(a%(i+1));e.writeUint32(t,4,o),e.writeUint32(t,8,l)}})})})},e.prototype.append=function(t,r,n,i){var o=this.initData;o||(this.resetInitSegment(t,this.audioCodec,this.videoCodec,!1),o=this.initData);var s,l=this.initPTS;if(void 0===l){var u=e.getStartDTS(o,t);this.initPTS=l=u-r,this.observer.trigger(a.a.INIT_PTS_FOUND,{initPTS:l})}e.offsetStartDTS(o,t,l),s=e.getStartDTS(o,t),this.remuxer.remux(o.audio,o.video,null,null,s,n,i,t)},e.prototype.destroy=function(){},e}();t.a=o},function(e,t,r){"use strict";var n=r(1),a=r(2),i=r(8),o=r(3),s=r(0),l=r(4);function u(e,t){return 255===e[t]&&240===(246&e[t+1])}function d(e,t){return 1&e[t+1]?7:9}function c(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function f(e,t){return!!(t+1>>6),!((o=(60&t[r+2])>>>2)>p.length-1))return d=(1&t[r+2])<<2,d|=(192&t[r+3])>>>6,s.b.log("manifest codec:"+i+",ADTS data:type:"+l+",sampleingIndex:"+o+"["+p[o]+"Hz],channelConfig:"+d),/firefox/i.test(f)?o>=6?(l=5,c=new Array(4),u=o-3):(l=2,c=new Array(2),u=o):-1!==f.indexOf("android")?(l=2,c=new Array(2),u=o):(l=5,c=new Array(4),i&&(-1!==i.indexOf("mp4a.40.29")||-1!==i.indexOf("mp4a.40.5"))||!i&&o>=6?u=o-3:((i&&-1!==i.indexOf("mp4a.40.2")&&(o>=6&&1===d||/vivaldi/i.test(f))||!i&&1===d)&&(l=2,c=new Array(2)),u=o)),c[0]=l<<3,c[0]|=(14&o)>>1,c[1]|=(1&o)<<7,c[1]|=d<<3,5===l&&(c[1]|=(14&u)>>1,c[2]=(1&u)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:p[o],channelCount:d,codec:"mp4a.40."+l,manifestCodec:h};e.trigger(n.a.ERROR,{type:a.b.MEDIA_ERROR,details:a.a.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+o})}(t,r,i,o);e.config=l.config,e.samplerate=l.samplerate,e.channelCount=l.channelCount,e.codec=l.codec,e.manifestCodec=l.manifestCodec,s.b.log("parsed codec:"+e.codec+",rate:"+l.samplerate+",nb channel:"+l.channelCount)}}function v(e){return 9216e4/e}function y(e,t,r,n,a){var i=function(e,t,r,n,a){var i,o=void 0,s=e.length;if(i=d(e,t),o=c(e,t),(o-=i)>0&&t+i+o<=s)return{headerLength:i,frameLength:o,stamp:r+n*a}}(t,r,n,a,v(e.samplerate));if(i){var o=i.stamp,s=i.headerLength,l=i.frameLength,u={unit:t.subarray(r+s,r+s+l),pts:o,dts:o};return e.samples.push(u),e.len+=l,{sample:u,length:l+s}}}var g=r(6);var m=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.observer=t,this.config=n,this.remuxer=r}return e.prototype.resetInitSegment=function(e,t,r,n){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:t,duration:n,inputTimeScale:9e4}},e.prototype.resetTimeStamp=function(){},e.probe=function(e){if(!e)return!1;for(var t=(g.a.getID3Data(e,0)||[]).length,r=e.length;tt.length)){var i=this.parseHeader(t,r);if(i&&r+i.frameLength<=t.length){var o=n+a*(9e4*i.samplesPerFrame/i.sampleRate),s={unit:t.subarray(r,r+i.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=i.channelCount,e.samplerate=i.sampleRate,e.samples.push(s),e.len+=i.frameLength,{sample:s,length:i.frameLength}}}},parseHeader:function(e,t){var r=e[t+1]>>3&3,n=e[t+1]>>1&3,a=e[t+2]>>4&15,i=e[t+2]>>2&3,o=e[t+2]>>1&1;if(1!==r&&0!==a&&15!==a&&3!==i){var s=3===r?3-n:3===n?3:4,l=1e3*E.BitratesMap[14*s+a-1],u=3===r?0:2===r?1:2,d=E.SamplingRateMap[3*u+i],c=e[t+3]>>6===3?1:2,f=E.SamplesCoefficients[r][n],h=E.BytesInSlot[n],p=8*f*h;return{sampleRate:d,channelCount:c,frameLength:parseInt(f*l/d+o,10)*h,samplesPerFrame:p}}},isHeaderPattern:function(e,t){return 255===e[t]&&224===(224&e[t+1])&&0!==(6&e[t+1])},isHeader:function(e,t){return!!(t+1e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},e.prototype.readBits=function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return e>32&&s.b.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),(t=e-t)>0&&this.bitsAvailable?r<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},e.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},e.prototype.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},e.prototype.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},e.prototype.readBoolean=function(){return 1===this.readBits(1)},e.prototype.readUByte=function(){return this.readBits(8)},e.prototype.readUShort=function(){return this.readBits(16)},e.prototype.readUInt=function(){return this.readBits(32)},e.prototype.skipScalingList=function(e){var t=8,r=8,n=void 0;for(n=0;n=e.length)return void r();if(!(e[t].unit.length<32)){var n=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,n),!n)return}}},e.prototype.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),n=0,a=32;a<=e.length-16;a+=160,n+=16)r.set(e.subarray(a,a+16),n);return r},e.prototype.getAvcDecryptedUnit=function(e,t){t=new Uint8Array(t);for(var r=0,n=32;n<=e.length-16;n+=160,r+=16)e.set(t.subarray(r,r+16),n);return e},e.prototype.decryptAvcSample=function(e,t,r,n,a,i){var o=this.discardEPB(a.data),s=this.getAvcEncryptedData(o),l=this;this.decryptBuffer(s.buffer,function(s){a.data=l.getAvcDecryptedUnit(o,s),i||l.decryptAvcSamples(e,t,r+1,n)})},e.prototype.decryptAvcSamples=function(e,t,r,n){for(;;t++,r=0){if(t>=e.length)return void n();for(var a=e[t].units;!(r>=a.length);r++){var i=a[r];if(!(i.length<=48||1!==i.type&&5!==i.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,n,i,o),!o)return}}}},e}();var _={video:1,audio:2,id3:3,text:4},A=function(){function e(t,r,n,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.observer=t,this.config=n,this.typeSupported=a,this.remuxer=r,this.sampleAes=null}return e.prototype.setDecryptData=function(e){null!=e&&null!=e.key&&"SAMPLE-AES"===e.method?this.sampleAes=new k(this.observer,this.config,e,this.discardEPB):this.sampleAes=null},e.probe=function(t){var r=e._syncOffset(t);return!(r<0)&&(r&&s.b.warn("MPEG2-TS detected but first sync word found @ offset "+r+", junk ahead ?"),!0)},e._syncOffset=function(e){for(var t=Math.min(1e3,e.length-564),r=0;r>4>1){if((f=l+5+t[l+4])===l+188)continue}else f=l+4;switch(c){case b:d&&(k&&(h=L(k))&&void 0!==h.pts&&P(h,!1),k={data:[],size:0}),k&&(k.data.push(t.subarray(f,l+188)),k.size+=l+188-f);break;case E:d&&(_&&(h=L(_))&&void 0!==h.pts&&(g.isAAC?D(h):C(h)),_={data:[],size:0}),_&&(_.data.push(t.subarray(f,l+188)),_.size+=l+188-f);break;case T:d&&(A&&(h=L(A))&&void 0!==h.pts&&I(h),A={data:[],size:0}),A&&(A.data.push(t.subarray(f,l+188)),A.size+=l+188-f);break;case 0:d&&(f+=t[f]+1),S=this._pmtId=R(t,f);break;case S:d&&(f+=t[f]+1);var x=w(t,f,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);(b=x.avc)>0&&(y.pid=b),(E=x.audio)>0&&(g.pid=E,g.isAAC=x.isAAC),(T=x.id3)>0&&(m.pid=T),p&&!v&&(s.b.log("reparse from beginning"),p=!1,l=O-188),v=this.pmtParsed=!0;break;case 17:case 8191:break;default:p=!0}}else this.observer.trigger(n.a.ERROR,{type:a.b.MEDIA_ERROR,details:a.a.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});k&&(h=L(k))&&void 0!==h.pts?(P(h,!0),y.pesData=null):y.pesData=k,_&&(h=L(_))&&void 0!==h.pts?(g.isAAC?D(h):C(h),g.pesData=null):(_&&_.size&&s.b.log("last AAC PES packet truncated,might overlap between fragments"),g.pesData=_),A&&(h=L(A))&&void 0!==h.pts?(I(h),m.pesData=null):m.pesData=A,null==this.sampleAes?this.remuxer.remux(g,y,m,this._txtTrack,r,i,o):this.decryptAndRemux(g,y,m,this._txtTrack,r,i,o)},e.prototype.decryptAndRemux=function(e,t,r,n,a,i,o){if(e.samples&&e.isAAC){var s=this;this.sampleAes.decryptAacSamples(e.samples,0,function(){s.decryptAndRemuxAvc(e,t,r,n,a,i,o)})}else this.decryptAndRemuxAvc(e,t,r,n,a,i,o)},e.prototype.decryptAndRemuxAvc=function(e,t,r,n,a,i,o){if(t.samples){var s=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,function(){s.remuxer.remux(e,t,r,n,a,i,o)})}else this.remuxer.remux(e,t,r,n,a,i,o)},e.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},e.prototype._parsePAT=function(e,t){return(31&e[t+10])<<8|e[t+11]},e.prototype._parsePMT=function(e,t,r,n){var a,i=void 0,o={audio:-1,avc:-1,id3:-1,isAAC:!0};for(a=t+3+((15&e[t+1])<<8|e[t+2])-4,t+=12+((15&e[t+10])<<8|e[t+11]);t1;){var f=new Uint8Array(c[0].length+c[1].length);f.set(c[0]),f.set(c[1],c[0].length),c[0]=f,c.splice(1,1)}if(1===((r=c[0])[0]<<16)+(r[1]<<8)+r[2]){if((a=(r[4]<<8)+r[5])&&a>e.size-6)return null;192&(n=r[7])&&((l=536870912*(14&r[9])+4194304*(255&r[10])+16384*(254&r[11])+128*(255&r[12])+(254&r[13])/2)>4294967295&&(l-=8589934592),64&n?((u=536870912*(14&r[14])+4194304*(255&r[15])+16384*(254&r[16])+128*(255&r[17])+(254&r[18])/2)>4294967295&&(u-=8589934592),l-u>54e5&&(s.b.warn(Math.round((l-u)/9e4)+"s delta between PTS and DTS, align them"),l=u)):u=l),d=(i=r[8])+9,e.size-=d,o=new Uint8Array(e.size);for(var h=0,p=c.length;hv){d-=v;continue}r=r.subarray(d),v-=d,d=0}o.set(r,t),t+=v}return a&&(a-=i+3),{data:o,pts:l,dts:u,len:a}}return null},e.prototype.pushAccesUnit=function(e,t){if(e.units.length&&e.frame){var r=t.samples,n=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(n||this.contiguous)?(e.id=n,r.push(e)):t.dropped++}e.debug.length&&s.b.log(e.pts+"/"+e.dts+":"+e.debug)},e.prototype._parseAVCPES=function(e,t){var r=this,n=this._avcTrack,a=this._parseAVCNALu(e.data),i=void 0,o=this.avcSample,s=void 0,l=!1,u=void 0,d=this.pushAccesUnit.bind(this),c=function(e,t,r,n){return{key:e,pts:t,dts:r,units:[],debug:n}};e.data=null,o&&a.length&&!n.audFound&&(d(o,n),o=this.avcSample=c(!1,e.pts,e.dts,"")),a.forEach(function(t){switch(t.type){case 1:s=!0,o||(o=r.avcSample=c(!0,e.pts,e.dts,"")),o.frame=!0;var a=t.data;if(l&&a.length>4){var f=new S(a).readSliceType();2!==f&&4!==f&&7!==f&&9!==f||(o.key=!0)}break;case 5:s=!0,o||(o=r.avcSample=c(!0,e.pts,e.dts,"")),o.key=!0,o.frame=!0;break;case 6:s=!0,(i=new S(r.discardEPB(t.data))).readUByte();for(var h=0,p=0,v=!1,y=0;!v&&i.bytesAvailable>1;){h=0;do{h+=y=i.readUByte()}while(255===y);p=0;do{p+=y=i.readUByte()}while(255===y);if(4===h&&0!==i.bytesAvailable){if(v=!0,181===i.readUByte())if(49===i.readUShort())if(1195456820===i.readUInt())if(3===i.readUByte()){var g=i.readUByte(),m=31&g,b=[g,i.readUByte()];for(u=0;u0){if(t.pts>=e[r-1].pts)e.push(t);else for(var n=r-1;n>=0;n--)if(t.pts=0)u={data:e.subarray(d,t-o-1),type:c},l.push(u);else{var f=this._getLastNalUnit();if(f&&(s&&t<=4-s&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-s)),(a=t-o-1)>0)){var h=new Uint8Array(f.data.byteLength+a);h.set(f.data,0),h.set(e.subarray(0,a),f.data.byteLength),f.data=h}}t=0&&o>=0&&(u={data:e.subarray(d,r),type:c,state:o},l.push(u)),0===l.length){var p=this._getLastNalUnit();if(p){var v=new Uint8Array(p.data.byteLength+e.byteLength);v.set(p.data,0),v.set(e,p.data.byteLength),p.data=v}}return i.naluState=o,l},e.prototype.discardEPB=function(e){for(var t,r=e.byteLength,n=[],a=1,i=void 0;a1&&(s.b.log("AAC: align PTS for overlapping frames by "+Math.round((T-l)/90)),l=T)}for(;h>24&255,i[1]=r>>16&255,i[2]=r>>8&255,i[3]=255&r,i.set(e,4),n=0,r=8;n>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,a>>24,a>>16&255,a>>8&255,255&a,85,196,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))},e.mfhd=function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))},e.minf=function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))},e.moof=function(t,r,n){return e.box(e.types.moof,e.mfhd(t),e.traf(n,r))},e.moov=function(t){for(var r=t.length,n=[];r--;)n[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(n).concat(e.mvex(t)))},e.mvex=function(t){for(var r=t.length,n=[];r--;)n[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(n))},e.mvhd=function(t,r){r*=t;var n=Math.floor(r/(L+1)),a=Math.floor(r%(L+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,a>>24,a>>16&255,a>>8&255,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 e.box(e.types.mvhd,i)},e.sdtp=function(t){var r=t.samples||[],n=new Uint8Array(4+r.length),a=void 0,i=void 0;for(i=0;i>>8&255),r.push(255&o),r=r.concat(Array.prototype.slice.call(i));for(a=0;a>>8&255),n.push(255&o),n=n.concat(Array.prototype.slice.call(i));var s=e.box(e.types.avcC,new Uint8Array([1,r[3],r[4],r[5],255,224|t.sps.length].concat(r).concat([t.pps.length]).concat(n))),l=t.width,u=t.height,d=t.pixelRatio[0],c=t.pixelRatio[1];return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,c>>24,c>>16&255,c>>8&255,255&c])))},e.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},e.mp4a=function(t){var r=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))},e.mp3=function(t){var r=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},e.stsd=function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))},e.tkhd=function(t){var r=t.id,n=t.duration*t.timescale,a=t.width,i=t.height,o=Math.floor(n/(L+1)),s=Math.floor(n%(L+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255,255&a,0,0,i>>8&255,255&i,0,0]))},e.traf=function(t,r){var n=e.sdtp(t),a=t.id,i=Math.floor(r/(L+1)),o=Math.floor(r%(L+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,o>>24,o>>16&255,o>>8&255,255&o])),e.trun(t,n.length+16+20+8+16+8+8),n)},e.trak=function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.trex=function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(t,r){var n=t.samples||[],a=n.length,i=12+16*a,o=new Uint8Array(i),s=void 0,l=void 0,u=void 0,d=void 0,c=void 0,f=void 0;for(r+=8+i,o.set([0,0,15,1,a>>>24&255,a>>>16&255,a>>>8&255,255&a,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),s=0;s>>24&255,u>>>16&255,u>>>8&255,255&u,d>>>24&255,d>>>16&255,d>>>8&255,255&d,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.paddingValue<<1|c.isNonSync,61440&c.degradPrio,15&c.degradPrio,f>>>24&255,f>>>16&255,f>>>8&255,255&f],12+16*s);return e.box(e.types.trun,o)},e.initSegment=function(t){e.types||e.init();var r=e.moov(t),n=void 0;return(n=new Uint8Array(e.FTYP.byteLength+r.byteLength)).set(e.FTYP),n.set(r,e.FTYP.byteLength),n},e}();var D=function(){function e(t,r,n,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.observer=t,this.config=r,this.typeSupported=n;var i=navigator.userAgent;this.isSafari=a&&a.indexOf("Apple")>-1&&i&&!i.match("CriOS"),this.ISGenerated=!1}return e.prototype.destroy=function(){},e.prototype.resetTimeStamp=function(e){this._initPTS=this._initDTS=e},e.prototype.resetInitSegment=function(){this.ISGenerated=!1},e.prototype.remux=function(e,t,r,a,i,o,l){if(this.ISGenerated||this.generateIS(e,t,i),this.ISGenerated){var u=e.samples.length,d=t.samples.length,c=i,f=i;if(u&&d){var h=(e.samples[0].dts-t.samples[0].dts)/t.inputTimeScale;c+=Math.max(0,h),f+=Math.max(0,-h)}if(u){e.timescale||(s.b.warn("regenerate InitSegment as audio detected"),this.generateIS(e,t,i));var p=this.remuxAudio(e,c,o,l);if(d){var v=void 0;p&&(v=p.endPTS-p.startPTS),t.timescale||(s.b.warn("regenerate InitSegment as video detected"),this.generateIS(e,t,i)),this.remuxVideo(t,f,o,v,l)}}else if(d){var y=this.remuxVideo(t,f,o,0,l);y&&e.codec&&this.remuxEmptyAudio(e,c,o,y)}}r.samples.length&&this.remuxID3(r,i),a.samples.length&&this.remuxText(a,i),this.observer.trigger(n.a.FRAG_PARSED)},e.prototype.generateIS=function(e,t,r){var i=this.observer,o=e.samples,l=t.samples,u=this.typeSupported,d="audio/mp4",c={},f={tracks:c},h=void 0===this._initPTS,p=void 0,v=void 0;if(h&&(p=v=1/0),e.config&&o.length&&(e.timescale=e.samplerate,s.b.log("audio sampling rate : "+e.samplerate),e.isAAC||(u.mpeg?(d="audio/mpeg",e.codec=""):u.mp3&&(e.codec="mp3")),c.audio={container:d,codec:e.codec,initSegment:!e.isAAC&&u.mpeg?new Uint8Array:P.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(p=v=o[0].pts-e.inputTimeScale*r)),t.sps&&t.pps&&l.length){var y=t.inputTimeScale;t.timescale=y,c.video={container:"video/mp4",codec:t.codec,initSegment:P.initSegment([t]),metadata:{width:t.width,height:t.height}},h&&(p=Math.min(p,l[0].pts-y*r),v=Math.min(v,l[0].dts-y*r),this.observer.trigger(n.a.INIT_PTS_FOUND,{initPTS:p}))}Object.keys(c).length?(i.trigger(n.a.FRAG_PARSING_INIT_SEGMENT,f),this.ISGenerated=!0,h&&(this._initPTS=p,this._initDTS=v)):i.trigger(n.a.ERROR,{type:a.b.MEDIA_ERROR,details:a.a.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},e.prototype.remuxVideo=function(e,t,r,i,o){var l,u,d,c=8,f=e.timescale,h=void 0,p=void 0,v=void 0,y=void 0,g=e.samples,m=[],b=g.length,E=this._PTSNormalize,T=this._initDTS,S=this.nextAvcDts,k=this.isSafari;if(0!==b){k&&(r|=g.length&&S&&(o&&Math.abs(t-S/f)<.1||Math.abs(g[0].pts-S-T)1?s.b.log("AVC:"+w+" ms hole between fragments detected,filling it"):w<-1&&s.b.log("AVC:"+-w+" ms overlapping between fragments detected"),y=S,g[0].dts=y,v=Math.max(v-w,S),g[0].pts=v,s.b.log("Video/PTS/DTS adjusted: "+Math.round(v/90)+"/"+Math.round(y/90)+",delta:"+w+" ms")),y,R=g[g.length-1],d=Math.max(R.dts,0),u=Math.max(R.pts,0,d),k&&(h=Math.round((d-y)/(g.length-1)));for(var L=0,D=0,C=0;C0?B-1:B].dts;if(X.stretchShortVideoTrack){var Q=X.maxBufferHole,Z=Math.floor(Q*f),$=(i?v+i*f:this.nextAudioPts)-G.pts;$>Z?((h=$-J)<0&&(h=J),s.b.log("It is approximately "+$/90+" ms to the next segment; using duration "+h/90+" ms for the last video frame.")):h=J}else h=J}W=Math.round(G.pts-G.dts)}m.push({size:K,duration:h,cts:W,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:G.key?2:1,isNonSync:G.key?0:1}})}this.nextAvcDts=d+h;var ee=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,m.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var te=m[0].flags;te.dependsOn=2,te.isNonSync=0}e.samples=m,l=P.moof(e.sequenceNumber++,y,e),e.samples=[];var re={data1:l,data2:p,startPTS:v/f,endPTS:(u+h)/f,startDTS:y/f,endDTS:this.nextAvcDts/f,type:"video",hasAudio:!1,hasVideo:!0,nb:m.length,dropped:ee};return this.observer.trigger(n.a.FRAG_PARSING_DATA,re),re}},e.prototype.remuxAudio=function(e,t,r,i){var o=e.inputTimeScale,l=e.timescale,u=o/l,d=(e.isAAC?1024:1152)*u,c=this._PTSNormalize,f=this._initDTS,h=!e.isAAC&&this.typeSupported.mpeg,p=void 0,v=void 0,y=void 0,g=void 0,m=void 0,b=void 0,E=void 0,T=e.samples,S=[],k=this.nextAudioPts;if(r|=T.length&&k&&(i&&Math.abs(t-k/o)<.1||Math.abs(T[0].pts-k-f)<20*d),T.forEach(function(e){e.pts=e.dts=c(e.pts-f,t*o)}),0!==(T=T.filter(function(e){return e.pts>=0})).length){if(r||(k=i?t*o:T[0].pts),e.isAAC)for(var _=this.config.maxAudioFramesDrift,A=0,R=k;A=_*d&&C<1e4&&R){var I=Math.round(L/d);s.b.warn("Injecting "+I+" audio frame @ "+(R/o).toFixed(3)+"s due to "+Math.round(1e3*L/o)+" ms gap.");for(var O=0;O0&&G<1e4)j=Math.round((B-k)/d),s.b.log(G+" ms hole between AAC samples detected,filling it"),j>0&&((y=w.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(y=U.subarray()),e.len+=j*y.length);else if(G<-12){s.b.log("drop overlapping AAC sample, expected/parsed/delta:"+(k/o).toFixed(3)+"s/"+(B/o).toFixed(3)+"s/"+-G+"ms"),e.len-=U.byteLength;continue}B=k}if(b=B,!(e.len>0))return;var K=h?e.len:e.len+8;p=h?0:8;try{g=new Uint8Array(K)}catch(e){return void this.observer.trigger(n.a.ERROR,{type:a.b.MUX_ERROR,details:a.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:K,reason:"fail allocating audio mdat "+K})}h||(new DataView(g.buffer).setUint32(0,K),g.set(P.types.mdat,4));for(var W=0;W=2&&(Y=S[q-2].duration,v.duration=Y),q){this.nextAudioPts=k=E+u*Y,e.len=0,e.samples=S,m=h?new Uint8Array:P.moof(e.sequenceNumber++,b/u,e),e.samples=[];var V=b/o,z=k/o,X={data1:m,data2:g,startPTS:V,endPTS:z,startDTS:V,endDTS:z,type:"audio",hasAudio:!0,hasVideo:!1,nb:q};return this.observer.trigger(n.a.FRAG_PARSING_DATA,X),X}return null}},e.prototype.remuxEmptyAudio=function(e,t,r,n){var a=e.inputTimeScale,i=a/(e.samplerate?e.samplerate:a),o=this.nextAudioPts,l=(void 0!==o?o:n.startDTS*a)+this._initDTS,u=n.endDTS*a+this._initDTS,d=1024*i,c=Math.ceil((u-l)/d),f=w.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(s.b.warn("remux empty Audio"),f){for(var h=[],p=0;p4294967296;)e+=r;return e},e}();var C=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.observer=t}return e.prototype.destroy=function(){},e.prototype.resetTimeStamp=function(){},e.prototype.resetInitSegment=function(){},e.prototype.remux=function(e,t,r,a,i,o,s,l){var u=this.observer,d="";e&&(d+="audio"),t&&(d+="video"),u.trigger(n.a.FRAG_PARSING_DATA,{data1:l,startPTS:i,startDTS:i,type:d,hasAudio:!!e,hasVideo:!!t,nb:1,dropped:0}),u.trigger(n.a.FRAG_PARSED)},e}();var I=Object(l.a)().performance,O=function(){function e(t,r,n,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.observer=t,this.typeSupported=r,this.config=n,this.vendor=a}return e.prototype.destroy=function(){var e=this.demuxer;e&&e.destroy()},e.prototype.push=function(e,t,r,a,o,s,l,u,d,c,f,h){if(e.byteLength>0&&null!=t&&null!=t.key&&"AES-128"===t.method){var p=this.decrypter;null==p&&(p=this.decrypter=new i.a(this.observer,this.config));var v=this,y=void 0;try{y=I.now()}catch(e){y=Date.now()}p.decrypt(e,t.key.buffer,t.iv.buffer,function(e){var i=void 0;try{i=I.now()}catch(e){i=Date.now()}v.observer.trigger(n.a.FRAG_DECRYPTED,{stats:{tstart:y,tdecrypt:i}}),v.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),a,o,s,l,u,d,c,f,h)})}else this.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),a,o,s,l,u,d,c,f,h)},e.prototype.pushDecrypted=function(e,t,r,i,o,s,l,u,d,c,f,h){var p=this.demuxer;if(!p||(l||u)&&!this.probe(e)){for(var v=this.observer,y=this.typeSupported,g=this.config,E=[{demux:A,remux:D},{demux:b.a,remux:C},{demux:m,remux:D},{demux:R,remux:D}],T=0,S=E.length;T1?r-1:0),a=1;a>8*(15-r)&255;return t},e.prototype.fragmentDecryptdataFromLevelkey=function(e,t){var r=e;return e&&e.method&&e.uri&&!e.iv&&((r=new v).method=e.method,r.baseuri=e.baseuri,r.reluri=e.reluri,r.iv=this.createInitializationVector(t)),r},y(e,[{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=i.a.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(e){this._url=e}},{key:"byteRange",get:function(){if(!this._byteRange&&!this.rawByteRange)return[];if(this._byteRange)return this._byteRange;var e=[];if(this.rawByteRange){var t=this.rawByteRange.split("@",2);if(1===t.length){var r=this.lastByteRangeEndOffset;e[0]=r||0}else e[0]=parseInt(t[1]);e[1]=parseInt(t[0])+e[0],this._byteRange=e}return e}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}},{key:"endProgramDateTime",get:function(){if(!Object(s.a)(this.programDateTime))return null;var e=Object(s.a)(this.duration)?this.duration:0;return this.programDateTime+1e3*e}},{key:"encrypted",get:function(){return!(!this.decryptdata||null===this.decryptdata.uri||null!==this.decryptdata.key)}}],[{key:"ElementaryStreamTypes",get:function(){return{AUDIO:"audio",VIDEO:"video"}}}]),e}(),m=function(){function e(e,t){for(var r=0;rNumber.MAX_SAFE_INTEGER?1/0:t},e.prototype.hexadecimalInteger=function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),n=0;nNumber.MAX_SAFE_INTEGER?1/0:t},e.prototype.decimalFloatingPoint=function(e){return parseFloat(this[e])},e.prototype.enumeratedString=function(e){return this[e]},e.prototype.decimalResolution=function(e){var t=E.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},e.parseAttrList=function(e){var t=void 0,r={};for(T.lastIndex=0;null!==(t=T.exec(e));){var n=t[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),r[t[1]]=n}return r},e}(),k={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};function _(e,t){return window.MediaSource.isTypeSupported((t||"video")+'/mp4;codecs="'+e+'"')}var A=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,R=/#EXT-X-MEDIA:(.*)/g,w=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)(\S+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),L=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,P=/\.(mp4|m4s|m4v|m4a)$/i,D=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.findGroup=function(e,t){if(!e)return null;for(var r=null,n=0;n2?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t},e.resolve=function(e,t){return i.a.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},e.parseMasterPlaylist=function(t,r){var n=[],a=void 0;function i(e,t){["video","audio"].forEach(function(r){var n=e.filter(function(e){return function(e,t){var r=k[t];return!!r&&!0===r[e.slice(0,4)]}(e,r)});if(n.length){var a=n.filter(function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)});t[r+"Codec"]=a.length>0?a[0]:n[0],e=e.filter(function(e){return-1===n.indexOf(e)})}}),t.unknownCodecs=e}for(A.lastIndex=0;null!=(a=A.exec(t));){var o={},s=o.attrs=new S(a[1]);o.url=e.resolve(a[2],r);var l=s.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),o.bitrate=s.decimalInteger("AVERAGE-BANDWIDTH")||s.decimalInteger("BANDWIDTH"),o.name=s.NAME,i([].concat((s.CODECS||"").split(/[ ,]+/)),o),o.videoCodec&&-1!==o.videoCodec.indexOf("avc1")&&(o.videoCodec=e.convertAVC1ToAVCOTI(o.videoCodec)),n.push(o)}return n},e.parseMasterPlaylistMedia=function(t,r,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=void 0,o=[],s=0;for(R.lastIndex=0;null!==(i=R.exec(t));){var l={},u=new S(i[1]);if(u.TYPE===n){if(l.groupId=u["GROUP-ID"],l.name=u.NAME,l.type=n,l.default="YES"===u.DEFAULT,l.autoselect="YES"===u.AUTOSELECT,l.forced="YES"===u.FORCED,u.URI&&(l.url=e.resolve(u.URI,r)),l.lang=u.LANGUAGE,l.name||(l.name=l.lang),a.length){var d=e.findGroup(a,l.groupId);l.audioCodec=d?d.codec:a[0].codec}l.id=s++,o.push(l)}}return o},e.parseLevelPlaylist=function(e,t,r,n,a){var i=0,o=0,l=new b(t),d=new v,c=0,f=null,h=new g,p=void 0,y=void 0,m=null;for(w.lastIndex=0;null!==(p=w.exec(e));){var E=p[1];if(E){h.duration=parseFloat(E);var T=(" "+p[2]).slice(1);h.title=T||null,h.tagList.push(T?["INF",E,T]:["INF",E])}else if(p[3]){if(Object(s.a)(h.duration)){var k=i++;h.type=n,h.start=o,h.levelkey=d,h.sn=k,h.level=r,h.cc=c,h.urlId=a,h.baseurl=t,h.relurl=(" "+p[3]).slice(1),C(h,f),l.fragments.push(h),f=h,o+=h.duration,h=new g}}else if(p[4]){if(h.rawByteRange=(" "+p[4]).slice(1),f){var _=f.byteRangeEndOffset;_&&(h.lastByteRangeEndOffset=_)}}else if(p[5])h.rawProgramDateTime=(" "+p[5]).slice(1),h.tagList.push(["PROGRAM-DATE-TIME",h.rawProgramDateTime]),null===m&&(m=l.fragments.length);else{for(p=p[0].match(L),y=1;y=0&&(d.method=I,d.baseuri=t,d.reluri=O,d.key=null,d.iv=x));break;case"START":var M=new S(A).decimalFloatingPoint("TIME-OFFSET");Object(s.a)(M)&&(l.startTimeOffset=M);break;case"MAP":var N=new S(A);h.relurl=N.URI,h.rawByteRange=N.BYTERANGE,h.baseurl=t,h.level=r,h.type=n,h.sn="initSegment",l.initSegment=h,(h=new g).rawProgramDateTime=l.initSegment.rawProgramDateTime;break;default:u.b.warn("line parsed but not handled: "+p)}}}return(h=f)&&!h.relurl&&(l.fragments.pop(),o-=h.duration),l.totalduration=o,l.averagetargetduration=o/l.fragments.length,l.endSN=i-1,l.startCC=l.fragments[0]?l.fragments[0].cc:0,l.endCC=c,!l.initSegment&&l.fragments.length&&l.fragments.every(function(e){return P.test(e.relurl)})&&(u.b.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(h=new g).relurl=l.fragments[0].relurl,h.baseurl=t,h.level=r,h.type=n,h.sn="initSegment",l.initSegment=h,l.needSidxRanges=!0),m&&function(e,t){for(var r=e[t],n=t-1;n>=0;n--){var a=e[n];a.programDateTime=r.programDateTime-1e3*a.duration,r=a}}(l.fragments,m),l},e}();function C(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),Object(s.a)(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}var I=function(){function e(e,t){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:null;if(r.isSidxRequest)return this._handleSidxRequest(e,r),void this._handlePlaylistLoaded(e,t,r,n);this.resetInternalLoader(r.type);var a=e.data;t.tload=O.now(),0===a.indexOf("#EXTM3U")?a.indexOf("#EXTINF:")>0||a.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(e,t,r,n):this._handleMasterPlaylist(e,t,r,n):this._handleManifestParsingError(e,r,"no EXTM3U delimiter",n)},t.prototype.loaderror=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._handleNetworkError(t,r)},t.prototype.loadtimeout=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._handleNetworkError(t,r,!0)},t.prototype._handleMasterPlaylist=function(e,r,n,a){var i=this.hls,o=e.data,s=t.getResponseUrl(e,n),d=D.parseMasterPlaylist(o,s);if(d.length){var c=d.map(function(e){return{id:e.attrs.AUDIO,codec:e.audioCodec}}),f=D.parseMasterPlaylistMedia(o,s,"AUDIO",c),h=D.parseMasterPlaylistMedia(o,s,"SUBTITLES");if(f.length){var p=!1;f.forEach(function(e){e.url||(p=!0)}),!1===p&&d[0].audioCodec&&!d[0].attrs.AUDIO&&(u.b.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),f.unshift({type:"main",name:"main"}))}i.trigger(l.a.MANIFEST_LOADED,{levels:d,audioTracks:f,subtitles:h,url:s,stats:r,networkDetails:a})}else this._handleManifestParsingError(e,n,"no level found in manifest",a)},t.prototype._handleTrackOrLevelPlaylist=function(e,r,n,a){var i=this.hls,o=n.id,u=n.level,d=n.type,c=t.getResponseUrl(e,n),f=Object(s.a)(o)?o:0,h=Object(s.a)(u)?u:f,p=t.mapContextToLevelType(n),v=D.parseLevelPlaylist(e.data,c,h,p,f);if(v.tload=r.tload,d===x.MANIFEST){var y={url:c,details:v};i.trigger(l.a.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:c,stats:r,networkDetails:a})}if(r.tparsed=O.now(),v.needSidxRanges){var g=v.initSegment.url;this.load(g,{isSidxRequest:!0,type:d,level:u,levelDetails:v,id:o,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"})}else n.levelDetails=v,this._handlePlaylistLoaded(e,r,n,a)},t.prototype._handleSidxRequest=function(e,t){var r=h.a.parseSegmentIndex(new Uint8Array(e.data));r.references.forEach(function(e,r){var n=e.info,a=t.levelDetails.fragments[r];0===a.byteRange.length&&(a.rawByteRange=String(1+n.end-n.start)+"@"+String(n.start))}),t.levelDetails.initSegment.rawByteRange=String(r.moovEndOffset)+"@0"},t.prototype._handleManifestParsingError=function(e,t,r,n){this.hls.trigger(l.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.MANIFEST_PARSING_ERROR,fatal:!0,url:e.url,reason:r,networkDetails:n})},t.prototype._handleNetworkError=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];u.b.info("A network error occured while loading a "+e.type+"-type playlist");var n=void 0,a=void 0,i=this.getInternalLoader(e);switch(e.type){case x.MANIFEST:n=r?o.a.MANIFEST_LOAD_TIMEOUT:o.a.MANIFEST_LOAD_ERROR,a=!0;break;case x.LEVEL:n=r?o.a.LEVEL_LOAD_TIMEOUT:o.a.LEVEL_LOAD_ERROR,a=!1;break;case x.AUDIO_TRACK:n=r?o.a.AUDIO_TRACK_LOAD_TIMEOUT:o.a.AUDIO_TRACK_LOAD_ERROR,a=!1;break;default:a=!1}i&&(i.abort(),this.resetInternalLoader(e.type)),this.hls.trigger(l.a.ERROR,{type:o.b.NETWORK_ERROR,details:n,fatal:a,url:i.url,loader:i,context:e,networkDetails:t})},t.prototype._handlePlaylistLoaded=function(e,r,n,a){var i=n.type,o=n.level,s=n.id,u=n.levelDetails;if(u.targetduration)if(t.canHaveQualityLevels(n.type))this.hls.trigger(l.a.LEVEL_LOADED,{details:u,level:o||0,id:s||0,stats:r,networkDetails:a});else switch(i){case x.AUDIO_TRACK:this.hls.trigger(l.a.AUDIO_TRACK_LOADED,{details:u,id:s,stats:r,networkDetails:a});break;case x.SUBTITLE_TRACK:this.hls.trigger(l.a.SUBTITLE_TRACK_LOADED,{details:u,id:s,stats:r,networkDetails:a})}else this._handleManifestParsingError(e,n,"invalid target duration",a)},I(t,null,[{key:"ContextType",get:function(){return x}},{key:"LevelType",get:function(){return M}}]),t}(f);var F=function(e){function t(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this,r,l.a.FRAG_LOADING));return n.loaders={},n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.destroy=function(){var t=this.loaders;for(var r in t){var n=t[r];n&&n.destroy()}this.loaders={},e.prototype.destroy.call(this)},t.prototype.onFragLoading=function(e){var t=e.frag,r=t.type,n=this.loaders,a=this.hls.config,i=a.fLoader,o=a.loader;t.loaded=0;var l=n[r];l&&(u.b.warn("abort previous fragment loader for type: "+r),l.abort()),l=n[r]=t.loader=a.fLoader?new i(a):new o(a);var d,c,f=void 0;f={url:t.url,frag:t,responseType:"arraybuffer",progressData:!1};var h=t.byteRangeStartOffset,p=t.byteRangeEndOffset;Object(s.a)(h)&&Object(s.a)(p)&&(f.rangeStart=h,f.rangeEnd=p),d={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},l.load(f,d,c)},t.prototype.loadsuccess=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=e.data,i=r.frag;i.loader=void 0,this.loaders[i.type]=void 0,this.hls.trigger(l.a.FRAG_LOADED,{payload:a,frag:i,stats:t,networkDetails:n})},t.prototype.loaderror=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=t.frag,a=n.loader;a&&a.abort(),this.loaders[n.type]=void 0,this.hls.trigger(l.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.FRAG_LOAD_ERROR,fatal:!1,frag:t.frag,response:e,networkDetails:r})},t.prototype.loadtimeout=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=t.frag,a=n.loader;a&&a.abort(),this.loaders[n.type]=void 0,this.hls.trigger(l.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t.frag,networkDetails:r})},t.prototype.loadprogress=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=t.frag;a.loaded=e.loaded,this.hls.trigger(l.a.FRAG_LOAD_PROGRESS,{frag:a,stats:e,networkDetails:n})},t}(f);var U=function(e){function t(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this,r,l.a.KEY_LOADING));return n.loaders={},n.decryptkey=null,n.decrypturl=null,n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.destroy=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},f.prototype.destroy.call(this)},t.prototype.onKeyLoading=function(e){var t=e.frag,r=t.type,n=this.loaders[r],a=t.decryptdata,i=a.uri;if(i!==this.decrypturl||null===this.decryptkey){var o=this.hls.config;n&&(u.b.warn("abort previous key loader for type:"+r),n.abort()),t.loader=this.loaders[r]=new o.loader(o),this.decrypturl=i,this.decryptkey=null;var s,d,c;s={url:i,frag:t,responseType:"arraybuffer"},d={timeout:o.fragLoadingTimeOut,maxRetry:o.fragLoadingMaxRetry,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},t.loader.load(s,d,c)}else this.decryptkey&&(a.key=this.decryptkey,this.hls.trigger(l.a.KEY_LOADED,{frag:t}))},t.prototype.loadsuccess=function(e,t,r){var n=r.frag;this.decryptkey=n.decryptdata.key=new Uint8Array(e.data),n.loader=void 0,this.loaders[n.type]=void 0,this.hls.trigger(l.a.KEY_LOADED,{frag:n})},t.prototype.loaderror=function(e,t){var r=t.frag,n=r.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(l.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.KEY_LOAD_ERROR,fatal:!1,frag:r,response:e})},t.prototype.loadtimeout=function(e,t){var r=t.frag,n=r.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(l.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},t}(f);var B="NOT_LOADED",G="APPENDING",j="PARTIAL",K="OK",W=function(e){function t(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this,r,l.a.BUFFER_APPENDED,l.a.FRAG_BUFFERED,l.a.FRAG_LOADED));return n.bufferPadding=.2,n.fragments=Object.create(null),n.timeRanges=Object.create(null),n.config=r.config,n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.destroy=function(){this.fragments=null,this.timeRanges=null,this.config=null,f.prototype.destroy.call(this),e.prototype.destroy.call(this)},t.prototype.getBufferedFrag=function(e,t){var r=this.fragments,n=Object.keys(r).filter(function(n){var a=r[n];if(a.body.type!==t)return!1;if(!a.buffered)return!1;var i=a.body;return i.startPTS<=e&&e<=i.endPTS});if(0===n.length)return null;var a=n.pop();return r[a].body},t.prototype.detectEvictedFragments=function(e,t){var r=this,n=void 0,a=void 0;Object.keys(this.fragments).forEach(function(i){var o=r.fragments[i];if(!0===o.buffered){var s=o.range[e];if(s){n=s.time;for(var l=0;l=a&&t<=i){n.push({startPTS:Math.max(e,r.start(s)),endPTS:Math.min(t,r.end(s))});break}if(ea)n.push({startPTS:Math.max(e,r.start(s)),endPTS:Math.min(t,r.end(s))}),o=!0;else if(t<=a)break}return{time:n,partial:o}},t.prototype.getFragmentKey=function(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn},t.prototype.getPartialFragment=function(e){var t=this,r=void 0,n=void 0,a=void 0,i=null,o=0;return Object.keys(this.fragments).forEach(function(s){var l=t.fragments[s];t.isPartial(l)&&(n=l.body.startPTS-t.bufferPadding,a=l.body.endPTS+t.bufferPadding,e>=n&&e<=a&&(r=Math.min(e-n,a-e),o<=r&&(i=l.body,o=r)))}),i},t.prototype.getState=function(e){var t=this.getFragmentKey(e),r=this.fragments[t],n=B;return void 0!==r&&(n=r.buffered?!0===this.isPartial(r)?j:K:G),n},t.prototype.isPartial=function(e){return!0===e.buffered&&(void 0!==e.range.video&&!0===e.range.video.partial||void 0!==e.range.audio&&!0===e.range.audio.partial)},t.prototype.isTimeBuffered=function(e,t,r){for(var n=void 0,a=void 0,i=0;i=n&&t<=a)return!0;if(t<=n)return!1}return!1},t.prototype.onFragLoaded=function(e){var t=e.frag;Object(s.a)(t.sn)&&!t.bitrateTest&&(this.fragments[this.getFragmentKey(t)]={body:t,range:Object.create(null),buffered:!1})},t.prototype.onBufferAppended=function(e){var t=this;this.timeRanges=e.timeRanges,Object.keys(this.timeRanges).forEach(function(e){var r=t.timeRanges[e];t.detectEvictedFragments(e,r)})},t.prototype.onFragBuffered=function(e){this.detectPartialFragments(e.frag)},t.prototype.hasFragment=function(e){var t=this.getFragmentKey(e);return void 0!==this.fragments[t]},t.prototype.removeFragment=function(e){var t=this.getFragmentKey(e);delete this.fragments[t]},t.prototype.removeAllFragments=function(){this.fragments=Object.create(null)},t}(f),H={search:function(e,t){for(var r=0,n=e.length-1,a=null,i=null;r<=n;){var o=t(i=e[a=(r+n)/2|0]);if(o>0)r=a+1;else{if(!(o<0))return i;n=a-1}}return null}};var Y=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.isBuffered=function(e,t){try{if(e)for(var r=e.buffered,n=0;n=r.start(n)&&t<=r.end(n))return!0}catch(e){}return!1},e.bufferInfo=function(e,t,r){try{if(e){var n=e.buffered,a=[],i=void 0;for(i=0;id&&(n[u-1].end=e[l].end):n.push(e[l])}else n.push(e[l])}for(l=0,a=0,i=o=t;l=c&&t1?t-1:0),a=1;a1?t-1:0),a=1;at?(n.duration=i-n.start,n.duration<0&&u.b.warn("negative duration computed for frag "+n.sn+",level "+n.level+", there should be some duration drift between playlist and fragment!")):(a.duration=n.start-i,a.duration<0&&u.b.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!")):a.start=r>t?n.start+n.duration:Math.max(n.start-a.duration,0)}function ae(e,t,r,n,a,i){var o=r;if(Object(s.a)(t.startPTS)){var l=Math.abs(t.startPTS-r);Object(s.a)(t.deltaPTS)?t.deltaPTS=Math.max(l,t.deltaPTS):t.deltaPTS=l,o=Math.max(r,t.startPTS),r=Math.min(r,t.startPTS),n=Math.max(n,t.endPTS),a=Math.min(a,t.startDTS),i=Math.max(i,t.endDTS)}var u=r-t.start;t.start=t.startPTS=r,t.maxStartPTS=o,t.endPTS=n,t.startDTS=a,t.endDTS=i,t.duration=n-r;var d=t.sn;if(!e||de.endSN)return 0;var c,f=void 0,h=void 0;for(c=d-e.startSN,(f=e.fragments)[c]=t,h=c;h>0;h--)ne(f,h,h-1);for(h=c;h=0&&ar.startCC||e&&e.cc1?n-1:0),i=1;i1&&(this.clearNextTick(),this._tickTimer=setTimeout(this._boundTick,0)),this._tickCallCount=0)},t.prototype.doTick=function(){},t}(f);function de(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments[2],n=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-n<=e?1:r.start-n>e&&r.start?-1:0}function ce(e,t,r){var n=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.endProgramDateTime-n>e}var fe=function(){function e(t,r,n,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.media=r,this.fragmentTracker=n,this.hls=a,this.stallReported=!1}return e.prototype.poll=function(e,t){var r=this.config,n=this.media,a=n.currentTime,i=window.performance.now();if(a!==e)return this.stallReported&&(u.b.warn("playback not stuck anymore @"+a+", after "+Math.round(i-this.stalled)+"ms"),this.stallReported=!1),this.stalled=null,void(this.nudgeRetry=0);if(!(n.ended||!n.buffered.length||n.readyState>2)&&(!n.seeking||!Y.isBuffered(n,a))){var o=i-this.stalled,s=Y.bufferInfo(n,a,r.maxBufferHole);this.stalled?(o>=1e3&&this._reportStall(s.len),this._tryFixBufferStall(s,o)):this.stalled=i}},e.prototype._tryFixBufferStall=function(e,t){var r=this.config,n=this.fragmentTracker,a=this.media.currentTime,i=n.getPartialFragment(a);i&&this._trySkipBufferHole(i),e.len>.5&&t>1e3*r.highBufferWatchdogPeriod&&(this.stalled=null,this._tryNudgeBuffer())},e.prototype._reportStall=function(e){var t=this.hls,r=this.media;this.stallReported||(this.stallReported=!0,u.b.warn("Playback stalling at @"+r.currentTime+" due to low buffer"),t.trigger(l.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:e}))},e.prototype._trySkipBufferHole=function(e){for(var t=this.hls,r=this.media,n=r.currentTime,a=0,i=0;i=a&&n0&&-1===e&&(u.b.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=pe.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=pe.STOPPED},t.prototype.stopLoad=function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragmentTracker.removeFragment(e),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.clearInterval(),this.state=pe.STOPPED,this.forceStartLoad=!1},t.prototype.doTick=function(){switch(this.state){case pe.BUFFER_FLUSHING:this.fragLoadError=0;break;case pe.IDLE:this._doTickIdle();break;case pe.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=pe.IDLE);break;case pe.FRAG_LOADING_WAITING_RETRY:var t=window.performance.now(),r=this.retryDate;(!r||t>=r||this.media&&this.media.seeking)&&(u.b.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=pe.IDLE);break;case pe.ERROR:case pe.STOPPED:case pe.FRAG_LOADING:case pe.PARSING:case pe.PARSED:case pe.ENDED:}this._checkBuffer(),this._checkFragmentChanged()},t.prototype._doTickIdle=function(){var e=this.hls,t=e.config,r=this.media;if(void 0!==this.levelLastLoaded&&(r||!this.startFragRequested&&t.startFragPrefetch)){var n=void 0;n=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var a=e.nextLoadLevel,i=this.levels[a];if(i){var o=i.bitrate,s=void 0;s=o?Math.max(8*t.maxBufferSize/o,t.maxBufferLength):t.maxBufferLength,s=Math.min(s,t.maxMaxBufferLength);var d=Y.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,n,t.maxBufferHole),c=d.len;if(!(c>=s)){u.b.trace("buffer length of "+c.toFixed(3)+" is below max of "+s.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=a;var f=i.details;if(!f||f.live&&this.levelLastLoaded!==a)this.state=pe.WAITING_LEVEL;else{var h=this.fragPrevious;if(!f.live&&h&&!h.backtracked&&h.sn===f.endSN&&!d.nextStart)if(Math.min(r.duration,h.start+h.duration)-Math.max(d.end,h.start)<=Math.max(.2,h.duration)){var p={};return this.altAudio&&(p.type="video"),this.hls.trigger(l.a.BUFFER_EOS,p),void(this.state=pe.ENDED)}this._fetchPayloadOrEos(n,d,f)}}}}},t.prototype._fetchPayloadOrEos=function(e,t,r){var n=this.fragPrevious,a=this.level,i=r.fragments,o=i.length;if(0!==o){var s=i[0].start,l=i[o-1].start+i[o-1].duration,d=t.end,c=void 0;if(r.initSegment&&!r.initSegment.data)c=r.initSegment;else if(r.live){var f=this.config.initialLiveManifestSize;if(oh&&(d.currentTime=h),this.nextLoadPosition=h}if(e.PTSKnown&&t>n&&d&&d.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(a)if(e.hasProgramDateTime)u.b.log("live playlist, switching playlist, load frag with same PDT: "+a.programDateTime),c=function(e,t,r){if(!Array.isArray(e)||!e.length||!Object(s.a)(t))return null;if(t=e[e.length-1].endProgramDateTime)return null;r=r||0;for(var n=0;n=e.startSN&&p<=e.endSN){var v=i[p-e.startSN];a.cc===v.cc&&(c=v,u.b.log("live playlist, switching playlist, load frag with next SN: "+c.sn))}c||(c=H.search(i,function(e){return a.cc-e.cc}))&&u.b.log("live playlist, switching playlist, load frag with same CC: "+c.sn)}c||(c=i[Math.min(o-1,Math.round(o/2))],u.b.log("live playlist, switching playlist, unknown, load middle frag : "+c.sn))}return c},t.prototype._findFragment=function(e,t,r,n,a,i,o){var s=this.hls.config,l=void 0;a2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=e?t[e.sn-t[0].sn+1]:null;return a&&!de(r,n,a)?a:H.search(t,de.bind(null,r,n))}(t,n,a,a>i-s.maxFragLookUpTolerance?0:s.maxFragLookUpTolerance):l=n[r-1];if(l){var d=l.sn-o.startSN,c=t&&l.level===t.level,f=n[d-1],h=n[d+1];if(t&&l.sn===t.sn)if(c&&!l.backtracked)if(l.sns.maxBufferHole&&t.dropped&&d?(l=f,u.b.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this")):(l=h,u.b.log("SN just loaded, load next one: "+l.sn,l))}else l=null;else l.backtracked&&(h&&h.backtracked?(u.b.warn("Already backtracked from fragment "+h.sn+", will not backtrack to fragment "+l.sn+". Loading fragment "+h.sn),l=h):(u.b.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),l.dropped=0,f?(l=f).backtracked=!0:d&&(l=null)))}return l},t.prototype._loadKey=function(e){this.state=pe.KEY_LOADING,this.hls.trigger(l.a.KEY_LOADING,{frag:e})},t.prototype._loadFragment=function(e){var t=this.fragmentTracker.getState(e);this.fragCurrent=e,this.startFragRequested=!0,Object(s.a)(e.sn)&&!e.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),e.backtracked||t===B||t===j?(e.autoLevel=this.hls.autoLevelEnabled,e.bitrateTest=this.bitrateTest,this.hls.trigger(l.a.FRAG_LOADING,{frag:e}),this.demuxer||(this.demuxer=new te(this.hls,"main")),this.state=pe.FRAG_LOADING):t===G&&this._reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e)},t.prototype.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,N.LevelType.MAIN)},t.prototype.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.endPTS+.5):null},t.prototype._checkFragmentChanged=function(){var e=void 0,t=void 0,r=this.media;if(r&&r.readyState&&!1===r.seeking&&((t=r.currentTime)>this.lastCurrentTime&&(this.lastCurrentTime=t),Y.isBuffered(r,t)?e=this.getBufferedFrag(t):Y.isBuffered(r,t+.1)&&(e=this.getBufferedFrag(t+.1)),e)){var n=e;if(n!==this.fragPlaying){this.hls.trigger(l.a.FRAG_CHANGED,{frag:n});var a=n.level;this.fragPlaying&&this.fragPlaying.level===a||this.hls.trigger(l.a.LEVEL_SWITCHED,{level:a}),this.fragPlaying=n}}},t.prototype.immediateLevelSwitch=function(){if(u.b.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,t=void 0;e?(t=e.paused,e.pause()):t=!0,this.previouslyPaused=t}var r=this.fragCurrent;r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},t.prototype.immediateLevelSwitchEnd=function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,Y.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())},t.prototype.nextLevelSwitch=function(){var e=this.media;if(e&&e.readyState){var t,r=void 0,n=void 0;if((t=this.getBufferedFrag(e.currentTime))&&t.startPTS>1&&this.flushMainBuffer(0,t.startPTS-1),e.paused)r=0;else{var a=this.hls.nextLoadLevel,i=this.levels[a],o=this.fragLastKbps;r=o&&this.fragCurrent?this.fragCurrent.duration*i.bitrate/(1e3*o)+1:0}if((n=this.getBufferedFrag(e.currentTime+r))&&(n=this.followingBufferedFrag(n))){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(n.maxStartPTS,Number.POSITIVE_INFINITY)}}},t.prototype.flushMainBuffer=function(e,t){this.state=pe.BUFFER_FLUSHING;var r={startOffset:e,endOffset:t};this.altAudio&&(r.type="video"),this.hls.trigger(l.a.BUFFER_FLUSHING,r)},t.prototype.onMediaAttached=function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("seeked",this.onvseeked),t.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition),this.gapController=new fe(r,t,this.fragmentTracker,this.hls)},t.prototype.onMediaDetaching=function(){var e=this.media;e&&e.ended&&(u.b.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.levels;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.backtracked=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},t.prototype.onMediaSeeking=function(){var e=this.media,t=e?e.currentTime:void 0,r=this.config;Object(s.a)(t)&&u.b.log("media seeking to "+t.toFixed(3));var n=this.mediaBuffer?this.mediaBuffer:e,a=Y.bufferInfo(n,t,this.config.maxBufferHole);if(this.state===pe.FRAG_LOADING){var i=this.fragCurrent;if(0===a.len&&i){var o=r.maxFragLookUpTolerance,l=i.start-o,d=i.start+i.duration+o;td?(i.loader&&(u.b.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),i.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=pe.IDLE):u.b.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===pe.ENDED&&(0===a.len&&(this.fragPrevious=0),this.state=pe.IDLE);e&&(this.lastCurrentTime=t),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=t),this.tick()},t.prototype.onMediaSeeked=function(){var e=this.media,t=e?e.currentTime:void 0;Object(s.a)(t)&&u.b.log("media seeked to "+t.toFixed(3)),this.tick()},t.prototype.onMediaEnded=function(){u.b.log("media ended"),this.startPosition=this.lastCurrentTime=0},t.prototype.onManifestLoading=function(){u.b.log("trigger BUFFER_RESET"),this.hls.trigger(l.a.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},t.prototype.onManifestParsed=function(e){var t=!1,r=!1,n=void 0;e.levels.forEach(function(e){(n=e.audioCodec)&&(-1!==n.indexOf("mp4a.40.2")&&(t=!0),-1!==n.indexOf("mp4a.40.5")&&(r=!0))}),this.audioCodecSwitch=t&&r,this.audioCodecSwitch&&u.b.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1;var a=this.config;(a.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(a.startPosition)},t.prototype.onLevelLoaded=function(e){var t=e.details,r=e.level,n=this.levels[this.levelLastLoaded],a=this.levels[r],i=t.totalduration,o=0;if(u.b.log("level "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+i),t.live){var d=a.details;d&&t.fragments.length>0?(ie(d,t),o=t.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(o,d),t.PTSKnown&&Object(s.a)(o)?u.b.log("live playlist sliding:"+o.toFixed(3)):(u.b.log("live playlist - outdated PTS, unknown sliding"),le(this.fragPrevious,n,t))):(u.b.log("live playlist - first load, unknown sliding"),t.PTSKnown=!1,le(this.fragPrevious,n,t))}else t.PTSKnown=!1;if(a.details=t,this.levelLastLoaded=r,this.hls.trigger(l.a.LEVEL_UPDATED,{details:t,level:r}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var c=t.startTimeOffset;Object(s.a)(c)?(c<0&&(u.b.log("negative start time offset "+c+", count from end of last fragment"),c=o+i+c),u.b.log("start time offset found in playlist, adjust startPosition to "+c),this.startPosition=c):t.live?(this.startPosition=this.computeLivePosition(o,t),u.b.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===pe.WAITING_LEVEL&&(this.state=pe.IDLE),this.tick()},t.prototype.onKeyLoaded=function(){this.state===pe.KEY_LOADING&&(this.state=pe.IDLE,this.tick())},t.prototype.onFragLoaded=function(e){var t=this.fragCurrent,r=this.hls,n=this.levels,a=this.media,i=e.frag;if(this.state===pe.FRAG_LOADING&&t&&"main"===i.type&&i.level===t.level&&i.sn===t.sn){var o=e.stats,s=n[t.level],d=s.details;if(this.bitrateTest=!1,this.stats=o,u.b.log("Loaded "+t.sn+" of ["+d.startSN+" ,"+d.endSN+"],level "+t.level),i.bitrateTest&&r.nextLoadLevel)this.state=pe.IDLE,this.startFragRequested=!1,o.tparsed=o.tbuffered=window.performance.now(),r.trigger(l.a.FRAG_BUFFERED,{stats:o,frag:t,id:"main"}),this.tick();else if("initSegment"===i.sn)this.state=pe.IDLE,o.tparsed=o.tbuffered=window.performance.now(),d.initSegment.data=e.payload,r.trigger(l.a.FRAG_BUFFERED,{stats:o,frag:t,id:"main"}),this.tick();else{u.b.log("Parsing "+t.sn+" of ["+d.startSN+" ,"+d.endSN+"],level "+t.level+", cc "+t.cc),this.state=pe.PARSING,this.pendingBuffering=!0,this.appended=!1,i.bitrateTest&&(i.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:i}));var c=!(a&&a.seeking)&&(d.PTSKnown||!d.live),f=d.initSegment?d.initSegment.data:[],h=this._getAudioCodec(s);(this.demuxer=this.demuxer||new te(this.hls,"main")).push(e.payload,f,h,s.videoCodec,t,d.totalduration,c)}}this.fragLoadError=0},t.prototype.onFragParsingInitSegment=function(e){var t=this.fragCurrent,r=e.frag;if(t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===pe.PARSING){var n=e.tracks,a=void 0,i=void 0;if(n.audio&&this.altAudio&&delete n.audio,i=n.audio){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(u.b.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==i.metadata.channelCount&&-1===s.indexOf("firefox")&&(o="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==i.container&&(o="mp4a.40.2",u.b.log("Android: force audio codec to "+o)),i.levelCodec=o,i.id=e.id}for(a in(i=n.video)&&(i.levelCodec=this.levels[this.level].videoCodec,i.id=e.id),this.hls.trigger(l.a.BUFFER_CODECS,n),n){i=n[a],u.b.log("main track:"+a+",container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var d=i.initSegment;d&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(l.a.BUFFER_APPENDING,{type:a,data:d,parent:"main",content:"initSegment"}))}this.tick()}},t.prototype.onFragParsingData=function(e){var t=this,r=this.fragCurrent,n=e.frag;if(r&&"main"===e.id&&n.sn===r.sn&&n.level===r.level&&("audio"!==e.type||!this.altAudio)&&this.state===pe.PARSING){var a=this.levels[this.level],i=r;if(Object(s.a)(e.endPTS)||(e.endPTS=e.startPTS+r.duration,e.endDTS=e.startDTS+r.duration),!0===e.hasAudio&&i.addElementaryStream(g.ElementaryStreamTypes.AUDIO),!0===e.hasVideo&&i.addElementaryStream(g.ElementaryStreamTypes.VIDEO),u.b.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0)),"video"===e.type)if(i.dropped=e.dropped,i.dropped)if(i.backtracked)u.b.warn("Already backtracked on this fragment, appending with the gap",i.sn);else{var o=a.details;if(!o||i.sn!==o.startSN)return u.b.warn("missing video frame(s), backtracking fragment",i.sn),this.fragmentTracker.removeFragment(i),i.backtracked=!0,this.nextLoadPosition=e.startPTS,this.state=pe.IDLE,this.fragPrevious=i,void this.tick();u.b.warn("missing video frame(s) on first frag, appending with gap",i.sn)}else i.backtracked=!1;var d=ae(a.details,i,e.startPTS,e.endPTS,e.startDTS,e.endDTS),c=this.hls;c.trigger(l.a.LEVEL_PTS_UPDATED,{details:a.details,level:this.level,drift:d,type:e.type,start:e.startPTS,end:e.endPTS}),[e.data1,e.data2].forEach(function(r){r&&r.length&&t.state===pe.PARSING&&(t.appended=!0,t.pendingBuffering=!0,c.trigger(l.a.BUFFER_APPENDING,{type:e.type,data:r,parent:"main",content:"data"}))}),this.tick()}},t.prototype.onFragParsed=function(e){var t=this.fragCurrent,r=e.frag;t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===pe.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=pe.PARSED,this._checkAppendedParsed())},t.prototype.onAudioTrackSwitching=function(e){var t=!!e.url,r=e.id;if(!t){if(this.mediaBuffer!==this.media){u.b.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var n=this.fragCurrent;n.loader&&(u.b.log("switching to main audio track, cancel main fragment load"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=pe.IDLE}var a=this.hls;a.trigger(l.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),a.trigger(l.a.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}},t.prototype.onAudioTrackSwitched=function(e){var t=e.id,r=!!this.hls.audioTracks[t].url;if(r){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(u.b.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r,this.tick()},t.prototype.onBufferCreated=function(e){var t=e.tracks,r=void 0,n=void 0,a=!1;for(var i in t){var o=t[i];"main"===o.id?(n=i,r=o,"video"===i&&(this.videoBuffer=t[i].buffer)):a=!0}a&&r?(u.b.log("alternate track found, use "+n+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},t.prototype.onBufferAppended=function(e){if("main"===e.parent){var t=this.state;t!==pe.PARSING&&t!==pe.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}},t.prototype._checkAppendedParsed=function(){if(this.state===pe.PARSED&&(!this.appended||!this.pendingBuffering)){var e=this.fragCurrent;if(e){var t=this.mediaBuffer?this.mediaBuffer:this.media;u.b.log("main buffered : "+oe.toString(t.buffered)),this.fragPrevious=e;var r=this.stats;r.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*r.total/(r.tbuffered-r.tfirst)),this.hls.trigger(l.a.FRAG_BUFFERED,{stats:r,frag:e,id:"main"}),this.state=pe.IDLE}this.tick()}},t.prototype.onError=function(e){var t=e.frag||this.fragCurrent;if(!t||"main"===t.type){var r=!!this.media&&Y.isBuffered(this.media,this.media.currentTime)&&Y.isBuffered(this.media,this.media.currentTime+.5);switch(e.details){case o.a.FRAG_LOAD_ERROR:case o.a.FRAG_LOAD_TIMEOUT:case o.a.KEY_LOAD_ERROR:case o.a.KEY_LOAD_TIMEOUT:if(!e.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var n=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);u.b.warn("mediaController: frag loading failed, retry in "+n+" ms"),this.retryDate=window.performance.now()+n,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=pe.FRAG_LOADING_WAITING_RETRY}else u.b.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=pe.ERROR;break;case o.a.LEVEL_LOAD_ERROR:case o.a.LEVEL_LOAD_TIMEOUT:this.state!==pe.ERROR&&(e.fatal?(this.state=pe.ERROR,u.b.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):e.levelRetry||this.state!==pe.WAITING_LEVEL||(this.state=pe.IDLE));break;case o.a.BUFFER_FULL_ERROR:"main"!==e.parent||this.state!==pe.PARSING&&this.state!==pe.PARSED||(r?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=pe.IDLE):(u.b.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}},t.prototype._reduceMaxBufferLength=function(e){var t=this.config;return t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,u.b.warn("main:reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},t.prototype._checkBuffer=function(){var e=this.media;if(e&&0!==e.readyState){var t=(this.mediaBuffer?this.mediaBuffer:e).buffered;!this.loadedmetadata&&t.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,t)}},t.prototype.onFragLoadEmergencyAborted=function(){this.state=pe.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},t.prototype.onBufferFlushed=function(){var e=this.mediaBuffer?this.mediaBuffer:this.media;e&&this.fragmentTracker.detectEvictedFragments(g.ElementaryStreamTypes.VIDEO,e.buffered),this.state=pe.IDLE,this.fragPrevious=null},t.prototype.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},t.prototype.computeLivePosition=function(e,t){var r=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*t.targetduration;return e+Math.max(0,t.totalduration-r)},t.prototype._seekToStartPos=function(){var e=this.media,t=e.currentTime,r=e.seeking?t:this.startPosition;t!==r&&(u.b.log("target start position not buffered, seek to buffered.start(0) "+r+" from current time "+t+" "),e.currentTime=r)},t.prototype._getAudioCodec=function(e){var t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&(u.b.log("swapping playlist audio codec"),t&&(t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),t},he(t,[{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,u.b.log("main stream:"+t+"->"+e),this.hls.trigger(l.a.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getBufferedFrag(e.currentTime);if(t)return t.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e}}]),t}(ue),ye="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ge=function(){function e(e,t){for(var r=0;r0){r=t[0].bitrate,t.sort(function(e,t){return e.bitrate-t.bitrate}),this._levels=t;for(var f=0;f0&&i})}else this.hls.trigger(l.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:this.hls.url,reason:"no level with compatible codecs found in manifest"})},t.prototype.setLevelInternal=function(e){var t=this._levels,r=this.hls;if(e>=0&&e1&&s.loadError0){var t=this.currentLevelIndex,r=e.urlId,n=e.url[r];u.b.log("Attempt loading level index "+t+" with URL-id "+r),this.hls.trigger(l.a.LEVEL_LOADING,{url:n,level:t,id:r})}}},ge(t,[{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var t=this._levels;t&&(e=Math.min(e,t.length-1),this.currentLevelIndex===e&&t[e].details||this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}}]),t}(f),Ee=r(6);function Te(e,t){var r=null;try{r=new window.Event("addtrack")}catch(e){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)}function Se(e){if(e&&e.cues)for(;e.cues.length>0;)e.removeCue(e.cues[0])}var ke=function(e){function t(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this,r,l.a.MEDIA_ATTACHED,l.a.MEDIA_DETACHING,l.a.FRAG_PARSING_METADATA));return n.id3Track=void 0,n.media=void 0,n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.destroy=function(){f.prototype.destroy.call(this)},t.prototype.onMediaAttached=function(e){this.media=e.media,this.media},t.prototype.onMediaDetaching=function(){Se(this.id3Track),this.id3Track=void 0,this.media=void 0},t.prototype.getID3Track=function(e){for(var t=0;t=this.minWeight_},e.prototype.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.prototype.destroy=function(){},e}(),Re=function(){function e(e,t){for(var r=0;r500*r.duration/s){var d=e.levels,c=Math.max(1,i.bw?i.bw/8:1e3*i.loaded/o),f=d[r.level],h=f.realBitrate?Math.max(f.realBitrate,f.bitrate):f.bitrate,p=i.total?i.total:Math.max(i.loaded,Math.round(r.duration*h/8)),v=t.currentTime,y=(p-i.loaded)/c,g=(Y.bufferInfo(t,v,e.config.maxBufferHole).end-v)/s;if(g<2*r.duration/s&&y>g){var m=void 0,b=void 0;for(b=r.level-1;b>a;b--){var E=d[b].realBitrate?Math.max(d[b].realBitrate,d[b].bitrate):d[b].bitrate;if((m=r.duration*E/(6.4*c))=n;d--){var c=l[d];if(c){var f=c.details,h=f?f.totalduration/f.fragments.length:t,p=!!f&&f.live,v=void 0;v=d<=e?o*r:s*r;var y=l[d].realBitrate?Math.max(l[d].realBitrate,l[d].bitrate):l[d].bitrate,g=y*h/v;if(u.b.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+d+"/"+Math.round(v)+"/"+y+"/"+h+"/"+i+"/"+g),v>y&&(!g||p&&!this.bitrateTestDelay||g=0)return h;u.b.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var p=s?Math.min(s,n.maxStarvationDelay):n.maxStarvationDelay,v=n.abrBandWidthFactor,y=n.abrBandWidthUpFactor;if(0===f){var g=this.bitrateTestDelay;if(g)p=(s?Math.min(s,n.maxLoadingDelay):n.maxLoadingDelay)-g,u.b.trace("bitrate test took "+Math.round(1e3*g)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*p)+" ms"),v=y=1}return h=this._findBestLevel(o,s,c,a,t,f+p,v,y,r),Math.max(h,0)}}]),t}(f);var Pe=Q(),De=function(e){function t(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this,r,l.a.MEDIA_ATTACHING,l.a.MEDIA_DETACHING,l.a.MANIFEST_PARSED,l.a.BUFFER_RESET,l.a.BUFFER_APPENDING,l.a.BUFFER_CODECS,l.a.BUFFER_EOS,l.a.BUFFER_FLUSHING,l.a.LEVEL_PTS_UPDATED,l.a.LEVEL_UPDATED));return n._msDuration=null,n._levelDuration=null,n._live=null,n._objectUrl=null,n.onsbue=n.onSBUpdateEnd.bind(n),n.onsbe=n.onSBUpdateError.bind(n),n.pendingTracks={},n.tracks={},n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.destroy=function(){f.prototype.destroy.call(this)},t.prototype.onLevelPtsUpdated=function(e){var t=e.type,r=this.tracks.audio;if("audio"===t&&r&&"audio/mpeg"===r.container){var n=this.sourceBuffer.audio;if(Math.abs(n.timestampOffset-e.start)>.1){var a=n.updating;try{n.abort()}catch(e){a=!0,u.b.warn("can not abort audio buffer: "+e)}a?this.audioTimestampOffset=e.start:(u.b.warn("change mpeg audio timestamp offset from "+n.timestampOffset+" to "+e.start),n.timestampOffset=e.start)}}},t.prototype.onManifestParsed=function(e){var t=e.audio,r=e.video||e.levels.length&&e.altAudio,n=0;e.altAudio&&(t||r)&&(n=(t?1:0)+(r?1:0),u.b.log(n+" sourceBuffer(s) expected")),this.sourceBufferNb=n},t.prototype.onMediaAttaching=function(e){var t=this.media=e.media;if(t){var r=this.mediaSource=new Pe;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),t.src=window.URL.createObjectURL(r),this._objectUrl=t.src}},t.prototype.onMediaDetaching=function(){u.b.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(e){u.b.warn("onMediaDetaching:"+e.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this.onmso),e.removeEventListener("sourceended",this.onmse),e.removeEventListener("sourceclose",this.onmsc),this.media&&(window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):u.b.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(l.a.MEDIA_DETACHED)},t.prototype.onMediaSourceOpen=function(){u.b.log("media source opened"),this.hls.trigger(l.a.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()},t.prototype.checkPendingTracks=function(){var e=this.pendingTracks,t=Object.keys(e).length;t&&(this.sourceBufferNb<=t||0===this.sourceBufferNb)&&(this.createSourceBuffers(e),this.pendingTracks={},this.doAppending())},t.prototype.onMediaSourceClose=function(){u.b.log("media source closed")},t.prototype.onMediaSourceEnded=function(){u.b.log("media source ended")},t.prototype.onSBUpdateEnd=function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;u.b.warn("change mpeg audio timestamp offset from "+e.timestampOffset+" to "+this.audioTimestampOffset),e.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var t=this.parent,r=this.segments.reduce(function(e,r){return r.parent===t?e+1:e},0),n={},a=this.sourceBuffer;for(var i in a)n[i]=a[i].buffered;this.hls.trigger(l.a.BUFFER_APPENDED,{parent:t,pending:r,timeRanges:n}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()},t.prototype.onSBUpdateError=function(e){u.b.error("sourceBuffer error:",e),this.hls.trigger(l.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_APPENDING_ERROR,fatal:!1})},t.prototype.onBufferReset=function(){var e=this.sourceBuffer;for(var t in e){var r=e[t];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(e){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},t.prototype.onBufferCodecs=function(e){if(0===Object.keys(this.sourceBuffer).length){for(var t in e)this.pendingTracks[t]=e[t];var r=this.mediaSource;r&&"open"===r.readyState&&this.checkPendingTracks()}},t.prototype.createSourceBuffers=function(e){var t=this.sourceBuffer,r=this.mediaSource;for(var n in e)if(!t[n]){var a=e[n],i=a.levelCodec||a.codec,s=a.container+";codecs="+i;u.b.log("creating sourceBuffer("+s+")");try{var d=t[n]=r.addSourceBuffer(s);d.addEventListener("updateend",this.onsbue),d.addEventListener("error",this.onsbe),this.tracks[n]={codec:i,container:a.container},a.buffer=d}catch(e){u.b.error("error while trying to add sourceBuffer:"+e.message),this.hls.trigger(l.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:e,mimeType:s})}}this.hls.trigger(l.a.BUFFER_CREATED,{tracks:e})},t.prototype.onBufferAppending=function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())},t.prototype.onBufferAppendFail=function(e){u.b.error("sourceBuffer error:",e.event),this.hls.trigger(l.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_APPENDING_ERROR,fatal:!1})},t.prototype.onBufferEos=function(e){var t=this.sourceBuffer,r=e.type;for(var n in t)r&&n!==r||t[n].ended||(t[n].ended=!0,u.b.log(n+" sourceBuffer now EOS"));this.checkEos()},t.prototype.checkEos=function(){var e=this.sourceBuffer,t=this.mediaSource;if(t&&"open"===t.readyState){for(var r in e){var n=e[r];if(!n.ended)return;if(n.updating)return void(this._needsEos=!0)}u.b.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(e){u.b.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}else this._needsEos=!1},t.prototype.onBufferFlushing=function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()},t.prototype.onLevelUpdated=function(e){var t=e.details;t.fragments.length>0&&(this._levelDuration=t.totalduration+t.fragments[0].start,this._live=t.live,this.updateMediaElementDuration())},t.prototype.updateMediaElementDuration=function(){var e,t=this.hls.config;if(null!==this._levelDuration&&this.media&&this.mediaSource&&this.sourceBuffer&&0!==this.media.readyState&&"open"===this.mediaSource.readyState){for(var r in this.sourceBuffer)if(!0===this.sourceBuffer[r].updating)return;e=this.media.duration,null===this._msDuration&&(this._msDuration=this.mediaSource.duration),!0===this._live&&!0===t.liveDurationInfinity?(u.b.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>e||!Object(s.a)(e))&&(u.b.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},t.prototype.doFlush=function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var t=0,r=this.sourceBuffer;try{for(var n in r)t+=r[n].buffered.length}catch(e){u.b.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(l.a.BUFFER_FLUSHED)}},t.prototype.doAppending=function(){var e=this.hls,t=this.sourceBuffer,r=this.segments;if(Object.keys(t).length){if(this.media.error)return this.segments=[],void u.b.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(r&&r.length){var n=r.shift();try{var a=t[n.type];a?a.updating?r.unshift(n):(a.ended=!1,this.parent=n.parent,a.appendBuffer(n.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(t){u.b.error("error while trying to append buffer:"+t.message),r.unshift(n);var i={type:o.b.MEDIA_ERROR,parent:n.parent};22!==t.code?(this.appendError?this.appendError++:this.appendError=1,i.details=o.a.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry?(u.b.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),r=[],i.fatal=!0,e.trigger(l.a.ERROR,i)):(i.fatal=!1,e.trigger(l.a.ERROR,i))):(this.segments=[],i.details=o.a.BUFFER_FULL_ERROR,i.fatal=!1,e.trigger(l.a.ERROR,i))}}}},t.prototype.flushBuffer=function(e,t,r){var n=void 0,a=void 0,i=void 0,o=void 0,s=void 0,l=void 0,d=this.sourceBuffer;if(Object.keys(d).length){if(u.b.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter.5)return this.flushBufferCounter++,u.b.log("flush "+c+" ["+s+","+l+"], of ["+i+","+o+"], pos:"+this.media.currentTime),n.remove(s,l),!1}catch(e){u.b.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else u.b.warn("abort flushing too many retries");u.b.log("buffer flushed")}return!0},t}(f),Ce=function(){function e(e,t){for(var r=0;rthis.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}},t.prototype.getMaxLevel=function(e){var r=this;if(!this.levels)return-1;var n=this.levels.filter(function(n,a){return t.isLevelAllowed(a,r.restrictedLevels)&&a<=e});return t.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},t.prototype._startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},t.prototype._stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},t.isLevelAllowed=function(e){return-1===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).indexOf(e)},t.getMaxLevelByMediaSize=function(e,t,r){if(!e||e&&!e.length)return-1;for(var n,a,i=e.length-1,o=0;o=t||s.height>=r)&&(n=s,!(a=e[o+1])||n.width!==a.width||n.height!==a.height)){i=o;break}}return i},Ce(t,[{key:"mediaWidth",get:function(){var e=void 0,r=this.media;return r&&(e=r.width||r.clientWidth||r.offsetWidth,e*=t.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e=void 0,r=this.media;return r&&(e=r.height||r.clientHeight||r.offsetHeight,e*=t.contentScaleFactor),e}}],[{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e}}]),t}(f);var Oe=window.performance,xe=function(e){function t(r){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this,r,l.a.MEDIA_ATTACHING))}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},t.prototype.onMediaAttaching=function(e){var t=this.hls.config;t.capLevelOnFPSDrop&&("function"===typeof(this.video=e.media instanceof window.HTMLVideoElement?e.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),t.fpsDroppedMonitoringPeriod))},t.prototype.checkFPS=function(e,t,r){var n=Oe.now();if(t){if(this.lastTime){var a=n-this.lastTime,i=r-this.lastDroppedFrames,o=t-this.lastDecodedFrames,s=1e3*i/a,d=this.hls;if(d.trigger(l.a.FPS_DROP,{currentDropped:i,currentDecoded:o,totalDroppedFrames:r}),s>0&&i>d.config.fpsDroppedMonitoringThreshold*o){var c=d.currentLevel;u.b.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(-1===d.autoLevelCapping||d.autoLevelCapping>=c)&&(c-=1,d.trigger(l.a.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:d.currentLevel}),d.autoLevelCapping=c,d.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,this.lastDecodedFrames=t}},t.prototype.checkFPSInterval=function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},t}(f);var Me=window,Ne=Me.performance,Fe=Me.XMLHttpRequest,Ue=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&t.xhrSetup&&(this.xhrSetup=t.xhrSetup)}return e.prototype.destroy=function(){this.abort(),this.loader=null},e.prototype.abort=function(){var e=this.loader;e&&4!==e.readyState&&(this.stats.aborted=!0,e.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},e.prototype.load=function(e,t,r){this.context=e,this.config=t,this.callbacks=r,this.stats={trequest:Ne.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()},e.prototype.loadInternal=function(){var e=void 0,t=this.context;e=this.loader=new Fe;var r=this.stats;r.tfirst=0,r.loaded=0;var n=this.xhrSetup;try{if(n)try{n(e,t.url)}catch(r){e.open("GET",t.url,!0),n(e,t.url)}e.readyState||e.open("GET",t.url,!0)}catch(r){return void this.callbacks.onError({code:e.status,text:r.message},t,e)}t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),e.send()},e.prototype.readystatechange=function(e){var t=e.currentTarget,r=t.readyState,n=this.stats,a=this.context,i=this.config;if(!n.aborted&&r>=2)if(window.clearTimeout(this.requestTimeout),0===n.tfirst&&(n.tfirst=Math.max(Ne.now(),n.trequest)),4===r){var o=t.status;if(o>=200&&o<300){n.tload=Math.max(n.tfirst,Ne.now());var s=void 0,l=void 0;l="arraybuffer"===a.responseType?(s=t.response).byteLength:(s=t.responseText).length,n.loaded=n.total=l;var d={url:t.responseURL,data:s};this.callbacks.onSuccess(d,n,a,t)}else n.retry>=i.maxRetry||o>=400&&o<499?(u.b.error(o+" while loading "+a.url),this.callbacks.onError({code:o,text:t.statusText},a,t)):(u.b.warn(o+" while loading "+a.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,i.maxRetryDelay),n.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),i.timeout)},e.prototype.loadtimeout=function(){u.b.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},e.prototype.loadprogress=function(e){var t=e.currentTarget,r=this.stats;r.loaded=e.loaded,e.lengthComputable&&(r.total=e.total);var n=this.callbacks.onProgress;n&&n(r,this.context,null,t)},e}(),Be=function(){function e(e,t){for(var r=0;r=this.tracks.length)u.b.warn("Invalid audio track id:",e.id);else{if(u.b.log("audioTrack "+e.id+" loaded"),this.tracks[e.id].details=e.details,e.details.live&&!this.hasInterval()){var t=1e3*e.details.targetduration;this.setInterval(t)}!e.details.live&&this.hasInterval()&&this.clearInterval()}},t.prototype.onAudioTrackSwitched=function(e){var t=this.tracks[e.id].groupId;t&&this.audioGroupId!==t&&(this.audioGroupId=t)},t.prototype.onLevelLoaded=function(e){var t=this.hls.levels[e.level];if(t.audioGroupIds){var r=t.audioGroupIds[t.urlId];this.audioGroupId!==r&&(this.audioGroupId=r,this._selectInitialAudioTrack())}},t.prototype.onError=function(e){e.type===o.b.NETWORK_ERROR&&(e.fatal&&this.clearInterval(),e.details===o.a.AUDIO_TRACK_LOAD_ERROR&&(u.b.warn("Network failure on audio-track id:",e.context.id),this._handleLoadError()))},t.prototype._setAudioTrack=function(e){if(this._trackId===e&&this.tracks[this._trackId].details)u.b.debug("Same id as current audio-track passed, and track details available -> no-op");else if(e<0||e>=this.tracks.length)u.b.warn("Invalid id passed to audio-track controller");else{var t=this.tracks[e];u.b.log("Now switching to audio-track index "+e),this.clearInterval(),this._trackId=e;var r=t.url,n=t.type,a=t.id;this.hls.trigger(l.a.AUDIO_TRACK_SWITCHING,{id:a,type:n,url:r}),this._loadTrackDetailsIfNeeded(t)}},t.prototype.doTick=function(){this._updateTrack(this._trackId)},t.prototype._selectInitialAudioTrack=function(){var e=this,t=this.tracks;if(t.length){var r=this.tracks[this._trackId],n=null;if(r&&(n=r.name),this._selectDefaultTrack){var a=t.filter(function(e){return e.default});a.length?t=a:u.b.warn("No default audio tracks defined")}var i=!1,s=function(){t.forEach(function(t){i||e.audioGroupId&&t.groupId!==e.audioGroupId||n&&n!==t.name||(e._setAudioTrack(t.id),i=!0)})};s(),i||(n=null,s()),i||(u.b.error("No track found for running audio group-ID: "+this.audioGroupId),this.hls.trigger(l.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))}},t.prototype._needsTrackLoading=function(e){var t=e.details;return!t||(!!t.live||void 0)},t.prototype._loadTrackDetailsIfNeeded=function(e){if(this._needsTrackLoading(e)){var t=e.url,r=e.id;u.b.log("loading audio-track playlist for id: "+r),this.hls.trigger(l.a.AUDIO_TRACK_LOADING,{url:t,id:r})}},t.prototype._updateTrack=function(e){if(!(e<0||e>=this.tracks.length)){this.clearInterval(),this._trackId=e,u.b.log("trying to update audio-track "+e);var t=this.tracks[e];this._loadTrackDetailsIfNeeded(t)}},t.prototype._handleLoadError=function(){this.trackIdBlacklist[this._trackId]=!0;var e=this._trackId,t=this.tracks[e],r=t.name,n=t.language,a=t.groupId;u.b.warn("Loading failed on audio track id: "+e+", group-id: "+a+', name/language: "'+r+'" / "'+n+'"');for(var i=e,o=0;o0&&-1===e?(u.b.log("audio:override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=We.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=We.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=We.STOPPED},t.prototype.stopLoad=function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragmentTracker.removeFragment(e),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=We.STOPPED},t.prototype.doTick=function(){var e=void 0,t=void 0,r=void 0,n=this.hls,a=n.config;switch(this.state){case We.ERROR:case We.PAUSED:case We.BUFFER_FLUSHING:break;case We.STARTING:this.state=We.WAITING_TRACK,this.loadedmetadata=!1;break;case We.IDLE:var i=this.tracks;if(!i)break;if(!this.media&&(this.startFragRequested||!a.startFragPrefetch))break;if(this.loadedmetadata)e=this.media.currentTime;else if(void 0===(e=this.nextLoadPosition))break;var o=this.mediaBuffer?this.mediaBuffer:this.media,d=this.videoBuffer?this.videoBuffer:this.media,c=Y.bufferInfo(o,e,a.maxBufferHole),f=Y.bufferInfo(d,e,a.maxBufferHole),h=c.len,p=c.end,v=this.fragPrevious,y=Math.min(a.maxBufferLength,a.maxMaxBufferLength),g=Math.max(y,f.len),m=this.audioSwitch,b=this.trackId;if((hS||c.nextStart))return;u.b.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=S+.05}if(r.initSegment&&!r.initSegment.data)_=r.initSegment;else if(p<=S){if(_=E[0],null!==this.videoTrackCC&&_.cc!==this.videoTrackCC&&(_=function(e,t){return H.search(e,function(e){return e.cct?-1:0})}(E,this.videoTrackCC)),r.live&&_.loadIdx&&_.loadIdx===this.fragLoadIdx){var A=c.nextStart?c.nextStart:S;return u.b.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(A+.05)),void(this.media.currentTime=A+.05)}}else{var R=void 0,w=a.maxFragLookUpTolerance,L=v?E[v.sn-E[0].sn+1]:void 0,P=function(e){var t=Math.min(w,e.duration);return e.start+e.duration-t<=p?1:e.start-t>p&&e.start?-1:0};pk-w&&(w=0),R=L&&!P(L)?L:H.search(E,P)):R=E[T-1],R&&(_=R,S=R.start,v&&_.level===v.level&&_.sn===v.sn&&(_.sn=C||I)&&(u.b.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=We.IDLE);break;case We.WAITING_INIT_PTS:var O=this.videoTrackCC;if(void 0===this.initPTS[O])break;var x=this.waitingFragment;if(x){var M=x.frag.cc;O!==M?(t=this.tracks[this.trackId]).details&&t.details.live&&(u.b.warn("Waiting fragment CC ("+M+") does not match video track CC ("+O+")"),this.waitingFragment=null,this.state=We.IDLE):(this.state=We.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=We.IDLE;break;case We.STOPPED:case We.FRAG_LOADING:case We.PARSING:case We.PARSED:case We.ENDED:}},t.prototype.onMediaAttached=function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)},t.prototype.onMediaDetaching=function(){var e=this.media;e&&e.ended&&(u.b.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.stopLoad()},t.prototype.onMediaSeeking=function(){this.state===We.ENDED&&(this.state=We.IDLE),this.media&&(this.lastCurrentTime=this.media.currentTime),this.tick()},t.prototype.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},t.prototype.onAudioTracksUpdated=function(e){u.b.log("audio tracks updated"),this.tracks=e.audioTracks},t.prototype.onAudioTrackSwitching=function(e){var t=!!e.url;this.trackId=e.id,this.fragCurrent=null,this.state=We.PAUSED,this.waitingFragment=null,t?this.setInterval(100):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),t&&(this.audioSwitch=!0,this.state=We.IDLE),this.tick()},t.prototype.onAudioTrackLoaded=function(e){var t=e.details,r=e.id,n=this.tracks[r],a=t.totalduration,i=0;if(u.b.log("track "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+a),t.live){var o=n.details;o&&t.fragments.length>0?(ie(o,t),i=t.fragments[0].start,t.PTSKnown?u.b.log("live audio playlist sliding:"+i.toFixed(3)):u.b.log("live audio playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,u.b.log("live audio playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(n.details=t,!this.startFragRequested){if(-1===this.startPosition){var l=t.startTimeOffset;Object(s.a)(l)?(u.b.log("start time offset found in playlist, adjust startPosition to "+l),this.startPosition=l):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===We.WAITING_TRACK&&(this.state=We.IDLE),this.tick()},t.prototype.onKeyLoaded=function(){this.state===We.KEY_LOADING&&(this.state=We.IDLE,this.tick())},t.prototype.onFragLoaded=function(e){var t=this.fragCurrent,r=e.frag;if(this.state===We.FRAG_LOADING&&t&&"audio"===r.type&&r.level===t.level&&r.sn===t.sn){var n=this.tracks[this.trackId],a=n.details,i=a.totalduration,o=t.level,s=t.sn,d=t.cc,c=this.config.defaultAudioCodec||n.audioCodec||"mp4a.40.2",f=this.stats=e.stats;if("initSegment"===s)this.state=We.IDLE,f.tparsed=f.tbuffered=Ke.now(),a.initSegment.data=e.payload,this.hls.trigger(l.a.FRAG_BUFFERED,{stats:f,frag:t,id:"audio"}),this.tick();else{this.state=We.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new te(this.hls,"audio"));var h=this.initPTS[d],p=a.initSegment?a.initSegment.data:[];if(a.initSegment||void 0!==h){this.pendingBuffering=!0,u.b.log("Demuxing "+s+" of ["+a.startSN+" ,"+a.endSN+"],track "+o);this.demuxer.push(e.payload,p,c,null,t,i,!1,h)}else u.b.log("unknown video PTS for continuity counter "+d+", waiting for video PTS before demuxing audio frag "+s+" of ["+a.startSN+" ,"+a.endSN+"],track "+o),this.waitingFragment=e,this.state=We.WAITING_INIT_PTS}}this.fragLoadError=0},t.prototype.onFragParsingInitSegment=function(e){var t=this.fragCurrent,r=e.frag;if(t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===We.PARSING){var n=e.tracks,a=void 0;if(n.video&&delete n.video,a=n.audio){a.levelCodec=a.codec,a.id=e.id,this.hls.trigger(l.a.BUFFER_CODECS,n),u.b.log("audio track:audio,container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var i=a.initSegment;if(i){var o={type:"audio",data:i,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[o]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(l.a.BUFFER_APPENDING,o))}this.tick()}}},t.prototype.onFragParsingData=function(e){var t=this,r=this.fragCurrent,n=e.frag;if(r&&"audio"===e.id&&"audio"===e.type&&n.sn===r.sn&&n.level===r.level&&this.state===We.PARSING){var a=this.trackId,i=this.tracks[a],d=this.hls;Object(s.a)(e.endPTS)||(e.endPTS=e.startPTS+r.duration,e.endDTS=e.startDTS+r.duration),r.addElementaryStream(g.ElementaryStreamTypes.AUDIO),u.b.log("parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb),ae(i.details,r,e.startPTS,e.endPTS);var c=this.audioSwitch,f=this.media,h=!1;if(c&&f)if(f.readyState){var p=f.currentTime;u.b.log("switching audio track : currentTime:"+p),p>=e.startPTS&&(u.b.log("switching audio track : flushing all audio"),this.state=We.BUFFER_FLUSHING,d.trigger(l.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),h=!0,this.audioSwitch=!1,d.trigger(l.a.AUDIO_TRACK_SWITCHED,{id:a}))}else this.audioSwitch=!1,d.trigger(l.a.AUDIO_TRACK_SWITCHED,{id:a});var v=this.pendingData;if(!v)return u.b.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),void d.trigger(l.a.ERROR,{type:o.b.MEDIA_ERROR,details:null,fatal:!0});this.audioSwitch||([e.data1,e.data2].forEach(function(t){t&&t.length&&v.push({type:e.type,data:t,parent:"audio",content:"data"})}),!h&&v.length&&(v.forEach(function(e){t.state===We.PARSING&&(t.pendingBuffering=!0,t.hls.trigger(l.a.BUFFER_APPENDING,e))}),this.pendingData=[],this.appended=!0)),this.tick()}},t.prototype.onFragParsed=function(e){var t=this.fragCurrent,r=e.frag;t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===We.PARSING&&(this.stats.tparsed=Ke.now(),this.state=We.PARSED,this._checkAppendedParsed())},t.prototype.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},t.prototype.onBufferCreated=function(e){var t=e.tracks.audio;t&&(this.mediaBuffer=t.buffer,this.loadedmetadata=!0),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},t.prototype.onBufferAppended=function(e){if("audio"===e.parent){var t=this.state;t!==We.PARSING&&t!==We.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}},t.prototype._checkAppendedParsed=function(){if(this.state===We.PARSED&&(!this.appended||!this.pendingBuffering)){var e=this.fragCurrent,t=this.stats,r=this.hls;if(e){this.fragPrevious=e,t.tbuffered=Ke.now(),r.trigger(l.a.FRAG_BUFFERED,{stats:t,frag:e,id:"audio"});var n=this.mediaBuffer?this.mediaBuffer:this.media;u.b.log("audio buffered : "+oe.toString(n.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(l.a.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=We.IDLE}this.tick()}},t.prototype.onError=function(e){var t=e.frag;if(!t||"audio"===t.type)switch(e.details){case o.a.FRAG_LOAD_ERROR:case o.a.FRAG_LOAD_TIMEOUT:var r=e.frag;if(r&&"audio"!==r.type)break;if(!e.fatal){var n=this.fragLoadError;n?n++:n=1;var a=this.config;if(n<=a.fragLoadingMaxRetry){this.fragLoadError=n;var i=Math.min(Math.pow(2,n-1)*a.fragLoadingRetryDelay,a.fragLoadingMaxRetryTimeout);u.b.warn("AudioStreamController: frag loading failed, retry in "+i+" ms"),this.retryDate=Ke.now()+i,this.state=We.FRAG_LOADING_WAITING_RETRY}else u.b.error("AudioStreamController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=We.ERROR}break;case o.a.AUDIO_TRACK_LOAD_ERROR:case o.a.AUDIO_TRACK_LOAD_TIMEOUT:case o.a.KEY_LOAD_ERROR:case o.a.KEY_LOAD_TIMEOUT:this.state!==We.ERROR&&(this.state=e.fatal?We.ERROR:We.IDLE,u.b.warn("AudioStreamController: "+e.details+" while loading frag, now switching to "+this.state+" state ..."));break;case o.a.BUFFER_FULL_ERROR:if("audio"===e.parent&&(this.state===We.PARSING||this.state===We.PARSED)){var s=this.mediaBuffer,d=this.media.currentTime;if(s&&Y.isBuffered(s,d)&&Y.isBuffered(s,d+.5)){var c=this.config;c.maxMaxBufferLength>=c.maxBufferLength&&(c.maxMaxBufferLength/=2,u.b.warn("AudioStreamController: reduce max buffer length to "+c.maxMaxBufferLength+"s")),this.state=We.IDLE}else u.b.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=We.BUFFER_FLUSHING,this.hls.trigger(l.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}}},t.prototype.onBufferFlushed=function(){var e=this,t=this.pendingData;t&&t.length?(u.b.log("AudioStreamController: appending pending audio data after buffer flushed"),t.forEach(function(t){e.hls.trigger(l.a.BUFFER_APPENDING,t)}),this.appended=!0,this.pendingData=[],this.state=We.PARSED):(this.state=We.IDLE,this.fragPrevious=null,this.tick())},je(t,[{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,u.b.log("audio stream:"+t+"->"+e)}},get:function(){return this._state}}]),t}(ue),Ye=function(){if("undefined"!==typeof window&&window.VTTCue)return window.VTTCue;var e="auto",t={"":!0,lr:!0,rl:!0},r={start:!0,middle:!0,end:!0,left:!0,right:!0};function n(e){return"string"===typeof e&&(!!r[e.toLowerCase()]&&e.toLowerCase())}function a(e){for(var t=1;t100)throw new Error("Position must be between 0 and 100.");E=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",a({},u,{get:function(){return T},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",a({},u,{get:function(){return S},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");S=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",a({},u,{get:function(){return k},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");k=t,this.hasBeenReset=!0}})),s.displayState=void 0,l)return s}return i.prototype.getCueAsHTML=function(){return window.WebVTT.convertCueToDOMTree(window,this.text)},i}(),qe=function(){return{decode:function(e){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}};function Ve(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new qe,this.regionList=[]}function ze(){this.values=Object.create(null)}function Xe(e,t,r,n){var a=n?e.split(n):[e];for(var i in a)if("string"===typeof a[i]){var o=a[i].split(r);if(2===o.length)t(o[0],o[1])}}ze.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,r){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0)}};var Je=new Ye(0,0,0),Qe="middle"===Je.align?"middle":"center";function Ze(e,t,r){var n=e;function a(){var t=function(e){function t(e,t,r,n){return 3600*(0|e)+60*(0|t)+(0|r)+(0|n)/1e3}var r=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return r?r[3]?t(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?t(r[1],r[2],0,r[4]):t(0,r[1],r[2],r[4]):null}(e);if(null===t)throw new Error("Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function i(){e=e.replace(/^\s+/,"")}if(i(),t.startTime=a(),i(),"--\x3e"!==e.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),i(),t.endTime=a(),i(),function(e,t){var n=new ze;Xe(e,function(e,t){switch(e){case"region":for(var a=r.length-1;a>=0;a--)if(r[a].id===t){n.set(e,r[a].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var i=t.split(","),o=i[0];n.integer(e,o),n.percent(e,o)&&n.set("snapToLines",!1),n.alt(e,o,["auto"]),2===i.length&&n.alt("lineAlign",i[1],["start",Qe,"end"]);break;case"position":i=t.split(","),n.percent(e,i[0]),2===i.length&&n.alt("positionAlign",i[1],["start",Qe,"end","line-left","line-right","auto"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start",Qe,"end","left","right"])}},/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");var a=n.get("line","auto");"auto"===a&&-1===Je.line&&(a=-1),t.line=a,t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align",Qe);var i=n.get("position","auto");"auto"===i&&50===Je.position&&(i="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=i}(e,t)}function $e(e){return e.replace(//gi,"\n")}Ve.prototype={parse:function(e){var t=this;function r(){var e=t.buffer,r=0;for(e=$e(e);r=16?s--:s++,navigator.userAgent.match(/Firefox\//)?i.line=d+1:i.line=d>7?d-2:d+1,i.align="left",i.position=Math.max(0,Math.min(100,s/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),e.addCue(i)}}function rt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var nt={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},at=function(e){var t=e;return nt.hasOwnProperty(e)&&(t=nt[e]),String.fromCharCode(t)},it=15,ot=100,st={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},lt={17:2,18:4,21:6,22:8,23:10,19:13,20:15},ut={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},dt={25:2,26:4,29:6,30:8,31:10,27:13,28:15},ct=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],ft={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){this.verboseFilter[e];this.verboseLevel}},ht=function(e){for(var t=[],r=0;rot&&(ft.log("ERROR","Too large cursor position "+this.pos),this.pos=ot)},e.prototype.moveCursor=function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r=144&&this.backSpace();var t=at(e);this.pos>=ot?ft.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},e.prototype.clearFromPos=function(e){var t=void 0;for(t=e;t0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r},e.prototype.getTextAndFormat=function(){return this.rows},e}(),mt=function(){function e(t,r){rt(this,e),this.chNr=t,this.outputFilter=r,this.mode=null,this.verbose=0,this.displayedMemory=new gt,this.nonDisplayedMemory=new gt,this.lastOutputScreen=new gt,this.currRollUpRow=this.displayedMemory.rows[it-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return e.prototype.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[it-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},e.prototype.getHandler=function(){return this.outputFilter},e.prototype.setHandler=function(e){this.outputFilter=e},e.prototype.setPAC=function(e){this.writeScreen.setPAC(e)},e.prototype.setBkgData=function(e){this.writeScreen.setBkgData(e)},e.prototype.setMode=function(e){e!==this.mode&&(this.mode=e,ft.log("INFO","MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},e.prototype.insertChars=function(e){for(var t=0;t=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}ft.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},e.prototype.outputDataUpdate=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=ft.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),!0===e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue()),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))},e.prototype.cueSplitAtTime=function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))},e}(),bt=function(){function e(t,r,n){rt(this,e),this.field=t||1,this.outputs=[r,n],this.channels=[new mt(1,r),new mt(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return e.prototype.getHandler=function(e){return this.channels[e].getHandler()},e.prototype.setHandler=function(e,t){this.channels[e].setHandler(t)},e.prototype.addData=function(e,t){var r=void 0,n=void 0,a=void 0,i=!1;this.lastTime=e,ft.setTime(e);for(var o=0;o ("+ht([n,a])+")"),(r=this.parseCmd(n,a))||(r=this.parseMidrow(n,a)),r||(r=this.parsePAC(n,a)),r||(r=this.parseBackgroundAttributes(n,a)),!r)if(i=this.parseChars(n,a))if(this.currChNr&&this.currChNr>=0)this.channels[this.currChNr-1].insertChars(i);else ft.log("WARNING","No channel found yet. TEXT-MODE?");r?this.dataCounters.cmd+=2:i?this.dataCounters.char+=2:(this.dataCounters.other+=2,ft.log("WARNING","Couldn't parse cleaned data "+ht([n,a])+" orig: "+ht([t[o],t[o+1]])))}else this.dataCounters.padding+=2},e.prototype.parseCmd=function(e,t){var r=null;if(!((20===e||28===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=33&&t<=35))return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,ft.log("DEBUG","Repeated command ("+ht([e,t])+") is dropped"),!0;r=20===e||23===e?1:2;var n=this.channels[r-1];return 20===e||28===e?32===t?n.ccRCL():33===t?n.ccBS():34===t?n.ccAOF():35===t?n.ccAON():36===t?n.ccDER():37===t?n.ccRU(2):38===t?n.ccRU(3):39===t?n.ccRU(4):40===t?n.ccFON():41===t?n.ccRDC():42===t?n.ccTR():43===t?n.ccRTD():44===t?n.ccEDM():45===t?n.ccCR():46===t?n.ccENM():47===t&&n.ccEOC():n.ccTO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0},e.prototype.parseMidrow=function(e,t){var r=null;return(17===e||25===e)&&t>=32&&t<=47&&((r=17===e?1:2)!==this.currChNr?(ft.log("ERROR","Mismatch channel in midrow parsing"),!1):(this.channels[r-1].ccMIDROW(t),ft.log("DEBUG","MIDROW ("+ht([e,t])+")"),!0))},e.prototype.parsePAC=function(e,t){var r,n=null;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127)&&!((16===e||24===e)&&t>=64&&t<=95))return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=e<=23?1:2,n=t>=64&&t<=95?1===r?st[e]:ut[e]:1===r?lt[e]:dt[e];var a=this.interpretPAC(n,t);return this.channels[r-1].setPAC(a),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0},e.prototype.interpretPAC=function(e,t){var r=t,n={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,n.underline=1===(1&r),r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n},e.prototype.parseChars=function(e,t){var r=null,n=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),a>=17&&a<=19){var i=t;i=17===a?t+80:18===a?t+112:t+144,ft.log("INFO","Special char '"+at(i)+"' in channel "+r),n=[i]}else e>=32&&e<=127&&(n=0===t?[e]:[e,t]);if(n){var o=ht(n);ft.log("DEBUG","Char codes = "+o.join(",")),this.lastCmdA=null,this.lastCmdB=null}return n},e.prototype.parseBackgroundAttributes=function(e,t){var r,n=void 0,a=void 0;return((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47)&&(n={},16===e||24===e?(a=Math.floor((t-32)/2),n.background=ct[a],t%2===1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),r=e<24?1:2,this.channels[r-1].setBkgData(n),this.lastCmdA=null,this.lastCmdB=null,!0)},e.prototype.reset=function(){for(var e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},e}(),Tt=function(e,t,r){return e.substr(r||0,t.length)===t},St=function(e){for(var t=5381,r=e.length;r;)t=33*t^e.charCodeAt(--r);return(t>>>0).toString()},kt={parse:function(e,t,r,n,a,i){var o=Object(Ee.b)(new Uint8Array(e)).trim().replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n"),l="00:00.000",u=0,d=0,c=0,f=[],h=void 0,p=!0,v=new et;v.oncue=function(e){var t=r[n],a=r.ccOffset;t&&t.new&&(void 0!==d?a=r.ccOffset=t.start:function(e,t,r){var n=e[t],a=e[n.prevCC];if(!a||!a.new&&n.new)return e.ccOffset=e.presentationOffset=n.start,void(n.new=!1);for(;a&&a.new;)e.ccOffset+=n.start-a.start,n.new=!1,a=e[(n=a).prevCC];e.presentationOffset=r}(r,n,c)),c&&(a=c+r.ccOffset-r.presentationOffset),e.startTime+=a-d,e.endTime+=a-d,e.id=St(e.startTime.toString())+St(e.endTime.toString())+St(e.text),e.text=decodeURIComponent(encodeURIComponent(e.text)),e.endTime>0&&f.push(e)},v.onparsingerror=function(e){h=e},v.onflush=function(){h&&i?i(h):a(f)},o.forEach(function(e){if(p){if(Tt(e,"X-TIMESTAMP-MAP=")){p=!1,e.substr(16).split(",").forEach(function(e){Tt(e,"LOCAL:")?l=e.substr(6):Tt(e,"MPEGTS:")&&(u=parseInt(e.substr(7)))});try{u-=t=t<0?t+8589934592:t,r=l,n=parseInt(r.substr(-3)),a=parseInt(r.substr(-6,2)),i=parseInt(r.substr(-9,2)),o=r.length>9?parseInt(r.substr(0,r.indexOf(":"))):0,d=(Object(s.a)(n)&&Object(s.a)(a)&&Object(s.a)(i)&&Object(s.a)(o)?(n+=1e3*a,n+=6e4*i,n+=36e5*o):-1)/1e3,c=u/9e4,-1===d&&(h=new Error("Malformed X-TIMESTAMP-MAP: "+e))}catch(t){h=new Error("Malformed X-TIMESTAMP-MAP: "+e)}return}""===e&&(p=!1)}var r,n,a,i,o;v.parse(e+"\n")}),v.flush()}};var _t=function(e){function t(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this,r,l.a.MEDIA_ATTACHING,l.a.MEDIA_DETACHING,l.a.FRAG_PARSING_USERDATA,l.a.FRAG_DECRYPTED,l.a.MANIFEST_LOADING,l.a.MANIFEST_LOADED,l.a.FRAG_LOADED,l.a.LEVEL_SWITCHING,l.a.INIT_PTS_FOUND));if(n.hls=r,n.config=r.config,n.enabled=!0,n.Cues=r.config.cueHandler,n.textTracks=[],n.tracks=[],n.unparsedVttFrags=[],n.initPTS=void 0,n.cueRanges=[],n.captionsTracks={},n.captionsProperties={textTrack1:{label:n.config.captionsTextTrack1Label,languageCode:n.config.captionsTextTrack1LanguageCode},textTrack2:{label:n.config.captionsTextTrack2Label,languageCode:n.config.captionsTextTrack2LanguageCode}},n.config.enableCEA708Captions){var a=new Et(n,"textTrack1"),i=new Et(n,"textTrack2");n.cea608Parser=new bt(0,a,i)}return n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.addCues=function(e,t,r,n){for(var a,i,o,s,l=this.cueRanges,u=!1,d=l.length;d--;){var c=l[d],f=(a=c[0],i=c[1],o=t,s=r,Math.min(i,s)-Math.max(a,o));if(f>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],r),u=!0,f/(r-t)>.5))return}u||l.push([t,r]),this.Cues.newCue(this.captionsTracks[e],t,r,n)},t.prototype.onInitPtsFound=function(e){var t=this;"undefined"===typeof this.initPTS&&(this.initPTS=e.initPTS),this.unparsedVttFrags.length&&(this.unparsedVttFrags.forEach(function(e){t.onFragLoaded(e)}),this.unparsedVttFrags=[])},t.prototype.getExistingTrack=function(e){var t=this.media;if(t)for(var r=0;r=r.length)&&(this._stopTimer(),this.trackId=e,u.b.log("switching to subtitle track "+e),t.trigger(l.a.SUBTITLE_TRACK_SWITCH,{id:e}),-1!==e)){var n=r[e],a=n.details;a&&!a.live||(u.b.log("(re)loading playlist for subtitle track "+e),t.trigger(l.a.SUBTITLE_TRACK_LOADING,{url:n.url,id:e}))}},t.prototype._stopTimer=function(){this.timer&&(clearInterval(this.timer),this.timer=null)},t.prototype._toggleTrackModes=function(e){var t=this.media,r=this.subtitleDisplay,n=this.trackId;if(t){var a=Rt(t.textTracks);if(-1===e)[].slice.call(a).forEach(function(e){e.mode="disabled"});else{var i=a[n];i&&(i.mode="disabled")}var o=a[e];o&&(o.mode=r?"showing":"hidden")}},At(t,[{key:"subtitleTracks",get:function(){return this.tracks}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.trackId!==e&&(this._toggleTrackModes(e),this.setSubtitleTrackInternal(e))}}]),t}(f),Lt=r(8);var Pt=window.performance,Dt={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING"},Ct=function(e){function t(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this,r,l.a.MEDIA_ATTACHED,l.a.ERROR,l.a.KEY_LOADED,l.a.FRAG_LOADED,l.a.SUBTITLE_TRACKS_UPDATED,l.a.SUBTITLE_TRACK_SWITCH,l.a.SUBTITLE_TRACK_LOADED,l.a.SUBTITLE_FRAG_PROCESSED));return n.config=r.config,n.vttFragSNsProcessed={},n.vttFragQueues=void 0,n.currentlyProcessing=null,n.state=Dt.STOPPED,n.currentTrackId=-1,n.decrypter=new Lt.a(r.observer,r.config),n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.onHandlerDestroyed=function(){this.state=Dt.STOPPED},t.prototype.clearVttFragQueues=function(){var e=this;this.vttFragQueues={},this.tracks.forEach(function(t){e.vttFragQueues[t.id]=[]})},t.prototype.nextFrag=function(){if(null===this.currentlyProcessing&&this.currentTrackId>-1&&this.vttFragQueues[this.currentTrackId].length){var e=this.currentlyProcessing=this.vttFragQueues[this.currentTrackId].shift();this.fragCurrent=e,this.hls.trigger(l.a.FRAG_LOADING,{frag:e}),this.state=Dt.FRAG_LOADING}},t.prototype.onSubtitleFragProcessed=function(e){e.success&&this.vttFragSNsProcessed[e.frag.trackId].push(e.frag.sn),this.currentlyProcessing=null,this.state=Dt.IDLE,this.nextFrag()},t.prototype.onMediaAttached=function(){this.state=Dt.IDLE},t.prototype.onError=function(e){var t=e.frag;t&&"subtitle"!==t.type||this.currentlyProcessing&&(this.currentlyProcessing=null,this.nextFrag())},t.prototype.doTick=function(){var e=this;switch(this.state){case Dt.IDLE:var t,r=this.tracks,n=this.currentTrackId,a=this.vttFragSNsProcessed[n],i=this.vttFragQueues[n],o=this.currentlyProcessing?this.currentlyProcessing.sn:-1;if(!r)break;if(n-1})(t)||t.sn===o||function(e){return i.some(function(t){return t.sn===e.sn})}(t)||(t.encrypted?(u.b.log("Loading key for "+t.sn),e.state=Dt.KEY_LOADING,e.hls.trigger(l.a.KEY_LOADING,{frag:t})):(t.trackId=n,i.push(t),e.nextFrag()))})}},t.prototype.onSubtitleTracksUpdated=function(e){var t=this;u.b.log("subtitle tracks updated"),this.tracks=e.subtitleTracks,this.clearVttFragQueues(),this.vttFragSNsProcessed={},this.tracks.forEach(function(e){t.vttFragSNsProcessed[e.id]=[]})},t.prototype.onSubtitleTrackSwitch=function(e){if(this.currentTrackId=e.id,this.tracks&&-1!==this.currentTrackId){var t=this.tracks[this.currentTrackId];t&&t.details&&this.tick()}},t.prototype.onSubtitleTrackLoaded=function(){this.tick()},t.prototype.onKeyLoaded=function(){this.state===Dt.KEY_LOADING&&(this.state=Dt.IDLE,this.tick())},t.prototype.onFragLoaded=function(e){var t=this.fragCurrent,r=e.frag.decryptdata,n=e.frag,a=this.hls;if(this.state===Dt.FRAG_LOADING&&t&&"subtitle"===e.frag.type&&t.sn===e.frag.sn&&e.payload.byteLength>0&&null!=r&&null!=r.key&&"AES-128"===r.method){var i=void 0;try{i=Pt.now()}catch(e){i=Date.now()}this.decrypter.decrypt(e.payload,r.key.buffer,r.iv.buffer,function(e){var t=void 0;try{t=Pt.now()}catch(e){t=Date.now()}a.trigger(l.a.FRAG_DECRYPTED,{frag:n,payload:e,stats:{tstart:i,tdecrypt:t}})})}},t}(ue),It=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=e.DefaultConfig;if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var a in n)a in r||(r[a]=n[a]);if(void 0!==r.liveMaxLatencyDurationCount&&r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==r.liveMaxLatencyDuration&&(r.liveMaxLatencyDuration<=r.liveSyncDuration||void 0===r.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');Object(u.a)(r.debug),this.config=r,this._autoLevelCapping=-1;var i=this.observer=new V.a;i.trigger=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:-1;u.b.log("startLoad("+e+")"),this.networkControllers.forEach(function(t){t.startLoad(e)})},e.prototype.stopLoad=function(){u.b.log("stopLoad"),this.networkControllers.forEach(function(e){e.stopLoad()})},e.prototype.swapAudioCodec=function(){u.b.log("swapAudioCodec"),this.streamController.swapAudioCodec()},e.prototype.recoverMediaError=function(){u.b.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)},Ut(e,[{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){u.b.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){u.b.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){u.b.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){u.b.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){u.b.log("set startLevel:"+e);-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){u.b.log("set autoLevelCapping:"+e),this._autoLevelCapping=e}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var e=this.levels,t=this.config.minAutoBitrate,r=e?e.length:0,n=0;nt)return n}return 0}},{key:"maxAutoLevel",get:function(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}}]),e}();t.default=Bt},function(e,t,r){function n(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw e};var n=r(r.s=ENTRY_MODULE);return n.default||n}var a="[\\.|\\-|\\+|\\w|/|@]+",i="\\((/\\*.*?\\*/)?s?.*?("+a+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e,t,n){var s={};s[n]=[];var l=t.toString(),u=l.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return s;for(var d,c=u[1],f=new RegExp("(\\\\n|\\W)"+o(c)+i,"g");d=f.exec(l);)"dll-reference"!==d[3]&&s[n].push(d[3]);for(f=new RegExp("\\("+o(c)+'\\("(dll-reference\\s('+a+'))"\\)\\)'+i,"g");d=f.exec(l);)e[d[2]]||(s[n].push(d[1]),e[d[2]]=r(d[1]).m),s[d[2]]=s[d[2]]||[],s[d[2]].push(d[4]);return s}function l(e){return Object.keys(e).reduce(function(t,r){return t||e[r].length>0},!1)}e.exports=function(e,t){t=t||{};var a={main:r.m},i=t.all?{main:Object.keys(a)}:function(e,t){for(var r={main:[t]},n={main:[]},a={main:{}};l(r);)for(var i=Object.keys(r),o=0;o1?r-1:0),a=1;a1?r-1:0),a=1;a1){var s=arguments[1];void 0!==s&&(o=s?Number(s):0)!=o&&(o=0)}var l=Math.min(Math.max(o,0),n)-i;if(l<0)return!1;for(var u=-1;++u0&&void 0!==arguments[0]?arguments[0]:{action:"play",source:""};return this.video.play(),{type:i,operation:e}},t.pause=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{action:"pause",source:""};return this.video.pause(),{type:i,operation:e}},t.togglePlay=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{action:"toggle-play",source:""};return this.video.togglePlay(),{type:i,operation:e}},t.seek=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{action:"seek",source:""};return this.video.seek(e),{type:i,operation:t}},t.forward=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{action:"forward-".concat(e),source:""};return this.video.forward(e),{type:i,operation:t}},t.replay=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{action:"replay-".concat(e),source:""};return this.video.replay(e),{type:i,operation:t}},t.changeRate=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{action:"change-rate",source:""};return this.video.playbackRate=e,{type:i,operation:t}},t.changeVolume=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{action:"change-volume",source:""},r=e;e<0&&(r=0);e>1&&(r=1);return this.video.volume=r,{type:i,operation:t}},t.mute=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{action:e?"muted":"unmuted",source:""};return this.video.muted=e,{type:i,operation:t}},t.toggleFullscreen=function(e){if(a.default.enabled)return a.default.isFullscreen?a.default.exit():a.default.request(this.rootElement),{type:i,operation:{action:"toggle-fullscreen",source:""}};return{type:o,isFullscreen:!e.isFullscreen}},t.USER_ACTIVATE=t.PLAYER_ACTIVATE=t.FULLSCREEN_CHANGE=t.OPERATE=void 0;var a=n(r("rzyQ")),i="video-react/OPERATE";t.OPERATE=i;var o="video-react/FULLSCREEN_CHANGE";t.FULLSCREEN_CHANGE=o;var s="video-react/PLAYER_ACTIVATE";t.PLAYER_ACTIVATE=s;var l="video-react/USER_ACTIVATE";t.USER_ACTIVATE=l},xFFL:function(e,t,r){"use strict";var n=r("284h"),a=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r("lwsE")),o=a(r("W8MJ")),s=a(r("a1gu")),l=a(r("Nsbk")),u=a(r("PJYZ")),d=a(r("7W2i")),c=a(r("17x9")),f=n(r("q1tI")),h=a(r("TSYQ")),p=a(r("kXlQ")),v=a(r("q+t5")),y=a(r("rsAN")),g=a(r("GuGs")),m=r("tJTW"),b={player:c.default.object,mouseTime:c.default.object,actions:c.default.object,className:c.default.string},E=function(e){function t(e,r){var n;return(0,i.default)(this,t),(n=(0,s.default)(this,(0,l.default)(t).call(this,e,r))).getPercent=n.getPercent.bind((0,u.default)(n)),n.getNewTime=n.getNewTime.bind((0,u.default)(n)),n.stepForward=n.stepForward.bind((0,u.default)(n)),n.stepBack=n.stepBack.bind((0,u.default)(n)),n.handleMouseDown=n.handleMouseDown.bind((0,u.default)(n)),n.handleMouseMove=n.handleMouseMove.bind((0,u.default)(n)),n.handleMouseUp=n.handleMouseUp.bind((0,u.default)(n)),n}return(0,d.default)(t,e),(0,o.default)(t,[{key:"componentDidMount",value:function(){}},{key:"componentDidUpdate",value:function(){}},{key:"getPercent",value:function(){var e=this.props.player,t=e.currentTime,r=e.seekingTime,n=e.duration,a=(r||t)/n;return a>=1?1:a}},{key:"getNewTime",value:function(e){var t=this.props.player.duration,r=this.slider.calculateDistance(e)*t;return r===t?r-.1:r}},{key:"handleMouseDown",value:function(){}},{key:"handleMouseUp",value:function(e){var t=this.props.actions,r=this.getNewTime(e);t.seek(r),t.handleEndSeeking(r)}},{key:"handleMouseMove",value:function(e){var t=this.props.actions,r=this.getNewTime(e);t.handleSeekingTime(r)}},{key:"stepForward",value:function(){this.props.actions.forward(5)}},{key:"stepBack",value:function(){this.props.actions.replay(5)}},{key:"render",value:function(){var e=this,t=this.props,r=t.player,n=r.currentTime,a=r.seekingTime,i=r.duration,o=r.buffered,s=t.mouseTime,l=a||n;return f.default.createElement(p.default,{ref:function(t){e.slider=t},label:"video progress bar",className:(0,h.default)("video-react-progress-holder",this.props.className),valuenow:(100*this.getPercent()).toFixed(2),valuetext:(0,m.formatTime)(l,i),onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,getPercent:this.getPercent,stepForward:this.stepForward,stepBack:this.stepBack},f.default.createElement(y.default,{buffered:o,currentTime:l,duration:i}),f.default.createElement(g.default,{duration:i,mouseTime:s}),f.default.createElement(v.default,{currentTime:l,duration:i}))}}]),t}(f.Component);t.default=E,E.propTypes=b,E.displayName="SeekBar"},yYHT:function(e,t,r){"use strict";var n=r("284h"),a=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r("lwsE")),o=a(r("W8MJ")),s=a(r("a1gu")),l=a(r("Nsbk")),u=a(r("PJYZ")),d=a(r("7W2i")),c=a(r("17x9")),f=n(r("q1tI")),h=a(r("TSYQ")),p=a(r("U3K2")),v={player:c.default.object,actions:c.default.object,className:c.default.string,offMenuText:c.default.string,showOffMenu:c.default.bool,kinds:c.default.array},y=function(e){function t(e,r){var n;return(0,i.default)(this,t),(n=(0,s.default)(this,(0,l.default)(t).call(this,e,r))).getTextTrackItems=n.getTextTrackItems.bind((0,u.default)(n)),n.updateState=n.updateState.bind((0,u.default)(n)),n.handleSelectItem=n.handleSelectItem.bind((0,u.default)(n)),n.state=n.getTextTrackItems(),n}return(0,d.default)(t,e),(0,o.default)(t,[{key:"componentDidUpdate",value:function(){this.updateState()}},{key:"getTextTrackItems",value:function(){var e=this.props,t=e.kinds,r=e.player,n=e.offMenuText,a=e.showOffMenu,i=r.textTracks,o=r.activeTextTrack,s={items:[],selectedIndex:0},l=Array.from(i||[]);return 0===l.length?s:(a&&s.items.push({label:n||"Off",value:null}),l.forEach(function(e){t.length&&!t.includes(e.kind)||s.items.push({label:e.label,value:e.language})}),s.selectedIndex=s.items.findIndex(function(e){return o&&o.language===e.value}),-1===s.selectedIndex&&(s.selectedIndex=0),s)}},{key:"updateState",value:function(){var e=this.getTextTrackItems();e.selectedIndex===this.state.selectedIndex&&this.textTrackItemsAreEqual(e.items,this.state.items)||this.setState(e)}},{key:"textTrackItemsAreEqual",value:function(e,t){if(e.length!==t.length)return!1;for(var r=0;r