aboutsummaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
Diffstat (limited to 'assets')
-rw-r--r--assets/clapprio/809981e5b09d5336c45d72d0869ada2a.swfbin63602 -> 0 bytes
-rw-r--r--assets/clapprio/8fa12a459188502b9f0d39b8a67d9e6c.swfbin0 -> 63532 bytes
-rw-r--r--assets/clapprio/audio-selector.min.js14
-rw-r--r--assets/clapprio/clappr-playback-rate-plugin.min.js.map1
-rw-r--r--assets/clapprio/clappr.js28946
-rw-r--r--assets/clapprio/clappr.min.js2
-rw-r--r--assets/clapprio/clappr.min.js.map1
-rw-r--r--assets/clapprio/dash-shaka-playback.js92
-rw-r--r--assets/clapprio/dash-shaka-playback.min.js2
-rw-r--r--assets/clapprio/level-selector.min.js6
10 files changed, 14792 insertions, 14272 deletions
diff --git a/assets/clapprio/809981e5b09d5336c45d72d0869ada2a.swf b/assets/clapprio/809981e5b09d5336c45d72d0869ada2a.swf
deleted file mode 100644
index 68619a7..0000000
--- a/assets/clapprio/809981e5b09d5336c45d72d0869ada2a.swf
+++ /dev/null
Binary files differ
diff --git a/assets/clapprio/8fa12a459188502b9f0d39b8a67d9e6c.swf b/assets/clapprio/8fa12a459188502b9f0d39b8a67d9e6c.swf
new file mode 100644
index 0000000..1c40719
--- /dev/null
+++ b/assets/clapprio/8fa12a459188502b9f0d39b8a67d9e6c.swf
Binary files differ
diff --git a/assets/clapprio/audio-selector.min.js b/assets/clapprio/audio-selector.min.js
index 6330076..9870f85 100644
--- a/assets/clapprio/audio-selector.min.js
+++ b/assets/clapprio/audio-selector.min.js
@@ -1,20 +1,20 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("Clappr")):"function"==typeof define&&define.amd?define(["Clappr"],e):"object"==typeof exports?exports.AudioSelector=e(require("Clappr")):t.AudioSelector=e(t.Clappr)}(this,function(t){return function(t){function e(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="<%=baseUrl%>/",e(0)}([/*!******************!*\
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Clappr")):"function"==typeof define&&define.amd?define(["Clappr"],t):"object"==typeof exports?exports.AudioSelector=t(require("Clappr")):e.AudioSelector=t(e.Clappr)}(this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="<%=baseUrl%>/",t(0)}([/*!******************!*\
!*** ./index.js ***!
\******************/
-function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=i(/*! ./src/main.js */1),t.exports=e.default},/*!*********************!*\
+function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=n(/*! ./src/main.js */1),e.exports=t.default},/*!*********************!*\
!*** ./src/main.js ***!
\*********************/
-function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=function(t,e,i){for(var o=!0;o;){var n=t,r=e,a=i;o=!1,null===n&&(n=Function.prototype);var s=Object.getOwnPropertyDescriptor(n,r);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(a)}var c=Object.getPrototypeOf(n);if(null===c)return;t=c,e=r,i=a,o=!0,s=c=void 0}},l=i(/*! Clappr */2),c=i(/*! ./public/audio-selector.html */3),u=o(c),d=i(/*! ./public/style.scss */4),h=o(d),f=function(t){function e(){n(this,e),s(Object.getPrototypeOf(e.prototype),"constructor",this).apply(this,arguments)}return r(e,t),a(e,[{key:"bindEvents",value:function(){this.listenTo(this.core,l.Events.CORE_READY,this.bindPlaybackEvents),this.listenTo(this.core.mediaControl,l.Events.MEDIACONTROL_CONTAINERCHANGED,this.reload),this.listenTo(this.core.mediaControl,l.Events.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.core.mediaControl,l.Events.MEDIACONTROL_HIDE,this.hideSelectLevelMenu)}},{key:"unBindEvents",value:function(){this.stopListening(this.core,l.Events.CORE_READY),this.stopListening(this.core.mediaControl,l.Events.MEDIACONTROL_CONTAINERCHANGED),this.stopListening(this.core.mediaControl,l.Events.MEDIACONTROL_RENDERED),this.stopListening(this.core.mediaControl,l.Events.MEDIACONTROL_HIDE),this.stopListening(this.core.getCurrentPlayback(),l.Events.PLAYBACK_BITRATE),this.stopListening(this.core.getCurrentPlayback(),l.Events.PLAYBACK_LEVELS_AVAILABLE),this.stopListening(this.core.getCurrentPlayback(),l.Events.PLAYBACK_LEVEL_SWITCH_START),this.stopListening(this.core.getCurrentPlayback(),l.Events.PLAYBACK_LEVEL_SWITCH_END)}},{key:"bindPlaybackEvents",value:function(){var t=this.core.getCurrentPlayback();this.listenTo(t,l.Events.PLAYBACK_BITRATE,this._handleAdaptation),this.listenTo(t,l.Events.PLAYBACK_LEVELS_AVAILABLE,this.fillLevels),this.listenTo(t,l.Events.PLAYBACK_LEVEL_SWITCH_START,this.startLevelSwitch),this.listenTo(t,l.Events.PLAYBACK_LEVEL_SWITCH_END,this.stopLevelSwitch)}},{key:"reload",value:function(){this.unBindEvents(),this.bindEvents(),this.bindPlaybackEvents()}},{key:"shouldRender",value:function(){if(!this.core.getCurrentContainer())return!1;var t=this.core.getCurrentPlayback();if(!t)return!1;var e=!!(this.tracks&&this.tracks.length>1);return e}},{key:"render",value:function(){if(this.shouldRender()){var t=l.Styler.getStyleFor(h.default,{baseUrl:this.core.options.baseUrl});this.$el.html(this.template({tracks:this.tracks,title:this._getTitle()})),this.$el.append(t),this.core.mediaControl.$(".media-control-right-panel").append(this.el),this._highlightCurrentElement()}return this}},{key:"_setAudioTrack",value:function(t){var e=player.core.getCurrentPlayback();this._startTrackSwitch(),this.nextId=t,e.selectTrack(this._getAudioTrack(t)),this.didSwitch||(e.selectTrack(this._getAudioTrack(t)),this.didSwitch=!0)}},{key:"_getAudioTrack",value:function(t){for(var e=0;e<this.tracks.length;e++){var i=this.tracks[e];if(i.id==t)return i}return null}},{key:"_getActiveTrack",value:function(t){for(var e=0;e<t.length;e++)if(t[e].active)return t[e];return null}},{key:"fillLevels",value:function(){var t=player.core.getCurrentPlayback();this.tracks=t.audioTracks,void 0===this.trackId&&(this.trackId=this._getActiveTrack(this.tracks).id),this._setLabels(),this.render()}},{key:"_setLabels",value:function(){this.tracks.forEach(function(t){t.label=t.language})}},{key:"handleTrackSelect",value:function(t){t.preventDefault(),t.stopPropagation();var e=parseInt(t.target.dataset.audioSelectorSelect,10);return this.trackId!=e&&(this._setAudioTrack(e),this._toggleContextMenu(),!1)}},{key:"handleAudioSelectorClick",value:function(t){this._toggleContextMenu()}},{key:"_toggleContextMenu",value:function(){this.$(".audio_selector ul").toggle()}},{key:"hideSelectLevelMenu",value:function(){this.$(".audio_selector ul").hide()}},{key:"_getButtonElement",value:function(){return this.$(".audio_selector button")}},{key:"_getTrackElement",value:function(){var t=arguments.length<=0||void 0===arguments[0]?null:arguments[0];return t?this.$('.audio_selector a[data-audio-selector-select="'+t+'"]'):this.$(".audio_selector a")}},{key:"_getTitle",value:function(){return(this.core.options.levelSelectorConfig||{}).title}},{key:"_startTrackSwitch",value:function(){this._getButtonElement().addClass("changing")}},{key:"_stopTrackSwitch",value:function(){this._getButtonElement().removeClass("changing")}},{key:"_updateText",value:function(t){var e=this._getAudioTrack(t);this._getButtonElement().text(e.label)}},{key:"_handleAdaptation",value:function(){if(this.nextId){this.fillLevels();var t=this._getActiveTrack(this.tracks);t.id==this.nextId&&(this.trackId=this.nextId,this.nextId=null,this._stopTrackSwitch(),this._highlightCurrentElement())}}},{key:"_highlightCurrentElement",value:function(){this.trackId&&(this._getTrackElement().removeClass("current"),this._getTrackElement(this.trackId).addClass("current"),this._updateText(this.trackId))}},{key:"name",get:function(){return"audio_selector"}},{key:"template",get:function(){return(0,l.template)(u.default)}},{key:"attributes",get:function(){return{class:this.name,"data-audio-selector":""}}},{key:"events",get:function(){return{"click [data-audio-selector-select]":"handleTrackSelect","click [data-audio-selector-button]":"handleAudioSelectorClick"}}}],[{key:"version",get:function(){return VERSION}}]),e}(l.UICorePlugin);e.default=f,t.exports=e.default},/*!*************************!*\
+function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=function(e,t,n){for(var o=!0;o;){var i=e,a=t,r=n;o=!1,null===i&&(i=Function.prototype);var l=Object.getOwnPropertyDescriptor(i,a);if(void 0!==l){if("value"in l)return l.value;var s=l.get;if(void 0===s)return;return s.call(r)}var u=Object.getPrototypeOf(i);if(null===u)return;e=u,t=a,n=r,o=!0,l=u=void 0}},s=n(/*! Clappr */2),u=n(/*! ./public/audio-selector.html */3),c=o(u),d=n(/*! ./public/style.scss */4),h=o(d),g=function(e){function t(){i(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return a(t,e),r(t,[{key:"bindEvents",value:function(){this.listenTo(this.core,s.Events.CORE_READY,this.bindPlaybackEvents),this.listenTo(this.core.mediaControl,s.Events.MEDIACONTROL_CONTAINERCHANGED,this.reload),this.listenTo(this.core.mediaControl,s.Events.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.core.mediaControl,s.Events.MEDIACONTROL_HIDE,this._hideSelectLevelMenu)}},{key:"unBindEvents",value:function(){this.stopListening(this.core,s.Events.CORE_READY),this.stopListening(this.core.mediaControl,s.Events.MEDIACONTROL_CONTAINERCHANGED),this.stopListening(this.core.mediaControl,s.Events.MEDIACONTROL_RENDERED),this.stopListening(this.core.mediaControl,s.Events.MEDIACONTROL_HIDE),this.stopListening(this.core.getCurrentPlayback(),s.Events.PLAYBACK_BITRATE),this.stopListening(this.core.getCurrentPlayback(),s.Events.PLAYBACK_LEVELS_AVAILABLE),this.stopListening(this.core.getCurrentPlayback(),s.Events.PLAYBACK_LEVEL_SWITCH_START),this.stopListening(this.core.getCurrentPlayback(),s.Events.PLAYBACK_LEVEL_SWITCH_END)}},{key:"bindPlaybackEvents",value:function(){var e=this.core.getCurrentPlayback();this.listenTo(e,s.Events.PLAYBACK_LEVELS_AVAILABLE,this.fillLevels),this.listenTo(e,s.Events.PLAYBACK_LEVEL_SWITCH_START,this.startLevelSwitch),this.listenTo(e,s.Events.PLAYBACK_LEVEL_SWITCH_END,this.stopLevelSwitch),this.listenTo(e,s.Events.PLAYBACK_BITRATE,this.handleAdaptation)}},{key:"reload",value:function(){this.unBindEvents(),this.bindEvents(),this.bindPlaybackEvents()}},{key:"shouldRender",value:function(){if(!this.core.getCurrentContainer())return!1;var e=this.core.getCurrentPlayback();if(!e)return!1;var t=!!(this.languages&&this.languages.length>1);return t}},{key:"render",value:function(){if(this.shouldRender()){var e=s.Styler.getStyleFor(h.default,{baseUrl:this.core.options.baseUrl});this.$el.html(this.template({title:this._getTitle(),languages:this.languages})),this.$el.append(e),this.core.mediaControl.$(".media-control-right-panel").append(this.el),this._highlightCurrentElement()}return this}},{key:"_setLanguage",value:function(e){var t=this.core.getCurrentPlayback();this._startTrackSwitch(),t.selectAudioLanguage(e)}},{key:"_getAudioTrack",value:function(e){for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(n.id==e)return n}return null}},{key:"fillLevels",value:function(){var e=this.core.getCurrentPlayback();this.languages=e.audioLanguages,this.activeLanguage=this.languages[0],this.render()}},{key:"handleLanguageSelect",value:function(e){e.preventDefault(),e.stopPropagation();var t=e.target.dataset.audioSelectorLang;return this.activeLanguage!=t&&(this._setLanguage(t),this._toggleContextMenu(),!1)}},{key:"handleAdaptation",value:function(e){this.fillLevels(),this.activeLanguage=e.language,this._stopTrackSwitch(),this._highlightCurrentElement()}},{key:"handleAudioSelectorClick",value:function(e){this._toggleContextMenu()}},{key:"_toggleContextMenu",value:function(){this.$(".audio_selector ul").toggle()}},{key:"_hideSelectLevelMenu",value:function(){this.$(".audio_selector ul").hide()}},{key:"_getLanguageElement",value:function(){var e=arguments.length<=0||void 0===arguments[0]?null:arguments[0];return e?this.$('.audio_selector a[data-audio-selector-lang="'+e+'"]'):this.$(".audio_selector a")}},{key:"_getButtonElement",value:function(){return this.$(".audio_selector button")}},{key:"_getTitle",value:function(){return(this.core.options.levelSelectorConfig||{}).title}},{key:"_startTrackSwitch",value:function(){this._getButtonElement().addClass("changing")}},{key:"_stopTrackSwitch",value:function(){this._getButtonElement().removeClass("changing")}},{key:"_highlightCurrentElement",value:function(){this.activeLanguage&&(this._getLanguageElement().removeClass("current"),this._getLanguageElement(this.activeLanguage).addClass("current"),this._getButtonElement().text(this.activeLanguage))}},{key:"name",get:function(){return"audio_selector"}},{key:"template",get:function(){return(0,s.template)(c.default)}},{key:"attributes",get:function(){return{class:this.name,"data-audio-selector":""}}},{key:"events",get:function(){return{"click [data-audio-selector-lang]":"handleLanguageSelect","click [data-audio-selector-button]":"handleAudioSelectorClick"}}}],[{key:"version",get:function(){return VERSION}}]),t}(s.UICorePlugin);t.default=g,e.exports=t.default},/*!*************************!*\
!*** external "Clappr" ***!
\*************************/
-function(e,i){e.exports=t},/*!****************************************!*\
+function(t,n){t.exports=e},/*!****************************************!*\
!*** ./src/public/audio-selector.html ***!
\****************************************/
-function(t,e){t.exports='<button data-audio-selector-button>\n Auto\n</button>\n<ul>\n <% if (title) { %>\n <li data-title><%= title %></li>\n <% }; %>\n <% for (var i = 0; i < tracks.length; i++) { %>\n <li><a href="#" data-audio-selector-select="<%= tracks[i].id %>"><%= tracks[i].label %></a></li>\n <% }; %>\n</ul>\n'},/*!*******************************!*\
+function(e,t){e.exports='<button data-audio-selector-button>\n Language\n</button>\n<ul>\n <% if (title) { %>\n <li data-title><%= title %></li>\n <% }; %>\n <% for (var i = 0; i < languages.length; i++) { %>\n <li><a href="#" data-audio-selector-lang="<%= languages[i] %>"><%= languages[i] %></a></li>\n <% }; %>\n</ul>\n'},/*!*******************************!*\
!*** ./src/public/style.scss ***!
\*******************************/
-function(t,e,i){e=t.exports=i(/*! ./../../~/css-loader/lib/css-base.js */5)(),e.push([t.id,".audio_selector[data-audio-selector]{float:right;margin-top:7px;position:relative}.audio_selector[data-audio-selector] button{background-color:transparent;color:#fff;font-family:Roboto,Open Sans,Arial,sans-serif;-webkit-font-smoothing:antialiased;border:none;font-size:12px}.audio_selector[data-audio-selector] button:hover{color:#c9c9c9}.audio_selector[data-audio-selector] button.changing{-webkit-animation:pulse .5s infinite alternate}.audio_selector[data-audio-selector]>ul{list-style-type:none;position:absolute;bottom:25px;border:1px solid #000;display:none;background-color:#e6e6e6}.audio_selector[data-audio-selector] li{font-size:12px}.audio_selector[data-audio-selector] li[data-title]{background-color:#c3c2c2;padding:5px}.audio_selector[data-audio-selector] li a{color:#444;padding:2px 12px;display:block;text-decoration:none}.audio_selector[data-audio-selector] li a:hover{background-color:#555;color:#fff}.audio_selector[data-audio-selector] li a:hover a{color:#fff;text-decoration:none}.audio_selector[data-audio-selector] li.current a{color:red}@-webkit-keyframes pulse{0%{color:#fff}50%{color:#ff0101}to{color:#b80000}}",""])},/*!**************************************!*\
+function(e,t,n){t=e.exports=n(/*! ./../../~/css-loader/lib/css-base.js */5)(),t.push([e.id,".audio_selector[data-audio-selector]{float:right;margin-top:7px;position:relative}.audio_selector[data-audio-selector] button{background-color:transparent;color:#fff;font-family:Roboto,Open Sans,Arial,sans-serif;-webkit-font-smoothing:antialiased;border:none;font-size:12px}.audio_selector[data-audio-selector] button:hover{color:#c9c9c9}.audio_selector[data-audio-selector] button.changing{-webkit-animation:pulse .5s infinite alternate}.audio_selector[data-audio-selector]>ul{list-style-type:none;position:absolute;bottom:25px;border:1px solid #000;display:none;background-color:#e6e6e6}.audio_selector[data-audio-selector] li{font-size:12px}.audio_selector[data-audio-selector] li[data-title]{background-color:#c3c2c2;padding:5px}.audio_selector[data-audio-selector] li a{color:#444;padding:2px 12px;display:block;text-decoration:none}.audio_selector[data-audio-selector] li a:hover{background-color:#555;color:#fff}.audio_selector[data-audio-selector] li a:hover a{color:#fff;text-decoration:none}.audio_selector[data-audio-selector] li.current a{color:red}@-webkit-keyframes pulse{0%{color:#fff}50%{color:#ff0101}to{color:#b80000}}",""])},/*!**************************************!*\
!*** ./~/css-loader/lib/css-base.js ***!
\**************************************/
-function(t,e){"use strict";t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var i=this[e];i[2]?t.push("@media "+i[2]+"{"+i[1]+"}"):t.push(i[1])}return t.join("")},t.i=function(e,i){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},n=0;n<this.length;n++){var r=this[n][0];"number"==typeof r&&(o[r]=!0)}for(n=0;n<e.length;n++){var a=e[n];"number"==typeof a[0]&&o[a[0]]||(i&&!a[2]?a[2]=i:i&&(a[2]="("+a[2]+") and ("+i+")"),t.push(a))}},t}}])});
+function(e,t){"use strict";e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];n[2]?e.push("@media "+n[2]+"{"+n[1]+"}"):e.push(n[1])}return e.join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},i=0;i<this.length;i++){var a=this[i][0];"number"==typeof a&&(o[a]=!0)}for(i=0;i<t.length;i++){var r=t[i];"number"==typeof r[0]&&o[r[0]]||(n&&!r[2]?r[2]=n:n&&(r[2]="("+r[2]+") and ("+n+")"),e.push(r))}},e}}])});
//# sourceMappingURL=audio-selector.min.js.map \ No newline at end of file
diff --git a/assets/clapprio/clappr-playback-rate-plugin.min.js.map b/assets/clapprio/clappr-playback-rate-plugin.min.js.map
deleted file mode 100644
index 7251266..0000000
--- a/assets/clapprio/clappr-playback-rate-plugin.min.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///clappr-playback-rate-plugin.min.js","webpack:///webpack/bootstrap 9b75d8829f070623baa9","webpack:///./src/main.js","webpack:///external \"Clappr\"","webpack:///./src/public/playback-rate-selector.html","webpack:///./src/public/style.scss","webpack:///./~/css-loader/lib/css-base.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_1__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","_classCallCheck","instance","Constructor","TypeError","_inherits","subClass","superClass","prototype","Object","create","constructor","value","enumerable","writable","configurable","setPrototypeOf","__proto__","defineProperty","_createClass","defineProperties","target","props","i","length","descriptor","key","protoProps","staticProps","_get","_x","_x2","_x3","_again","object","property","receiver","Function","desc","getOwnPropertyDescriptor","undefined","getter","get","parent","getPrototypeOf","_clappr","_publicPlaybackRateSelectorHtml","_publicPlaybackRateSelectorHtml2","_publicStyleScss","_publicStyleScss2","DEFAULT_PLAYBACK_RATES","label","DEFAULT_PLAYBACK_RATE","PlaybackRatePlugin","_UICorePlugin","apply","arguments","listenTo","core","mediaControl","Events","MEDIACONTROL_CONTAINERCHANGED","reload","MEDIACONTROL_RENDERED","render","MEDIACONTROL_HIDE","hideContextMenu","MEDIACONTROL_PLAYBACKRATE","updatePlaybackRate","stopListening","unBindEvents","bindEvents","getCurrentContainer","currentPlayback","getCurrentPlayback","tagName","cfg","options","playbackRateConfig","playbackRates","selectedRate","defaultValue","shouldRender","t","template","html","title","getTitle","$el","style","Styler","getStyleFor","baseUrl","append","$","el","updateText","event","rate","dataset","playbackRateSelect","setSelectedRate","toggleContextMenu","stopPropagation","toggle","hide","find","playbackRate","rateValue","removeClass","addClass","_this","forEach","r","buttonElement","text","setActiveListItem","class","name","data-playback-rate-select","click [data-playback-rate-select]","click [data-playback-rate-button]","UICorePlugin","type","push","list","toString","result","item","join","mediaQuery","alreadyImportedModules"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,WACA,kBAAAC,gBAAAC,IACAD,QAAA,UAAAJ,GACA,gBAAAC,SACAA,QAAA,mBAAAD,EAAAG,QAAA,WAEAJ,EAAA,mBAAAC,EAAAD,EAAA,SACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAT,WACAW,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAZ,EAAAD,QAAAC,IAAAD,QAAAQ,GAGAP,EAAAW,QAAA,EAGAX,EAAAD,QAvBA,GAAAU,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,gBAGAR,EAAA;;;ADmBM,SAASP,EAAQD,EAASQ,GAE/B,YAAmqC,SAASS,GAAuBC,GAAK,MAAOA,IAAOA,EAAIC,WAAWD,GAAKE,UAAUF,GAAM,QAASG,GAAgBC,EAASC,GA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IAAK,CACpC,GAAIyG,GAAO/I,KAAKsC,EACbyG,GAAK,GACPD,EAAOH,KAAK,UAAYI,EAAK,GAAK,IAAMA,EAAK,GAAK,KAElDD,EAAOH,KAAKI,EAAK,IAGnB,MAAOD,GAAOE,KAAK,KAIpBJ,EAAKtG,EAAI,SAASpC,EAAS+I,GACJ,gBAAZ/I,KACTA,IAAY,KAAMA,EAAS,KAE5B,KAAI,GADAgJ,MACI5G,EAAI,EAAGA,EAAItC,KAAKuC,OAAQD,IAAK,CACpC,GAAIhC,GAAKN,KAAKsC,GAAG,EACA,iBAAPhC,KACT4I,EAAuB5I,IAAM,GAE/B,IAAIgC,EAAI,EAAGA,EAAIpC,EAAQqC,OAAQD,IAAK,CACnC,GAAIyG,GAAO7I,EAAQoC,EAKG,iBAAZyG,GAAK,IAAoBG,EAAuBH,EAAK,MAC3DE,IAAeF,EAAK,GACtBA,EAAK,GAAKE,EACDA,IACTF,EAAK,GAAK,IAAMA,EAAK,GAAK,UAAYE,EAAa,KAEpDL,EAAKD,KAAKI,MAINH","file":"clappr-playback-rate-plugin.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"Clappr\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"Clappr\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaybackRatePlugin\"] = factory(require(\"Clappr\"));\n\telse\n\t\troot[\"PlaybackRatePlugin\"] = factory(root[\"Clappr\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"Clappr\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"Clappr\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaybackRatePlugin\"] = factory(require(\"Clappr\"));\n\telse\n\t\troot[\"PlaybackRatePlugin\"] = factory(root[\"Clappr\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"<%=baseUrl%>/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/*!*********************!*\\\n !*** ./src/main.js ***!\n \\*********************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if('value' in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();var _get=function get(_x,_x2,_x3){var _again=true;_function: while(_again) {var object=_x,property=_x2,receiver=_x3;_again = false;if(object === null)object = Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc === undefined){var parent=Object.getPrototypeOf(object);if(parent === null){return undefined;}else {_x = parent;_x2 = property;_x3 = receiver;_again = true;desc = parent = undefined;continue _function;}}else if('value' in desc){return desc.value;}else {var getter=desc.get;if(getter === undefined){return undefined;}return getter.call(receiver);}}};function _interopRequireDefault(obj){return obj && obj.__esModule?obj:{'default':obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}}function _inherits(subClass,superClass){if(typeof superClass !== 'function' && superClass !== null){throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__ = superClass;}var _clappr=__webpack_require__(/*! clappr */ 1);var _publicPlaybackRateSelectorHtml=__webpack_require__(/*! ./public/playback-rate-selector.html */ 2);var _publicPlaybackRateSelectorHtml2=_interopRequireDefault(_publicPlaybackRateSelectorHtml);var _publicStyleScss=__webpack_require__(/*! ./public/style.scss */ 3);var _publicStyleScss2=_interopRequireDefault(_publicStyleScss);var DEFAULT_PLAYBACK_RATES=[{value:'0.5',label:'0.5x'},{value:'0.75',label:'0.75x'},{value:'1.0',label:'Normal'},{value:'1.5',label:'1.5x'},{value:'2.0',label:'2x'}];var DEFAULT_PLAYBACK_RATE='1.0';var PlaybackRatePlugin=(function(_UICorePlugin){_inherits(PlaybackRatePlugin,_UICorePlugin);function PlaybackRatePlugin(){_classCallCheck(this,PlaybackRatePlugin);_get(Object.getPrototypeOf(PlaybackRatePlugin.prototype),'constructor',this).apply(this,arguments);}_createClass(PlaybackRatePlugin,[{key:'bindEvents',value:function bindEvents(){this.listenTo(this.core.mediaControl,_clappr.Events.MEDIACONTROL_CONTAINERCHANGED,this.reload);this.listenTo(this.core.mediaControl,_clappr.Events.MEDIACONTROL_RENDERED,this.render);this.listenTo(this.core.mediaControl,_clappr.Events.MEDIACONTROL_HIDE,this.hideContextMenu);this.listenTo(this.core.mediaControl,PlaybackRatePlugin.MEDIACONTROL_PLAYBACKRATE,this.updatePlaybackRate);}},{key:'unBindEvents',value:function unBindEvents(){this.stopListening(this.core.mediaControl,_clappr.Events.MEDIACONTROL_CONTAINERCHANGED);this.stopListening(this.core.mediaControl,_clappr.Events.MEDIACONTROL_RENDERED);this.stopListening(this.core.mediaControl,_clappr.Events.MEDIACONTROL_HIDE);}},{key:'reload',value:function reload(){this.unBindEvents();this.bindEvents();}},{key:'shouldRender',value:function shouldRender(){if(!this.core.getCurrentContainer()){return false;}var currentPlayback=this.core.getCurrentPlayback();if(currentPlayback.tagName != 'video' && currentPlayback.tagName != 'audio'){ //console.warn('PlaybackRatePlugin#shouldRender: Cannot affect rate for playback', currentPlayback);\n\treturn false;}return true;}},{key:'render',value:function render(){ //console.log('PlaybackRatePlugin#render()');\n\tvar cfg=this.core.options.playbackRateConfig || {};if(!this.playbackRates){this.playbackRates = cfg.options || DEFAULT_PLAYBACK_RATES;}if(!this.selectedRate){this.selectedRate = cfg.defaultValue || DEFAULT_PLAYBACK_RATE;}if(this.shouldRender()){var t=(0,_clappr.template)(_publicPlaybackRateSelectorHtml2['default']);var html=t({playbackRates:this.playbackRates,title:this.getTitle()});this.$el.html(html);var style=_clappr.Styler.getStyleFor(_publicStyleScss2['default'],{baseUrl:this.core.options.baseUrl});this.$el.append(style);this.core.mediaControl.$('.media-control-right-panel').append(this.el);this.updateText();}return this;}},{key:'onRateSelect',value:function onRateSelect(event){ //console.log('onRateSelect', event.target);\n\tvar rate=event.target.dataset.playbackRateSelect;this.setSelectedRate(rate);this.toggleContextMenu();event.stopPropagation();return false;}},{key:'onShowMenu',value:function onShowMenu(event){this.toggleContextMenu();}},{key:'toggleContextMenu',value:function toggleContextMenu(){this.$('.playback_rate ul').toggle();}},{key:'hideContextMenu',value:function hideContextMenu(){this.$('.playback_rate ul').hide();}},{key:'updatePlaybackRate',value:function updatePlaybackRate(rate){this.setSelectedRate(rate);}},{key:'setSelectedRate',value:function setSelectedRate(rate){ // Set <video playbackRate=\"...\"\n\tthis.core.$el.find('video').get(0).playbackRate = rate;this.selectedRate = rate;this.updateText();}},{key:'setActiveListItem',value:function setActiveListItem(rateValue){this.$('a').removeClass('active');this.$('a[data-playback-rate-select=\"' + rateValue + '\"]').addClass('active');}},{key:'buttonElement',value:function buttonElement(){return this.$('.playback_rate button');}},{key:'getTitle',value:function getTitle(){var _this=this;var title=this.selectedRate;this.playbackRates.forEach(function(r){if(r.value == _this.selectedRate){title = r.label;}});return title;}},{key:'updateText',value:function updateText(){this.buttonElement().text(this.getTitle());this.setActiveListItem(this.selectedRate);}},{key:'name',get:function get(){return 'playback_rate';}},{key:'template',get:function get(){return (0,_clappr.template)(_publicPlaybackRateSelectorHtml2['default']);}},{key:'attributes',get:function get(){return {'class':this.name,'data-playback-rate-select':''};}},{key:'events',get:function get(){return {'click [data-playback-rate-select]':'onRateSelect','click [data-playback-rate-button]':'onShowMenu'};}}]);return PlaybackRatePlugin;})(_clappr.UICorePlugin);exports['default'] = PlaybackRatePlugin;PlaybackRatePlugin.type = 'core';PlaybackRatePlugin.MEDIACONTROL_PLAYBACKRATE = 'playbackRate';module.exports = exports['default'];\n\n/***/ },\n/* 1 */\n/*!*************************!*\\\n !*** external \"Clappr\" ***!\n \\*************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ },\n/* 2 */\n/*!************************************************!*\\\n !*** ./src/public/playback-rate-selector.html ***!\n \\************************************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<button data-playback-rate-button>\\n <%= title %>\\n</button>\\n<ul>\\n <% for (var i = 0; i < playbackRates.length; i++) { %>\\n <li><a href=\\\"#\\\" data-playback-rate-select=\\\"<%= playbackRates[i].value %>\\\"><%= playbackRates[i].label %></a></li>\\n <% }; %>\\n</ul>\\n\";\n\n/***/ },\n/* 3 */\n/*!*******************************!*\\\n !*** ./src/public/style.scss ***!\n \\*******************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../~/css-loader/lib/css-base.js */ 4)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \".playback_rate[data-playback-rate-select]{float:right;margin-top:5px;position:relative}.playback_rate[data-playback-rate-select] button{background-color:transparent;color:#fff;font-family:Roboto,Open Sans,Arial,sans-serif;-webkit-font-smoothing:antialiased;border:none;font-size:10px;cursor:pointer}.playback_rate[data-playback-rate-select] button:hover{color:#c9c9c9}.playback_rate[data-playback-rate-select] button.changing{-webkit-animation:pulse .5s infinite alternate}.playback_rate[data-playback-rate-select]>ul{display:none;list-style-type:none;position:absolute;bottom:25px;border:1px solid #000;border-radius:4px;background-color:rgba(0,0,0,.7)}.playback_rate[data-playback-rate-select] li{position:relative;font-size:10px}.playback_rate[data-playback-rate-select] li[data-title]{padding:5px}.playback_rate[data-playback-rate-select] li a{color:#aaa;padding:2px 10px 2px 15px;display:block;text-decoration:none}.playback_rate[data-playback-rate-select] li a.active{background-color:#000;font-weight:700;color:#fff}.playback_rate[data-playback-rate-select] li a.active:before{content:'\\\\2713';position:absolute;top:2px;left:4px}.playback_rate[data-playback-rate-select] li a:hover{color:#fff;text-decoration:none}@-webkit-keyframes pulse{0%{color:#fff}50%{color:#ff0101}to{color:#b80000}}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 4 */\n/*!**************************************!*\\\n !*** ./~/css-loader/lib/css-base.js ***!\n \\**************************************/\n/***/ function(module, exports) {\n\n\t/*\r\n\t\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\t\tAuthor Tobias Koppers @sokra\r\n\t*/ // css base code, injected by the css-loader\n\t\"use strict\";module.exports = function(){var list=[]; // return the list of modules as css string\n\tlist.toString = function toString(){var result=[];for(var i=0;i < this.length;i++) {var item=this[i];if(item[2]){result.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");}else {result.push(item[1]);}}return result.join(\"\");}; // import a list of modules into the list\n\tlist.i = function(modules,mediaQuery){if(typeof modules === \"string\")modules = [[null,modules,\"\"]];var alreadyImportedModules={};for(var i=0;i < this.length;i++) {var id=this[i][0];if(typeof id === \"number\")alreadyImportedModules[id] = true;}for(i = 0;i < modules.length;i++) {var item=modules[i]; // skip already imported module\n\t// this implementation is not 100% perfect for weird media query combinations\n\t// when a module is imported multiple times with different media queries.\n\t// I hope this will never occur (Hey this way we have smaller bundles)\n\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]){if(mediaQuery && !item[2]){item[2] = mediaQuery;}else if(mediaQuery){item[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";}list.push(item);}}};return list;};\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** clappr-playback-rate-plugin.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"<%=baseUrl%>/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 9b75d8829f070623baa9\n **/","import {Events, Styler, UICorePlugin, template} from 'clappr'\nimport pluginHtml from './public/playback-rate-selector.html'\nimport pluginStyle from './public/style.scss'\n\n\nconst DEFAULT_PLAYBACK_RATES = [\n {value: '0.5', label: '0.5x'},\n {value: '0.75', label: '0.75x'},\n {value: '1.0', label: 'Normal'},\n {value: '1.5', label: '1.5x'},\n {value: '2.0', label: '2x'}\n];\n\nconst DEFAULT_PLAYBACK_RATE = '1.0';\n\n\nexport default class PlaybackRatePlugin extends UICorePlugin {\n\n get name() { return 'playback_rate'; }\n get template() { return template(pluginHtml); }\n\n get attributes() {\n return {\n 'class': this.name,\n 'data-playback-rate-select': ''\n }\n }\n\n get events() {\n return {\n 'click [data-playback-rate-select]': 'onRateSelect',\n 'click [data-playback-rate-button]': 'onShowMenu'\n }\n }\n\n bindEvents() {\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.reload);\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.render);\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_HIDE, this.hideContextMenu);\n this.listenTo(this.core.mediaControl, PlaybackRatePlugin.MEDIACONTROL_PLAYBACKRATE, this.updatePlaybackRate);\n }\n\n unBindEvents() {\n this.stopListening(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED);\n this.stopListening(this.core.mediaControl, Events.MEDIACONTROL_RENDERED);\n this.stopListening(this.core.mediaControl, Events.MEDIACONTROL_HIDE);\n }\n\n reload() {\n this.unBindEvents();\n this.bindEvents();\n }\n\n shouldRender() {\n if (!this.core.getCurrentContainer()) {\n return false;\n }\n\n var currentPlayback = this.core.getCurrentPlayback();\n if (currentPlayback.tagName != 'video' && currentPlayback.tagName != 'audio') {\n //console.warn('PlaybackRatePlugin#shouldRender: Cannot affect rate for playback', currentPlayback);\n return false;\n }\n\n return true;\n }\n\n render() {\n //console.log('PlaybackRatePlugin#render()');\n const cfg = this.core.options.playbackRateConfig || {};\n\n if (!this.playbackRates) {\n this.playbackRates = cfg.options || DEFAULT_PLAYBACK_RATES;\n }\n\n if (!this.selectedRate) {\n this.selectedRate = cfg.defaultValue || DEFAULT_PLAYBACK_RATE;\n }\n\n if (this.shouldRender()) {\n var t = template(pluginHtml);\n var html = t({playbackRates: this.playbackRates, title: this.getTitle()});\n this.$el.html(html);\n\n var style = Styler.getStyleFor(pluginStyle, {baseUrl: this.core.options.baseUrl});\n this.$el.append(style);\n\n this.core.mediaControl.$('.media-control-right-panel').append(this.el);\n this.updateText();\n }\n\n return this;\n }\n\n onRateSelect(event) {\n //console.log('onRateSelect', event.target);\n let rate = event.target.dataset.playbackRateSelect;\n this.setSelectedRate(rate);\n this.toggleContextMenu();\n event.stopPropagation();\n return false;\n }\n\n onShowMenu(event) {\n this.toggleContextMenu();\n }\n\n toggleContextMenu() {\n this.$('.playback_rate ul').toggle();\n }\n\n hideContextMenu() {\n this.$('.playback_rate ul').hide();\n }\n\n updatePlaybackRate(rate) {\n this.setSelectedRate(rate);\n }\n\n setSelectedRate(rate) {\n // Set <video playbackRate=\"...\"\n this.core.$el.find('video').get(0).playbackRate = rate;\n this.selectedRate = rate;\n this.updateText();\n }\n\n setActiveListItem(rateValue) {\n this.$(`a`).removeClass('active');\n this.$(`a[data-playback-rate-select=\"${rateValue}\"]`).addClass('active');\n }\n\n buttonElement() {\n return this.$('.playback_rate button');\n }\n\n getTitle() {\n let title = this.selectedRate;\n this.playbackRates.forEach((r) => {\n if (r.value == this.selectedRate) {\n title = r.label;\n }\n });\n return title;\n }\n\n updateText() {\n this.buttonElement().text(this.getTitle());\n this.setActiveListItem(this.selectedRate);\n }\n}\n\nPlaybackRatePlugin.type = 'core';\nPlaybackRatePlugin.MEDIACONTROL_PLAYBACKRATE = 'playbackRate';\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"Clappr\"\n ** module id = 1\n ** module chunks = 0\n **/","module.exports = \"<button data-playback-rate-button>\\n <%= title %>\\n</button>\\n<ul>\\n <% for (var i = 0; i < playbackRates.length; i++) { %>\\n <li><a href=\\\"#\\\" data-playback-rate-select=\\\"<%= playbackRates[i].value %>\\\"><%= playbackRates[i].label %></a></li>\\n <% }; %>\\n</ul>\\n\";\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/public/playback-rate-selector.html\n ** module id = 2\n ** module chunks = 0\n **/","exports = module.exports = require(\"./../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".playback_rate[data-playback-rate-select]{float:right;margin-top:5px;position:relative}.playback_rate[data-playback-rate-select] button{background-color:transparent;color:#fff;font-family:Roboto,Open Sans,Arial,sans-serif;-webkit-font-smoothing:antialiased;border:none;font-size:10px;cursor:pointer}.playback_rate[data-playback-rate-select] button:hover{color:#c9c9c9}.playback_rate[data-playback-rate-select] button.changing{-webkit-animation:pulse .5s infinite alternate}.playback_rate[data-playback-rate-select]>ul{display:none;list-style-type:none;position:absolute;bottom:25px;border:1px solid #000;border-radius:4px;background-color:rgba(0,0,0,.7)}.playback_rate[data-playback-rate-select] li{position:relative;font-size:10px}.playback_rate[data-playback-rate-select] li[data-title]{padding:5px}.playback_rate[data-playback-rate-select] li a{color:#aaa;padding:2px 10px 2px 15px;display:block;text-decoration:none}.playback_rate[data-playback-rate-select] li a.active{background-color:#000;font-weight:700;color:#fff}.playback_rate[data-playback-rate-select] li a.active:before{content:'\\\\2713';position:absolute;top:2px;left:4px}.playback_rate[data-playback-rate-select] li a:hover{color:#fff;text-decoration:none}@-webkit-keyframes pulse{0%{color:#fff}50%{color:#ff0101}to{color:#b80000}}\", \"\"]);\n\n// exports\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/public/style.scss\n ** module id = 3\n ** module chunks = 0\n **/","/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./~/css-loader/lib/css-base.js\n **/"],"sourceRoot":""} \ No newline at end of file
diff --git a/assets/clapprio/clappr.js b/assets/clapprio/clappr.js
index 1b7d42f..954893a 100644
--- a/assets/clapprio/clappr.js
+++ b/assets/clapprio/clappr.js
@@ -67,10 +67,10 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "<%=baseUrl%>/";
+/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 87);
+/******/ return __webpack_require__(__webpack_require__.s = 88);
/******/ })
/************************************************************************/
/******/ ([
@@ -120,7 +120,7 @@ exports.default = function (self, call) {
exports.__esModule = true;
-var _setPrototypeOf = __webpack_require__(119);
+var _setPrototypeOf = __webpack_require__(120);
var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
@@ -223,16 +223,13 @@ var slice = Array.prototype.slice;
var eventSplitter = /\s+/;
var eventsApi = function eventsApi(obj, action, name, rest) {
- if (!name) {
- return true;
- }
+ if (!name) return true;
// Handle event maps.
if ((typeof name === 'undefined' ? 'undefined' : (0, _typeof3.default)(name)) === 'object') {
for (var key in name) {
obj[action].apply(obj, [key, name[key]].concat(rest));
- }
- return false;
+ }return false;
}
// Handle space separated event names.
@@ -240,8 +237,7 @@ var eventsApi = function eventsApi(obj, action, name, rest) {
var names = name.split(eventSplitter);
for (var i = 0, l = names.length; i < l; i++) {
obj[action].apply(obj, [names[i]].concat(rest));
- }
- return false;
+ }return false;
}
return true;
@@ -259,6 +255,7 @@ var triggerEvents = function triggerEvents(events, args, klass, name) {
function run() {
try {
switch (args.length) {
+ /* eslint-disable curly */
case 0:
while (++i < l) {
(ev = events[i]).callback.call(ev.ctx);
@@ -306,9 +303,7 @@ var Events = function () {
* @param {Object} context
*/
Events.prototype.on = function on(name, callback, context) {
- if (!eventsApi(this, 'on', name, [callback, context]) || !callback) {
- return this;
- }
+ if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
this._events || (this._events = {});
var events = this._events[name] || (this._events[name] = []);
events.push({ callback: callback, context: context, ctx: context || this });
@@ -327,17 +322,16 @@ var Events = function () {
Events.prototype.once = function once(name, callback, context) {
var _this = this;
- if (!eventsApi(this, 'once', name, [callback, context]) || !callback) {
- return this;
- }
+ var _once = void 0;
+ if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
var off = function off() {
- return _this.off(name, once);
+ return _this.off(name, _once);
};
- var once = function once() {
- off(name, once);
+ _once = function once() {
+ off(name, _once);
callback.apply(this, arguments);
};
- return this.on(name, once, context);
+ return this.on(name, _once, context);
};
/**
@@ -358,9 +352,7 @@ var Events = function () {
l = void 0,
j = void 0,
k = void 0;
- if (!this._events || !eventsApi(this, 'off', name, [callback, context])) {
- return this;
- }
+ if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
if (!name && !callback && !context) {
this._events = void 0;
return this;
@@ -375,14 +367,10 @@ var Events = function () {
if (callback || context) {
for (j = 0, k = events.length; j < k; j++) {
ev = events[j];
- if (callback && callback !== ev.callback && callback !== ev.callback._callback || context && context !== ev.context) {
- retain.push(ev);
- }
+ if (callback && callback !== ev.callback && callback !== ev.callback._callback || context && context !== ev.context) retain.push(ev);
}
}
- if (!retain.length) {
- delete this._events[name];
- }
+ if (!retain.length) delete this._events[name];
}
}
return this;
@@ -398,21 +386,13 @@ var Events = function () {
Events.prototype.trigger = function trigger(name) {
var klass = this.name || this.constructor.name;
_log2.default.debug.apply(_log2.default, [klass].concat(Array.prototype.slice.call(arguments)));
- if (!this._events) {
- return this;
- }
+ if (!this._events) return this;
var args = slice.call(arguments, 1);
- if (!eventsApi(this, 'trigger', name, args)) {
- return this;
- }
+ if (!eventsApi(this, 'trigger', name, args)) return this;
var events = this._events[name];
var allEvents = this._events.all;
- if (events) {
- triggerEvents(events, args, klass, name);
- }
- if (allEvents) {
- triggerEvents(allEvents, arguments, klass, name);
- }
+ if (events) triggerEvents(events, args, klass, name);
+ if (allEvents) triggerEvents(allEvents, arguments, klass, name);
return this;
};
@@ -427,22 +407,14 @@ var Events = function () {
Events.prototype.stopListening = function stopListening(obj, name, callback) {
var listeningTo = this._listeningTo;
- if (!listeningTo) {
- return this;
- }
+ if (!listeningTo) return this;
var remove = !name && !callback;
- if (!callback && (typeof name === 'undefined' ? 'undefined' : (0, _typeof3.default)(name)) === 'object') {
- callback = this;
- }
- if (obj) {
- (listeningTo = {})[obj._listenId] = obj;
- }
+ if (!callback && (typeof name === 'undefined' ? 'undefined' : (0, _typeof3.default)(name)) === 'object') callback = this;
+ if (obj) (listeningTo = {})[obj._listenId] = obj;
for (var id in listeningTo) {
obj = listeningTo[id];
obj.off(name, callback, this);
- if (remove || (0, _keys2.default)(obj._events).length === 0) {
- delete this._listeningTo[id];
- }
+ if (remove || (0, _keys2.default)(obj._events).length === 0) delete this._listeningTo[id];
}
return this;
};
@@ -453,11 +425,9 @@ var Events = function () {
if (property && !Events.Custom[property]) {
Events.Custom[property] = property.toLowerCase().split('_').map(function (value, index) {
- return index == 0 ? value : value = value[0].toUpperCase() + value.slice(1);
+ return index === 0 ? value : value = value[0].toUpperCase() + value.slice(1);
}).join('');
- } else {
- _log2.default.error('Events', 'Error when register event: ' + eventName);
- }
+ } else _log2.default.error('Events', 'Error when register event: ' + eventName);
};
Events.listAvailableCustomEvents = function listAvailableCustomEvents() {
@@ -504,9 +474,7 @@ var listenMethods = { listenTo: 'on', listenToOnce: 'once' };
var listeningTo = this._listeningTo || (this._listeningTo = {});
var id = obj._listenId || (obj._listenId = (0, _utils.uniqueId)('l'));
listeningTo[id] = obj;
- if (!callback && (typeof name === 'undefined' ? 'undefined' : (0, _typeof3.default)(name)) === 'object') {
- callback = this;
- }
+ if (!callback && (typeof name === 'undefined' ? 'undefined' : (0, _typeof3.default)(name)) === 'object') callback = this;
obj[listenMethods[method]](name, callback, this);
return this;
};
@@ -772,6 +740,12 @@ Events.PLAYBACK_PLAY = 'playback:play';
*/
Events.PLAYBACK_PAUSE = 'playback:pause';
/**
+ * Fired when the media for a playback is seeked.
+ *
+ * @event PLAYBACK_SEEKED
+ */
+Events.PLAYBACK_SEEKED = 'playback:seeked';
+/**
* Fired when the media for a playback is stopped.
*
* @event PLAYBACK_STOP
@@ -957,6 +931,13 @@ Events.CONTAINER_MOUSE_LEAVE = 'container:mouseleave';
* @param {Number} time the current time in seconds
*/
Events.CONTAINER_SEEK = 'container:seek';
+/**
+ * Fired when the container was finished the seek video
+ *
+ * @event CONTAINER_SEEKED
+ * @param {Number} time the current time in seconds
+ */
+Events.CONTAINER_SEEKED = 'container:seeked';
Events.CONTAINER_VOLUME = 'container:volume';
Events.CONTAINER_FULLSCREEN = 'container:fullscreen';
/**
@@ -1097,7 +1078,7 @@ var _defineProperty = __webpack_require__(70);
var _defineProperty2 = _interopRequireDefault(_defineProperty);
-var _getOwnPropertyDescriptor = __webpack_require__(125);
+var _getOwnPropertyDescriptor = __webpack_require__(126);
var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor);
@@ -1111,7 +1092,7 @@ exports.getBrowserLanguage = getBrowserLanguage;
exports.now = now;
exports.removeArrayItem = removeArrayItem;
-__webpack_require__(128);
+__webpack_require__(129);
var _browser = __webpack_require__(13);
@@ -1149,9 +1130,8 @@ function extend(parent, properties) {
var _this = (0, _possibleConstructorReturn3.default)(this, _parent.call.apply(_parent, [this].concat(args)));
- if (properties.initialize) {
- properties.initialize.apply(_this, args);
- }
+ if (properties.initialize) properties.initialize.apply(_this, args);
+
return _this;
}
@@ -1163,9 +1143,8 @@ function extend(parent, properties) {
}
function formatTime(time, paddedHours) {
- if (!isFinite(time)) {
- return '--:--';
- }
+ if (!isFinite(time)) return '--:--';
+
time = time * 1000;
time = parseInt(time / 1000);
var seconds = time % 60;
@@ -1177,13 +1156,9 @@ function formatTime(time, paddedHours) {
var out = '';
if (days && days > 0) {
out += days + ':';
- if (hours < 1) {
- out += '00:';
- }
- }
- if (hours && hours > 0 || paddedHours) {
- out += ('0' + hours).slice(-2) + ':';
+ if (hours < 1) out += '00:';
}
+ if (hours && hours > 0 || paddedHours) out += ('0' + hours).slice(-2) + ':';
out += ('0' + minutes).slice(-2) + ':';
out += ('0' + seconds).slice(-2);
return out.trim();
@@ -1194,34 +1169,12 @@ var Fullscreen = exports.Fullscreen = {
return !!(document.webkitFullscreenElement || document.webkitIsFullScreen || document.mozFullScreen || document.msFullscreenElement);
},
requestFullscreen: function requestFullscreen(el) {
- if (el.requestFullscreen) {
- el.requestFullscreen();
- } else if (el.webkitRequestFullscreen) {
- el.webkitRequestFullscreen();
- } else if (el.mozRequestFullScreen) {
- el.mozRequestFullScreen();
- } else if (el.msRequestFullscreen) {
- el.msRequestFullscreen();
- } else if (el.querySelector && el.querySelector('video') && el.querySelector('video').webkitEnterFullScreen) {
- el.querySelector('video').webkitEnterFullScreen();
- } else if (el.webkitEnterFullScreen) {
- el.webkitEnterFullScreen();
- }
+ if (el.requestFullscreen) el.requestFullscreen();else if (el.webkitRequestFullscreen) el.webkitRequestFullscreen();else if (el.mozRequestFullScreen) el.mozRequestFullScreen();else if (el.msRequestFullscreen) el.msRequestFullscreen();else if (el.querySelector && el.querySelector('video') && el.querySelector('video').webkitEnterFullScreen) el.querySelector('video').webkitEnterFullScreen();else if (el.webkitEnterFullScreen) el.webkitEnterFullScreen();
},
cancelFullscreen: function cancelFullscreen() {
var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
- if (el.exitFullscreen) {
- el.exitFullscreen();
- } else if (el.webkitCancelFullScreen) {
- el.webkitCancelFullScreen();
- } else if (el.webkitExitFullscreen) {
- el.webkitExitFullscreen();
- } else if (el.mozCancelFullScreen) {
- el.mozCancelFullScreen();
- } else if (el.msExitFullscreen) {
- el.msExitFullscreen();
- }
+ if (el.exitFullscreen) el.exitFullscreen();else if (el.webkitCancelFullScreen) el.webkitCancelFullScreen();else if (el.webkitExitFullscreen) el.webkitExitFullscreen();else if (el.mozCancelFullScreen) el.mozCancelFullScreen();else if (el.msExitFullscreen) el.msExitFullscreen();
},
fullscreenEnabled: function fullscreenEnabled() {
return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled);
@@ -1255,9 +1208,8 @@ var Config = exports.Config = function () {
};
Config.restore = function restore(key) {
- if (_browser2.default.hasLocalstorage && localStorage[this._createKeyspace(key)]) {
- return this._defaultConfig()[key].parse(localStorage[this._createKeyspace(key)]);
- }
+ if (_browser2.default.hasLocalstorage && localStorage[this._createKeyspace(key)]) return this._defaultConfig()[key].parse(localStorage[this._createKeyspace(key)]);
+
return this._defaultValueFor(key);
};
@@ -1340,6 +1292,7 @@ function seekStringToSeconds() {
} else if (seekString) {
seconds = parseInt(seekString, 10);
}
+
return seconds;
}
@@ -1371,18 +1324,15 @@ function getBrowserLanguage() {
}
function now() {
- if (window.performance && window.performance.now) {
- return performance.now();
- }
+ if (window.performance && window.performance.now) return performance.now();
+
return Date.now();
}
// remove the item from the array if it exists in the array
function removeArrayItem(arr, item) {
var i = arr.indexOf(item);
- if (i >= 0) {
- arr.splice(i, 1);
- }
+ if (i >= 0) arr.splice(i, 1);
}
// Simple Zepto element factory with video recycle feature.
@@ -1398,9 +1348,8 @@ var DomRecycler = exports.DomRecycler = function () {
};
DomRecycler.create = function create(name) {
- if (this.options.recycleVideo && name === 'video' && videoStack.length > 0) {
- return videoStack.shift();
- }
+ if (this.options.recycleVideo && name === 'video' && videoStack.length > 0) return videoStack.shift();
+
return (0, _clapprZepto2.default)('<' + name + '>');
};
@@ -3364,39 +3313,85 @@ module.exports = Zepto
/***/ }),
/* 7 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
+/***/ (function(module, exports) {
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+// css base code, injected by the css-loader
+module.exports = function(useSourceMap) {
+ var list = [];
-var _clapprZepto = __webpack_require__(6);
+ // return the list of modules as css string
+ list.toString = function toString() {
+ return this.map(function (item) {
+ var content = cssWithMappingToString(item, useSourceMap);
+ if(item[2]) {
+ return "@media " + item[2] + "{" + content + "}";
+ } else {
+ return content;
+ }
+ }).join("");
+ };
-var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
+ // import a list of modules into the list
+ list.i = function(modules, mediaQuery) {
+ if(typeof modules === "string")
+ modules = [[null, modules, ""]];
+ var alreadyImportedModules = {};
+ for(var i = 0; i < this.length; i++) {
+ var id = this[i][0];
+ if(typeof id === "number")
+ alreadyImportedModules[id] = true;
+ }
+ for(i = 0; i < modules.length; i++) {
+ var item = modules[i];
+ // skip already imported module
+ // this implementation is not 100% perfect for weird media query combinations
+ // when a module is imported multiple times with different media queries.
+ // I hope this will never occur (Hey this way we have smaller bundles)
+ if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
+ if(mediaQuery && !item[2]) {
+ item[2] = mediaQuery;
+ } else if(mediaQuery) {
+ item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
+ }
+ list.push(item);
+ }
+ }
+ };
+ return list;
+};
-var _template = __webpack_require__(8);
+function cssWithMappingToString(item, useSourceMap) {
+ var content = item[1] || '';
+ var cssMapping = item[3];
+ if (!cssMapping) {
+ return content;
+ }
-var _template2 = _interopRequireDefault(_template);
+ if (useSourceMap && typeof btoa === 'function') {
+ var sourceMapping = toComment(cssMapping);
+ var sourceURLs = cssMapping.sources.map(function (source) {
+ return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
+ });
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
+ }
-// Copyright 2014 Globo.com Player authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
+ return [content].join('\n');
+}
-var Styler = {
- getStyleFor: function getStyleFor(style) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { baseUrl: '' };
+// Adapted from convert-source-map (MIT)
+function toComment(sourceMap) {
+ // eslint-disable-next-line no-undef
+ var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
+ var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
- return (0, _clapprZepto2.default)('<style class="clappr-style"></style>').html((0, _template2.default)(style.toString())(options));
- }
-};
+ return '/*# ' + data + ' */';
+}
-exports.default = Styler;
-module.exports = exports['default'];
/***/ }),
/* 8 */
@@ -3453,9 +3448,7 @@ var htmlEntities = {
var entityRe = new RegExp('[&<>"\']', 'g');
var escapeExpr = function escapeExpr(string) {
- if (string === null) {
- return '';
- }
+ if (string === null) return '';
return ('' + string).replace(entityRe, function (match) {
return htmlEntities[match];
});
@@ -3480,24 +3473,19 @@ var tmpl = function tmpl(text, data) {
return '\\' + escapes[match];
});
- if (escape) {
- source += '\'+\n((__t=(' + escape + '))==null?\'\':escapeExpr(__t))+\n\'';
- }
- if (interpolate) {
- source += '\'+\n((__t=(' + interpolate + '))==null?\'\':__t)+\n\'';
- }
- if (evaluate) {
- source += '\';\n' + evaluate + '\n__p+=\'';
- }
+ if (escape) source += '\'+\n((__t=(' + escape + '))==null?\'\':escapeExpr(__t))+\n\'';
+
+ if (interpolate) source += '\'+\n((__t=(' + interpolate + '))==null?\'\':__t)+\n\'';
+
+ if (evaluate) source += '\';\n' + evaluate + '\n__p+=\'';
+
index = offset + match.length;
return match;
});
source += '\';\n';
// If a variable is not specified, place data values in local scope.
- if (!settings.variable) {
- source = 'with(obj||{}){\n' + source + '}\n';
- }
+ if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
source = 'var __t,__p=\'\',__j=Array.prototype.join,' + 'print=function(){__p+=__j.call(arguments,\'\');};\n' + source + 'return __p;\n//# sourceURL=/microtemplates/source[' + counter++ + ']';
@@ -3510,9 +3498,7 @@ var tmpl = function tmpl(text, data) {
throw e;
}
- if (data) {
- return render(data, escapeExpr);
- }
+ if (data) return render(data, escapeExpr);
var template = function template(data) {
return render.call(this, data, escapeExpr);
};
@@ -3899,83 +3885,373 @@ module.exports = exports['default'];
/***/ }),
/* 10 */
-/***/ (function(module, exports) {
+/***/ (function(module, exports, __webpack_require__) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
-// css base code, injected by the css-loader
-module.exports = function(useSourceMap) {
- var list = [];
- // return the list of modules as css string
- list.toString = function toString() {
- return this.map(function (item) {
- var content = cssWithMappingToString(item, useSourceMap);
- if(item[2]) {
- return "@media " + item[2] + "{" + content + "}";
- } else {
- return content;
+var stylesInDom = {};
+
+var memoize = function (fn) {
+ var memo;
+
+ return function () {
+ if (typeof memo === "undefined") memo = fn.apply(this, arguments);
+ return memo;
+ };
+};
+
+var isOldIE = memoize(function () {
+ // Test for IE <= 9 as proposed by Browserhacks
+ // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
+ // Tests for existence of standard globals is to allow style-loader
+ // to operate correctly into non-standard environments
+ // @see https://github.com/webpack-contrib/style-loader/issues/177
+ return window && document && document.all && !window.atob;
+});
+
+var getElement = (function (fn) {
+ var memo = {};
+
+ return function(selector) {
+ if (typeof memo[selector] === "undefined") {
+ var styleTarget = fn.call(this, selector);
+ // Special case to return head of iframe instead of iframe itself
+ if (styleTarget instanceof window.HTMLIFrameElement) {
+ try {
+ // This will throw an exception if access to iframe is blocked
+ // due to cross-origin restrictions
+ styleTarget = styleTarget.contentDocument.head;
+ } catch(e) {
+ styleTarget = null;
+ }
}
- }).join("");
+ memo[selector] = styleTarget;
+ }
+ return memo[selector]
};
+})(function (target) {
+ return document.querySelector(target)
+});
- // import a list of modules into the list
- list.i = function(modules, mediaQuery) {
- if(typeof modules === "string")
- modules = [[null, modules, ""]];
- var alreadyImportedModules = {};
- for(var i = 0; i < this.length; i++) {
- var id = this[i][0];
- if(typeof id === "number")
- alreadyImportedModules[id] = true;
+var singleton = null;
+var singletonCounter = 0;
+var stylesInsertedAtTop = [];
+
+var fixUrls = __webpack_require__(140);
+
+module.exports = function(list, options) {
+ if (typeof DEBUG !== "undefined" && DEBUG) {
+ if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
+ }
+
+ options = options || {};
+
+ options.attrs = typeof options.attrs === "object" ? options.attrs : {};
+
+ // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
+ // tags it will allow on a page
+ if (!options.singleton) options.singleton = isOldIE();
+
+ // By default, add <style> tags to the <head> element
+ if (!options.insertInto) options.insertInto = "head";
+
+ // By default, add <style> tags to the bottom of the target
+ if (!options.insertAt) options.insertAt = "bottom";
+
+ var styles = listToStyles(list, options);
+
+ addStylesToDom(styles, options);
+
+ return function update (newList) {
+ var mayRemove = [];
+
+ for (var i = 0; i < styles.length; i++) {
+ var item = styles[i];
+ var domStyle = stylesInDom[item.id];
+
+ domStyle.refs--;
+ mayRemove.push(domStyle);
}
- for(i = 0; i < modules.length; i++) {
- var item = modules[i];
- // skip already imported module
- // this implementation is not 100% perfect for weird media query combinations
- // when a module is imported multiple times with different media queries.
- // I hope this will never occur (Hey this way we have smaller bundles)
- if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
- if(mediaQuery && !item[2]) {
- item[2] = mediaQuery;
- } else if(mediaQuery) {
- item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
- }
- list.push(item);
+
+ if(newList) {
+ var newStyles = listToStyles(newList, options);
+ addStylesToDom(newStyles, options);
+ }
+
+ for (var i = 0; i < mayRemove.length; i++) {
+ var domStyle = mayRemove[i];
+
+ if(domStyle.refs === 0) {
+ for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
+
+ delete stylesInDom[domStyle.id];
}
}
};
- return list;
};
-function cssWithMappingToString(item, useSourceMap) {
- var content = item[1] || '';
- var cssMapping = item[3];
- if (!cssMapping) {
- return content;
+function addStylesToDom (styles, options) {
+ for (var i = 0; i < styles.length; i++) {
+ var item = styles[i];
+ var domStyle = stylesInDom[item.id];
+
+ if(domStyle) {
+ domStyle.refs++;
+
+ for(var j = 0; j < domStyle.parts.length; j++) {
+ domStyle.parts[j](item.parts[j]);
+ }
+
+ for(; j < item.parts.length; j++) {
+ domStyle.parts.push(addStyle(item.parts[j], options));
+ }
+ } else {
+ var parts = [];
+
+ for(var j = 0; j < item.parts.length; j++) {
+ parts.push(addStyle(item.parts[j], options));
+ }
+
+ stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
+ }
}
+}
- if (useSourceMap && typeof btoa === 'function') {
- var sourceMapping = toComment(cssMapping);
- var sourceURLs = cssMapping.sources.map(function (source) {
- return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
- });
+function listToStyles (list, options) {
+ var styles = [];
+ var newStyles = {};
- return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
+ for (var i = 0; i < list.length; i++) {
+ var item = list[i];
+ var id = options.base ? item[0] + options.base : item[0];
+ var css = item[1];
+ var media = item[2];
+ var sourceMap = item[3];
+ var part = {css: css, media: media, sourceMap: sourceMap};
+
+ if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
+ else newStyles[id].parts.push(part);
}
- return [content].join('\n');
+ return styles;
}
-// Adapted from convert-source-map (MIT)
-function toComment(sourceMap) {
- // eslint-disable-next-line no-undef
- var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
- var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
+function insertStyleElement (options, style) {
+ var target = getElement(options.insertInto)
- return '/*# ' + data + ' */';
+ if (!target) {
+ throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
+ }
+
+ var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
+
+ if (options.insertAt === "top") {
+ if (!lastStyleElementInsertedAtTop) {
+ target.insertBefore(style, target.firstChild);
+ } else if (lastStyleElementInsertedAtTop.nextSibling) {
+ target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
+ } else {
+ target.appendChild(style);
+ }
+ stylesInsertedAtTop.push(style);
+ } else if (options.insertAt === "bottom") {
+ target.appendChild(style);
+ } else if (typeof options.insertAt === "object" && options.insertAt.before) {
+ var nextSibling = getElement(options.insertInto + " " + options.insertAt.before);
+ target.insertBefore(style, nextSibling);
+ } else {
+ throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
+ }
+}
+
+function removeStyleElement (style) {
+ if (style.parentNode === null) return false;
+ style.parentNode.removeChild(style);
+
+ var idx = stylesInsertedAtTop.indexOf(style);
+ if(idx >= 0) {
+ stylesInsertedAtTop.splice(idx, 1);
+ }
+}
+
+function createStyleElement (options) {
+ var style = document.createElement("style");
+
+ options.attrs.type = "text/css";
+
+ addAttrs(style, options.attrs);
+ insertStyleElement(options, style);
+
+ return style;
+}
+
+function createLinkElement (options) {
+ var link = document.createElement("link");
+
+ options.attrs.type = "text/css";
+ options.attrs.rel = "stylesheet";
+
+ addAttrs(link, options.attrs);
+ insertStyleElement(options, link);
+
+ return link;
+}
+
+function addAttrs (el, attrs) {
+ Object.keys(attrs).forEach(function (key) {
+ el.setAttribute(key, attrs[key]);
+ });
+}
+
+function addStyle (obj, options) {
+ var style, update, remove, result;
+
+ // If a transform function was defined, run it on the css
+ if (options.transform && obj.css) {
+ result = options.transform(obj.css);
+
+ if (result) {
+ // If transform returns a value, use that instead of the original css.
+ // This allows running runtime transformations on the css.
+ obj.css = result;
+ } else {
+ // If the transform function returns a falsy value, don't add this css.
+ // This allows conditional loading of css
+ return function() {
+ // noop
+ };
+ }
+ }
+
+ if (options.singleton) {
+ var styleIndex = singletonCounter++;
+
+ style = singleton || (singleton = createStyleElement(options));
+
+ update = applyToSingletonTag.bind(null, style, styleIndex, false);
+ remove = applyToSingletonTag.bind(null, style, styleIndex, true);
+
+ } else if (
+ obj.sourceMap &&
+ typeof URL === "function" &&
+ typeof URL.createObjectURL === "function" &&
+ typeof URL.revokeObjectURL === "function" &&
+ typeof Blob === "function" &&
+ typeof btoa === "function"
+ ) {
+ style = createLinkElement(options);
+ update = updateLink.bind(null, style, options);
+ remove = function () {
+ removeStyleElement(style);
+
+ if(style.href) URL.revokeObjectURL(style.href);
+ };
+ } else {
+ style = createStyleElement(options);
+ update = applyToTag.bind(null, style);
+ remove = function () {
+ removeStyleElement(style);
+ };
+ }
+
+ update(obj);
+
+ return function updateStyle (newObj) {
+ if (newObj) {
+ if (
+ newObj.css === obj.css &&
+ newObj.media === obj.media &&
+ newObj.sourceMap === obj.sourceMap
+ ) {
+ return;
+ }
+
+ update(obj = newObj);
+ } else {
+ remove();
+ }
+ };
+}
+
+var replaceText = (function () {
+ var textStore = [];
+
+ return function (index, replacement) {
+ textStore[index] = replacement;
+
+ return textStore.filter(Boolean).join('\n');
+ };
+})();
+
+function applyToSingletonTag (style, index, remove, obj) {
+ var css = remove ? "" : obj.css;
+
+ if (style.styleSheet) {
+ style.styleSheet.cssText = replaceText(index, css);
+ } else {
+ var cssNode = document.createTextNode(css);
+ var childNodes = style.childNodes;
+
+ if (childNodes[index]) style.removeChild(childNodes[index]);
+
+ if (childNodes.length) {
+ style.insertBefore(cssNode, childNodes[index]);
+ } else {
+ style.appendChild(cssNode);
+ }
+ }
+}
+
+function applyToTag (style, obj) {
+ var css = obj.css;
+ var media = obj.media;
+
+ if(media) {
+ style.setAttribute("media", media)
+ }
+
+ if(style.styleSheet) {
+ style.styleSheet.cssText = css;
+ } else {
+ while(style.firstChild) {
+ style.removeChild(style.firstChild);
+ }
+
+ style.appendChild(document.createTextNode(css));
+ }
+}
+
+function updateLink (link, options, obj) {
+ var css = obj.css;
+ var sourceMap = obj.sourceMap;
+
+ /*
+ If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
+ and there is no publicPath defined then lets turn convertToAbsoluteUrls
+ on by default. Otherwise default to the convertToAbsoluteUrls option
+ directly
+ */
+ var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
+
+ if (options.convertToAbsoluteUrls || autoFixUrls) {
+ css = fixUrls(css);
+ }
+
+ if (sourceMap) {
+ // http://stackoverflow.com/a/26603875
+ css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
+ }
+
+ var blob = new Blob([css], { type: "text/css" });
+
+ var oldSrc = link.href;
+
+ link.href = URL.createObjectURL(blob);
+
+ if(oldSrc) URL.revokeObjectURL(oldSrc);
}
@@ -4037,8 +4313,7 @@ var hasFlash = function hasFlash() {
}
};
-var getBrowserInfo = function getBrowserInfo() {
- var ua = navigator.userAgent;
+var getBrowserInfo = exports.getBrowserInfo = function getBrowserInfo(ua) {
var parts = ua.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [],
extra = void 0;
if (/trident/i.test(parts[1])) {
@@ -4046,23 +4321,20 @@ var getBrowserInfo = function getBrowserInfo() {
return { name: 'IE', version: parseInt(extra[1] || '') };
} else if (parts[1] === 'Chrome') {
extra = ua.match(/\bOPR\/(\d+)/);
- if (extra != null) {
- return { name: 'Opera', version: parseInt(extra[1]) };
- }
+ if (extra != null) return { name: 'Opera', version: parseInt(extra[1]) };
+
extra = ua.match(/\bEdge\/(\d+)/);
- if (extra != null) {
- return { name: 'Edge', version: parseInt(extra[1]) };
- }
+ if (extra != null) return { name: 'Edge', version: parseInt(extra[1]) };
+ } else if (/android/i.test(ua) && (extra = ua.match(/version\/(\d+)/i))) {
+ parts.splice(1, 1, 'Android WebView');
+ parts.splice(2, 1, extra[1]);
}
parts = parts[2] ? [parts[1], parts[2]] : [navigator.appName, navigator.appVersion, '-?'];
- if (extra = ua.match(/version\/(\d+)/i)) {
- parts.splice(1, 1, extra[1]);
- }
return { name: parts[0], version: parseInt(parts[1]) };
};
-var browserInfo = getBrowserInfo();
+var browserInfo = getBrowserInfo(navigator.userAgent);
Browser.isEdge = /edge/i.test(navigator.userAgent);
Browser.isChrome = /chrome|CriOS/i.test(navigator.userAgent) && !Browser.isEdge;
@@ -4086,14 +4358,13 @@ Browser.name = browserInfo.name;
Browser.version = browserInfo.version;
exports.default = Browser;
-module.exports = exports['default'];
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
-var IObject = __webpack_require__(91)
+var IObject = __webpack_require__(92)
, defined = __webpack_require__(40);
module.exports = function(it){
return IObject(defined(it));
@@ -4511,14 +4782,10 @@ var UIObject = function (_BaseObject) {
UIObject.prototype.setElement = function setElement(element, delegate) {
- if (this.$el) {
- this.undelegateEvents();
- }
- this.$el = element instanceof _clapprZepto2.default ? element : (0, _clapprZepto2.default)(element);
+ if (this.$el) this.undelegateEvents();
+ this.$el = _clapprZepto2.default.zepto.isZ(element) ? element : (0, _clapprZepto2.default)(element);
this.el = this.$el[0];
- if (delegate !== false) {
- this.delegateEvents();
- }
+ if (delegate !== false) this.delegateEvents();
return this;
};
@@ -4531,28 +4798,18 @@ var UIObject = function (_BaseObject) {
UIObject.prototype.delegateEvents = function delegateEvents(events) {
- if (!(events || (events = this.events))) {
- return this;
- }
+ if (!(events || (events = this.events))) return this;
this.undelegateEvents();
for (var key in events) {
var method = events[key];
- if (method && method.constructor !== Function) {
- method = this[events[key]];
- }
- if (!method) {
- continue;
- }
+ if (method && method.constructor !== Function) method = this[events[key]];
+ if (!method) continue;
var match = key.match(delegateEventSplitter);
var eventName = match[1],
selector = match[2];
eventName += '.delegateEvents' + this.cid;
- if (selector === '') {
- this.$el.on(eventName, method.bind(this));
- } else {
- this.$el.on(eventName, selector, method.bind(this));
- }
+ if (selector === '') this.$el.on(eventName, method.bind(this));else this.$el.on(eventName, selector, method.bind(this));
}
return this;
};
@@ -4579,12 +4836,8 @@ var UIObject = function (_BaseObject) {
UIObject.prototype._ensureElement = function _ensureElement() {
if (!this.el) {
var attrs = _clapprZepto2.default.extend({}, this.attributes);
- if (this.id) {
- attrs.id = this.id;
- }
- if (this.className) {
- attrs['class'] = this.className;
- }
+ if (this.id) attrs.id = this.id;
+ if (this.className) attrs['class'] = this.className;
var $el = _utils.DomRecycler.create(this.tagName).attr(attrs);
this.setElement($el, false);
} else {
@@ -4824,7 +5077,7 @@ module.exports = exports['default'];
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
-module.exports = { "default": __webpack_require__(89), __esModule: true };
+module.exports = { "default": __webpack_require__(90), __esModule: true };
/***/ }),
/* 32 */
@@ -4845,11 +5098,11 @@ module.exports = function(key){
exports.__esModule = true;
-var _iterator = __webpack_require__(95);
+var _iterator = __webpack_require__(96);
var _iterator2 = _interopRequireDefault(_iterator);
-var _symbol = __webpack_require__(106);
+var _symbol = __webpack_require__(107);
var _symbol2 = _interopRequireDefault(_symbol);
@@ -4912,7 +5165,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _html5_video = __webpack_require__(152);
+var _html5_video = __webpack_require__(158);
var _html5_video2 = _interopRequireDefault(_html5_video);
@@ -5258,7 +5511,7 @@ module.exports = (
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
-var aFunction = __webpack_require__(94);
+var aFunction = __webpack_require__(95);
module.exports = function(fn, that, length){
aFunction(fn);
if(that === undefined)return fn;
@@ -5307,7 +5560,7 @@ module.exports = true;
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__(23)
- , dPs = __webpack_require__(99)
+ , dPs = __webpack_require__(100)
, enumBugKeys = __webpack_require__(45)
, IE_PROTO = __webpack_require__(43)('IE_PROTO')
, Empty = function(){ /* empty */ }
@@ -5322,7 +5575,7 @@ var createDict = function(){
, gt = '>'
, iframeDocument;
iframe.style.display = 'none';
- __webpack_require__(100).appendChild(iframe);
+ __webpack_require__(101).appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
@@ -5418,7 +5671,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _log = __webpack_require__(129);
+var _log = __webpack_require__(130);
var _log2 = _interopRequireDefault(_log);
@@ -5438,7 +5691,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _kibo = __webpack_require__(130);
+var _kibo = __webpack_require__(131);
var _kibo2 = _interopRequireDefault(_kibo);
@@ -5649,7 +5902,7 @@ module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\
Object.defineProperty(exports, "__esModule", {
value: true
});
-exports.default = __webpack_require__(164);
+exports.default = __webpack_require__(171);
module.exports = exports['default'];
/***/ }),
@@ -5658,7 +5911,7 @@ module.exports = exports['default'];
var has = __webpack_require__(18)
, toIObject = __webpack_require__(14)
- , arrayIndexOf = __webpack_require__(92)(false)
+ , arrayIndexOf = __webpack_require__(93)(false)
, IE_PROTO = __webpack_require__(43)('IE_PROTO');
module.exports = function(object, names){
@@ -5726,7 +5979,7 @@ module.exports = function(it){
"use strict";
-var $at = __webpack_require__(97)(true);
+var $at = __webpack_require__(98)(true);
// 21.1.3.27 String.prototype[@@iterator]()
__webpack_require__(66)(String, 'String', function(iterated){
@@ -5755,9 +6008,9 @@ var LIBRARY = __webpack_require__(48)
, hide = __webpack_require__(22)
, has = __webpack_require__(18)
, Iterators = __webpack_require__(29)
- , $iterCreate = __webpack_require__(98)
+ , $iterCreate = __webpack_require__(99)
, setToStringTag = __webpack_require__(50)
- , getPrototypeOf = __webpack_require__(101)
+ , getPrototypeOf = __webpack_require__(102)
, ITERATOR = __webpack_require__(12)('iterator')
, BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`
, FF_ITERATOR = '@@iterator'
@@ -5847,13 +6100,13 @@ exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){
/* 70 */
/***/ (function(module, exports, __webpack_require__) {
-module.exports = { "default": __webpack_require__(117), __esModule: true };
+module.exports = { "default": __webpack_require__(118), __esModule: true };
/***/ }),
/* 71 */
/***/ (function(module, exports, __webpack_require__) {
-module.exports = { "default": __webpack_require__(123), __esModule: true };
+module.exports = { "default": __webpack_require__(124), __esModule: true };
/***/ }),
/* 72 */
@@ -5866,7 +6119,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _core = __webpack_require__(133);
+var _core = __webpack_require__(134);
var _core2 = _interopRequireDefault(_core);
@@ -5886,7 +6139,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _container = __webpack_require__(136);
+var _container = __webpack_require__(137);
var _container2 = _interopRequireDefault(_container);
@@ -5906,7 +6159,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _media_control = __webpack_require__(138);
+var _media_control = __webpack_require__(141);
var _media_control2 = _interopRequireDefault(_media_control);
@@ -5917,9 +6170,9 @@ module.exports = exports['default'];
/***/ }),
/* 75 */
-/***/ (function(module, exports, __webpack_require__) {
+/***/ (function(module, exports) {
-module.exports = __webpack_require__.p + "a8c874b93b3d848f39a71260c57e3863.cur";
+module.exports = "<%=baseUrl%>/a8c874b93b3d848f39a71260c57e3863.cur";
/***/ }),
/* 76 */
@@ -5938,7 +6191,43 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _loader = __webpack_require__(151);
+var _clapprZepto = __webpack_require__(6);
+
+var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
+
+var _template = __webpack_require__(8);
+
+var _template2 = _interopRequireDefault(_template);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+// Copyright 2014 Globo.com Player authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+var Styler = {
+ getStyleFor: function getStyleFor(style) {
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { baseUrl: '' };
+
+ return (0, _clapprZepto2.default)('<style class="clappr-style"></style>').html((0, _template2.default)(style.toString())(options));
+ }
+};
+
+exports.default = Styler;
+module.exports = exports['default'];
+
+/***/ }),
+/* 78 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _loader = __webpack_require__(157);
var _loader2 = _interopRequireDefault(_loader);
@@ -5948,13 +6237,13 @@ exports.default = _loader2.default;
module.exports = exports['default'];
/***/ }),
-/* 78 */
+/* 79 */
/***/ (function(module, exports, __webpack_require__) {
-module.exports = { "default": __webpack_require__(153), __esModule: true };
+module.exports = { "default": __webpack_require__(159), __esModule: true };
/***/ }),
-/* 79 */
+/* 80 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -5962,7 +6251,7 @@ module.exports = { "default": __webpack_require__(153), __esModule: true };
exports.__esModule = true;
-var _from = __webpack_require__(78);
+var _from = __webpack_require__(79);
var _from2 = _interopRequireDefault(_from);
@@ -5981,7 +6270,7 @@ exports.default = function (arr) {
};
/***/ }),
-/* 80 */
+/* 81 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -5991,7 +6280,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _flash = __webpack_require__(163);
+var _flash = __webpack_require__(170);
var _flash2 = _interopRequireDefault(_flash);
@@ -6001,7 +6290,7 @@ exports.default = _flash2.default;
module.exports = exports['default'];
/***/ }),
-/* 81 */
+/* 82 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -6011,7 +6300,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _html5_audio = __webpack_require__(168);
+var _html5_audio = __webpack_require__(176);
var _html5_audio2 = _interopRequireDefault(_html5_audio);
@@ -6021,7 +6310,7 @@ exports.default = _html5_audio2.default;
module.exports = exports['default'];
/***/ }),
-/* 82 */
+/* 83 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -6031,7 +6320,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _flashls = __webpack_require__(169);
+var _flashls = __webpack_require__(177);
var _flashls2 = _interopRequireDefault(_flashls);
@@ -6041,7 +6330,7 @@ exports.default = _flashls2.default;
module.exports = exports['default'];
/***/ }),
-/* 83 */
+/* 84 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -6051,7 +6340,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _hls = __webpack_require__(172);
+var _hls = __webpack_require__(180);
var _hls2 = _interopRequireDefault(_hls);
@@ -6061,7 +6350,7 @@ exports.default = _hls2.default;
module.exports = exports['default'];
/***/ }),
-/* 84 */
+/* 85 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -6071,7 +6360,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _html_img = __webpack_require__(174);
+var _html_img = __webpack_require__(182);
var _html_img2 = _interopRequireDefault(_html_img);
@@ -6081,7 +6370,7 @@ exports.default = _html_img2.default;
module.exports = exports['default'];
/***/ }),
-/* 85 */
+/* 86 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -6091,7 +6380,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _no_op = __webpack_require__(176);
+var _no_op = __webpack_require__(185);
var _no_op2 = _interopRequireDefault(_no_op);
@@ -6101,7 +6390,7 @@ exports.default = _no_op2.default;
module.exports = exports['default'];
/***/ }),
-/* 86 */
+/* 87 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -6111,7 +6400,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _poster = __webpack_require__(189);
+var _poster = __webpack_require__(201);
var _poster2 = _interopRequireDefault(_poster);
@@ -6121,7 +6410,7 @@ exports.default = _poster2.default;
module.exports = exports['default'];
/***/ }),
-/* 87 */
+/* 88 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -6131,7 +6420,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _player = __webpack_require__(88);
+var _player = __webpack_require__(89);
var _player2 = _interopRequireDefault(_player);
@@ -6183,7 +6472,7 @@ var _core = __webpack_require__(72);
var _core2 = _interopRequireDefault(_core);
-var _loader = __webpack_require__(77);
+var _loader = __webpack_require__(78);
var _loader2 = _interopRequireDefault(_loader);
@@ -6203,19 +6492,19 @@ var _base_flash_playback = __webpack_require__(59);
var _base_flash_playback2 = _interopRequireDefault(_base_flash_playback);
-var _flash = __webpack_require__(80);
+var _flash = __webpack_require__(81);
var _flash2 = _interopRequireDefault(_flash);
-var _flashls = __webpack_require__(82);
+var _flashls = __webpack_require__(83);
var _flashls2 = _interopRequireDefault(_flashls);
-var _hls = __webpack_require__(83);
+var _hls = __webpack_require__(84);
var _hls2 = _interopRequireDefault(_hls);
-var _html5_audio = __webpack_require__(81);
+var _html5_audio = __webpack_require__(82);
var _html5_audio2 = _interopRequireDefault(_html5_audio);
@@ -6223,15 +6512,15 @@ var _html5_video = __webpack_require__(35);
var _html5_video2 = _interopRequireDefault(_html5_video);
-var _html_img = __webpack_require__(84);
+var _html_img = __webpack_require__(85);
var _html_img2 = _interopRequireDefault(_html_img);
-var _no_op = __webpack_require__(85);
+var _no_op = __webpack_require__(86);
var _no_op2 = _interopRequireDefault(_no_op);
-var _poster = __webpack_require__(86);
+var _poster = __webpack_require__(87);
var _poster2 = _interopRequireDefault(_poster);
@@ -6239,7 +6528,7 @@ var _log = __webpack_require__(55);
var _log2 = _interopRequireDefault(_log);
-var _styler = __webpack_require__(7);
+var _styler = __webpack_require__(77);
var _styler2 = _interopRequireDefault(_styler);
@@ -6257,7 +6546,7 @@ var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-var version = "0.2.71"; // Copyright 2014 Globo.com Player authors. All rights reserved.
+var version = "0.2.80"; // Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -6298,7 +6587,7 @@ exports.default = {
module.exports = exports['default'];
/***/ }),
-/* 88 */
+/* 89 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -6342,11 +6631,11 @@ var _browser = __webpack_require__(13);
var _browser2 = _interopRequireDefault(_browser);
-var _core_factory = __webpack_require__(131);
+var _core_factory = __webpack_require__(132);
var _core_factory2 = _interopRequireDefault(_core_factory);
-var _loader = __webpack_require__(77);
+var _loader = __webpack_require__(78);
var _loader2 = _interopRequireDefault(_loader);
@@ -6399,9 +6688,8 @@ var Player = function (_BaseObject) {
this._loader = loader;
},
get: function get() {
- if (!this._loader) {
- this._loader = new _loader2.default(this.options.plugins || {}, this.options.playerId);
- }
+ if (!this._loader) this._loader = new _loader2.default(this.options.plugins || {}, this.options.playerId);
+
return this._loader;
}
@@ -6501,7 +6789,7 @@ var Player = function (_BaseObject) {
* whether or not the player should handle click events when in chromeless mode **default**: `false` on desktops browsers, `true` on mobile.
* @param {Boolean} [options.disableKeyboardShortcuts]
* disable keyboard shortcuts. **default**: `false`. `true` if `allowUserInteraction` is `false`.
- * @param {Boolean} [options.muted]
+ * @param {Boolean} [options.mute]
* start the video muted **default**: `false`
* @param {String} [options.mimeType]
* add `mimeType: "application/vnd.apple.mpegurl"` if you need to use a url without extension.
@@ -6570,11 +6858,8 @@ var Player = function (_BaseObject) {
_this.playerInfo = _player_info2.default.getInstance(_this.options.playerId);
_this.playerInfo.currentSize = { width: options.width, height: options.height };
_this.playerInfo.options = _this.options;
- if (_this.options.parentId) {
- _this.setParentId(_this.options.parentId);
- } else if (_this.options.parent) {
- _this.attachTo(_this.options.parent);
- }
+ if (_this.options.parentId) _this.setParentId(_this.options.parentId);else if (_this.options.parent) _this.attachTo(_this.options.parent);
+
return _this;
}
@@ -6588,9 +6873,8 @@ var Player = function (_BaseObject) {
Player.prototype.setParentId = function setParentId(parentId) {
var el = document.querySelector(parentId);
- if (el) {
- this.attachTo(el);
- }
+ if (el) this.attachTo(el);
+
return this;
};
@@ -6610,11 +6894,8 @@ var Player = function (_BaseObject) {
};
Player.prototype._addEventListeners = function _addEventListeners() {
- if (!this.core.isReady) {
- this.listenToOnce(this.core, _events2.default.CORE_READY, this._onReady);
- } else {
- this._onReady();
- }
+ if (!this.core.isReady) this.listenToOnce(this.core, _events2.default.CORE_READY, this._onReady);else this._onReady();
+
this.listenTo(this.core.mediaControl, _events2.default.MEDIACONTROL_CONTAINERCHANGED, this._containerChanged);
this.listenTo(this.core, _events2.default.CORE_FULLSCREEN, this._onFullscreenChange);
return this;
@@ -6736,9 +7017,8 @@ var Player = function (_BaseObject) {
Player.prototype.load = function load(sources, mimeType, autoPlay) {
- if (autoPlay !== undefined) {
- this.configure({ autoPlay: !!autoPlay });
- }
+ if (autoPlay !== undefined) this.configure({ autoPlay: !!autoPlay });
+
this.core.load(sources, mimeType);
return this;
};
@@ -6838,9 +7118,8 @@ var Player = function (_BaseObject) {
Player.prototype.setVolume = function setVolume(volume) {
- if (this.core && this.core.mediaControl) {
- this.core.mediaControl.setVolume(volume);
- }
+ if (this.core && this.core.mediaControl) this.core.mediaControl.setVolume(volume);
+
return this;
};
@@ -6989,14 +7268,14 @@ exports.default = Player;
module.exports = exports['default'];
/***/ }),
-/* 89 */
+/* 90 */
/***/ (function(module, exports, __webpack_require__) {
-__webpack_require__(90);
+__webpack_require__(91);
module.exports = __webpack_require__(11).Object.keys;
/***/ }),
-/* 90 */
+/* 91 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 Object.keys(O)
@@ -7010,7 +7289,7 @@ __webpack_require__(62)('keys', function(){
});
/***/ }),
-/* 91 */
+/* 92 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
@@ -7020,14 +7299,14 @@ module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
};
/***/ }),
-/* 92 */
+/* 93 */
/***/ (function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__(14)
, toLength = __webpack_require__(61)
- , toIndex = __webpack_require__(93);
+ , toIndex = __webpack_require__(94);
module.exports = function(IS_INCLUDES){
return function($this, el, fromIndex){
var O = toIObject($this)
@@ -7046,7 +7325,7 @@ module.exports = function(IS_INCLUDES){
};
/***/ }),
-/* 93 */
+/* 94 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(42)
@@ -7058,7 +7337,7 @@ module.exports = function(index, length){
};
/***/ }),
-/* 94 */
+/* 95 */
/***/ (function(module, exports) {
module.exports = function(it){
@@ -7067,21 +7346,21 @@ module.exports = function(it){
};
/***/ }),
-/* 95 */
+/* 96 */
/***/ (function(module, exports, __webpack_require__) {
-module.exports = { "default": __webpack_require__(96), __esModule: true };
+module.exports = { "default": __webpack_require__(97), __esModule: true };
/***/ }),
-/* 96 */
+/* 97 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(65);
-__webpack_require__(102);
+__webpack_require__(103);
module.exports = __webpack_require__(51).f('iterator');
/***/ }),
-/* 97 */
+/* 98 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(42)
@@ -7103,7 +7382,7 @@ module.exports = function(TO_STRING){
};
/***/ }),
-/* 98 */
+/* 99 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -7122,7 +7401,7 @@ module.exports = function(Constructor, NAME, next){
};
/***/ }),
-/* 99 */
+/* 100 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(16)
@@ -7140,13 +7419,13 @@ module.exports = __webpack_require__(20) ? Object.defineProperties : function de
};
/***/ }),
-/* 100 */
+/* 101 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(15).document && document.documentElement;
/***/ }),
-/* 101 */
+/* 102 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
@@ -7164,10 +7443,10 @@ module.exports = Object.getPrototypeOf || function(O){
};
/***/ }),
-/* 102 */
+/* 103 */
/***/ (function(module, exports, __webpack_require__) {
-__webpack_require__(103);
+__webpack_require__(104);
var global = __webpack_require__(15)
, hide = __webpack_require__(22)
, Iterators = __webpack_require__(29)
@@ -7182,13 +7461,13 @@ for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList'
}
/***/ }),
-/* 103 */
+/* 104 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var addToUnscopables = __webpack_require__(104)
- , step = __webpack_require__(105)
+var addToUnscopables = __webpack_require__(105)
+ , step = __webpack_require__(106)
, Iterators = __webpack_require__(29)
, toIObject = __webpack_require__(14);
@@ -7222,13 +7501,13 @@ addToUnscopables('values');
addToUnscopables('entries');
/***/ }),
-/* 104 */
+/* 105 */
/***/ (function(module, exports) {
module.exports = function(){ /* empty */ };
/***/ }),
-/* 105 */
+/* 106 */
/***/ (function(module, exports) {
module.exports = function(done, value){
@@ -7236,23 +7515,23 @@ module.exports = function(done, value){
};
/***/ }),
-/* 106 */
+/* 107 */
/***/ (function(module, exports, __webpack_require__) {
-module.exports = { "default": __webpack_require__(107), __esModule: true };
+module.exports = { "default": __webpack_require__(108), __esModule: true };
/***/ }),
-/* 107 */
+/* 108 */
/***/ (function(module, exports, __webpack_require__) {
-__webpack_require__(108);
-__webpack_require__(114);
+__webpack_require__(109);
__webpack_require__(115);
__webpack_require__(116);
+__webpack_require__(117);
module.exports = __webpack_require__(11).Symbol;
/***/ }),
-/* 108 */
+/* 109 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -7263,7 +7542,7 @@ var global = __webpack_require__(15)
, DESCRIPTORS = __webpack_require__(20)
, $export = __webpack_require__(19)
, redefine = __webpack_require__(67)
- , META = __webpack_require__(109).KEY
+ , META = __webpack_require__(110).KEY
, $fails = __webpack_require__(27)
, shared = __webpack_require__(44)
, setToStringTag = __webpack_require__(50)
@@ -7271,15 +7550,15 @@ var global = __webpack_require__(15)
, wks = __webpack_require__(12)
, wksExt = __webpack_require__(51)
, wksDefine = __webpack_require__(52)
- , keyOf = __webpack_require__(110)
- , enumKeys = __webpack_require__(111)
- , isArray = __webpack_require__(112)
+ , keyOf = __webpack_require__(111)
+ , enumKeys = __webpack_require__(112)
+ , isArray = __webpack_require__(113)
, anObject = __webpack_require__(23)
, toIObject = __webpack_require__(14)
, toPrimitive = __webpack_require__(47)
, createDesc = __webpack_require__(28)
, _create = __webpack_require__(49)
- , gOPNExt = __webpack_require__(113)
+ , gOPNExt = __webpack_require__(114)
, $GOPD = __webpack_require__(54)
, $DP = __webpack_require__(16)
, $keys = __webpack_require__(25)
@@ -7493,7 +7772,7 @@ setToStringTag(Math, 'Math', true);
setToStringTag(global.JSON, 'JSON', true);
/***/ }),
-/* 109 */
+/* 110 */
/***/ (function(module, exports, __webpack_require__) {
var META = __webpack_require__(32)('meta')
@@ -7551,7 +7830,7 @@ var meta = module.exports = {
};
/***/ }),
-/* 110 */
+/* 111 */
/***/ (function(module, exports, __webpack_require__) {
var getKeys = __webpack_require__(25)
@@ -7566,7 +7845,7 @@ module.exports = function(object, el){
};
/***/ }),
-/* 111 */
+/* 112 */
/***/ (function(module, exports, __webpack_require__) {
// all enumerable object keys, includes symbols
@@ -7586,7 +7865,7 @@ module.exports = function(it){
};
/***/ }),
-/* 112 */
+/* 113 */
/***/ (function(module, exports, __webpack_require__) {
// 7.2.2 IsArray(argument)
@@ -7596,7 +7875,7 @@ module.exports = Array.isArray || function isArray(arg){
};
/***/ }),
-/* 113 */
+/* 114 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
@@ -7621,35 +7900,35 @@ module.exports.f = function getOwnPropertyNames(it){
/***/ }),
-/* 114 */
+/* 115 */
/***/ (function(module, exports) {
/***/ }),
-/* 115 */
+/* 116 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(52)('asyncIterator');
/***/ }),
-/* 116 */
+/* 117 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(52)('observable');
/***/ }),
-/* 117 */
+/* 118 */
/***/ (function(module, exports, __webpack_require__) {
-__webpack_require__(118);
+__webpack_require__(119);
var $Object = __webpack_require__(11).Object;
module.exports = function defineProperty(it, key, desc){
return $Object.defineProperty(it, key, desc);
};
/***/ }),
-/* 118 */
+/* 119 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(19);
@@ -7657,28 +7936,28 @@ var $export = __webpack_require__(19);
$export($export.S + $export.F * !__webpack_require__(20), 'Object', {defineProperty: __webpack_require__(16).f});
/***/ }),
-/* 119 */
+/* 120 */
/***/ (function(module, exports, __webpack_require__) {
-module.exports = { "default": __webpack_require__(120), __esModule: true };
+module.exports = { "default": __webpack_require__(121), __esModule: true };
/***/ }),
-/* 120 */
+/* 121 */
/***/ (function(module, exports, __webpack_require__) {
-__webpack_require__(121);
+__webpack_require__(122);
module.exports = __webpack_require__(11).Object.setPrototypeOf;
/***/ }),
-/* 121 */
+/* 122 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.19 Object.setPrototypeOf(O, proto)
var $export = __webpack_require__(19);
-$export($export.S, 'Object', {setPrototypeOf: __webpack_require__(122).set});
+$export($export.S, 'Object', {setPrototypeOf: __webpack_require__(123).set});
/***/ }),
-/* 122 */
+/* 123 */
/***/ (function(module, exports, __webpack_require__) {
// Works with __proto__ only. Old v8 can't work with null proto objects.
@@ -7708,17 +7987,17 @@ module.exports = {
};
/***/ }),
-/* 123 */
+/* 124 */
/***/ (function(module, exports, __webpack_require__) {
-__webpack_require__(124);
+__webpack_require__(125);
var $Object = __webpack_require__(11).Object;
module.exports = function create(P, D){
return $Object.create(P, D);
};
/***/ }),
-/* 124 */
+/* 125 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(19)
@@ -7726,23 +8005,23 @@ var $export = __webpack_require__(19)
$export($export.S, 'Object', {create: __webpack_require__(49)});
/***/ }),
-/* 125 */
+/* 126 */
/***/ (function(module, exports, __webpack_require__) {
-module.exports = { "default": __webpack_require__(126), __esModule: true };
+module.exports = { "default": __webpack_require__(127), __esModule: true };
/***/ }),
-/* 126 */
+/* 127 */
/***/ (function(module, exports, __webpack_require__) {
-__webpack_require__(127);
+__webpack_require__(128);
var $Object = __webpack_require__(11).Object;
module.exports = function getOwnPropertyDescriptor(it, key){
return $Object.getOwnPropertyDescriptor(it, key);
};
/***/ }),
-/* 127 */
+/* 128 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
@@ -7756,7 +8035,7 @@ __webpack_require__(62)('getOwnPropertyDescriptor', function(){
});
/***/ }),
-/* 128 */
+/* 129 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -7773,13 +8052,12 @@ __webpack_require__(62)('getOwnPropertyDescriptor', function(){
* See also : https://tc39.github.io/ecma262/#sec-array.prototype.find
*/
if (!Array.prototype.find) {
+ // eslint-disable-next-line
Object.defineProperty(Array.prototype, 'find', {
// Note: ES6 arrow function syntax is not used on purpose to avoid this to be undefined
value: function value(predicate) {
// 1. Let O be ? ToObject(this value).
- if (this == null) {
- throw new TypeError('"this" is null or not defined');
- }
+ if (this == null) throw new TypeError('"this" is null or not defined');
var o = Object(this);
@@ -7787,9 +8065,7 @@ if (!Array.prototype.find) {
var len = o.length >>> 0;
// 3. If IsCallable(predicate) is false, throw a TypeError exception.
- if (typeof predicate !== 'function') {
- throw new TypeError('predicate must be a function');
- }
+ if (typeof predicate !== 'function') throw new TypeError('predicate must be a function');
// 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
var thisArg = arguments[1];
@@ -7804,9 +8080,8 @@ if (!Array.prototype.find) {
// c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
// d. If testResult is true, return kValue.
var kValue = o[k];
- if (predicate.call(thisArg, kValue, k, o)) {
- return kValue;
- }
+ if (predicate.call(thisArg, kValue, k, o)) return kValue;
+
// e. Increase k by 1.
k++;
}
@@ -7818,7 +8093,7 @@ if (!Array.prototype.find) {
}
/***/ }),
-/* 129 */
+/* 130 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -7895,9 +8170,7 @@ var Log = function () {
this.level = this.offLevel;
}
// handle instances where console.log is unavailable
- if (window.console && window.console.log) {
- window.console.log('%c[Clappr.Log] set log level to ' + DESCRIPTIONS[this.level], WARN);
- }
+ if (window.console && window.console.log) window.console.log('%c[Clappr.Log] set log level to ' + DESCRIPTIONS[this.level], WARN);
};
Log.prototype.level = function level(newLevel) {
@@ -7914,12 +8187,9 @@ var Log = function () {
}
var color = COLORS[level];
var klassDescription = '';
- if (klass) {
- klassDescription = '[' + klass + ']';
- }
- if (window.console && window.console.log) {
- window.console.log.apply(console, ['%c[' + DESCRIPTIONS[level] + ']' + klassDescription, color].concat(message));
- }
+ if (klass) klassDescription = '[' + klass + ']';
+
+ if (window.console && window.console.log) window.console.log.apply(console, ['%c[' + DESCRIPTIONS[level] + ']' + klassDescription, color].concat(message));
};
return Log;
@@ -7961,7 +8231,7 @@ Log.error = function () {
module.exports = exports['default'];
/***/ }),
-/* 130 */
+/* 131 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -8267,7 +8537,7 @@ exports.default = Kibo;
module.exports = exports['default'];
/***/ }),
-/* 131 */
+/* 132 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -8277,7 +8547,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _core_factory = __webpack_require__(132);
+var _core_factory = __webpack_require__(133);
var _core_factory2 = _interopRequireDefault(_core_factory);
@@ -8287,7 +8557,7 @@ exports.default = _core_factory2.default;
module.exports = exports['default'];
/***/ }),
-/* 132 */
+/* 133 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -8407,7 +8677,7 @@ exports.default = CoreFactory;
module.exports = exports['default'];
/***/ }),
-/* 133 */
+/* 134 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -8439,10 +8709,6 @@ var _events = __webpack_require__(4);
var _events2 = _interopRequireDefault(_events);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
var _ui_object = __webpack_require__(21);
var _ui_object2 = _interopRequireDefault(_ui_object);
@@ -8451,7 +8717,7 @@ var _browser = __webpack_require__(13);
var _browser2 = _interopRequireDefault(_browser);
-var _container_factory = __webpack_require__(134);
+var _container_factory = __webpack_require__(135);
var _container_factory2 = _interopRequireDefault(_container_factory);
@@ -8467,16 +8733,28 @@ var _player_info = __webpack_require__(34);
var _player_info2 = _interopRequireDefault(_player_info);
+var _styler = __webpack_require__(77);
+
+var _styler2 = _interopRequireDefault(_styler);
+
var _clapprZepto = __webpack_require__(6);
var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
-var _style = __webpack_require__(149);
+__webpack_require__(153);
+
+var _fonts = __webpack_require__(155);
-var _style2 = _interopRequireDefault(_style);
+var _fonts2 = _interopRequireDefault(_fonts);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+// Copyright 2014 Globo.com Player authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+var style = void 0;
+
/**
* The Core is responsible to manage Containers, the mediator, MediaControl
* and the player state.
@@ -8485,6 +8763,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
* @extends UIObject
* @module components
*/
+
var Core = function (_UIObject) {
(0, _inherits3.default)(Core, _UIObject);
(0, _createClass3.default)(Core, [{
@@ -8577,11 +8856,7 @@ var Core = function (_UIObject) {
};
Core.prototype.updateSize = function updateSize() {
- if (_utils.Fullscreen.isFullscreen()) {
- this.setFullscreen();
- } else {
- this.setPlayerSize();
- }
+ if (_utils.Fullscreen.isFullscreen()) this.setFullscreen();else this.setPlayerSize();
};
Core.prototype.setFullscreen = function setFullscreen() {
@@ -8619,7 +8894,7 @@ var Core = function (_UIObject) {
var _this3 = this;
var checkSizeCallback = function checkSizeCallback() {
- if (_this3.playerInfo.computedSize.width != _this3.el.clientWidth || _this3.playerInfo.computedSize.height != _this3.el.clientHeight) {
+ if (_this3.playerInfo.computedSize.width !== _this3.el.clientWidth || _this3.playerInfo.computedSize.height !== _this3.el.clientHeight) {
_this3.playerInfo.computedSize = { width: _this3.el.clientWidth, height: _this3.el.clientHeight };
_this3.triggerResize(_this3.playerInfo.computedSize);
}
@@ -8744,7 +9019,7 @@ var Core = function (_UIObject) {
this.renderContainers();
this.setupMediaControl(this.getCurrentContainer());
this.render();
- this.$el.appendTo(this.options.parentElement);
+ this.appendToParent();
return this.containers;
};
@@ -8775,17 +9050,12 @@ var Core = function (_UIObject) {
};
Core.prototype.createMediaControl = function createMediaControl(options) {
- if (options.mediacontrol && options.mediacontrol.external) {
- return new options.mediacontrol.external(options).render();
- } else {
- return new _media_control2.default(options).render();
- }
+ if (options.mediacontrol && options.mediacontrol.external) return new options.mediacontrol.external(options).render();else return new _media_control2.default(options).render();
};
Core.prototype.getCurrentContainer = function getCurrentContainer() {
- if (!this.mediaControl || !this.mediaControl.container) {
- return this.containers[0];
- }
+ if (!this.mediaControl || !this.mediaControl.container) return this.containers[0];
+
return this.mediaControl.container;
};
@@ -8802,14 +9072,10 @@ var Core = function (_UIObject) {
Core.prototype.toggleFullscreen = function toggleFullscreen() {
if (!_utils.Fullscreen.isFullscreen()) {
_utils.Fullscreen.requestFullscreen(this.el);
- if (!_browser2.default.isiOS) {
- this.$el.addClass('fullscreen');
- }
+ if (!_browser2.default.isiOS) this.$el.addClass('fullscreen');
} else {
_utils.Fullscreen.cancelFullscreen();
- if (!_browser2.default.isiOS) {
- this.$el.removeClass('fullscreen nocursor');
- }
+ if (!_browser2.default.isiOS) this.$el.removeClass('fullscreen nocursor');
}
this.mediaControl.show();
};
@@ -8853,12 +9119,18 @@ var Core = function (_UIObject) {
}
};
+ Core.prototype.appendToParent = function appendToParent() {
+ var hasCoreParent = this.$el.parent() && this.$el.parent().length;
+ !hasCoreParent && this.$el.appendTo(this.options.parentElement);
+ };
+
Core.prototype.render = function render() {
- this.$style && this.$style.remove();
- this.$style = _styler2.default.getStyleFor(_style2.default, { baseUrl: this.options.baseUrl });
- this.$el.append(this.$style);
this.$el.append(this.mediaControl.render().el);
+ if (!style) style = _styler2.default.getStyleFor(_fonts2.default, { baseUrl: this.options.baseUrl });
+
+ (0, _clapprZepto2.default)('head').append(style);
+
this.options.width = this.options.width || this.$el.width();
this.options.height = this.options.height || this.$el.height();
var size = { width: this.options.width, height: this.options.height };
@@ -8873,15 +9145,13 @@ var Core = function (_UIObject) {
};
return Core;
-}(_ui_object2.default); // Copyright 2014 Globo.com Player authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
+}(_ui_object2.default);
exports.default = Core;
module.exports = exports['default'];
/***/ }),
-/* 134 */
+/* 135 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -8891,7 +9161,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _container_factory = __webpack_require__(135);
+var _container_factory = __webpack_require__(136);
var _container_factory2 = _interopRequireDefault(_container_factory);
@@ -8901,7 +9171,7 @@ exports.default = _container_factory2.default;
module.exports = exports['default'];
/***/ }),
-/* 135 */
+/* 136 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -9000,9 +9270,7 @@ var ContainerFactory = function (_BaseObject) {
mimeType = this.options.mimeType;
if ((typeof source === 'undefined' ? 'undefined' : (0, _typeof3.default)(source)) === 'object') {
resolvedSource = source.source.toString();
- if (source.mimeType) {
- mimeType = source.mimeType;
- }
+ if (source.mimeType) mimeType = source.mimeType;
} else {
resolvedSource = source.toString();
}
@@ -9041,7 +9309,7 @@ exports.default = ContainerFactory;
module.exports = exports['default'];
/***/ }),
-/* 136 */
+/* 137 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -9075,13 +9343,7 @@ var _ui_object = __webpack_require__(21);
var _ui_object2 = _interopRequireDefault(_ui_object);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
-var _style = __webpack_require__(137);
-
-var _style2 = _interopRequireDefault(_style);
+__webpack_require__(138);
var _clapprZepto = __webpack_require__(6);
@@ -9097,6 +9359,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
* @extends UIObject
* @module base
*/
+// Copyright 2014 Globo.com Player authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/**
+ * Container is responsible for the video rendering and state
+ */
+
var Container = function (_UIObject) {
(0, _inherits3.default)(Container, _UIObject);
(0, _createClass3.default)(Container, [{
@@ -9283,6 +9553,7 @@ var Container = function (_UIObject) {
this.listenTo(this.playback, _events2.default.PLAYBACK_DVR, this.playbackDvrStateChanged);
this.listenTo(this.playback, _events2.default.PLAYBACK_MEDIACONTROL_DISABLE, this.disableMediaControl);
this.listenTo(this.playback, _events2.default.PLAYBACK_MEDIACONTROL_ENABLE, this.enableMediaControl);
+ this.listenTo(this.playback, _events2.default.PLAYBACK_SEEKED, this.onSeeked);
this.listenTo(this.playback, _events2.default.PLAYBACK_ENDED, this.onEnded);
this.listenTo(this.playback, _events2.default.PLAYBACK_PLAY, this.playing);
this.listenTo(this.playback, _events2.default.PLAYBACK_PAUSE, this.paused);
@@ -9389,9 +9660,8 @@ var Container = function (_UIObject) {
};
Container.prototype.error = function error(errorObj) {
- if (!this.isReady) {
- this.ready();
- }
+ if (!this.isReady) this.ready();
+
this.trigger(_events2.default.CONTAINER_ERROR, { error: errorObj, container: this }, this.name);
};
@@ -9461,21 +9731,15 @@ var Container = function (_UIObject) {
};
Container.prototype.clicked = function clicked() {
- if (!this.options.chromeless || this.options.allowUserInteraction) {
- this.trigger(_events2.default.CONTAINER_CLICK, this, this.name);
- }
+ if (!this.options.chromeless || this.options.allowUserInteraction) this.trigger(_events2.default.CONTAINER_CLICK, this, this.name);
};
Container.prototype.dblClicked = function dblClicked() {
- if (!this.options.chromeless || this.options.allowUserInteraction) {
- this.trigger(_events2.default.CONTAINER_DBLCLICK, this, this.name);
- }
+ if (!this.options.chromeless || this.options.allowUserInteraction) this.trigger(_events2.default.CONTAINER_DBLCLICK, this, this.name);
};
Container.prototype.onContextMenu = function onContextMenu(event) {
- if (!this.options.chromeless || this.options.allowUserInteraction) {
- this.trigger(_events2.default.CONTAINER_CONTEXTMENU, event, this.name);
- }
+ if (!this.options.chromeless || this.options.allowUserInteraction) this.trigger(_events2.default.CONTAINER_CONTEXTMENU, event, this.name);
};
Container.prototype.seek = function seek(time) {
@@ -9483,6 +9747,10 @@ var Container = function (_UIObject) {
this.playback.seek(time);
};
+ Container.prototype.onSeeked = function onSeeked() {
+ this.trigger(_events2.default.CONTAINER_SEEKED, this.name);
+ };
+
Container.prototype.seekPercentage = function seekPercentage(percentage) {
var duration = this.getDuration();
if (percentage >= 0 && percentage <= 100) {
@@ -9546,15 +9814,11 @@ var Container = function (_UIObject) {
};
Container.prototype.mouseEnter = function mouseEnter() {
- if (!this.options.chromeless || this.options.allowUserInteraction) {
- this.trigger(_events2.default.CONTAINER_MOUSE_ENTER);
- }
+ if (!this.options.chromeless || this.options.allowUserInteraction) this.trigger(_events2.default.CONTAINER_MOUSE_ENTER);
};
Container.prototype.mouseLeave = function mouseLeave() {
- if (!this.options.chromeless || this.options.allowUserInteraction) {
- this.trigger(_events2.default.CONTAINER_MOUSE_LEAVE);
- }
+ if (!this.options.chromeless || this.options.allowUserInteraction) this.trigger(_events2.default.CONTAINER_MOUSE_LEAVE);
};
Container.prototype.settingsUpdate = function settingsUpdate() {
@@ -9585,11 +9849,7 @@ var Container = function (_UIObject) {
};
Container.prototype.updateStyle = function updateStyle() {
- if (!this.options.chromeless || this.options.allowUserInteraction) {
- this.$el.removeClass('chromeless');
- } else {
- this.$el.addClass('chromeless');
- }
+ if (!this.options.chromeless || this.options.allowUserInteraction) this.$el.removeClass('chromeless');else this.$el.addClass('chromeless');
};
/**
@@ -9606,30 +9866,53 @@ var Container = function (_UIObject) {
};
Container.prototype.render = function render() {
- var s = _styler2.default.getStyleFor(_style2.default);
- this.$el.append(s);
this.$el.append(this.playback.render().el);
this.updateStyle();
return this;
};
return Container;
-}(_ui_object2.default); // Copyright 2014 Globo.com Player authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/**
- * Container is responsible for the video rendering and state
- */
+}(_ui_object2.default);
exports.default = Container;
module.exports = exports['default'];
/***/ }),
-/* 137 */
+/* 138 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(139);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./style.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./style.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 139 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
@@ -9640,7 +9923,102 @@ exports.push([module.i, ".container[data-container] {\n position: absolute;\n
/***/ }),
-/* 138 */
+/* 140 */
+/***/ (function(module, exports) {
+
+
+/**
+ * When source maps are enabled, `style-loader` uses a link element with a data-uri to
+ * embed the css on the page. This breaks all relative urls because now they are relative to a
+ * bundle instead of the current page.
+ *
+ * One solution is to only use full urls, but that may be impossible.
+ *
+ * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
+ *
+ * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
+ *
+ */
+
+module.exports = function (css) {
+ // get current location
+ var location = typeof window !== "undefined" && window.location;
+
+ if (!location) {
+ throw new Error("fixUrls requires window.location");
+ }
+
+ // blank or null?
+ if (!css || typeof css !== "string") {
+ return css;
+ }
+
+ var baseUrl = location.protocol + "//" + location.host;
+ var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
+
+ // convert each url(...)
+ /*
+ This regular expression is just a way to recursively match brackets within
+ a string.
+
+ /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
+ ( = Start a capturing group
+ (?: = Start a non-capturing group
+ [^)(] = Match anything that isn't a parentheses
+ | = OR
+ \( = Match a start parentheses
+ (?: = Start another non-capturing groups
+ [^)(]+ = Match anything that isn't a parentheses
+ | = OR
+ \( = Match a start parentheses
+ [^)(]* = Match anything that isn't a parentheses
+ \) = Match a end parentheses
+ ) = End Group
+ *\) = Match anything and then a close parens
+ ) = Close non-capturing group
+ * = Match anything
+ ) = Close capturing group
+ \) = Match a close parens
+
+ /gi = Get all matches, not the first. Be case insensitive.
+ */
+ var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
+ // strip quotes (if they exist)
+ var unquotedOrigUrl = origUrl
+ .trim()
+ .replace(/^"(.*)"$/, function(o, $1){ return $1; })
+ .replace(/^'(.*)'$/, function(o, $1){ return $1; });
+
+ // already a full url? no change
+ if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) {
+ return fullMatch;
+ }
+
+ // convert the url to a full url
+ var newUrl;
+
+ if (unquotedOrigUrl.indexOf("//") === 0) {
+ //TODO: should we add protocol?
+ newUrl = unquotedOrigUrl;
+ } else if (unquotedOrigUrl.indexOf("/") === 0) {
+ // path should be relative to the base url
+ newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
+ } else {
+ // path should be relative to current directory
+ newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
+ }
+
+ // send back the fixed url(...)
+ return "url(" + JSON.stringify(newUrl) + ")";
+ });
+
+ // send back the fixed css
+ return fixedCss;
+};
+
+
+/***/ }),
+/* 141 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -9650,7 +10028,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _stringify = __webpack_require__(139);
+var _stringify = __webpack_require__(142);
var _stringify2 = _interopRequireDefault(_stringify);
@@ -9678,10 +10056,6 @@ var _events = __webpack_require__(4);
var _events2 = _interopRequireDefault(_events);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
var _ui_object = __webpack_require__(21);
var _ui_object2 = _interopRequireDefault(_ui_object);
@@ -9706,13 +10080,11 @@ var _clapprZepto = __webpack_require__(6);
var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
-var _mediaControl = __webpack_require__(141);
+__webpack_require__(144);
-var _mediaControl2 = _interopRequireDefault(_mediaControl);
-
-var _mediaControl3 = __webpack_require__(142);
+var _mediaControl = __webpack_require__(146);
-var _mediaControl4 = _interopRequireDefault(_mediaControl3);
+var _mediaControl2 = _interopRequireDefault(_mediaControl);
var _play = __webpack_require__(58);
@@ -9722,40 +10094,32 @@ var _pause = __webpack_require__(76);
var _pause2 = _interopRequireDefault(_pause);
-var _stop = __webpack_require__(143);
+var _stop = __webpack_require__(147);
var _stop2 = _interopRequireDefault(_stop);
-var _volume = __webpack_require__(144);
+var _volume = __webpack_require__(148);
var _volume2 = _interopRequireDefault(_volume);
-var _mute = __webpack_require__(145);
+var _mute = __webpack_require__(149);
var _mute2 = _interopRequireDefault(_mute);
-var _expand = __webpack_require__(146);
+var _expand = __webpack_require__(150);
var _expand2 = _interopRequireDefault(_expand);
-var _shrink = __webpack_require__(147);
+var _shrink = __webpack_require__(151);
var _shrink2 = _interopRequireDefault(_shrink);
-var _hd = __webpack_require__(148);
+var _hd = __webpack_require__(152);
var _hd2 = _interopRequireDefault(_hd);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-// Copyright 2014 Globo.com Player authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/**
- * The MediaControl is responsible for displaying the Player controls.
- */
-
var MediaControl = function (_UIObject) {
(0, _inherits3.default)(MediaControl, _UIObject);
(0, _createClass3.default)(MediaControl, [{
@@ -9803,12 +10167,7 @@ var MediaControl = function (_UIObject) {
}, {
key: 'template',
get: function get() {
- return (0, _template2.default)(_mediaControl4.default);
- }
- }, {
- key: 'stylesheet',
- get: function get() {
- return _styler2.default.getStyleFor(_mediaControl2.default, { baseUrl: this.options.baseUrl });
+ return (0, _template2.default)(_mediaControl2.default);
}
}, {
key: 'volume',
@@ -9843,17 +10202,14 @@ var MediaControl = function (_UIObject) {
};
if (_this.container) {
- if (!_clapprZepto2.default.isEmptyObject(_this.container.settings)) {
- _this.settings = _clapprZepto2.default.extend({}, _this.container.settings);
- }
+ if (!_clapprZepto2.default.isEmptyObject(_this.container.settings)) _this.settings = _clapprZepto2.default.extend({}, _this.container.settings);
} else {
_this.settings = {};
}
_this.userDisabled = false;
- if (_this.container && _this.container.mediaControlDisabled || _this.options.chromeless) {
- _this.disable();
- }
+ if (_this.container && _this.container.mediaControlDisabled || _this.options.chromeless) _this.disable();
+
_this.stopDragHandler = function (event) {
return _this.stopDrag(event);
};
@@ -9966,9 +10322,7 @@ var MediaControl = function (_UIObject) {
this.$playPauseToggle.append(_play2.default);
this.$playStopToggle.append(_play2.default);
this.trigger(_events2.default.MEDIACONTROL_NOTPLAYING);
- if (_browser2.default.isMobile) {
- this.show();
- }
+ if (_browser2.default.isMobile) this.show();
}
this.applyButtonStyle(this.$playPauseToggle);
this.applyButtonStyle(this.$playStopToggle);
@@ -9991,40 +10345,26 @@ var MediaControl = function (_UIObject) {
};
MediaControl.prototype.mousemoveOnVolumeBar = function mousemoveOnVolumeBar(event) {
- if (this.draggingVolumeBar) {
- this.setVolume(this.getVolumeFromUIEvent(event));
- }
+ if (this.draggingVolumeBar) this.setVolume(this.getVolumeFromUIEvent(event));
};
MediaControl.prototype.playerResize = function playerResize(size) {
this.$fullscreenToggle.html('');
- if (_utils.Fullscreen.isFullscreen()) {
- this.$fullscreenToggle.append(_shrink2.default);
- } else {
- this.$fullscreenToggle.append(_expand2.default);
- }
+ if (_utils.Fullscreen.isFullscreen()) this.$fullscreenToggle.append(_shrink2.default);else this.$fullscreenToggle.append(_expand2.default);
+
this.applyButtonStyle(this.$fullscreenToggle);
this.$el.removeClass('w320');
- if (size.width <= 320 || this.options.hideVolumeBar) {
- this.$el.addClass('w320');
- }
+ if (size.width <= 320 || this.options.hideVolumeBar) this.$el.addClass('w320');
};
MediaControl.prototype.togglePlayPause = function togglePlayPause() {
- if (this.container.isPlaying()) {
- this.container.pause();
- } else {
- this.container.play();
- }
+ if (this.container.isPlaying()) this.container.pause();else this.container.play();
+
return false;
};
MediaControl.prototype.togglePlayStop = function togglePlayStop() {
- if (this.container.isPlaying()) {
- this.container.stop();
- } else {
- this.container.play();
- }
+ if (this.container.isPlaying()) this.container.stop();else this.container.play();
};
MediaControl.prototype.startSeekDrag = function startSeekDrag(event) {
@@ -10034,23 +10374,18 @@ var MediaControl = function (_UIObject) {
this.$seekBarLoaded.addClass('media-control-notransition');
this.$seekBarPosition.addClass('media-control-notransition');
this.$seekBarScrubber.addClass('media-control-notransition');
- if (event) {
- event.preventDefault();
- }
+ if (event) event.preventDefault();
};
MediaControl.prototype.startVolumeDrag = function startVolumeDrag(event) {
this.draggingVolumeBar = true;
this.$el.addClass('dragging');
- if (event) {
- event.preventDefault();
- }
+ if (event) event.preventDefault();
};
MediaControl.prototype.stopDrag = function stopDrag(event) {
- if (this.draggingSeekBar) {
- this.seek(event);
- }
+ if (this.draggingSeekBar) this.seek(event);
+
this.$el.removeClass('dragging');
this.$seekBarLoaded.removeClass('media-control-notransition');
this.$seekBarPosition.removeClass('media-control-notransition');
@@ -10129,16 +10464,14 @@ var MediaControl = function (_UIObject) {
this.addEventListeners();
this.settingsUpdate();
this.container.trigger(_events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, this.container.isDvrInUse());
- if (this.container.mediaControlDisabled) {
- this.disable();
- }
+ if (this.container.mediaControlDisabled) this.disable();
+
this.trigger(_events2.default.MEDIACONTROL_CONTAINERCHANGED);
};
MediaControl.prototype.showVolumeBar = function showVolumeBar() {
- if (this.hideVolumeId) {
- clearTimeout(this.hideVolumeId);
- }
+ if (this.hideVolumeId) clearTimeout(this.hideVolumeId);
+
this.$volumeBarContainer.removeClass('volume-bar-hide');
};
@@ -10153,9 +10486,8 @@ var MediaControl = function (_UIObject) {
return _this3.hideVolumeBar();
}, timeout);
} else {
- if (this.hideVolumeId) {
- clearTimeout(this.hideVolumeId);
- }
+ if (this.hideVolumeId) clearTimeout(this.hideVolumeId);
+
this.hideVolumeId = setTimeout(function () {
return _this3.$volumeBarContainer.addClass('volume-bar-hide');
}, timeout);
@@ -10190,9 +10522,8 @@ var MediaControl = function (_UIObject) {
// default to 100%
this.currentSeekBarPercentage = 100;
- if (this.container.getPlaybackType() !== _playback2.default.LIVE || this.container.isDvrInUse()) {
- this.currentSeekBarPercentage = this.currentPositionValue / this.currentDurationValue * 100;
- }
+ if (this.container.getPlaybackType() !== _playback2.default.LIVE || this.container.isDvrInUse()) this.currentSeekBarPercentage = this.currentPositionValue / this.currentDurationValue * 100;
+
this.setSeekPercentage(this.currentSeekBarPercentage);
var newPosition = (0, _utils.formatTime)(this.currentPositionValue);
@@ -10240,9 +10571,8 @@ var MediaControl = function (_UIObject) {
MediaControl.prototype.show = function show(event) {
var _this4 = this;
- if (this.disabled) {
- return;
- }
+ if (this.disabled) return;
+
var timeout = 2000;
if (!event || event.clientX !== this.lastMouseX && event.clientY !== this.lastMouseY || navigator.userAgent.match(/firefox/i)) {
clearTimeout(this.hideId);
@@ -10264,14 +10594,12 @@ var MediaControl = function (_UIObject) {
var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- if (!this.isVisible() || _browser2.default.isMobile && !this.container.isPlaying()) {
- return;
- }
+ if (!this.isVisible() || _browser2.default.isMobile && !this.container.isPlaying()) return;
+
var timeout = delay || 2000;
clearTimeout(this.hideId);
- if (!this.disabled && this.options.hideMediaControl === false) {
- return;
- }
+ if (!this.disabled && this.options.hideMediaControl === false) return;
+
if (!this.disabled && (delay || this.userKeepVisible || this.keepVisible || this.draggingSeekBar || this.draggingVolumeBar)) {
this.hideId = setTimeout(function () {
return _this5.hide();
@@ -10439,9 +10767,7 @@ var MediaControl = function (_UIObject) {
};
MediaControl.prototype.applyButtonStyle = function applyButtonStyle(element) {
- if (this.buttonsColor && element) {
- (0, _clapprZepto2.default)(element).find('svg path').css('fill', this.buttonsColor);
- }
+ if (this.buttonsColor && element) (0, _clapprZepto2.default)(element).find('svg path').css('fill', this.buttonsColor);
};
MediaControl.prototype.destroy = function destroy() {
@@ -10456,7 +10782,6 @@ var MediaControl = function (_UIObject) {
var timeout = 1000;
this.$el.html(this.template({ settings: this.settings }));
- this.$el.append(this.stylesheet);
this.createCachedElements();
this.$playPauseToggle.addClass('paused');
this.$playStopToggle.addClass('stopped');
@@ -10465,37 +10790,28 @@ var MediaControl = function (_UIObject) {
this.hideId = setTimeout(function () {
return _this8.hide();
}, timeout);
- if (this.disabled) {
- this.hide();
- }
+ if (this.disabled) this.hide();
// Video volume cannot be changed with Safari on mobile devices
// Display mute/unmute icon only if Safari version >= 10
if (_browser2.default.isSafari && _browser2.default.isMobile) {
- if (_browser2.default.version < 10) {
- this.$volumeContainer.css('display', 'none');
- } else {
- this.$volumeBarContainer.css('display', 'none');
- }
+ if (_browser2.default.version < 10) this.$volumeContainer.css('display', 'none');else this.$volumeBarContainer.css('display', 'none');
}
this.$seekBarPosition.addClass('media-control-notransition');
this.$seekBarScrubber.addClass('media-control-notransition');
var previousSeekPercentage = 0;
- if (this.displayedSeekBarPercentage) {
- previousSeekPercentage = this.displayedSeekBarPercentage;
- }
+ if (this.displayedSeekBarPercentage) previousSeekPercentage = this.displayedSeekBarPercentage;
+
this.displayedSeekBarPercentage = null;
this.setSeekPercentage(previousSeekPercentage);
process.nextTick(function () {
- if (!_this8.settings.seekEnabled) {
- _this8.$seekBarContainer.addClass('seek-disabled');
- }
- if (!_browser2.default.isMobile && !_this8.options.disableKeyboardShortcuts) {
- _this8.bindKeyEvents();
- }
+ if (!_this8.settings.seekEnabled) _this8.$seekBarContainer.addClass('seek-disabled');
+
+ if (!_browser2.default.isMobile && !_this8.options.disableKeyboardShortcuts) _this8.bindKeyEvents();
+
_this8.playerResize({ width: _this8.options.width, height: _this8.options.height });
_this8.hideVolumeBar(0);
});
@@ -10510,7 +10826,13 @@ var MediaControl = function (_UIObject) {
};
return MediaControl;
-}(_ui_object2.default);
+}(_ui_object2.default); // Copyright 2014 Globo.com Player authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/**
+ * The MediaControl is responsible for displaying the Player controls.
+ */
exports.default = MediaControl;
@@ -10522,13 +10844,13 @@ module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(57)))
/***/ }),
-/* 139 */
+/* 142 */
/***/ (function(module, exports, __webpack_require__) {
-module.exports = { "default": __webpack_require__(140), __esModule: true };
+module.exports = { "default": __webpack_require__(143), __esModule: true };
/***/ }),
-/* 140 */
+/* 143 */
/***/ (function(module, exports, __webpack_require__) {
var core = __webpack_require__(11)
@@ -10538,83 +10860,159 @@ module.exports = function stringify(it){ // eslint-disable-line no-unused-vars
};
/***/ }),
-/* 141 */
+/* 144 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(145);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./media-control.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./media-control.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 145 */
+/***/ (function(module, exports, __webpack_require__) {
+
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
// module
-exports.push([module.i, ".media-control-notransition {\n -webkit-transition: none !important;\n -moz-transition: none !important;\n transition: none !important; }\n\n.media-control[data-media-control] {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 9999;\n pointer-events: none; }\n .media-control[data-media-control].dragging {\n pointer-events: auto;\n cursor: -webkit-grabbing !important;\n cursor: grabbing !important;\n cursor: url(" + __webpack_require__(75) + "), move; }\n .media-control[data-media-control].dragging * {\n cursor: -webkit-grabbing !important;\n cursor: grabbing !important;\n cursor: url(" + __webpack_require__(75) + "), move; }\n .media-control[data-media-control] .media-control-background[data-background] {\n position: absolute;\n height: 40%;\n width: 100%;\n bottom: 0;\n background: -webkit-linear-gradient(transparent, rgba(0, 0, 0, 0.9));\n background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));\n -webkit-transition: opacity 0.6s ease-out;\n -moz-transition: opacity 0.6s ease-out;\n transition: opacity 0.6s ease-out; }\n .media-control[data-media-control] .media-control-icon {\n line-height: 0;\n letter-spacing: 0;\n speak: none;\n color: #fff;\n opacity: 0.5;\n vertical-align: middle;\n text-align: left;\n -webkit-transition: all 0.1s ease;\n -moz-transition: all 0.1s ease;\n transition: all 0.1s ease; }\n .media-control[data-media-control] .media-control-icon:hover {\n color: white;\n opacity: 0.75;\n text-shadow: rgba(255, 255, 255, 0.8) 0 0 5px; }\n .media-control[data-media-control].media-control-hide .media-control-background[data-background] {\n opacity: 0; }\n .media-control[data-media-control].media-control-hide .media-control-layer[data-controls] {\n bottom: -50px; }\n .media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] {\n opacity: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] {\n position: absolute;\n bottom: 7px;\n width: 100%;\n height: 32px;\n font-size: 0;\n vertical-align: middle;\n pointer-events: auto;\n -webkit-transition: bottom 0.4s ease-out;\n -moz-transition: bottom 0.4s ease-out;\n transition: bottom 0.4s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control] {\n position: absolute;\n top: 0;\n left: 4px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control] {\n height: 100%;\n text-align: center;\n line-height: 32px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control] {\n position: absolute;\n top: 0;\n right: 4px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button {\n background-color: transparent;\n border: 0;\n margin: 0 6px;\n padding: 0;\n cursor: pointer;\n display: inline-block;\n width: 32px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg {\n width: 100%;\n height: 22px; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg path {\n fill: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus {\n outline: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen] {\n float: right;\n background-color: transparent;\n border: 0;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator] {\n background-color: transparent;\n border: 0;\n cursor: default;\n display: none;\n float: right;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled {\n display: block;\n opacity: 1.0; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled:hover {\n opacity: 1.0;\n text-shadow: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause] {\n float: left; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop] {\n float: left; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position], .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration] {\n display: inline-block;\n font-size: 10px;\n color: white;\n cursor: default;\n line-height: 32px;\n position: relative; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position] {\n margin: 0 6px 0 7px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration] {\n color: rgba(255, 255, 255, 0.5);\n margin-right: 6px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before {\n content: \"|\";\n margin-right: 7px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] {\n position: absolute;\n top: -20px;\n left: 0;\n display: inline-block;\n vertical-align: middle;\n width: 100%;\n height: 25px;\n cursor: pointer; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] {\n width: 100%;\n height: 1px;\n position: relative;\n top: 12px;\n background-color: #666666; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #c2c2c2;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #005aff;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 0;\n position: absolute;\n top: -3px;\n width: 5px;\n height: 7px;\n background-color: rgba(255, 255, 255, 0.5);\n -webkit-transition: opacity 0.1s ease;\n -moz-transition: opacity 0.1s ease;\n transition: opacity 0.1s ease; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]:hover .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 1; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled {\n cursor: default; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled:hover .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] {\n position: absolute;\n -webkit-transform: translateX(-50%);\n -moz-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n -o-transform: translateX(-50%);\n transform: translateX(-50%);\n top: 2px;\n left: 0;\n width: 20px;\n height: 20px;\n opacity: 1;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar] {\n position: absolute;\n left: 6px;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 10px;\n box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);\n background-color: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] {\n float: right;\n display: inline-block;\n height: 32px;\n cursor: pointer;\n margin: 0 6px;\n box-sizing: border-box; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] {\n float: left;\n bottom: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] {\n background-color: transparent;\n border: 0;\n box-sizing: content-box;\n width: 32px;\n height: 32px;\n opacity: 0.5; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:hover {\n opacity: 0.75; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg {\n height: 24px;\n position: relative;\n top: 3px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg path {\n fill: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted svg {\n margin-left: 2px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] {\n float: left;\n position: relative;\n overflow: hidden;\n top: 6px;\n width: 42px;\n height: 18px;\n padding: 3px 0;\n -webkit-transition: width 0.2s ease-out;\n -moz-transition: width 0.2s ease-out;\n transition: width 0.2s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] {\n height: 1px;\n position: relative;\n top: 7px;\n margin: 0 3px;\n background-color: #666666; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #c2c2c2;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-2[data-volume] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #005aff;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-hover[data-volume] {\n opacity: 0;\n position: absolute;\n top: -3px;\n width: 5px;\n height: 7px;\n background-color: rgba(255, 255, 255, 0.5);\n -webkit-transition: opacity 0.1s ease;\n -moz-transition: opacity 0.1s ease;\n transition: opacity 0.1s ease; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] {\n position: absolute;\n -webkit-transform: translateX(-50%);\n -moz-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n -o-transform: translateX(-50%);\n transform: translateX(-50%);\n top: 0px;\n left: 0;\n width: 20px;\n height: 20px;\n opacity: 1;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume] {\n position: absolute;\n left: 6px;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 10px;\n box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);\n background-color: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume] {\n float: left;\n width: 4px;\n padding-left: 2px;\n height: 12px;\n opacity: 0.5;\n box-shadow: inset 2px 0 0 white;\n -webkit-transition: -webkit-transform 0.2s ease-out;\n -moz-transition: -moz-transform 0.2s ease-out;\n transition: transform 0.2s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume].fill {\n box-shadow: inset 2px 0 0 #fff;\n opacity: 1; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:nth-of-type(1) {\n padding-left: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:hover {\n -webkit-transform: scaleY(1.5);\n -moz-transform: scaleY(1.5);\n -ms-transform: scaleY(1.5);\n -o-transform: scaleY(1.5);\n transform: scaleY(1.5); }\n .media-control[data-media-control].w320 .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide {\n width: 0;\n height: 12px;\n top: 9px;\n padding: 0; }\n", ""]);
+exports.push([module.i, ".media-control-notransition {\n transition: none !important; }\n\n.media-control[data-media-control] {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 9999;\n pointer-events: none; }\n .media-control[data-media-control].dragging {\n pointer-events: auto;\n cursor: -webkit-grabbing !important;\n cursor: grabbing !important;\n cursor: url(" + __webpack_require__(75) + "), move; }\n .media-control[data-media-control].dragging * {\n cursor: -webkit-grabbing !important;\n cursor: grabbing !important;\n cursor: url(" + __webpack_require__(75) + "), move; }\n .media-control[data-media-control] .media-control-background[data-background] {\n position: absolute;\n height: 40%;\n width: 100%;\n bottom: 0;\n background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));\n transition: opacity 0.6s ease-out; }\n .media-control[data-media-control] .media-control-icon {\n line-height: 0;\n letter-spacing: 0;\n speak: none;\n color: #fff;\n opacity: 0.5;\n vertical-align: middle;\n text-align: left;\n transition: all 0.1s ease; }\n .media-control[data-media-control] .media-control-icon:hover {\n color: white;\n opacity: 0.75;\n text-shadow: rgba(255, 255, 255, 0.8) 0 0 5px; }\n .media-control[data-media-control].media-control-hide .media-control-background[data-background] {\n opacity: 0; }\n .media-control[data-media-control].media-control-hide .media-control-layer[data-controls] {\n bottom: -50px; }\n .media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] {\n opacity: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] {\n position: absolute;\n bottom: 7px;\n width: 100%;\n height: 32px;\n font-size: 0;\n vertical-align: middle;\n pointer-events: auto;\n transition: bottom 0.4s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control] {\n position: absolute;\n top: 0;\n left: 4px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control] {\n height: 100%;\n text-align: center;\n line-height: 32px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control] {\n position: absolute;\n top: 0;\n right: 4px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button {\n background-color: transparent;\n border: 0;\n margin: 0 6px;\n padding: 0;\n cursor: pointer;\n display: inline-block;\n width: 32px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg {\n width: 100%;\n height: 22px; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg path {\n fill: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus {\n outline: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen] {\n float: right;\n background-color: transparent;\n border: 0;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator] {\n background-color: transparent;\n border: 0;\n cursor: default;\n display: none;\n float: right;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled {\n display: block;\n opacity: 1.0; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled:hover {\n opacity: 1.0;\n text-shadow: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause] {\n float: left; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop] {\n float: left; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position], .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration] {\n display: inline-block;\n font-size: 10px;\n color: white;\n cursor: default;\n line-height: 32px;\n position: relative; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position] {\n margin: 0 6px 0 7px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration] {\n color: rgba(255, 255, 255, 0.5);\n margin-right: 6px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before {\n content: \"|\";\n margin-right: 7px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] {\n position: absolute;\n top: -20px;\n left: 0;\n display: inline-block;\n vertical-align: middle;\n width: 100%;\n height: 25px;\n cursor: pointer; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] {\n width: 100%;\n height: 1px;\n position: relative;\n top: 12px;\n background-color: #666666; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #c2c2c2;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #005aff;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 0;\n position: absolute;\n top: -3px;\n width: 5px;\n height: 7px;\n background-color: rgba(255, 255, 255, 0.5);\n transition: opacity 0.1s ease; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]:hover .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 1; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled {\n cursor: default; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled:hover .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] {\n position: absolute;\n -webkit-transform: translateX(-50%);\n transform: translateX(-50%);\n top: 2px;\n left: 0;\n width: 20px;\n height: 20px;\n opacity: 1;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar] {\n position: absolute;\n left: 6px;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 10px;\n box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);\n background-color: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] {\n float: right;\n display: inline-block;\n height: 32px;\n cursor: pointer;\n margin: 0 6px;\n box-sizing: border-box; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] {\n float: left;\n bottom: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] {\n background-color: transparent;\n border: 0;\n box-sizing: content-box;\n width: 32px;\n height: 32px;\n opacity: 0.5; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:hover {\n opacity: 0.75; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg {\n height: 24px;\n position: relative;\n top: 3px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg path {\n fill: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted svg {\n margin-left: 2px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] {\n float: left;\n position: relative;\n overflow: hidden;\n top: 6px;\n width: 42px;\n height: 18px;\n padding: 3px 0;\n transition: width .2s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] {\n height: 1px;\n position: relative;\n top: 7px;\n margin: 0 3px;\n background-color: #666666; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #c2c2c2;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-2[data-volume] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #005aff;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-hover[data-volume] {\n opacity: 0;\n position: absolute;\n top: -3px;\n width: 5px;\n height: 7px;\n background-color: rgba(255, 255, 255, 0.5);\n transition: opacity 0.1s ease; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] {\n position: absolute;\n -webkit-transform: translateX(-50%);\n transform: translateX(-50%);\n top: 0px;\n left: 0;\n width: 20px;\n height: 20px;\n opacity: 1;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume] {\n position: absolute;\n left: 6px;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 10px;\n box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);\n background-color: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume] {\n float: left;\n width: 4px;\n padding-left: 2px;\n height: 12px;\n opacity: 0.5;\n box-shadow: inset 2px 0 0 white;\n transition: -webkit-transform .2s ease-out;\n transition: transform .2s ease-out;\n transition: transform .2s ease-out, -webkit-transform .2s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume].fill {\n box-shadow: inset 2px 0 0 #fff;\n opacity: 1; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:nth-of-type(1) {\n padding-left: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:hover {\n -webkit-transform: scaleY(1.5);\n transform: scaleY(1.5); }\n .media-control[data-media-control].w320 .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide {\n width: 0;\n height: 12px;\n top: 9px;\n padding: 0; }\n", ""]);
// exports
/***/ }),
-/* 142 */
+/* 146 */
/***/ (function(module, exports) {
module.exports = "<div class=\"media-control-background\" data-background></div>\n<div class=\"media-control-layer\" data-controls>\n <% var renderBar = function(name) { %>\n <div class=\"bar-container\" data-<%= name %>>\n <div class=\"bar-background\" data-<%= name %>>\n <div class=\"bar-fill-1\" data-<%= name %>></div>\n <div class=\"bar-fill-2\" data-<%= name %>></div>\n <div class=\"bar-hover\" data-<%= name %>></div>\n </div>\n <div class=\"bar-scrubber\" data-<%= name %>>\n <div class=\"bar-scrubber-icon\" data-<%= name %>></div>\n </div>\n </div>\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n <div class=\"bar-container\" data-<%= name %>>\n <% for (var i = 0; i < segments; i++) { %>\n <div class=\"segmented-bar-element\" data-<%= name %>></div>\n <% } %>\n </div>\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n <div class=\"drawer-container\" data-<%= name %>>\n <div class=\"drawer-icon-container\" data-<%= name %>>\n <div class=\"drawer-icon media-control-icon\" data-<%= name %>></div>\n <span class=\"drawer-text\" data-<%= name %>></span>\n </div>\n <% renderContent(name); %>\n </div>\n <% }; %>\n <% var renderIndicator = function(name) { %>\n <div class=\"media-control-indicator\" data-<%= name %>></div>\n <% }; %>\n <% var renderButton = function(name) { %>\n <button type=\"button\" class=\"media-control-button media-control-icon\" data-<%= name %> aria-label=\"<%= name %>\"></button>\n <% }; %>\n <% var templates = {\n bar: renderBar,\n segmentedBar: renderSegmentedBar,\n };\n var render = function(settingsList) {\n settingsList.forEach(function(setting) {\n if(setting === \"seekbar\") {\n renderBar(setting);\n } else if (setting === \"volume\") {\n renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function(name) { return renderSegmentedBar(name); });\n } else if (setting === \"duration\" || setting === \"position\") {\n renderIndicator(setting);\n } else {\n renderButton(setting);\n }\n });\n }; %>\n <% if (settings.default && settings.default.length) { %>\n <div class=\"media-control-center-panel\" data-media-control>\n <% render(settings.default); %>\n </div>\n <% } %>\n <% if (settings.left && settings.left.length) { %>\n <div class=\"media-control-left-panel\" data-media-control>\n <% render(settings.left); %>\n </div>\n <% } %>\n <% if (settings.right && settings.right.length) { %>\n <div class=\"media-control-right-panel\" data-media-control>\n <% render(settings.right); %>\n </div>\n <% } %>\n</div>\n";
/***/ }),
-/* 143 */
+/* 147 */
/***/ (function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" fill=\"#010101\" d=\"M1.712 1.24h12.6v13.52h-12.6z\"></path></svg>"
/***/ }),
-/* 144 */
+/* 148 */
/***/ (function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" fill=\"#010101\" d=\"M11.5 11h-.002v1.502L7.798 10H4.5V6h3.297l3.7-2.502V4.5h.003V11zM11 4.49L7.953 6.5H5v3h2.953L11 11.51V4.49z\"></path></svg>"
/***/ }),
-/* 145 */
+/* 149 */
/***/ (function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" fill=\"#010101\" d=\"M9.75 11.51L6.7 9.5H3.75v-3H6.7L9.75 4.49v.664l.497.498V3.498L6.547 6H3.248v4h3.296l3.7 2.502v-2.154l-.497.5v.662zm3-5.165L12.404 6l-1.655 1.653L9.093 6l-.346.345L10.402 8 8.747 9.654l.346.347 1.655-1.653L12.403 10l.348-.346L11.097 8l1.655-1.655z\"></path></svg>"
/***/ }),
-/* 146 */
+/* 150 */
/***/ (function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"#010101\" d=\"M7.156 8L4 11.156V8.5H3V13h4.5v-1H4.844L8 8.844 7.156 8zM8.5 3v1h2.657L8 7.157 8.846 8 12 4.844V7.5h1V3H8.5z\"></path></svg>"
/***/ }),
-/* 147 */
+/* 151 */
/***/ (function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"#010101\" d=\"M13.5 3.344l-.844-.844L9.5 5.656V3h-1v4.5H13v-1h-2.656L13.5 3.344zM3 9.5h2.656L2.5 12.656l.844.844L6.5 10.344V13h1V8.5H3v1z\"></path></svg>"
/***/ }),
-/* 148 */
+/* 152 */
/***/ (function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"#010101\" d=\"M5.375 7.062H2.637V4.26H.502v7.488h2.135V8.9h2.738v2.848h2.133V4.26H5.375v2.802zm5.97-2.81h-2.84v7.496h2.798c2.65 0 4.195-1.607 4.195-3.77v-.022c0-2.162-1.523-3.704-4.154-3.704zm2.06 3.758c0 1.21-.81 1.896-2.03 1.896h-.83V6.093h.83c1.22 0 2.03.696 2.03 1.896v.02z\"></path></svg>"
/***/ }),
-/* 149 */
+/* 153 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(154);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./style.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./style.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 154 */
+/***/ (function(module, exports, __webpack_require__) {
+
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
// module
-exports.push([module.i, "@font-face {\n font-family: \"Roboto\";\n font-style: normal;\n font-weight: 400;\n src: local(\"Roboto\"), local(\"Roboto-Regular\"), url(" + __webpack_require__(150) + ") format(\"truetype\"); }\n\n[data-player] {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-transform: translate3d(0, 0, 0);\n -moz-transform: translate3d(0, 0, 0);\n -ms-transform: translate3d(0, 0, 0);\n -o-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n position: relative;\n margin: 0;\n padding: 0;\n border: 0;\n font-style: normal;\n font-weight: normal;\n text-align: center;\n overflow: hidden;\n font-size: 100%;\n font-family: \"Roboto\", \"Open Sans\", Arial, sans-serif;\n text-shadow: 0 0 0;\n box-sizing: border-box; }\n [data-player] div, [data-player] span, [data-player] applet, [data-player] object, [data-player] iframe,\n [data-player] h1, [data-player] h2, [data-player] h3, [data-player] h4, [data-player] h5, [data-player] h6, [data-player] p, [data-player] blockquote, [data-player] pre,\n [data-player] a, [data-player] abbr, [data-player] acronym, [data-player] address, [data-player] big, [data-player] cite, [data-player] code,\n [data-player] del, [data-player] dfn, [data-player] em, [data-player] img, [data-player] ins, [data-player] kbd, [data-player] q, [data-player] s, [data-player] samp,\n [data-player] small, [data-player] strike, [data-player] strong, [data-player] sub, [data-player] sup, [data-player] tt, [data-player] var,\n [data-player] b, [data-player] u, [data-player] i, [data-player] center,\n [data-player] dl, [data-player] dt, [data-player] dd, [data-player] ol, [data-player] ul, [data-player] li,\n [data-player] fieldset, [data-player] form, [data-player] label, [data-player] legend,\n [data-player] table, [data-player] caption, [data-player] tbody, [data-player] tfoot, [data-player] thead, [data-player] tr, [data-player] th, [data-player] td,\n [data-player] article, [data-player] aside, [data-player] canvas, [data-player] details, [data-player] embed,\n [data-player] figure, [data-player] figcaption, [data-player] footer, [data-player] header, [data-player] hgroup,\n [data-player] menu, [data-player] nav, [data-player] output, [data-player] ruby, [data-player] section, [data-player] summary,\n [data-player] time, [data-player] mark, [data-player] audio, [data-player] video {\n margin: 0;\n padding: 0;\n border: 0;\n font: inherit;\n font-size: 100%;\n vertical-align: baseline; }\n [data-player] table {\n border-collapse: collapse;\n border-spacing: 0; }\n [data-player] caption, [data-player] th, [data-player] td {\n text-align: left;\n font-weight: normal;\n vertical-align: middle; }\n [data-player] q, [data-player] blockquote {\n quotes: none; }\n [data-player] q:before, [data-player] q:after, [data-player] blockquote:before, [data-player] blockquote:after {\n content: \"\";\n content: none; }\n [data-player] a img {\n border: none; }\n [data-player]:focus {\n outline: 0; }\n [data-player] * {\n max-width: none;\n box-sizing: inherit;\n float: none; }\n [data-player] div {\n display: block; }\n [data-player].fullscreen {\n width: 100% !important;\n height: 100% !important;\n top: 0;\n left: 0; }\n [data-player].nocursor {\n cursor: none; }\n\n.clappr-style {\n display: none !important; }\n", ""]);
+exports.push([module.i, "[data-player] {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n position: relative;\n margin: 0;\n padding: 0;\n border: 0;\n font-style: normal;\n font-weight: normal;\n text-align: center;\n overflow: hidden;\n font-size: 100%;\n font-family: \"Roboto\", \"Open Sans\", Arial, sans-serif;\n text-shadow: 0 0 0;\n box-sizing: border-box; }\n [data-player] div, [data-player] span, [data-player] applet, [data-player] object, [data-player] iframe,\n [data-player] h1, [data-player] h2, [data-player] h3, [data-player] h4, [data-player] h5, [data-player] h6, [data-player] p, [data-player] blockquote, [data-player] pre,\n [data-player] a, [data-player] abbr, [data-player] acronym, [data-player] address, [data-player] big, [data-player] cite, [data-player] code,\n [data-player] del, [data-player] dfn, [data-player] em, [data-player] img, [data-player] ins, [data-player] kbd, [data-player] q, [data-player] s, [data-player] samp,\n [data-player] small, [data-player] strike, [data-player] strong, [data-player] sub, [data-player] sup, [data-player] tt, [data-player] var,\n [data-player] b, [data-player] u, [data-player] i, [data-player] center,\n [data-player] dl, [data-player] dt, [data-player] dd, [data-player] ol, [data-player] ul, [data-player] li,\n [data-player] fieldset, [data-player] form, [data-player] label, [data-player] legend,\n [data-player] table, [data-player] caption, [data-player] tbody, [data-player] tfoot, [data-player] thead, [data-player] tr, [data-player] th, [data-player] td,\n [data-player] article, [data-player] aside, [data-player] canvas, [data-player] details, [data-player] embed,\n [data-player] figure, [data-player] figcaption, [data-player] footer, [data-player] header, [data-player] hgroup,\n [data-player] menu, [data-player] nav, [data-player] output, [data-player] ruby, [data-player] section, [data-player] summary,\n [data-player] time, [data-player] mark, [data-player] audio, [data-player] video {\n margin: 0;\n padding: 0;\n border: 0;\n font: inherit;\n font-size: 100%;\n vertical-align: baseline; }\n [data-player] table {\n border-collapse: collapse;\n border-spacing: 0; }\n [data-player] caption, [data-player] th, [data-player] td {\n text-align: left;\n font-weight: normal;\n vertical-align: middle; }\n [data-player] q, [data-player] blockquote {\n quotes: none; }\n [data-player] q:before, [data-player] q:after, [data-player] blockquote:before, [data-player] blockquote:after {\n content: \"\";\n content: none; }\n [data-player] a img {\n border: none; }\n [data-player]:focus {\n outline: 0; }\n [data-player] * {\n max-width: none;\n box-sizing: inherit;\n float: none; }\n [data-player] div {\n display: block; }\n [data-player].fullscreen {\n width: 100% !important;\n height: 100% !important;\n top: 0;\n left: 0; }\n [data-player].nocursor {\n cursor: none; }\n\n.clappr-style {\n display: none !important; }\n", ""]);
// exports
/***/ }),
-/* 150 */
+/* 155 */
/***/ (function(module, exports, __webpack_require__) {
-module.exports = __webpack_require__.p + "38861cba61c66739c1452c3a71e39852.ttf";
+exports = module.exports = __webpack_require__(7)(undefined);
+// imports
+
+
+// module
+exports.push([module.i, "@font-face {\n font-family: \"Roboto\";\n font-style: normal;\n font-weight: 400;\n src: local(\"Roboto\"), local(\"Roboto-Regular\"), url(" + __webpack_require__(156) + ") format(\"truetype\");\n}\n", ""]);
+
+// exports
+
/***/ }),
-/* 151 */
+/* 156 */
+/***/ (function(module, exports) {
+
+module.exports = "<%=baseUrl%>/38861cba61c66739c1452c3a71e39852.ttf";
+
+/***/ }),
+/* 157 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -10652,79 +11050,79 @@ var _html5_video = __webpack_require__(35);
var _html5_video2 = _interopRequireDefault(_html5_video);
-var _flash = __webpack_require__(80);
+var _flash = __webpack_require__(81);
var _flash2 = _interopRequireDefault(_flash);
-var _html5_audio = __webpack_require__(81);
+var _html5_audio = __webpack_require__(82);
var _html5_audio2 = _interopRequireDefault(_html5_audio);
-var _flashls = __webpack_require__(82);
+var _flashls = __webpack_require__(83);
var _flashls2 = _interopRequireDefault(_flashls);
-var _hls = __webpack_require__(83);
+var _hls = __webpack_require__(84);
var _hls2 = _interopRequireDefault(_hls);
-var _html_img = __webpack_require__(84);
+var _html_img = __webpack_require__(85);
var _html_img2 = _interopRequireDefault(_html_img);
-var _no_op = __webpack_require__(85);
+var _no_op = __webpack_require__(86);
var _no_op2 = _interopRequireDefault(_no_op);
-var _spinner_three_bounce = __webpack_require__(179);
+var _spinner_three_bounce = __webpack_require__(189);
var _spinner_three_bounce2 = _interopRequireDefault(_spinner_three_bounce);
-var _stats = __webpack_require__(183);
+var _stats = __webpack_require__(194);
var _stats2 = _interopRequireDefault(_stats);
-var _watermark = __webpack_require__(185);
+var _watermark = __webpack_require__(196);
var _watermark2 = _interopRequireDefault(_watermark);
-var _poster = __webpack_require__(86);
+var _poster = __webpack_require__(87);
var _poster2 = _interopRequireDefault(_poster);
-var _google_analytics = __webpack_require__(192);
+var _google_analytics = __webpack_require__(205);
var _google_analytics2 = _interopRequireDefault(_google_analytics);
-var _click_to_pause = __webpack_require__(194);
+var _click_to_pause = __webpack_require__(207);
var _click_to_pause2 = _interopRequireDefault(_click_to_pause);
-var _dvr_controls = __webpack_require__(196);
+var _dvr_controls = __webpack_require__(209);
var _dvr_controls2 = _interopRequireDefault(_dvr_controls);
-var _closed_captions = __webpack_require__(200);
+var _closed_captions = __webpack_require__(214);
var _closed_captions2 = _interopRequireDefault(_closed_captions);
-var _favicon = __webpack_require__(205);
+var _favicon = __webpack_require__(220);
var _favicon2 = _interopRequireDefault(_favicon);
-var _seek_time = __webpack_require__(207);
+var _seek_time = __webpack_require__(222);
var _seek_time2 = _interopRequireDefault(_seek_time);
-var _sources = __webpack_require__(211);
+var _sources = __webpack_require__(227);
var _sources2 = _interopRequireDefault(_sources);
-var _end_video = __webpack_require__(212);
+var _end_video = __webpack_require__(228);
var _end_video2 = _interopRequireDefault(_end_video);
-var _strings = __webpack_require__(213);
+var _strings = __webpack_require__(229);
var _strings2 = _interopRequireDefault(_strings);
@@ -10763,9 +11161,8 @@ var Loader = function (_BaseObject) {
_this.containerPlugins = [_spinner_three_bounce2.default, _watermark2.default, _poster2.default, _stats2.default, _google_analytics2.default, _click_to_pause2.default];
_this.corePlugins = [_dvr_controls2.default, _closed_captions2.default, _favicon2.default, _seek_time2.default, _sources2.default, _end_video2.default, _strings2.default];
if (externalPlugins) {
- if (!Array.isArray(externalPlugins)) {
- _this.validateExternalPluginsType(externalPlugins);
- }
+ if (!Array.isArray(externalPlugins)) _this.validateExternalPluginsType(externalPlugins);
+
_this.addExternalPlugins(externalPlugins);
}
return _this;
@@ -10802,8 +11199,7 @@ var Loader = function (_BaseObject) {
var plugins = [];
for (var key in pluginsMap) {
plugins.unshift(pluginsMap[key]);
- }
- return plugins;
+ }return plugins;
};
/**
@@ -10816,15 +11212,11 @@ var Loader = function (_BaseObject) {
Loader.prototype.addExternalPlugins = function addExternalPlugins(plugins) {
plugins = this.groupPluginsByType(plugins);
- if (plugins.playback) {
- this.playbackPlugins = this.removeDups(plugins.playback.concat(this.playbackPlugins));
- }
- if (plugins.container) {
- this.containerPlugins = this.removeDups(plugins.container.concat(this.containerPlugins));
- }
- if (plugins.core) {
- this.corePlugins = this.removeDups(plugins.core.concat(this.corePlugins));
- }
+ if (plugins.playback) this.playbackPlugins = this.removeDups(plugins.playback.concat(this.playbackPlugins));
+
+ if (plugins.container) this.containerPlugins = this.removeDups(plugins.container.concat(this.containerPlugins));
+
+ if (plugins.core) this.corePlugins = this.removeDups(plugins.core.concat(this.corePlugins));
_player_info2.default.getInstance(this.playerId).playbackPlugins = this.playbackPlugins;
};
@@ -10842,9 +11234,7 @@ var Loader = function (_BaseObject) {
plugintypes.forEach(function (type) {
(plugins[type] || []).forEach(function (el) {
var errorMessage = 'external ' + el.type + ' plugin on ' + type + ' array';
- if (el.type !== type) {
- throw new ReferenceError(errorMessage);
- }
+ if (el.type !== type) throw new ReferenceError(errorMessage);
});
});
};
@@ -10862,7 +11252,7 @@ exports.default = Loader;
module.exports = exports['default'];
/***/ }),
-/* 152 */
+/* 158 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -10872,7 +11262,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _from = __webpack_require__(78);
+var _from = __webpack_require__(79);
var _from2 = _interopRequireDefault(_from);
@@ -10892,7 +11282,7 @@ var _inherits2 = __webpack_require__(2);
var _inherits3 = _interopRequireDefault(_inherits2);
-var _toConsumableArray2 = __webpack_require__(79);
+var _toConsumableArray2 = __webpack_require__(80);
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
@@ -10906,10 +11296,6 @@ var _playback = __webpack_require__(9);
var _playback2 = _interopRequireDefault(_playback);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
var _browser = __webpack_require__(13);
var _browser2 = _interopRequireDefault(_browser);
@@ -10918,10 +11304,6 @@ var _events = __webpack_require__(4);
var _events2 = _interopRequireDefault(_events);
-var _style = __webpack_require__(161);
-
-var _style2 = _interopRequireDefault(_style);
-
var _clapprZepto = __webpack_require__(6);
var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
@@ -10930,12 +11312,18 @@ var _template = __webpack_require__(8);
var _template2 = _interopRequireDefault(_template);
-var _tracks = __webpack_require__(162);
+var _tracks = __webpack_require__(167);
var _tracks2 = _interopRequireDefault(_tracks);
+__webpack_require__(168);
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+// Copyright 2014 Globo.com Player authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
var MIMETYPES = {
'mp4': ['avc1.42E01E', 'avc1.58A01E', 'avc1.4D401E', 'avc1.64001E', 'mp4v.20.8', 'mp4v.20.240', 'mp4a.40.2'].map(function (codec) {
return 'video/mp4; codecs="' + codec + ', mp4a.40.2"';
@@ -10945,10 +11333,7 @@ var MIMETYPES = {
'webm': ['video/webm; codecs="vp8, vorbis"'],
'mkv': ['video/x-matroska; codecs="theora, vorbis"'],
'm3u8': ['application/x-mpegurl']
-}; // Copyright 2014 Globo.com Player authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
+};
MIMETYPES['ogv'] = MIMETYPES['ogg'];
MIMETYPES['3gp'] = MIMETYPES['3gpp'];
@@ -11005,8 +11390,8 @@ var HTML5Video = function (_Playback) {
'pause': '_onPause',
'playing': '_onPlaying',
'progress': '_onProgress',
- 'seeked': '_handleBufferingEvents',
'seeking': '_handleBufferingEvents',
+ 'seeked': '_onSeeked',
'stalled': '_handleBufferingEvents',
'timeupdate': '_onTimeUpdate',
'waiting': '_onWaiting'
@@ -11036,7 +11421,7 @@ var HTML5Video = function (_Playback) {
}, {
key: 'buffering',
get: function get() {
- return !!this._bufferingState;
+ return this._isBuffering;
}
}]);
@@ -11051,6 +11436,7 @@ var HTML5Video = function (_Playback) {
_this._destroyed = false;
_this._loadStarted = false;
+ _this._isBuffering = false;
_this._playheadMoving = false;
_this._playheadMovingTimer = null;
_this._stopped = false;
@@ -11065,14 +11451,12 @@ var HTML5Video = function (_Playback) {
var posterUrl = void 0; // FIXME: poster plugin should always convert poster to object with expected properties ?
if (_this.options.poster) {
- if (typeof _this.options.poster === 'string') {
- posterUrl = _this.options.poster;
- } else if (typeof _this.options.poster.url === 'string') {
- posterUrl = _this.options.poster.url;
- }
+ if (typeof _this.options.poster === 'string') posterUrl = _this.options.poster;else if (typeof _this.options.poster.url === 'string') posterUrl = _this.options.poster.url;
}
_clapprZepto2.default.extend(_this.el, {
+ muted: _this.options.mute,
+ defaultMuted: _this.options.mute,
loop: _this.options.loop,
poster: posterUrl,
preload: preload || 'metadata',
@@ -11118,9 +11502,8 @@ var HTML5Video = function (_Playback) {
HTML5Video.prototype._setupSrc = function _setupSrc(srcUrl) {
- if (this.el.src === srcUrl) {
- return;
- }
+ if (this.el.src === srcUrl) return;
+
this._ccIsSetup = false;
this.el.src = srcUrl;
this._src = this.el.src;
@@ -11131,9 +11514,7 @@ var HTML5Video = function (_Playback) {
this.trigger(_events2.default.PLAYBACK_LOADEDMETADATA, { duration: e.target.duration, data: e });
this._updateSettings();
var autoSeekFromUrl = typeof this._options.autoSeekFromUrl === 'undefined' || this._options.autoSeekFromUrl;
- if (this.getPlaybackType() !== _playback2.default.LIVE && autoSeekFromUrl) {
- this._checkInitialSeek();
- }
+ if (this.getPlaybackType() !== _playback2.default.LIVE && autoSeekFromUrl) this._checkInitialSeek();
};
HTML5Video.prototype._onDurationChange = function _onDurationChange() {
@@ -11146,11 +11527,8 @@ var HTML5Video = function (_Playback) {
HTML5Video.prototype._updateSettings = function _updateSettings() {
// we can't figure out if hls resource is VoD or not until it is being loaded or duration has changed.
// that's why we check it again and update media control accordingly.
- if (this.getPlaybackType() === _playback2.default.VOD || this.getPlaybackType() === _playback2.default.AOD) {
- this.settings.left = ['playpause', 'position', 'duration'];
- } else {
- this.settings.left = ['playstop'];
- }
+ if (this.getPlaybackType() === _playback2.default.VOD || this.getPlaybackType() === _playback2.default.AOD) this.settings.left = ['playpause', 'position', 'duration'];else this.settings.left = ['playstop'];
+
this.settings.seekEnabled = this.isSeekEnabled();
this.trigger(_events2.default.PLAYBACK_SETTINGSUPDATE);
};
@@ -11183,9 +11561,7 @@ var HTML5Video = function (_Playback) {
this._handleBufferingEvents();
var promise = this.el.play();
// For more details, see https://developers.google.com/web/updates/2016/03/play-returns-promise
- if (promise && promise.catch) {
- promise.catch(function () {});
- }
+ if (promise && promise.catch) promise.catch(function () {});
};
HTML5Video.prototype.pause = function pause() {
@@ -11213,12 +11589,24 @@ var HTML5Video = function (_Playback) {
this.el.volume = value / 100;
};
+ /**
+ * @deprecated
+ * @private
+ */
+
+
HTML5Video.prototype.mute = function mute() {
- this.el.volume = 0;
+ this.el.muted = true;
};
+ /**
+ * @deprecated
+ * @private
+ */
+
+
HTML5Video.prototype.unmute = function unmute() {
- this.el.volume = 1;
+ this.el.muted = false;
};
HTML5Video.prototype.isMuted = function isMuted() {
@@ -11230,18 +11618,16 @@ var HTML5Video = function (_Playback) {
};
HTML5Video.prototype._startPlayheadMovingChecks = function _startPlayheadMovingChecks() {
- if (this._playheadMovingTimer !== null) {
- return;
- }
+ if (this._playheadMovingTimer !== null) return;
+
this._playheadMovingTimeOnCheck = null;
this._determineIfPlayheadMoving();
this._playheadMovingTimer = setInterval(this._determineIfPlayheadMoving.bind(this), 500);
};
HTML5Video.prototype._stopPlayheadMovingChecks = function _stopPlayheadMovingChecks() {
- if (this._playheadMovingTimer === null) {
- return;
- }
+ if (this._playheadMovingTimer === null) return;
+
clearInterval(this._playheadMovingTimer);
this._playheadMovingTimer = null;
this._playheadMoving = false;
@@ -11304,6 +11690,11 @@ var HTML5Video = function (_Playback) {
this.trigger(_events2.default.PLAYBACK_PAUSE);
};
+ HTML5Video.prototype._onSeeked = function _onSeeked() {
+ this._handleBufferingEvents();
+ this.trigger(_events2.default.PLAYBACK_SEEKED);
+ };
+
HTML5Video.prototype._onEnded = function _onEnded() {
this._handleBufferingEvents();
this.trigger(_events2.default.PLAYBACK_ENDED, this.name);
@@ -11319,13 +11710,9 @@ var HTML5Video = function (_Playback) {
HTML5Video.prototype._handleBufferingEvents = function _handleBufferingEvents() {
var playheadShouldBeMoving = !this.el.ended && !this.el.paused;
var buffering = this._loadStarted && !this.el.ended && !this._stopped && (playheadShouldBeMoving && !this._playheadMoving || this.el.readyState < this.el.HAVE_FUTURE_DATA);
- if (this._bufferingState !== buffering) {
- this._bufferingState = buffering;
- if (buffering) {
- this.trigger(_events2.default.PLAYBACK_BUFFERING, this.name);
- } else {
- this.trigger(_events2.default.PLAYBACK_BUFFERFULL, this.name);
- }
+ if (this._isBuffering !== buffering) {
+ this._isBuffering = buffering;
+ if (buffering) this.trigger(_events2.default.PLAYBACK_BUFFERING, this.name);else this.trigger(_events2.default.PLAYBACK_BUFFERFULL, this.name);
}
};
@@ -11353,9 +11740,7 @@ var HTML5Video = function (_Playback) {
HTML5Video.prototype._checkInitialSeek = function _checkInitialSeek() {
var seekTime = (0, _utils.seekStringToSeconds)();
- if (seekTime !== 0) {
- this.seek(seekTime);
- }
+ if (seekTime !== 0) this.seek(seekTime);
};
HTML5Video.prototype.getCurrentTime = function getCurrentTime() {
@@ -11367,25 +11752,17 @@ var HTML5Video = function (_Playback) {
};
HTML5Video.prototype._onTimeUpdate = function _onTimeUpdate() {
- this._handleBufferingEvents();
- if (this.getPlaybackType() === _playback2.default.LIVE) {
- this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: 1, total: 1 }, this.name);
- } else {
- this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: this.el.currentTime, total: this.el.duration }, this.name);
- }
+ if (this.getPlaybackType() === _playback2.default.LIVE) this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: 1, total: 1 }, this.name);else this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: this.el.currentTime, total: this.el.duration }, this.name);
};
HTML5Video.prototype._onProgress = function _onProgress() {
- if (!this.el.buffered.length) {
- return;
- }
+ if (!this.el.buffered.length) return;
+
var buffered = [];
var bufferedPos = 0;
for (var i = 0; i < this.el.buffered.length; i++) {
buffered = [].concat((0, _toConsumableArray3.default)(buffered), [{ start: this.el.buffered.start(i), end: this.el.buffered.end(i) }]);
- if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) {
- bufferedPos = i;
- }
+ if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) bufferedPos = i;
}
var progress = {
start: buffered[bufferedPos].start,
@@ -11397,17 +11774,15 @@ var HTML5Video = function (_Playback) {
HTML5Video.prototype._typeFor = function _typeFor(src) {
var mimeTypes = HTML5Video._mimeTypesForUrl(src, MIMETYPES, this.options.mimeType);
- if (mimeTypes.length == 0) {
- mimeTypes = HTML5Video._mimeTypesForUrl(src, AUDIO_MIMETYPES, this.options.mimeType);
- }
+ if (mimeTypes.length === 0) mimeTypes = HTML5Video._mimeTypesForUrl(src, AUDIO_MIMETYPES, this.options.mimeType);
+
var mimeType = mimeTypes[0] || '';
return mimeType.split(';')[0];
};
HTML5Video.prototype._ready = function _ready() {
- if (this._isReadyState) {
- return;
- }
+ if (this._isReadyState) return;
+
this._isReadyState = true;
this.trigger(_events2.default.PLAYBACK_READY, this.name);
};
@@ -11441,8 +11816,6 @@ var HTML5Video = function (_Playback) {
};
HTML5Video.prototype.render = function render() {
- var style = _styler2.default.getStyleFor(_style2.default);
-
if (this.options.playback.disableContextMenu) {
this.$el.on('contextmenu', function () {
return false;
@@ -11455,7 +11828,6 @@ var HTML5Video = function (_Playback) {
}));
}
- this.$el.append(style);
this._ready();
return this;
};
@@ -11491,9 +11863,7 @@ var HTML5Video = function (_Playback) {
return this._ccTrackId;
},
set: function set(trackId) {
- if (!(0, _utils.isNumber)(trackId)) {
- return;
- }
+ if (!(0, _utils.isNumber)(trackId)) return;
var tracks = this.closedCaptionsTracks;
var showingTrack = void 0;
@@ -11503,12 +11873,9 @@ var HTML5Video = function (_Playback) {
showingTrack = tracks.find(function (track) {
return track.id === trackId;
});
- if (!showingTrack) {
- return; // Track id not found
- }
- if (showingTrack.track.mode === 'showing') {
- return; // Track already showing
- }
+ if (!showingTrack) return; // Track id not found
+
+ if (showingTrack.track.mode === 'showing') return; // Track already showing
}
// Since it is possible to display multiple tracks,
@@ -11559,15 +11926,15 @@ module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(57)))
/***/ }),
-/* 153 */
+/* 159 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(65);
-__webpack_require__(154);
+__webpack_require__(160);
module.exports = __webpack_require__(11).Array.from;
/***/ }),
-/* 154 */
+/* 160 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -11575,13 +11942,13 @@ module.exports = __webpack_require__(11).Array.from;
var ctx = __webpack_require__(46)
, $export = __webpack_require__(19)
, toObject = __webpack_require__(39)
- , call = __webpack_require__(155)
- , isArrayIter = __webpack_require__(156)
+ , call = __webpack_require__(161)
+ , isArrayIter = __webpack_require__(162)
, toLength = __webpack_require__(61)
- , createProperty = __webpack_require__(157)
- , getIterFn = __webpack_require__(158);
+ , createProperty = __webpack_require__(163)
+ , getIterFn = __webpack_require__(164);
-$export($export.S + $export.F * !__webpack_require__(160)(function(iter){ Array.from(iter); }), 'Array', {
+$export($export.S + $export.F * !__webpack_require__(166)(function(iter){ Array.from(iter); }), 'Array', {
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
var O = toObject(arrayLike)
@@ -11611,7 +11978,7 @@ $export($export.S + $export.F * !__webpack_require__(160)(function(iter){ Array.
/***/ }),
-/* 155 */
+/* 161 */
/***/ (function(module, exports, __webpack_require__) {
// call something on iterator step with safe closing on error
@@ -11628,7 +11995,7 @@ module.exports = function(iterator, fn, value, entries){
};
/***/ }),
-/* 156 */
+/* 162 */
/***/ (function(module, exports, __webpack_require__) {
// check on default Array iterator
@@ -11641,7 +12008,7 @@ module.exports = function(it){
};
/***/ }),
-/* 157 */
+/* 163 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -11655,10 +12022,10 @@ module.exports = function(object, index, value){
};
/***/ }),
-/* 158 */
+/* 164 */
/***/ (function(module, exports, __webpack_require__) {
-var classof = __webpack_require__(159)
+var classof = __webpack_require__(165)
, ITERATOR = __webpack_require__(12)('iterator')
, Iterators = __webpack_require__(29);
module.exports = __webpack_require__(11).getIteratorMethod = function(it){
@@ -11668,7 +12035,7 @@ module.exports = __webpack_require__(11).getIteratorMethod = function(it){
};
/***/ }),
-/* 159 */
+/* 165 */
/***/ (function(module, exports, __webpack_require__) {
// getting tag from 19.1.3.6 Object.prototype.toString()
@@ -11696,7 +12063,7 @@ module.exports = function(it){
};
/***/ }),
-/* 160 */
+/* 166 */
/***/ (function(module, exports, __webpack_require__) {
var ITERATOR = __webpack_require__(12)('iterator')
@@ -11722,10 +12089,47 @@ module.exports = function(exec, skipClosing){
};
/***/ }),
-/* 161 */
+/* 167 */
+/***/ (function(module, exports) {
+
+module.exports = "<% for (var i = 0; i < tracks.length; i++) { %>\n <track data-html5-video-track=\"<%= i %>\" kind=\"<%= tracks[i].kind %>\" label=\"<%= tracks[i].label %>\" srclang=\"<%= tracks[i].lang %>\" src=\"<%= tracks[i].src %>\" />\n<% }; %>\n";
+
+/***/ }),
+/* 168 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(169);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./style.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./style.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 169 */
+/***/ (function(module, exports, __webpack_require__) {
+
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
@@ -11736,13 +12140,7 @@ exports.push([module.i, "[data-html5-video] {\n position: absolute;\n height:
/***/ }),
-/* 162 */
-/***/ (function(module, exports) {
-
-module.exports = "<% for (var i = 0; i < tracks.length; i++) { %>\n <track data-html5-video-track=\"<%= i %>\" kind=\"<%= tracks[i].kind %>\" label=\"<%= tracks[i].label %>\" srclang=\"<%= tracks[i].lang %>\" src=\"<%= tracks[i].src %>\" />\n<% }; %>\n";
-
-/***/ }),
-/* 163 */
+/* 170 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -11798,7 +12196,7 @@ var _playback = __webpack_require__(9);
var _playback2 = _interopRequireDefault(_playback);
-var _Player = __webpack_require__(167);
+var _Player = __webpack_require__(175);
var _Player2 = _interopRequireDefault(_Player);
@@ -11881,20 +12279,12 @@ var Flash = function (_BaseFlashPlayback) {
this._autoPlay && this.play();
}
(0, _clapprZepto2.default)('<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%" />').insertAfter(this.$el);
- if (this.getDuration() > 0) {
- this._metadataLoaded();
- } else {
- _mediator2.default.once(this.uniqueId + ':timeupdate', this._metadataLoaded, this);
- }
+ if (this.getDuration() > 0) this._metadataLoaded();else _mediator2.default.once(this.uniqueId + ':timeupdate', this._metadataLoaded, this);
} else {
this._attempts = this._attempts || 0;
- if (++this._attempts <= MAX_ATTEMPTS) {
- setTimeout(function () {
- return _this2._bootstrap();
- }, 50);
- } else {
- this.trigger(_events2.default.PLAYBACK_ERROR, { message: 'Max number of attempts reached' }, this.name);
- }
+ if (++this._attempts <= MAX_ATTEMPTS) setTimeout(function () {
+ return _this2._bootstrap();
+ }, 50);else this.trigger(_events2.default.PLAYBACK_ERROR, { message: 'Max number of attempts reached' }, this.name);
}
};
@@ -11979,9 +12369,7 @@ var Flash = function (_BaseFlashPlayback) {
Flash.prototype._checkInitialSeek = function _checkInitialSeek() {
var seekTime = (0, _utils.seekStringToSeconds)(window.location.href);
- if (seekTime !== 0) {
- this.seekSeconds(seekTime);
- }
+ if (seekTime !== 0) this.seekSeconds(seekTime);
};
Flash.prototype.play = function play() {
@@ -11999,13 +12387,9 @@ var Flash = function (_BaseFlashPlayback) {
Flash.prototype.volume = function volume(value) {
var _this4 = this;
- if (this.isReady) {
- this.el.playerVolume(value);
- } else {
- this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {
- return _this4.volume(value);
- });
- }
+ if (this.isReady) this.el.playerVolume(value);else this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {
+ return _this4.volume(value);
+ });
};
Flash.prototype.pause = function pause() {
@@ -12047,9 +12431,7 @@ var Flash = function (_BaseFlashPlayback) {
if (this.isReady && this.el.playerSeek) {
this.el.playerSeek(time);
this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: time, total: this.el.getDuration() }, this.name);
- if (this._currentState === 'PAUSED') {
- this.el.playerPause();
- }
+ if (this._currentState === 'PAUSED') this.el.playerPause();
} else {
this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {
return _this6.seek(time);
@@ -12086,7 +12468,7 @@ Flash.canPlay = function (resource) {
module.exports = exports['default'];
/***/ }),
-/* 164 */
+/* 171 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -12116,10 +12498,6 @@ var _playback = __webpack_require__(9);
var _playback2 = _interopRequireDefault(_playback);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
var _template = __webpack_require__(8);
var _template2 = _interopRequireDefault(_template);
@@ -12128,22 +12506,18 @@ var _browser = __webpack_require__(13);
var _browser2 = _interopRequireDefault(_browser);
-var _flash = __webpack_require__(165);
+var _flash = __webpack_require__(172);
var _flash2 = _interopRequireDefault(_flash);
-var _flash3 = __webpack_require__(166);
-
-var _flash4 = _interopRequireDefault(_flash3);
+__webpack_require__(173);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-// Copyright 2015 Globo.com Player authors. All rights reserved.
+var IE_CLASSID = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'; // Copyright 2015 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-var IE_CLASSID = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
-
var BaseFlashPlayback = function (_Playback) {
(0, _inherits3.default)(BaseFlashPlayback, _Playback);
@@ -12158,6 +12532,7 @@ var BaseFlashPlayback = function (_Playback) {
};
BaseFlashPlayback.prototype.render = function render() {
+ this.$el.attr('data', this.swfPath);
this.$el.html(this.template({
cid: this.cid,
swfPath: this.swfPath,
@@ -12169,13 +12544,10 @@ var BaseFlashPlayback = function (_Playback) {
if (_browser2.default.isIE) {
this.$('embed').remove();
- if (_browser2.default.isLegacyIE) {
- this.$el.attr('classid', IE_CLASSID);
- }
+ if (_browser2.default.isLegacyIE) this.$el.attr('classid', IE_CLASSID);
}
this.el.id = this.cid;
- this.$el.append(_styler2.default.getStyleFor(_flash4.default));
return this;
};
@@ -12205,9 +12577,7 @@ var BaseFlashPlayback = function (_Playback) {
get: function get() {
var type = 'application/x-shockwave-flash';
- if (_browser2.default.isLegacyIE) {
- type = '';
- }
+ if (_browser2.default.isLegacyIE) type = '';
return {
class: 'clappr-flash-playback',
@@ -12226,16 +12596,47 @@ exports.default = BaseFlashPlayback;
module.exports = exports['default'];
/***/ }),
-/* 165 */
+/* 172 */
/***/ (function(module, exports) {
module.exports = "<param name=\"movie\" value=\"<%= swfPath %>\">\n<param name=\"quality\" value=\"autohigh\">\n<param name=\"swliveconnect\" value=\"true\">\n<param name=\"allowScriptAccess\" value=\"always\">\n<param name=\"bgcolor\" value=\"#000000\">\n<param name=\"allowFullScreen\" value=\"false\">\n<param name=\"wmode\" value=\"<%= wmode %>\">\n<param name=\"tabindex\" value=\"1\">\n<param name=\"FlashVars\" value=\"playbackId=<%= playbackId %>&callback=<%= callbackName %>\">\n<embed\n name=\"<%= cid %>\"\n type=\"application/x-shockwave-flash\"\n disabled=\"disabled\"\n tabindex=\"-1\"\n enablecontextmenu=\"false\"\n allowScriptAccess=\"always\"\n quality=\"autohigh\"\n pluginspage=\"http://www.macromedia.com/go/getflashplayer\"\n wmode=\"<%= wmode %>\"\n swliveconnect=\"true\"\n allowfullscreen=\"false\"\n bgcolor=\"#000000\"\n FlashVars=\"playbackId=<%= playbackId %>&callback=<%= callbackName %>\"\n data=\"<%= swfPath %>\"\n src=\"<%= swfPath %>\"\n width=\"100%\"\n height=\"100%\">\n</embed>\n";
/***/ }),
-/* 166 */
+/* 173 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(174);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./flash.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./flash.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 174 */
+/***/ (function(module, exports, __webpack_require__) {
+
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
@@ -12246,13 +12647,13 @@ exports.push([module.i, ".clappr-flash-playback[data-flash-playback] {\n displa
/***/ }),
-/* 167 */
-/***/ (function(module, exports, __webpack_require__) {
+/* 175 */
+/***/ (function(module, exports) {
-module.exports = __webpack_require__.p + "4b76590b32dab62bc95c1b7951efae78.swf";
+module.exports = "<%=baseUrl%>/4b76590b32dab62bc95c1b7951efae78.swf";
/***/ }),
-/* 168 */
+/* 176 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -12347,7 +12748,7 @@ HTML5Audio.canPlay = function (resourceUrl, mimeType) {
module.exports = exports['default'];
/***/ }),
-/* 169 */
+/* 177 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -12397,11 +12798,11 @@ var _browser = __webpack_require__(13);
var _browser2 = _interopRequireDefault(_browser);
-var _flashls_events = __webpack_require__(170);
+var _flashls_events = __webpack_require__(178);
var _flashls_events2 = _interopRequireDefault(_flashls_events);
-var _HLSPlayer = __webpack_require__(171);
+var _HLSPlayer = __webpack_require__(179);
var _HLSPlayer2 = _interopRequireDefault(_HLSPlayer);
@@ -12437,11 +12838,7 @@ var FlasHLS = function (_BaseFlashPlayback) {
}, {
key: 'currentLevel',
get: function get() {
- if (this._currentLevel === null || this._currentLevel === undefined) {
- return AUTO;
- } else {
- return this._currentLevel; //0 is a valid level ID
- }
+ if (this._currentLevel === null || this._currentLevel === undefined) return AUTO;else return this._currentLevel; //0 is a valid level ID
},
set: function set(id) {
this._currentLevel = id;
@@ -12593,19 +12990,14 @@ var FlasHLS = function (_BaseFlashPlayback) {
this._currentState = 'IDLE';
this._setFlashSettings();
this._updatePlaybackType();
- if (this._autoPlay || this._shouldPlayOnManifestLoaded) {
- this.play();
- }
+ if (this._autoPlay || this._shouldPlayOnManifestLoaded) this.play();
+
this.trigger(_events2.default.PLAYBACK_READY, this.name);
} else {
this._bootstrapAttempts = this._bootstrapAttempts || 0;
- if (++this._bootstrapAttempts <= MAX_ATTEMPTS) {
- setTimeout(function () {
- return _this3._bootstrap();
- }, 50);
- } else {
- this.trigger(_events2.default.PLAYBACK_ERROR, { message: 'Max number of attempts reached' }, this.name);
- }
+ if (++this._bootstrapAttempts <= MAX_ATTEMPTS) setTimeout(function () {
+ return _this3._bootstrap();
+ }, 50);else this.trigger(_events2.default.PLAYBACK_ERROR, { message: 'Max number of attempts reached' }, this.name);
}
};
@@ -12848,9 +13240,7 @@ var FlasHLS = function (_BaseFlashPlayback) {
};
FlasHLS.prototype._updateTime = function _updateTime(timeMetrics) {
- if (this._currentState === 'IDLE') {
- return;
- }
+ if (this._currentState === 'IDLE') return;
var duration = this._normalizeDuration(timeMetrics.duration);
var position = Math.min(Math.max(timeMetrics.position, 0), duration);
@@ -12858,37 +13248,31 @@ var FlasHLS = function (_BaseFlashPlayback) {
var livePlayback = this._playbackType === _playback2.default.LIVE;
this._dvrEnabled = livePlayback && duration > this._hlsMinimumDvrSize;
- if (duration === 100 || livePlayback === undefined) {
- return;
- }
+ if (duration === 100 || livePlayback === undefined) return;
if (this._dvrEnabled !== previousDVRStatus) {
this._updateSettings();
this.trigger(_events2.default.PLAYBACK_SETTINGSUPDATE, this.name);
}
- if (livePlayback && (!this._dvrEnabled || !this._dvrInUse)) {
- position = duration;
- }
+ if (livePlayback && (!this._dvrEnabled || !this._dvrInUse)) position = duration;
this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: position, total: duration }, this.name);
};
FlasHLS.prototype.play = function play() {
this.trigger(_events2.default.PLAYBACK_PLAY_INTENT);
- if (this._currentState === 'PAUSED') {
- this.el.playerResume();
- } else if (!this._srcLoaded && this._currentState !== 'PLAYING') {
- this._firstPlay();
- } else {
- this.el.playerPlay();
- }
+ if (this._currentState === 'PAUSED') this.el.playerResume();else if (!this._srcLoaded && this._currentState !== 'PLAYING') this._firstPlay();else this.el.playerPlay();
};
FlasHLS.prototype.getPlaybackType = function getPlaybackType() {
return this._playbackType ? this._playbackType : null;
};
+ FlasHLS.prototype.getCurrentTime = function getCurrentTime() {
+ return this.el.getPosition();
+ };
+
FlasHLS.prototype.getCurrentLevelIndex = function getCurrentLevelIndex() {
return this._currentLevel;
};
@@ -12940,34 +13324,23 @@ var FlasHLS = function (_BaseFlashPlayback) {
FlasHLS.prototype._updateCurrentState = function _updateCurrentState(state) {
this._currentState = state;
- if (state !== 'IDLE') {
- this._hasEnded = false;
- }
+ if (state !== 'IDLE') this._hasEnded = false;
+
this._updatePlaybackType();
- if (state === 'PLAYING') {
- this.trigger(_events2.default.PLAYBACK_PLAY, this.name);
- } else if (state === 'PAUSED') {
- this.trigger(_events2.default.PLAYBACK_PAUSE, this.name);
- }
+ if (state === 'PLAYING') this.trigger(_events2.default.PLAYBACK_PLAY, this.name);else if (state === 'PAUSED') this.trigger(_events2.default.PLAYBACK_PAUSE, this.name);
};
FlasHLS.prototype._updatePlaybackType = function _updatePlaybackType() {
this._playbackType = this.el.getType();
if (this._playbackType) {
this._playbackType = this._playbackType.toLowerCase();
- if (this._playbackType === _playback2.default.VOD) {
- this._startReportingProgress();
- } else {
- this._stopReportingProgress();
- }
+ if (this._playbackType === _playback2.default.VOD) this._startReportingProgress();else this._stopReportingProgress();
}
this.trigger(_events2.default.PLAYBACK_PLAYBACKSTATE, { type: this._playbackType });
};
FlasHLS.prototype._startReportingProgress = function _startReportingProgress() {
- if (!this._reportingProgress) {
- this._reportingProgress = true;
- }
+ if (!this._reportingProgress) this._reportingProgress = true;
};
FlasHLS.prototype._stopReportingProgress = function _stopReportingProgress() {
@@ -12976,10 +13349,10 @@ var FlasHLS = function (_BaseFlashPlayback) {
FlasHLS.prototype._onFragmentLoaded = function _onFragmentLoaded(loadmetrics) {
this.trigger(_events2.default.PLAYBACK_FRAGMENT_LOADED, loadmetrics);
- if (this._reportingProgress && this.el.getPosition) {
- var buffered = this.el.getPosition() + this.el.getbufferLength();
+ if (this._reportingProgress && this.getCurrentTime()) {
+ var buffered = this.getCurrentTime() + this.el.getbufferLength();
this.trigger(_events2.default.PLAYBACK_PROGRESS, {
- start: this.el.getPosition(),
+ start: this.getCurrentTime(),
current: buffered,
total: this.el.getDuration()
});
@@ -13007,21 +13380,15 @@ var FlasHLS = function (_BaseFlashPlayback) {
FlasHLS.prototype.volume = function volume(value) {
var _this5 = this;
- if (this.isReady) {
- this.el.playerVolume(value);
- } else {
- this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {
- return _this5.volume(value);
- });
- }
+ if (this.isReady) this.el.playerVolume(value);else this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {
+ return _this5.volume(value);
+ });
};
FlasHLS.prototype.pause = function pause() {
if (this._playbackType !== _playback2.default.LIVE || this._dvrEnabled) {
this.el.playerPause();
- if (this._playbackType === _playback2.default.LIVE && this._dvrEnabled) {
- this._updateDvr(true);
- }
+ if (this._playbackType === _playback2.default.LIVE && this._dvrEnabled) this._updateDvr(true);
}
};
@@ -13033,9 +13400,8 @@ var FlasHLS = function (_BaseFlashPlayback) {
};
FlasHLS.prototype.isPlaying = function isPlaying() {
- if (this._currentState) {
- return !!this._currentState.match(/playing/i);
- }
+ if (this._currentState) return !!this._currentState.match(/playing/i);
+
return false;
};
@@ -13054,9 +13420,8 @@ var FlasHLS = function (_BaseFlashPlayback) {
FlasHLS.prototype.seekPercentage = function seekPercentage(percentage) {
var duration = this.el.getDuration();
var time = 0;
- if (percentage > 0) {
- time = duration * percentage / 100;
- }
+ if (percentage > 0) time = duration * percentage / 100;
+
this.seek(time);
};
@@ -13107,8 +13472,7 @@ var FlasHLS = function (_BaseFlashPlayback) {
for (var index = 0; index < levelsLength; index++) {
this._levels.push({ id: index, label: levels[index].height + 'p', level: levels[index] });
- }
- this.trigger(_events2.default.PLAYBACK_LEVELS_AVAILABLE, this._levels);
+ }this.trigger(_events2.default.PLAYBACK_LEVELS_AVAILABLE, this._levels);
};
FlasHLS.prototype.destroy = function destroy() {
@@ -13132,12 +13496,10 @@ var FlasHLS = function (_BaseFlashPlayback) {
FlasHLS.prototype._createCallbacks = function _createCallbacks() {
var _this6 = this;
- if (!window.Clappr) {
- window.Clappr = {};
- }
- if (!window.Clappr.flashlsCallbacks) {
- window.Clappr.flashlsCallbacks = {};
- }
+ if (!window.Clappr) window.Clappr = {};
+
+ if (!window.Clappr.flashlsCallbacks) window.Clappr.flashlsCallbacks = {};
+
this.flashlsEvents = new _flashls_events2.default(this.cid);
window.Clappr.flashlsCallbacks[this.cid] = function (eventName, args) {
_this6.flashlsEvents[eventName].apply(_this6.flashlsEvents, args);
@@ -13174,7 +13536,7 @@ FlasHLS.canPlay = function (resource, mimeType) {
module.exports = exports['default'];
/***/ }),
-/* 170 */
+/* 178 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -13272,13 +13634,13 @@ exports.default = HLSEvents;
module.exports = exports['default'];
/***/ }),
-/* 171 */
-/***/ (function(module, exports, __webpack_require__) {
+/* 179 */
+/***/ (function(module, exports) {
-module.exports = __webpack_require__.p + "809981e5b09d5336c45d72d0869ada2a.swf";
+module.exports = "<%=baseUrl%>/8fa12a459188502b9f0d39b8a67d9e6c.swf";
/***/ }),
-/* 172 */
+/* 180 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -13288,7 +13650,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _toConsumableArray2 = __webpack_require__(79);
+var _toConsumableArray2 = __webpack_require__(80);
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
@@ -13312,7 +13674,7 @@ var _html5_video = __webpack_require__(35);
var _html5_video2 = _interopRequireDefault(_html5_video);
-var _hls = __webpack_require__(173);
+var _hls = __webpack_require__(181);
var _hls2 = _interopRequireDefault(_hls);
@@ -13353,11 +13715,7 @@ var HLS = function (_HTML5VideoPlayback) {
}, {
key: 'currentLevel',
get: function get() {
- if (this._currentLevel === null || this._currentLevel === undefined) {
- return AUTO;
- } else {
- return this._currentLevel; //0 is a valid level ID
- }
+ if (this._currentLevel === null || this._currentLevel === undefined) return AUTO;else return this._currentLevel; //0 is a valid level ID
},
set: function set(id) {
this._currentLevel = id;
@@ -13365,11 +13723,15 @@ var HLS = function (_HTML5VideoPlayback) {
this._hls.currentLevel = this._currentLevel;
}
}, {
+ key: 'isReady',
+ get: function get() {
+ return this._isReadyState;
+ }
+ }, {
key: '_startTime',
get: function get() {
- if (this._playbackType === _playback2.default.LIVE && this._playlistType !== 'EVENT') {
- return this._extrapolatedStartTime;
- }
+ if (this._playbackType === _playback2.default.LIVE && this._playlistType !== 'EVENT') return this._extrapolatedStartTime;
+
return this._playableRegionStartTime;
}
}, {
@@ -13384,9 +13746,8 @@ var HLS = function (_HTML5VideoPlayback) {
}, {
key: '_extrapolatedStartTime',
get: function get() {
- if (!this._localStartTimeCorrelation) {
- return this._playableRegionStartTime;
- }
+ if (!this._localStartTimeCorrelation) return this._playableRegionStartTime;
+
var corr = this._localStartTimeCorrelation;
var timePassed = this._now - corr.local;
var extrapolatedWindowStartTime = (corr.remote + timePassed) / 1000;
@@ -13401,9 +13762,8 @@ var HLS = function (_HTML5VideoPlayback) {
key: '_extrapolatedEndTime',
get: function get() {
var actualEndTime = this._playableRegionStartTime + this._playableRegionDuration;
- if (!this._localEndTimeCorrelation) {
- return actualEndTime;
- }
+ if (!this._localEndTimeCorrelation) return actualEndTime;
+
var corr = this._localEndTimeCorrelation;
var timePassed = this._now - corr.local;
var extrapolatedEndTime = (corr.remote + timePassed) / 1000;
@@ -13436,9 +13796,8 @@ var HLS = function (_HTML5VideoPlayback) {
}, {
key: '_extrapolatedWindowDuration',
get: function get() {
- if (this._segmentTargetDuration === null) {
- return 0;
- }
+ if (this._segmentTargetDuration === null) return 0;
+
return this._extrapolatedWindowNumSegments * this._segmentTargetDuration;
}
}], [{
@@ -13499,7 +13858,7 @@ var HLS = function (_HTML5VideoPlayback) {
return _this;
}
- HLS.prototype._setupHls = function _setupHls() {
+ HLS.prototype._setup = function _setup() {
var _this2 = this;
this._ccIsSetup = false;
@@ -13530,6 +13889,14 @@ var HLS = function (_HTML5VideoPlayback) {
return _this2._ccTracksUpdated = true;
});
this._hls.attachMedia(this.el);
+ this._ready();
+ };
+
+ HLS.prototype._ready = function _ready() {
+ if (!this._hls) return;
+
+ this._isReadyState = true;
+ this.trigger(_events2.default.PLAYBACK_READY, this.name);
};
HLS.prototype._recover = function _recover(evt, data) {
@@ -13593,9 +13960,8 @@ var HLS = function (_HTML5VideoPlayback) {
HLS.prototype.seekPercentage = function seekPercentage(percentage) {
var seekTo = this._duration;
- if (percentage > 0) {
- seekTo = this._duration * (percentage / 100);
- }
+ if (percentage > 0) seekTo = this._duration * (percentage / 100);
+
this.seek(seekTo);
};
@@ -13620,13 +13986,8 @@ var HLS = function (_HTML5VideoPlayback) {
};
HLS.prototype._updateSettings = function _updateSettings() {
- if (this._playbackType === _playback2.default.VOD) {
- this.settings.left = ['playpause', 'position', 'duration'];
- } else if (this.dvrEnabled) {
- this.settings.left = ['playpause'];
- } else {
- this.settings.left = ['playstop'];
- }
+ if (this._playbackType === _playback2.default.VOD) this.settings.left = ['playpause', 'position', 'duration'];else if (this.dvrEnabled) this.settings.left = ['playpause'];else this.settings.left = ['playstop'];
+
this.settings.seekEnabled = this.isSeekEnabled();
this.trigger(_events2.default.PLAYBACK_SETTINGSUPDATE);
};
@@ -13678,26 +14039,23 @@ var HLS = function (_HTML5VideoPlayback) {
HLS.prototype._onTimeUpdate = function _onTimeUpdate() {
var update = { current: this.getCurrentTime(), total: this.getDuration() };
var isSame = this._lastTimeUpdate && update.current === this._lastTimeUpdate.current && update.total === this._lastTimeUpdate.total;
- if (isSame) {
- return;
- }
+ if (isSame) return;
+
this._lastTimeUpdate = update;
this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, update, this.name);
};
HLS.prototype._onDurationChange = function _onDurationChange() {
var duration = this.getDuration();
- if (this._lastDuration === duration) {
- return;
- }
+ if (this._lastDuration === duration) return;
+
this._lastDuration = duration;
_HTML5VideoPlayback.prototype._onDurationChange.call(this);
};
HLS.prototype._onProgress = function _onProgress() {
- if (!this.el.buffered.length) {
- return;
- }
+ if (!this.el.buffered.length) return;
+
var buffered = [];
var bufferedPos = 0;
for (var i = 0; i < this.el.buffered.length; i++) {
@@ -13706,9 +14064,7 @@ var HLS = function (_HTML5VideoPlayback) {
start: Math.max(0, this.el.buffered.start(i) - this._playableRegionStartTime),
end: Math.max(0, this.el.buffered.end(i) - this._playableRegionStartTime)
}]);
- if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) {
- bufferedPos = i;
- }
+ if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) bufferedPos = i;
}
var progress = {
start: buffered[bufferedPos].start,
@@ -13719,20 +14075,16 @@ var HLS = function (_HTML5VideoPlayback) {
};
HLS.prototype.play = function play() {
- if (!this._hls) {
- this._setupHls();
- }
+ if (!this._hls) this._setup();
+
_HTML5VideoPlayback.prototype.play.call(this);
};
HLS.prototype.pause = function pause() {
- if (!this._hls) {
- return;
- }
+ if (!this._hls) return;
+
_HTML5VideoPlayback.prototype.pause.call(this);
- if (this.dvrEnabled) {
- this._updateDvr(true);
- }
+ if (this.dvrEnabled) this._updateDvr(true);
};
HLS.prototype.stop = function stop() {
@@ -13758,9 +14110,7 @@ var HLS = function (_HTML5VideoPlayback) {
this._onLevelUpdated(evt, data);
// Live stream subtitle tracks detection hack (may not immediately available)
- if (this._ccTracksUpdated && this._playbackType === _playback2.default.LIVE && this.hasClosedCaptionsTracks) {
- this._onSubtitleLoaded();
- }
+ if (this._ccTracksUpdated && this._playbackType === _playback2.default.LIVE && this.hasClosedCaptionsTracks) this._onSubtitleLoaded();
};
HLS.prototype._fillLevels = function _fillLevels() {
@@ -13780,9 +14130,7 @@ var HLS = function (_HTML5VideoPlayback) {
var previousPlayableRegionStartTime = this._playableRegionStartTime;
var previousPlayableRegionDuration = this._playableRegionDuration;
- if (fragments.length === 0) {
- return;
- }
+ if (fragments.length === 0) return;
if (this._playableRegionStartTime !== fragments[0].start) {
startTimeChanged = true;
@@ -13829,7 +14177,7 @@ var HLS = function (_HTML5VideoPlayback) {
// seeks to areas after this point sometimes have issues
if (this._playbackType === _playback2.default.LIVE) {
var fragmentTargetDuration = data.details.targetduration;
- var hlsjsConfig = this.options.playback || {};
+ var hlsjsConfig = this.options.playback.hlsjsConfig || {};
var liveSyncDurationCount = hlsjsConfig.liveSyncDurationCount || _hls2.default.DefaultConfig.liveSyncDurationCount;
var hiddenAreaDuration = fragmentTargetDuration * liveSyncDurationCount;
if (hiddenAreaDuration <= newDuration) {
@@ -13909,9 +14257,8 @@ var HLS = function (_HTML5VideoPlayback) {
};
HLS.prototype._onLevelSwitch = function _onLevelSwitch(evt, data) {
- if (!this.levels.length) {
- this._fillLevels();
- }
+ if (!this.levels.length) this._fillLevels();
+
this.trigger(_events2.default.PLAYBACK_LEVEL_SWITCH_END);
this.trigger(_events2.default.PLAYBACK_LEVEL_SWITCH, data);
var currentLevel = this._hls.levels[data.level];
@@ -13962,10 +14309,1157 @@ HLS.canPlay = function (resource, mimeType) {
module.exports = exports['default'];
/***/ }),
-/* 173 */
+/* 181 */
/***/ (function(module, exports, __webpack_require__) {
-var require;var require;(function(f){if(true){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Hls = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(true)
+ module.exports = factory();
+ else if(typeof define === 'function' && define.amd)
+ define([], factory);
+ else if(typeof exports === 'object')
+ exports["Hls"] = factory();
+ else
+ root["Hls"] = factory();
+})(this, function() {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "/dist/";
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 8);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return enableLogs; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return logger; });
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+function noop() {}
+
+var fakeLogger = {
+ trace: noop,
+ debug: noop,
+ log: noop,
+ warn: noop,
+ info: noop,
+ error: noop
+};
+
+var exportedLogger = fakeLogger;
+
+/*globals self: false */
+
+//let lastCallTime;
+// function formatMsgWithTimeInfo(type, msg) {
+// const now = Date.now();
+// const diff = lastCallTime ? '+' + (now - lastCallTime) : '0';
+// lastCallTime = now;
+// msg = (new Date(now)).toISOString() + ' | [' + type + '] > ' + msg + ' ( ' + diff + ' ms )';
+// return msg;
+// }
+
+function formatMsg(type, msg) {
+ msg = '[' + type + '] > ' + msg;
+ return msg;
+}
+
+function consolePrintFn(type) {
+ var func = self.console[type];
+ if (func) {
+ return function () {
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ if (args[0]) {
+ args[0] = formatMsg(type, args[0]);
+ }
+ func.apply(self.console, args);
+ };
+ }
+ return noop;
+}
+
+function exportLoggerFunctions(debugConfig) {
+ for (var _len2 = arguments.length, functions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
+ functions[_key2 - 1] = arguments[_key2];
+ }
+
+ functions.forEach(function (type) {
+ exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);
+ });
+}
+
+var enableLogs = function enableLogs(debugConfig) {
+ if (debugConfig === true || (typeof debugConfig === 'undefined' ? 'undefined' : _typeof(debugConfig)) === 'object') {
+ exportLoggerFunctions(debugConfig,
+ // Remove out from list here to hard-disable a log-level
+ //'trace',
+ 'debug', 'log', 'info', 'warn', 'error');
+ // Some browsers don't allow to use bind on console object anyway
+ // fallback to default if needed
+ try {
+ exportedLogger.log();
+ } catch (e) {
+ exportedLogger = fakeLogger;
+ }
+ } else {
+ exportedLogger = fakeLogger;
+ }
+};
+
+var logger = exportedLogger;
+
+/***/ }),
+/* 1 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony default export */ __webpack_exports__["a"] = ({
+ // fired before MediaSource is attaching to media element - data: { media }
+ MEDIA_ATTACHING: 'hlsMediaAttaching',
+ // fired when MediaSource has been succesfully attached to media element - data: { }
+ MEDIA_ATTACHED: 'hlsMediaAttached',
+ // fired before detaching MediaSource from media element - data: { }
+ MEDIA_DETACHING: 'hlsMediaDetaching',
+ // fired when MediaSource has been detached from media element - data: { }
+ MEDIA_DETACHED: 'hlsMediaDetached',
+ // fired when we buffer is going to be reset - data: { }
+ BUFFER_RESET: 'hlsBufferReset',
+ // fired when we know about the codecs that we need buffers for to push into - data: {tracks : { container, codec, levelCodec, initSegment, metadata }}
+ BUFFER_CODECS: 'hlsBufferCodecs',
+ // fired when sourcebuffers have been created - data: { tracks : tracks }
+ BUFFER_CREATED: 'hlsBufferCreated',
+ // fired when we append a segment to the buffer - data: { segment: segment object }
+ BUFFER_APPENDING: 'hlsBufferAppending',
+ // fired when we are done with appending a media segment to the buffer - data : { parent : segment parent that triggered BUFFER_APPENDING, pending : nb of segments waiting for appending for this segment parent}
+ BUFFER_APPENDED: 'hlsBufferAppended',
+ // fired when the stream is finished and we want to notify the media buffer that there will be no more data - data: { }
+ BUFFER_EOS: 'hlsBufferEos',
+ // fired when the media buffer should be flushed - data { startOffset, endOffset }
+ BUFFER_FLUSHING: 'hlsBufferFlushing',
+ // fired when the media buffer has been flushed - data: { }
+ BUFFER_FLUSHED: 'hlsBufferFlushed',
+ // fired to signal that a manifest loading starts - data: { url : manifestURL}
+ MANIFEST_LOADING: 'hlsManifestLoading',
+ // fired after manifest has been loaded - data: { levels : [available quality levels], audioTracks : [ available audio tracks], url : manifestURL, stats : { trequest, tfirst, tload, mtime}}
+ MANIFEST_LOADED: 'hlsManifestLoaded',
+ // fired after manifest has been parsed - data: { levels : [available quality levels], firstLevel : index of first quality level appearing in Manifest}
+ MANIFEST_PARSED: 'hlsManifestParsed',
+ // fired when a level switch is requested - data: { level : id of new level } // deprecated in favor LEVEL_SWITCHING
+ LEVEL_SWITCH: 'hlsLevelSwitch',
+ // fired when a level switch is requested - data: { level : id of new level }
+ LEVEL_SWITCHING: 'hlsLevelSwitching',
+ // fired when a level switch is effective - data: { level : id of new level }
+ LEVEL_SWITCHED: 'hlsLevelSwitched',
+ // fired when a level playlist loading starts - data: { url : level URL, level : id of level being loaded}
+ LEVEL_LOADING: 'hlsLevelLoading',
+ // fired when a level playlist loading finishes - data: { details : levelDetails object, level : id of loaded level, stats : { trequest, tfirst, tload, mtime} }
+ LEVEL_LOADED: 'hlsLevelLoaded',
+ // fired when a level's details have been updated based on previous details, after it has been loaded - data: { details : levelDetails object, level : id of updated level }
+ LEVEL_UPDATED: 'hlsLevelUpdated',
+ // fired when a level's PTS information has been updated after parsing a fragment - data: { details : levelDetails object, level : id of updated level, drift: PTS drift observed when parsing last fragment }
+ LEVEL_PTS_UPDATED: 'hlsLevelPtsUpdated',
+ // fired to notify that audio track lists has been updated - data: { audioTracks : audioTracks }
+ AUDIO_TRACKS_UPDATED: 'hlsAudioTracksUpdated',
+ // fired when an audio track switch occurs - data: { id : audio track id } // deprecated in favor AUDIO_TRACK_SWITCHING
+ AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',
+ // fired when an audio track switching is requested - data: { id : audio track id }
+ AUDIO_TRACK_SWITCHING: 'hlsAudioTrackSwitching',
+ // fired when an audio track switch actually occurs - data: { id : audio track id }
+ AUDIO_TRACK_SWITCHED: 'hlsAudioTrackSwitched',
+ // fired when an audio track loading starts - data: { url : audio track URL, id : audio track id }
+ AUDIO_TRACK_LOADING: 'hlsAudioTrackLoading',
+ // fired when an audio track loading finishes - data: { details : levelDetails object, id : audio track id, stats : { trequest, tfirst, tload, mtime } }
+ AUDIO_TRACK_LOADED: 'hlsAudioTrackLoaded',
+ // fired to notify that subtitle track lists has been updated - data: { subtitleTracks : subtitleTracks }
+ SUBTITLE_TRACKS_UPDATED: 'hlsSubtitleTracksUpdated',
+ // fired when an subtitle track switch occurs - data: { id : subtitle track id }
+ SUBTITLE_TRACK_SWITCH: 'hlsSubtitleTrackSwitch',
+ // fired when a subtitle track loading starts - data: { url : subtitle track URL, id : subtitle track id }
+ SUBTITLE_TRACK_LOADING: 'hlsSubtitleTrackLoading',
+ // fired when a subtitle track loading finishes - data: { details : levelDetails object, id : subtitle track id, stats : { trequest, tfirst, tload, mtime } }
+ SUBTITLE_TRACK_LOADED: 'hlsSubtitleTrackLoaded',
+ // fired when a subtitle fragment has been processed - data: { success : boolean, frag : the processed frag }
+ SUBTITLE_FRAG_PROCESSED: 'hlsSubtitleFragProcessed',
+ // fired when the first timestamp is found - data: { id : demuxer id, initPTS: initPTS, frag : fragment object }
+ INIT_PTS_FOUND: 'hlsInitPtsFound',
+ // fired when a fragment loading starts - data: { frag : fragment object }
+ FRAG_LOADING: 'hlsFragLoading',
+ // fired when a fragment loading is progressing - data: { frag : fragment object, { trequest, tfirst, loaded } }
+ FRAG_LOAD_PROGRESS: 'hlsFragLoadProgress',
+ // Identifier for fragment load aborting for emergency switch down - data: { frag : fragment object }
+ FRAG_LOAD_EMERGENCY_ABORTED: 'hlsFragLoadEmergencyAborted',
+ // fired when a fragment loading is completed - data: { frag : fragment object, payload : fragment payload, stats : { trequest, tfirst, tload, length } }
+ FRAG_LOADED: 'hlsFragLoaded',
+ // fired when a fragment has finished decrypting - data: { id : demuxer id, frag: fragment object, payload : fragment payload, stats : { tstart, tdecrypt } }
+ FRAG_DECRYPTED: 'hlsFragDecrypted',
+ // fired when Init Segment has been extracted from fragment - data: { id : demuxer id, frag: fragment object, moov : moov MP4 box, codecs : codecs found while parsing fragment }
+ FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',
+ // fired when parsing sei text is completed - data: { id : demuxer id, frag: fragment object, samples : [ sei samples pes ] }
+ FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',
+ // fired when parsing id3 is completed - data: { id : demuxer id, frag: fragment object, samples : [ id3 samples pes ] }
+ FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',
+ // fired when data have been extracted from fragment - data: { id : demuxer id, frag: fragment object, data1 : moof MP4 box or TS fragments, data2 : mdat MP4 box or null}
+ FRAG_PARSING_DATA: 'hlsFragParsingData',
+ // fired when fragment parsing is completed - data: { id : demuxer id, frag: fragment object }
+ FRAG_PARSED: 'hlsFragParsed',
+ // fired when fragment remuxed MP4 boxes have all been appended into SourceBuffer - data: { id : demuxer id, frag : fragment object, stats : { trequest, tfirst, tload, tparsed, tbuffered, length, bwEstimate } }
+ FRAG_BUFFERED: 'hlsFragBuffered',
+ // fired when fragment matching with current media position is changing - data : { id : demuxer id, frag : fragment object }
+ FRAG_CHANGED: 'hlsFragChanged',
+ // Identifier for a FPS drop event - data: { curentDropped, currentDecoded, totalDroppedFrames }
+ FPS_DROP: 'hlsFpsDrop',
+ //triggered when FPS drop triggers auto level capping - data: { level, droppedlevel }
+ FPS_DROP_LEVEL_CAPPING: 'hlsFpsDropLevelCapping',
+ // Identifier for an error event - data: { type : error type, details : error details, fatal : if true, hls.js cannot/will not try to recover, if false, hls.js will try to recover,other error specific data }
+ ERROR: 'hlsError',
+ // fired when hls.js instance starts destroying. Different from MEDIA_DETACHED as one could want to detach and reattach a media to the instance of hls.js to handle mid-rolls for example - data: { }
+ DESTROYING: 'hlsDestroying',
+ // fired when a decrypt key loading starts - data: { frag : fragment object }
+ KEY_LOADING: 'hlsKeyLoading',
+ // fired when a decrypt key loading is completed - data: { frag : fragment object, payload : key payload, stats : { trequest, tfirst, tload, length } }
+ KEY_LOADED: 'hlsKeyLoaded',
+ // fired upon stream controller state transitions - data: { previousState, nextState }
+ STREAM_STATE_TRANSITION: 'hlsStreamStateTransition'
+});
+
+/***/ }),
+/* 2 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ErrorTypes; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ErrorDetails; });
+var ErrorTypes = {
+ // Identifier for a network error (loading error / timeout ...)
+ NETWORK_ERROR: 'networkError',
+ // Identifier for a media Error (video/parsing/mediasource error)
+ MEDIA_ERROR: 'mediaError',
+ // Identifier for a mux Error (demuxing/remuxing)
+ MUX_ERROR: 'muxError',
+ // Identifier for all other errors
+ OTHER_ERROR: 'otherError'
+};
+
+var ErrorDetails = {
+ // Identifier for a manifest load error - data: { url : faulty URL, response : { code: error code, text: error text }}
+ MANIFEST_LOAD_ERROR: 'manifestLoadError',
+ // Identifier for a manifest load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}
+ MANIFEST_LOAD_TIMEOUT: 'manifestLoadTimeOut',
+ // Identifier for a manifest parsing error - data: { url : faulty URL, reason : error reason}
+ MANIFEST_PARSING_ERROR: 'manifestParsingError',
+ // Identifier for a manifest with only incompatible codecs error - data: { url : faulty URL, reason : error reason}
+ MANIFEST_INCOMPATIBLE_CODECS_ERROR: 'manifestIncompatibleCodecsError',
+ // Identifier for a level load error - data: { url : faulty URL, response : { code: error code, text: error text }}
+ LEVEL_LOAD_ERROR: 'levelLoadError',
+ // Identifier for a level load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}
+ LEVEL_LOAD_TIMEOUT: 'levelLoadTimeOut',
+ // Identifier for a level switch error - data: { level : faulty level Id, event : error description}
+ LEVEL_SWITCH_ERROR: 'levelSwitchError',
+ // Identifier for an audio track load error - data: { url : faulty URL, response : { code: error code, text: error text }}
+ AUDIO_TRACK_LOAD_ERROR: 'audioTrackLoadError',
+ // Identifier for an audio track load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}
+ AUDIO_TRACK_LOAD_TIMEOUT: 'audioTrackLoadTimeOut',
+ // Identifier for fragment load error - data: { frag : fragment object, response : { code: error code, text: error text }}
+ FRAG_LOAD_ERROR: 'fragLoadError',
+ // Identifier for fragment loop loading error - data: { frag : fragment object}
+ FRAG_LOOP_LOADING_ERROR: 'fragLoopLoadingError',
+ // Identifier for fragment load timeout error - data: { frag : fragment object}
+ FRAG_LOAD_TIMEOUT: 'fragLoadTimeOut',
+ // Identifier for a fragment decryption error event - data: {id : demuxer Id,frag: fragment object, reason : parsing error description }
+ FRAG_DECRYPT_ERROR: 'fragDecryptError',
+ // Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description }
+ // will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release
+ FRAG_PARSING_ERROR: 'fragParsingError',
+ // Identifier for a remux alloc error event - data: { id : demuxer Id, frag : fragment object, bytes : nb of bytes on which allocation failed , reason : error text }
+ REMUX_ALLOC_ERROR: 'remuxAllocError',
+ // Identifier for decrypt key load error - data: { frag : fragment object, response : { code: error code, text: error text }}
+ KEY_LOAD_ERROR: 'keyLoadError',
+ // Identifier for decrypt key load timeout error - data: { frag : fragment object}
+ KEY_LOAD_TIMEOUT: 'keyLoadTimeOut',
+ // Triggered when an exception occurs while adding a sourceBuffer to MediaSource - data : { err : exception , mimeType : mimeType }
+ BUFFER_ADD_CODEC_ERROR: 'bufferAddCodecError',
+ // Identifier for a buffer append error - data: append error description
+ BUFFER_APPEND_ERROR: 'bufferAppendError',
+ // Identifier for a buffer appending error event - data: appending error description
+ BUFFER_APPENDING_ERROR: 'bufferAppendingError',
+ // Identifier for a buffer stalled error event
+ BUFFER_STALLED_ERROR: 'bufferStalledError',
+ // Identifier for a buffer full event
+ BUFFER_FULL_ERROR: 'bufferFullError',
+ // Identifier for a buffer seek over hole event
+ BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole',
+ // Identifier for a buffer nudge on stall (playback is stuck although currentTime is in a buffered area)
+ BUFFER_NUDGE_ON_STALL: 'bufferNudgeOnStall',
+ // Identifier for an internal exception happening inside hls.js while handling an event
+ INTERNAL_EXCEPTION: 'internalException'
+};
+
+/***/ }),
+/* 3 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return utf8ArrayToStr; });
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+/**
+ * ID3 parser
+ */
+var ID3 = function () {
+ function ID3() {
+ _classCallCheck(this, ID3);
+ }
+
+ /**
+ * Returns true if an ID3 header can be found at offset in data
+ * @param {Uint8Array} data - The data to search in
+ * @param {number} offset - The offset at which to start searching
+ * @return {boolean} - True if an ID3 header is found
+ */
+ ID3.isHeader = function isHeader(data, offset) {
+ /*
+ * http://id3.org/id3v2.3.0
+ * [0] = 'I'
+ * [1] = 'D'
+ * [2] = '3'
+ * [3,4] = {Version}
+ * [5] = {Flags}
+ * [6-9] = {ID3 Size}
+ *
+ * An ID3v2 tag can be detected with the following pattern:
+ * $49 44 33 yy yy xx zz zz zz zz
+ * Where yy is less than $FF, xx is the 'flags' byte and zz is less than $80
+ */
+ if (offset + 10 <= data.length) {
+ //look for 'ID3' identifier
+ if (data[offset] === 0x49 && data[offset + 1] === 0x44 && data[offset + 2] === 0x33) {
+ //check version is within range
+ if (data[offset + 3] < 0xFF && data[offset + 4] < 0xFF) {
+ //check size is within range
+ if (data[offset + 6] < 0x80 && data[offset + 7] < 0x80 && data[offset + 8] < 0x80 && data[offset + 9] < 0x80) {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * Returns true if an ID3 footer can be found at offset in data
+ * @param {Uint8Array} data - The data to search in
+ * @param {number} offset - The offset at which to start searching
+ * @return {boolean} - True if an ID3 footer is found
+ */
+
+
+ ID3.isFooter = function isFooter(data, offset) {
+ /*
+ * The footer is a copy of the header, but with a different identifier
+ */
+ if (offset + 10 <= data.length) {
+ //look for '3DI' identifier
+ if (data[offset] === 0x33 && data[offset + 1] === 0x44 && data[offset + 2] === 0x49) {
+ //check version is within range
+ if (data[offset + 3] < 0xFF && data[offset + 4] < 0xFF) {
+ //check size is within range
+ if (data[offset + 6] < 0x80 && data[offset + 7] < 0x80 && data[offset + 8] < 0x80 && data[offset + 9] < 0x80) {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * Returns any adjacent ID3 tags found in data starting at offset, as one block of data
+ * @param {Uint8Array} data - The data to search in
+ * @param {number} offset - The offset at which to start searching
+ * @return {Uint8Array} - The block of data containing any ID3 tags found
+ */
+
+
+ ID3.getID3Data = function getID3Data(data, offset) {
+ var front = offset;
+ var length = 0;
+
+ while (ID3.isHeader(data, offset)) {
+ //ID3 header is 10 bytes
+ length += 10;
+
+ var size = ID3._readSize(data, offset + 6);
+ length += size;
+
+ if (ID3.isFooter(data, offset + 10)) {
+ //ID3 footer is 10 bytes
+ length += 10;
+ }
+
+ offset += length;
+ }
+
+ if (length > 0) {
+ return data.subarray(front, front + length);
+ }
+
+ return undefined;
+ };
+
+ ID3._readSize = function _readSize(data, offset) {
+ var size = 0;
+ size = (data[offset] & 0x7f) << 21;
+ size |= (data[offset + 1] & 0x7f) << 14;
+ size |= (data[offset + 2] & 0x7f) << 7;
+ size |= data[offset + 3] & 0x7f;
+ return size;
+ };
+
+ /**
+ * Searches for the Elementary Stream timestamp found in the ID3 data chunk
+ * @param {Uint8Array} data - Block of data containing one or more ID3 tags
+ * @return {number} - The timestamp
+ */
+
+
+ ID3.getTimeStamp = function getTimeStamp(data) {
+ var frames = ID3.getID3Frames(data);
+ for (var i = 0; i < frames.length; i++) {
+ var frame = frames[i];
+ if (ID3.isTimeStampFrame(frame)) {
+ return ID3._readTimeStamp(frame);
+ }
+ }
+
+ return undefined;
+ };
+
+ /**
+ * Returns true if the ID3 frame is an Elementary Stream timestamp frame
+ * @param {ID3 frame} frame
+ */
+
+
+ ID3.isTimeStampFrame = function isTimeStampFrame(frame) {
+ return frame && frame.key === 'PRIV' && frame.info === 'com.apple.streaming.transportStreamTimestamp';
+ };
+
+ ID3._getFrameData = function _getFrameData(data) {
+ /*
+ Frame ID $xx xx xx xx (four characters)
+ Size $xx xx xx xx
+ Flags $xx xx
+ */
+ var type = String.fromCharCode(data[0], data[1], data[2], data[3]);
+ var size = ID3._readSize(data, 4);
+
+ //skip frame id, size, and flags
+ var offset = 10;
+
+ return { type: type, size: size, data: data.subarray(offset, offset + size) };
+ };
+
+ /**
+ * Returns an array of ID3 frames found in all the ID3 tags in the id3Data
+ * @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags
+ * @return {ID3 frame[]} - Array of ID3 frame objects
+ */
+
+
+ ID3.getID3Frames = function getID3Frames(id3Data) {
+ var offset = 0;
+ var frames = [];
+
+ while (ID3.isHeader(id3Data, offset)) {
+ var size = ID3._readSize(id3Data, offset + 6);
+ //skip past ID3 header
+ offset += 10;
+ var end = offset + size;
+ //loop through frames in the ID3 tag
+ while (offset + 8 < end) {
+ var frameData = ID3._getFrameData(id3Data.subarray(offset));
+ var frame = ID3._decodeFrame(frameData);
+ if (frame) {
+ frames.push(frame);
+ }
+ //skip frame header and frame data
+ offset += frameData.size + 10;
+ }
+
+ if (ID3.isFooter(id3Data, offset)) {
+ offset += 10;
+ }
+ }
+
+ return frames;
+ };
+
+ ID3._decodeFrame = function _decodeFrame(frame) {
+ if (frame.type === 'PRIV') {
+ return ID3._decodePrivFrame(frame);
+ } else if (frame.type[0] === 'T') {
+ return ID3._decodeTextFrame(frame);
+ } else if (frame.type[0] === 'W') {
+ return ID3._decodeURLFrame(frame);
+ }
+
+ return undefined;
+ };
+
+ ID3._readTimeStamp = function _readTimeStamp(timeStampFrame) {
+ if (timeStampFrame.data.byteLength === 8) {
+ var data = new Uint8Array(timeStampFrame.data);
+ // timestamp is 33 bit expressed as a big-endian eight-octet number,
+ // with the upper 31 bits set to zero.
+ var pts33Bit = data[3] & 0x1;
+ var timestamp = (data[4] << 23) + (data[5] << 15) + (data[6] << 7) + data[7];
+ timestamp /= 45;
+
+ if (pts33Bit) {
+ timestamp += 47721858.84; // 2^32 / 90
+ }
+
+ return Math.round(timestamp);
+ }
+
+ return undefined;
+ };
+
+ ID3._decodePrivFrame = function _decodePrivFrame(frame) {
+ /*
+ Format: <text string>\0<binary data>
+ */
+ if (frame.size < 2) {
+ return undefined;
+ }
+
+ var owner = ID3._utf8ArrayToStr(frame.data, true);
+ var privateData = new Uint8Array(frame.data.subarray(owner.length + 1));
+
+ return { key: frame.type, info: owner, data: privateData.buffer };
+ };
+
+ ID3._decodeTextFrame = function _decodeTextFrame(frame) {
+ if (frame.size < 2) {
+ return undefined;
+ }
+
+ if (frame.type === 'TXXX') {
+ /*
+ Format:
+ [0] = {Text Encoding}
+ [1-?] = {Description}\0{Value}
+ */
+ var index = 1;
+ var description = ID3._utf8ArrayToStr(frame.data.subarray(index));
+
+ index += description.length + 1;
+ var value = ID3._utf8ArrayToStr(frame.data.subarray(index));
+
+ return { key: frame.type, info: description, data: value };
+ } else {
+ /*
+ Format:
+ [0] = {Text Encoding}
+ [1-?] = {Value}
+ */
+ var text = ID3._utf8ArrayToStr(frame.data.subarray(1));
+ return { key: frame.type, data: text };
+ }
+ };
+
+ ID3._decodeURLFrame = function _decodeURLFrame(frame) {
+ if (frame.type === 'WXXX') {
+ /*
+ Format:
+ [0] = {Text Encoding}
+ [1-?] = {Description}\0{URL}
+ */
+ if (frame.size < 2) {
+ return undefined;
+ }
+
+ var index = 1;
+ var description = ID3._utf8ArrayToStr(frame.data.subarray(index));
+
+ index += description.length + 1;
+ var value = ID3._utf8ArrayToStr(frame.data.subarray(index));
+
+ return { key: frame.type, info: description, data: value };
+ } else {
+ /*
+ Format:
+ [0-?] = {URL}
+ */
+ var url = ID3._utf8ArrayToStr(frame.data);
+ return { key: frame.type, data: url };
+ }
+ };
+
+ // http://stackoverflow.com/questions/8936984/uint8array-to-string-in-javascript/22373197
+ // http://www.onicos.com/staff/iz/amuse/javascript/expert/utf.txt
+ /* utf.js - UTF-8 <=> UTF-16 convertion
+ *
+ * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
+ * Version: 1.0
+ * LastModified: Dec 25 1999
+ * This library is free. You can redistribute it and/or modify it.
+ */
+
+
+ ID3._utf8ArrayToStr = function _utf8ArrayToStr(array) {
+ var exitOnNull = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+
+
+ var len = array.length;
+ var c = void 0;
+ var char2 = void 0;
+ var char3 = void 0;
+ var out = '';
+ var i = 0;
+ while (i < len) {
+ c = array[i++];
+ if (c === 0x00 && exitOnNull) {
+ return out;
+ } else if (c === 0x00 || c === 0x03) {
+ // If the character is 3 (END_OF_TEXT) or 0 (NULL) then skip it
+ continue;
+ }
+ switch (c >> 4) {
+ case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:
+ // 0xxxxxxx
+ out += String.fromCharCode(c);
+ break;
+ case 12:case 13:
+ // 110x xxxx 10xx xxxx
+ char2 = array[i++];
+ out += String.fromCharCode((c & 0x1F) << 6 | char2 & 0x3F);
+ break;
+ case 14:
+ // 1110 xxxx 10xx xxxx 10xx xxxx
+ char2 = array[i++];
+ char3 = array[i++];
+ out += String.fromCharCode((c & 0x0F) << 12 | (char2 & 0x3F) << 6 | (char3 & 0x3F) << 0);
+ break;
+ default:
+ }
+ }
+ return out;
+ };
+
+ return ID3;
+}();
+
+var utf8ArrayToStr = ID3._utf8ArrayToStr;
+
+/* harmony default export */ __webpack_exports__["a"] = (ID3);
+
+
+
+/***/ }),
+/* 4 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+
+// CONCATENATED MODULE: ./src/crypt/aes-crypto.js
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var AESCrypto = function () {
+ function AESCrypto(subtle, iv) {
+ _classCallCheck(this, AESCrypto);
+
+ this.subtle = subtle;
+ this.aesIV = iv;
+ }
+
+ AESCrypto.prototype.decrypt = function decrypt(data, key) {
+ return this.subtle.decrypt({ name: 'AES-CBC', iv: this.aesIV }, key, data);
+ };
+
+ return AESCrypto;
+}();
+
+/* harmony default export */ var aes_crypto = (AESCrypto);
+// CONCATENATED MODULE: ./src/crypt/fast-aes-key.js
+function fast_aes_key__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var FastAESKey = function () {
+ function FastAESKey(subtle, key) {
+ fast_aes_key__classCallCheck(this, FastAESKey);
+
+ this.subtle = subtle;
+ this.key = key;
+ }
+
+ FastAESKey.prototype.expandKey = function expandKey() {
+ return this.subtle.importKey('raw', this.key, { name: 'AES-CBC' }, false, ['encrypt', 'decrypt']);
+ };
+
+ return FastAESKey;
+}();
+
+/* harmony default export */ var fast_aes_key = (FastAESKey);
+// CONCATENATED MODULE: ./src/crypt/aes-decryptor.js
+function aes_decryptor__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var AESDecryptor = function () {
+ function AESDecryptor() {
+ aes_decryptor__classCallCheck(this, AESDecryptor);
+
+ // Static after running initTable
+ this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
+ 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);
+
+ // Changes during runtime
+ this.key = new Uint32Array(0);
+
+ this.initTable();
+ }
+
+ // Using view.getUint32() also swaps the byte order.
+
+
+ AESDecryptor.prototype.uint8ArrayToUint32Array_ = function uint8ArrayToUint32Array_(arrayBuffer) {
+ var view = new DataView(arrayBuffer);
+ var newArray = new Uint32Array(4);
+ for (var i = 0; i < 4; i++) {
+ newArray[i] = view.getUint32(i * 4);
+ }
+ return newArray;
+ };
+
+ AESDecryptor.prototype.initTable = function initTable() {
+ var sBox = this.sBox;
+ var invSBox = this.invSBox;
+ var subMix = this.subMix;
+ var subMix0 = subMix[0];
+ var subMix1 = subMix[1];
+ var subMix2 = subMix[2];
+ var subMix3 = subMix[3];
+ var invSubMix = this.invSubMix;
+ var invSubMix0 = invSubMix[0];
+ var invSubMix1 = invSubMix[1];
+ var invSubMix2 = invSubMix[2];
+ var invSubMix3 = invSubMix[3];
+
+ var d = new Uint32Array(256);
+ var x = 0;
+ var xi = 0;
+ var i = 0;
+ for (i = 0; i < 256; i++) {
+ if (i < 128) {
+ d[i] = i << 1;
+ } else {
+ d[i] = i << 1 ^ 0x11b;
+ }
+ }
+
+ for (i = 0; i < 256; i++) {
+ var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;
+ sx = sx >>> 8 ^ sx & 0xff ^ 0x63;
+ sBox[x] = sx;
+ invSBox[sx] = x;
+
+ // Compute multiplication
+ var x2 = d[x];
+ var x4 = d[x2];
+ var x8 = d[x4];
+
+ // Compute sub/invSub bytes, mix columns tables
+ var t = d[sx] * 0x101 ^ sx * 0x1010100;
+ subMix0[x] = t << 24 | t >>> 8;
+ subMix1[x] = t << 16 | t >>> 16;
+ subMix2[x] = t << 8 | t >>> 24;
+ subMix3[x] = t;
+
+ // Compute inv sub bytes, inv mix columns tables
+ t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;
+ invSubMix0[sx] = t << 24 | t >>> 8;
+ invSubMix1[sx] = t << 16 | t >>> 16;
+ invSubMix2[sx] = t << 8 | t >>> 24;
+ invSubMix3[sx] = t;
+
+ // Compute next counter
+ if (!x) {
+ x = xi = 1;
+ } else {
+ x = x2 ^ d[d[d[x8 ^ x2]]];
+ xi ^= d[d[xi]];
+ }
+ }
+ };
+
+ AESDecryptor.prototype.expandKey = function expandKey(keyBuffer) {
+ // convert keyBuffer to Uint32Array
+ var key = this.uint8ArrayToUint32Array_(keyBuffer);
+ var sameKey = true;
+ var offset = 0;
+
+ while (offset < key.length && sameKey) {
+ sameKey = key[offset] === this.key[offset];
+ offset++;
+ }
+
+ if (sameKey) {
+ return;
+ }
+
+ this.key = key;
+ var keySize = this.keySize = key.length;
+
+ if (keySize !== 4 && keySize !== 6 && keySize !== 8) {
+ throw new Error('Invalid aes key size=' + keySize);
+ }
+
+ var ksRows = this.ksRows = (keySize + 6 + 1) * 4;
+ var ksRow = void 0;
+ var invKsRow = void 0;
+
+ var keySchedule = this.keySchedule = new Uint32Array(ksRows);
+ var invKeySchedule = this.invKeySchedule = new Uint32Array(ksRows);
+ var sbox = this.sBox;
+ var rcon = this.rcon;
+
+ var invSubMix = this.invSubMix;
+ var invSubMix0 = invSubMix[0];
+ var invSubMix1 = invSubMix[1];
+ var invSubMix2 = invSubMix[2];
+ var invSubMix3 = invSubMix[3];
+
+ var prev = void 0;
+ var t = void 0;
+
+ for (ksRow = 0; ksRow < ksRows; ksRow++) {
+ if (ksRow < keySize) {
+ prev = keySchedule[ksRow] = key[ksRow];
+ continue;
+ }
+ t = prev;
+
+ if (ksRow % keySize === 0) {
+ // Rot word
+ t = t << 8 | t >>> 24;
+
+ // Sub word
+ t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];
+
+ // Mix Rcon
+ t ^= rcon[ksRow / keySize | 0] << 24;
+ } else if (keySize > 6 && ksRow % keySize === 4) {
+ // Sub word
+ t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];
+ }
+
+ keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;
+ }
+
+ for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {
+ ksRow = ksRows - invKsRow;
+ if (invKsRow & 3) {
+ t = keySchedule[ksRow];
+ } else {
+ t = keySchedule[ksRow - 4];
+ }
+
+ if (invKsRow < 4 || ksRow <= 4) {
+ invKeySchedule[invKsRow] = t;
+ } else {
+ invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[t >>> 16 & 0xff]] ^ invSubMix2[sbox[t >>> 8 & 0xff]] ^ invSubMix3[sbox[t & 0xff]];
+ }
+
+ invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;
+ }
+ };
+
+ // Adding this as a method greatly improves performance.
+
+
+ AESDecryptor.prototype.networkToHostOrderSwap = function networkToHostOrderSwap(word) {
+ return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;
+ };
+
+ AESDecryptor.prototype.decrypt = function decrypt(inputArrayBuffer, offset, aesIV) {
+ var nRounds = this.keySize + 6;
+ var invKeySchedule = this.invKeySchedule;
+ var invSBOX = this.invSBox;
+
+ var invSubMix = this.invSubMix;
+ var invSubMix0 = invSubMix[0];
+ var invSubMix1 = invSubMix[1];
+ var invSubMix2 = invSubMix[2];
+ var invSubMix3 = invSubMix[3];
+
+ var initVector = this.uint8ArrayToUint32Array_(aesIV);
+ var initVector0 = initVector[0];
+ var initVector1 = initVector[1];
+ var initVector2 = initVector[2];
+ var initVector3 = initVector[3];
+
+ var inputInt32 = new Int32Array(inputArrayBuffer);
+ var outputInt32 = new Int32Array(inputInt32.length);
+
+ var t0 = void 0,
+ t1 = void 0,
+ t2 = void 0,
+ t3 = void 0;
+ var s0 = void 0,
+ s1 = void 0,
+ s2 = void 0,
+ s3 = void 0;
+ var inputWords0 = void 0,
+ inputWords1 = void 0,
+ inputWords2 = void 0,
+ inputWords3 = void 0;
+
+ var ksRow, i;
+ var swapWord = this.networkToHostOrderSwap;
+
+ while (offset < inputInt32.length) {
+ inputWords0 = swapWord(inputInt32[offset]);
+ inputWords1 = swapWord(inputInt32[offset + 1]);
+ inputWords2 = swapWord(inputInt32[offset + 2]);
+ inputWords3 = swapWord(inputInt32[offset + 3]);
+
+ s0 = inputWords0 ^ invKeySchedule[0];
+ s1 = inputWords3 ^ invKeySchedule[1];
+ s2 = inputWords2 ^ invKeySchedule[2];
+ s3 = inputWords1 ^ invKeySchedule[3];
+
+ ksRow = 4;
+
+ // Iterate through the rounds of decryption
+ for (i = 1; i < nRounds; i++) {
+ t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[s1 >> 16 & 0xff] ^ invSubMix2[s2 >> 8 & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];
+ t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[s2 >> 16 & 0xff] ^ invSubMix2[s3 >> 8 & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];
+ t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[s3 >> 16 & 0xff] ^ invSubMix2[s0 >> 8 & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];
+ t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[s0 >> 16 & 0xff] ^ invSubMix2[s1 >> 8 & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];
+ // Update state
+ s0 = t0;
+ s1 = t1;
+ s2 = t2;
+ s3 = t3;
+
+ ksRow = ksRow + 4;
+ }
+
+ // Shift rows, sub bytes, add round key
+ t0 = invSBOX[s0 >>> 24] << 24 ^ invSBOX[s1 >> 16 & 0xff] << 16 ^ invSBOX[s2 >> 8 & 0xff] << 8 ^ invSBOX[s3 & 0xff] ^ invKeySchedule[ksRow];
+ t1 = invSBOX[s1 >>> 24] << 24 ^ invSBOX[s2 >> 16 & 0xff] << 16 ^ invSBOX[s3 >> 8 & 0xff] << 8 ^ invSBOX[s0 & 0xff] ^ invKeySchedule[ksRow + 1];
+ t2 = invSBOX[s2 >>> 24] << 24 ^ invSBOX[s3 >> 16 & 0xff] << 16 ^ invSBOX[s0 >> 8 & 0xff] << 8 ^ invSBOX[s1 & 0xff] ^ invKeySchedule[ksRow + 2];
+ t3 = invSBOX[s3 >>> 24] << 24 ^ invSBOX[s0 >> 16 & 0xff] << 16 ^ invSBOX[s1 >> 8 & 0xff] << 8 ^ invSBOX[s2 & 0xff] ^ invKeySchedule[ksRow + 3];
+ ksRow = ksRow + 3;
+
+ // Write
+ outputInt32[offset] = swapWord(t0 ^ initVector0);
+ outputInt32[offset + 1] = swapWord(t3 ^ initVector1);
+ outputInt32[offset + 2] = swapWord(t2 ^ initVector2);
+ outputInt32[offset + 3] = swapWord(t1 ^ initVector3);
+
+ // reset initVector to last 4 unsigned int
+ initVector0 = inputWords0;
+ initVector1 = inputWords1;
+ initVector2 = inputWords2;
+ initVector3 = inputWords3;
+
+ offset = offset + 4;
+ }
+
+ return outputInt32.buffer;
+ };
+
+ AESDecryptor.prototype.destroy = function destroy() {
+ this.key = undefined;
+ this.keySize = undefined;
+ this.ksRows = undefined;
+
+ this.sBox = undefined;
+ this.invSBox = undefined;
+ this.subMix = undefined;
+ this.invSubMix = undefined;
+ this.keySchedule = undefined;
+ this.invKeySchedule = undefined;
+
+ this.rcon = undefined;
+ };
+
+ return AESDecryptor;
+}();
+
+/* harmony default export */ var aes_decryptor = (AESDecryptor);
+// EXTERNAL MODULE: ./src/errors.js
+var errors = __webpack_require__(2);
+
+// EXTERNAL MODULE: ./src/utils/logger.js
+var logger = __webpack_require__(0);
+
+// CONCATENATED MODULE: ./src/crypt/decrypter.js
+function decrypter__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+
+
+
+
+
+
+
+/*globals self: false */
+
+var decrypter_Decrypter = function () {
+ function Decrypter(observer, config) {
+ decrypter__classCallCheck(this, Decrypter);
+
+ this.observer = observer;
+ this.config = config;
+ this.logEnabled = true;
+ try {
+ var browserCrypto = crypto ? crypto : self.crypto;
+ this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;
+ } catch (e) {}
+ this.disableWebCrypto = !this.subtle;
+ }
+
+ Decrypter.prototype.isSync = function isSync() {
+ return this.disableWebCrypto && this.config.enableSoftwareAES;
+ };
+
+ Decrypter.prototype.decrypt = function decrypt(data, key, iv, callback) {
+ var _this = this;
+
+ if (this.disableWebCrypto && this.config.enableSoftwareAES) {
+ if (this.logEnabled) {
+ logger["b" /* logger */].log('JS AES decrypt');
+ this.logEnabled = false;
+ }
+ var decryptor = this.decryptor;
+ if (!decryptor) {
+ this.decryptor = decryptor = new aes_decryptor();
+ }
+ decryptor.expandKey(key);
+ callback(decryptor.decrypt(data, 0, iv));
+ } else {
+ if (this.logEnabled) {
+ logger["b" /* logger */].log('WebCrypto AES decrypt');
+ this.logEnabled = false;
+ }
+ var subtle = this.subtle;
+ if (this.key !== key) {
+ this.key = key;
+ this.fastAesKey = new fast_aes_key(subtle, key);
+ }
+
+ this.fastAesKey.expandKey().then(function (aesKey) {
+ // decrypt using web crypto
+ var crypto = new aes_crypto(subtle, iv);
+ crypto.decrypt(data, aesKey).catch(function (err) {
+ _this.onWebCryptoError(err, data, key, iv, callback);
+ }).then(function (result) {
+ callback(result);
+ });
+ }).catch(function (err) {
+ _this.onWebCryptoError(err, data, key, iv, callback);
+ });
+ }
+ };
+
+ Decrypter.prototype.onWebCryptoError = function onWebCryptoError(err, data, key, iv, callback) {
+ if (this.config.enableSoftwareAES) {
+ logger["b" /* logger */].log('WebCrypto Error, disable WebCrypto API');
+ this.disableWebCrypto = true;
+ this.logEnabled = true;
+ this.decrypt(data, key, iv, callback);
+ } else {
+ logger["b" /* logger */].error('decrypting error : ' + err.message);
+ this.observer.trigger(Event.ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].FRAG_DECRYPT_ERROR, fatal: true, reason: err.message });
+ }
+ };
+
+ Decrypter.prototype.destroy = function destroy() {
+ var decryptor = this.decryptor;
+ if (decryptor) {
+ decryptor.destroy();
+ this.decryptor = undefined;
+ }
+ };
+
+ return Decrypter;
+}();
+
+/* harmony default export */ var decrypter = __webpack_exports__["a"] = (decrypter_Decrypter);
+
+/***/ }),
+/* 5 */
+/***/ (function(module, exports) {
+
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
@@ -14269,7 +15763,11 @@ function isUndefined(arg) {
return arg === void 0;
}
-},{}],2:[function(_dereq_,module,exports){
+
+/***/ }),
+/* 6 */
+/***/ (function(module, exports, __webpack_require__) {
+
// see https://tools.ietf.org/html/rfc1808
/* jshint ignore:start */
@@ -14423,7 +15921,7 @@ function isUndefined(arg) {
};
/* jshint ignore:start */
- if(typeof exports === 'object' && typeof module === 'object')
+ if(true)
module.exports = URLToolkit;
else if(typeof define === 'function' && define.amd)
define([], function() { return URLToolkit; });
@@ -14434,6731 +15932,5310 @@ function isUndefined(arg) {
})(this);
/* jshint ignore:end */
-},{}],3:[function(_dereq_,module,exports){
-var bundleFn = arguments[3];
-var sources = arguments[4];
-var cache = arguments[5];
-
-var stringify = JSON.stringify;
-
-module.exports = function (fn, options) {
- var wkey;
- var cacheKeys = Object.keys(cache);
-
- for (var i = 0, l = cacheKeys.length; i < l; i++) {
- var key = cacheKeys[i];
- var exp = cache[key].exports;
- // Using babel as a transpiler to use esmodule, the export will always
- // be an object with the default export as a property of it. To ensure
- // the existing api and babel esmodule exports are both supported we
- // check for both
- if (exp === fn || exp && exp.default === fn) {
- wkey = key;
- break;
- }
- }
-
- if (!wkey) {
- wkey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);
- var wcache = {};
- for (var i = 0, l = cacheKeys.length; i < l; i++) {
- var key = cacheKeys[i];
- wcache[key] = key;
- }
- sources[wkey] = [
- Function(['require','module','exports'], '(' + fn + ')(self)'),
- wcache
- ];
- }
- var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);
- var scache = {}; scache[wkey] = wkey;
- sources[skey] = [
- Function(['require'], (
- // try to call default if defined to also support babel esmodule
- // exports
- 'var f = require(' + stringify(wkey) + ');' +
- '(f.default ? f.default : f)(self);'
- )),
- scache
- ];
+/***/ }),
+/* 7 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
- var workerSources = {};
- resolveSources(skey);
+"use strict";
- function resolveSources(key) {
- workerSources[key] = true;
+// EXTERNAL MODULE: ./src/events.js
+var events = __webpack_require__(1);
- for (var depPath in sources[key][1]) {
- var depKey = sources[key][1][depPath];
- if (!workerSources[depKey]) {
- resolveSources(depKey);
- }
- }
- }
+// EXTERNAL MODULE: ./src/errors.js
+var errors = __webpack_require__(2);
- var src = '(' + bundleFn + ')({'
- + Object.keys(workerSources).map(function (key) {
- return stringify(key) + ':['
- + sources[key][0]
- + ',' + stringify(sources[key][1]) + ']'
- ;
- }).join(',')
- + '},{},[' + stringify(skey) + '])'
- ;
+// EXTERNAL MODULE: ./src/crypt/decrypter.js + 3 modules
+var crypt_decrypter = __webpack_require__(4);
- var URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
+// EXTERNAL MODULE: ./src/utils/logger.js
+var logger = __webpack_require__(0);
- var blob = new Blob([src], { type: 'text/javascript' });
- if (options && options.bare) { return blob; }
- var workerUrl = URL.createObjectURL(blob);
- var worker = new Worker(workerUrl);
- worker.objectURL = workerUrl;
- return worker;
-};
-
-},{}],4:[function(_dereq_,module,exports){
+// CONCATENATED MODULE: ./src/demux/adts.js
/**
- * HLS config
+ * ADTS parser helper
*/
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.hlsDefaultConfig = undefined;
-
-var _abrController = _dereq_(5);
-
-var _abrController2 = _interopRequireDefault(_abrController);
-var _bufferController = _dereq_(8);
-var _bufferController2 = _interopRequireDefault(_bufferController);
-var _capLevelController = _dereq_(9);
+function getAudioConfig(observer, data, offset, audioCodec) {
+ var adtsObjectType,
+ // :int
+ adtsSampleingIndex,
+ // :int
+ adtsExtensionSampleingIndex,
+ // :int
+ adtsChanelConfig,
+ // :int
+ config,
+ userAgent = navigator.userAgent.toLowerCase(),
+ manifestCodec = audioCodec,
+ adtsSampleingRates = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];
+ // byte 2
+ adtsObjectType = ((data[offset + 2] & 0xC0) >>> 6) + 1;
+ adtsSampleingIndex = (data[offset + 2] & 0x3C) >>> 2;
+ if (adtsSampleingIndex > adtsSampleingRates.length - 1) {
+ observer.trigger(Event.ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].FRAG_PARSING_ERROR, fatal: true, reason: 'invalid ADTS sampling index:' + adtsSampleingIndex });
+ return;
+ }
+ adtsChanelConfig = (data[offset + 2] & 0x01) << 2;
+ // byte 3
+ adtsChanelConfig |= (data[offset + 3] & 0xC0) >>> 6;
+ logger["b" /* logger */].log('manifest codec:' + audioCodec + ',ADTS data:type:' + adtsObjectType + ',sampleingIndex:' + adtsSampleingIndex + '[' + adtsSampleingRates[adtsSampleingIndex] + 'Hz],channelConfig:' + adtsChanelConfig);
+ // firefox: freq less than 24kHz = AAC SBR (HE-AAC)
+ if (/firefox/i.test(userAgent)) {
+ if (adtsSampleingIndex >= 6) {
+ adtsObjectType = 5;
+ config = new Array(4);
+ // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies
+ // there is a factor 2 between frame sample rate and output sample rate
+ // multiply frequency by 2 (see table below, equivalent to substract 3)
+ adtsExtensionSampleingIndex = adtsSampleingIndex - 3;
+ } else {
+ adtsObjectType = 2;
+ config = new Array(2);
+ adtsExtensionSampleingIndex = adtsSampleingIndex;
+ }
+ // Android : always use AAC
+ } else if (userAgent.indexOf('android') !== -1) {
+ adtsObjectType = 2;
+ config = new Array(2);
+ adtsExtensionSampleingIndex = adtsSampleingIndex;
+ } else {
+ /* for other browsers (Chrome/Vivaldi/Opera ...)
+ always force audio type to be HE-AAC SBR, as some browsers do not support audio codec switch properly (like Chrome ...)
+ */
+ adtsObjectType = 5;
+ config = new Array(4);
+ // if (manifest codec is HE-AAC or HE-AACv2) OR (manifest codec not specified AND frequency less than 24kHz)
+ if (audioCodec && (audioCodec.indexOf('mp4a.40.29') !== -1 || audioCodec.indexOf('mp4a.40.5') !== -1) || !audioCodec && adtsSampleingIndex >= 6) {
+ // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies
+ // there is a factor 2 between frame sample rate and output sample rate
+ // multiply frequency by 2 (see table below, equivalent to substract 3)
+ adtsExtensionSampleingIndex = adtsSampleingIndex - 3;
+ } else {
+ // if (manifest codec is AAC) AND (frequency less than 24kHz AND nb channel is 1) OR (manifest codec not specified and mono audio)
+ // Chrome fails to play back with low frequency AAC LC mono when initialized with HE-AAC. This is not a problem with stereo.
+ if (audioCodec && audioCodec.indexOf('mp4a.40.2') !== -1 && (adtsSampleingIndex >= 6 && adtsChanelConfig === 1 || /vivaldi/i.test(userAgent)) || !audioCodec && adtsChanelConfig === 1) {
+ adtsObjectType = 2;
+ config = new Array(2);
+ }
+ adtsExtensionSampleingIndex = adtsSampleingIndex;
+ }
+ }
+ /* refer to http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio#Audio_Specific_Config
+ ISO 14496-3 (AAC).pdf - Table 1.13 — Syntax of AudioSpecificConfig()
+ Audio Profile / Audio Object Type
+ 0: Null
+ 1: AAC Main
+ 2: AAC LC (Low Complexity)
+ 3: AAC SSR (Scalable Sample Rate)
+ 4: AAC LTP (Long Term Prediction)
+ 5: SBR (Spectral Band Replication)
+ 6: AAC Scalable
+ sampling freq
+ 0: 96000 Hz
+ 1: 88200 Hz
+ 2: 64000 Hz
+ 3: 48000 Hz
+ 4: 44100 Hz
+ 5: 32000 Hz
+ 6: 24000 Hz
+ 7: 22050 Hz
+ 8: 16000 Hz
+ 9: 12000 Hz
+ 10: 11025 Hz
+ 11: 8000 Hz
+ 12: 7350 Hz
+ 13: Reserved
+ 14: Reserved
+ 15: frequency is written explictly
+ Channel Configurations
+ These are the channel configurations:
+ 0: Defined in AOT Specifc Config
+ 1: 1 channel: front-center
+ 2: 2 channels: front-left, front-right
+ */
+ // audioObjectType = profile => profile, the MPEG-4 Audio Object Type minus 1
+ config[0] = adtsObjectType << 3;
+ // samplingFrequencyIndex
+ config[0] |= (adtsSampleingIndex & 0x0E) >> 1;
+ config[1] |= (adtsSampleingIndex & 0x01) << 7;
+ // channelConfiguration
+ config[1] |= adtsChanelConfig << 3;
+ if (adtsObjectType === 5) {
+ // adtsExtensionSampleingIndex
+ config[1] |= (adtsExtensionSampleingIndex & 0x0E) >> 1;
+ config[2] = (adtsExtensionSampleingIndex & 0x01) << 7;
+ // adtsObjectType (force to 2, chrome is checking that object type is less than 5 ???
+ // https://chromium.googlesource.com/chromium/src.git/+/master/media/formats/mp4/aac.cc
+ config[2] |= 2 << 2;
+ config[3] = 0;
+ }
+ return { config: config, samplerate: adtsSampleingRates[adtsSampleingIndex], channelCount: adtsChanelConfig, codec: 'mp4a.40.' + adtsObjectType, manifestCodec: manifestCodec };
+}
-var _capLevelController2 = _interopRequireDefault(_capLevelController);
+function isHeaderPattern(data, offset) {
+ return data[offset] === 0xff && (data[offset + 1] & 0xf6) === 0xf0;
+}
-var _fpsController = _dereq_(10);
+function getHeaderLength(data, offset) {
+ return !!(data[offset + 1] & 0x01) ? 7 : 9;
+}
-var _fpsController2 = _interopRequireDefault(_fpsController);
+function getFullFrameLength(data, offset) {
+ return (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;
+}
-var _xhrLoader = _dereq_(58);
+function isHeader(data, offset) {
+ // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1
+ // Layer bits (position 14 and 15) in header should be always 0 for ADTS
+ // More info https://wiki.multimedia.cx/index.php?title=ADTS
+ if (offset + 1 < data.length && isHeaderPattern(data, offset)) {
+ return true;
+ }
+ return false;
+}
-var _xhrLoader2 = _interopRequireDefault(_xhrLoader);
+function adts_probe(data, offset) {
+ // same as isHeader but we also check that ADTS frame follows last ADTS frame
+ // or end of data is reached
+ if (offset + 1 < data.length && isHeaderPattern(data, offset)) {
+ // ADTS header Length
+ var headerLength = getHeaderLength(data, offset);
+ // ADTS frame Length
+ var frameLength = headerLength;
+ if (offset + 5 < data.length) {
+ frameLength = getFullFrameLength(data, offset);
+ }
+ var newOffset = offset + frameLength;
+ if (newOffset === data.length || newOffset + 1 < data.length && isHeaderPattern(data, newOffset)) {
+ return true;
+ }
+ }
+ return false;
+}
-var _audioTrackController = _dereq_(7);
+function initTrackConfig(track, observer, data, offset, audioCodec) {
+ if (!track.samplerate) {
+ var config = getAudioConfig(observer, data, offset, audioCodec);
+ track.config = config.config;
+ track.samplerate = config.samplerate;
+ track.channelCount = config.channelCount;
+ track.codec = config.codec;
+ track.manifestCodec = config.manifestCodec;
+ logger["b" /* logger */].log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);
+ }
+}
-var _audioTrackController2 = _interopRequireDefault(_audioTrackController);
+function getFrameDuration(samplerate) {
+ return 1024 * 90000 / samplerate;
+}
-var _audioStreamController = _dereq_(6);
+function parseFrameHeader(data, offset, pts, frameIndex, frameDuration) {
+ var headerLength, frameLength, stamp;
+ var length = data.length;
-var _audioStreamController2 = _interopRequireDefault(_audioStreamController);
+ // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header
+ headerLength = getHeaderLength(data, offset);
+ // retrieve frame size
+ frameLength = getFullFrameLength(data, offset);
+ frameLength -= headerLength;
-var _cues = _dereq_(50);
+ if (frameLength > 0 && offset + headerLength + frameLength <= length) {
+ stamp = pts + frameIndex * frameDuration;
+ //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);
+ return { headerLength: headerLength, frameLength: frameLength, stamp: stamp };
+ }
-var _cues2 = _interopRequireDefault(_cues);
+ return undefined;
+}
-var _timelineController = _dereq_(16);
+function appendFrame(track, data, offset, pts, frameIndex) {
+ var frameDuration = getFrameDuration(track.samplerate);
+ var header = parseFrameHeader(data, offset, pts, frameIndex, frameDuration);
+ if (header) {
+ var stamp = header.stamp;
+ var headerLength = header.headerLength;
+ var frameLength = header.frameLength;
+
+ //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);
+ var aacSample = {
+ unit: data.subarray(offset + headerLength, offset + headerLength + frameLength),
+ pts: stamp,
+ dts: stamp
+ };
-var _timelineController2 = _interopRequireDefault(_timelineController);
+ track.samples.push(aacSample);
+ track.len += frameLength;
-var _subtitleTrackController = _dereq_(15);
+ return { sample: aacSample, length: frameLength + headerLength };
+ }
-var _subtitleTrackController2 = _interopRequireDefault(_subtitleTrackController);
+ return undefined;
+}
+// EXTERNAL MODULE: ./src/demux/id3.js
+var id3 = __webpack_require__(3);
-var _subtitleStreamController = _dereq_(14);
+// CONCATENATED MODULE: ./src/demux/aacdemuxer.js
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var _subtitleStreamController2 = _interopRequireDefault(_subtitleStreamController);
+/**
+ * AAC demuxer
+ */
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-//#endif
-//#endif
-//#if subtitle
+var aacdemuxer_AACDemuxer = function () {
+ function AACDemuxer(observer, remuxer, config) {
+ _classCallCheck(this, AACDemuxer);
-//import FetchLoader from './utils/fetch-loader';
-//#if altaudio
-var hlsDefaultConfig = exports.hlsDefaultConfig = {
- autoStartLoad: true, // used by stream-controller
- startPosition: -1, // used by stream-controller
- defaultAudioCodec: undefined, // used by stream-controller
- debug: false, // used by logger
- capLevelOnFPSDrop: false, // used by fps-controller
- capLevelToPlayerSize: false, // used by cap-level-controller
- initialLiveManifestSize: 1, // used by stream-controller
- maxBufferLength: 30, // used by stream-controller
- maxBufferSize: 60 * 1000 * 1000, // used by stream-controller
- maxBufferHole: 0.5, // used by stream-controller
- maxSeekHole: 2, // used by stream-controller
- lowBufferWatchdogPeriod: 0.5, // used by stream-controller
- highBufferWatchdogPeriod: 3, // used by stream-controller
- nudgeOffset: 0.1, // used by stream-controller
- nudgeMaxRetry: 3, // used by stream-controller
- maxFragLookUpTolerance: 0.25, // used by stream-controller
- liveSyncDurationCount: 3, // used by stream-controller
- liveMaxLatencyDurationCount: Infinity, // used by stream-controller
- liveSyncDuration: undefined, // used by stream-controller
- liveMaxLatencyDuration: undefined, // used by stream-controller
- maxMaxBufferLength: 600, // used by stream-controller
- enableWorker: true, // used by demuxer
- enableSoftwareAES: true, // used by decrypter
- manifestLoadingTimeOut: 10000, // used by playlist-loader
- manifestLoadingMaxRetry: 1, // used by playlist-loader
- manifestLoadingRetryDelay: 1000, // used by playlist-loader
- manifestLoadingMaxRetryTimeout: 64000, // used by playlist-loader
- startLevel: undefined, // used by level-controller
- levelLoadingTimeOut: 10000, // used by playlist-loader
- levelLoadingMaxRetry: 4, // used by playlist-loader
- levelLoadingRetryDelay: 1000, // used by playlist-loader
- levelLoadingMaxRetryTimeout: 64000, // used by playlist-loader
- fragLoadingTimeOut: 20000, // used by fragment-loader
- fragLoadingMaxRetry: 6, // used by fragment-loader
- fragLoadingRetryDelay: 1000, // used by fragment-loader
- fragLoadingMaxRetryTimeout: 64000, // used by fragment-loader
- fragLoadingLoopThreshold: 3, // used by stream-controller
- startFragPrefetch: false, // used by stream-controller
- fpsDroppedMonitoringPeriod: 5000, // used by fps-controller
- fpsDroppedMonitoringThreshold: 0.2, // used by fps-controller
- appendErrorMaxRetry: 3, // used by buffer-controller
- loader: _xhrLoader2.default,
- //loader: FetchLoader,
- fLoader: undefined,
- pLoader: undefined,
- xhrSetup: undefined,
- fetchSetup: undefined,
- abrController: _abrController2.default,
- bufferController: _bufferController2.default,
- capLevelController: _capLevelController2.default,
- fpsController: _fpsController2.default,
- //#if altaudio
- audioStreamController: _audioStreamController2.default,
- audioTrackController: _audioTrackController2.default,
- //#endif
- //#if subtitle
- subtitleStreamController: _subtitleStreamController2.default,
- subtitleTrackController: _subtitleTrackController2.default,
- timelineController: _timelineController2.default,
- cueHandler: _cues2.default,
- enableCEA708Captions: true, // used by timeline-controller
- enableWebVTT: true, // used by timeline-controller
- captionsTextTrack1Label: 'English', // used by timeline-controller
- captionsTextTrack1LanguageCode: 'en', // used by timeline-controller
- captionsTextTrack2Label: 'Spanish', // used by timeline-controller
- captionsTextTrack2LanguageCode: 'es', // used by timeline-controller
- //#endif
- stretchShortVideoTrack: false, // used by mp4-remuxer
- forceKeyFrameOnDiscontinuity: true, // used by ts-demuxer
- abrEwmaFastLive: 3, // used by abr-controller
- abrEwmaSlowLive: 9, // used by abr-controller
- abrEwmaFastVoD: 3, // used by abr-controller
- abrEwmaSlowVoD: 9, // used by abr-controller
- abrEwmaDefaultEstimate: 5e5, // 500 kbps // used by abr-controller
- abrBandWidthFactor: 0.95, // used by abr-controller
- abrBandWidthUpFactor: 0.7, // used by abr-controller
- abrMaxWithRealBitrate: false, // used by abr-controller
- maxStarvationDelay: 4, // used by abr-controller
- maxLoadingDelay: 4, // used by abr-controller
- minAutoBitrate: 0 // used by hls
-};
+ this.observer = observer;
+ this.config = config;
+ this.remuxer = remuxer;
+ }
-},{"10":10,"14":14,"15":15,"16":16,"5":5,"50":50,"58":58,"6":6,"7":7,"8":8,"9":9}],5:[function(_dereq_,module,exports){
-'use strict';
+ AACDemuxer.prototype.resetInitSegment = function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {
+ this._audioTrack = { container: 'audio/adts', type: 'audio', id: 0, sequenceNumber: 0, isAAC: true, samples: [], len: 0, manifestCodec: audioCodec, duration: duration, inputTimeScale: 90000 };
+ };
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ AACDemuxer.prototype.resetTimeStamp = function resetTimeStamp() {};
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+ AACDemuxer.probe = function probe(data) {
+ if (!data) {
+ return false;
+ }
+ // Check for the ADTS sync word
+ // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1
+ // Layer bits (position 14 and 15) in header should be always 0 for ADTS
+ // More info https://wiki.multimedia.cx/index.php?title=ADTS
+ var id3Data = id3["a" /* default */].getID3Data(data, 0) || [];
+ var offset = id3Data.length;
-var _events = _dereq_(35);
+ for (var length = data.length; offset < length; offset++) {
+ if (adts_probe(data, offset)) {
+ logger["b" /* logger */].log('ADTS sync word found !');
+ return true;
+ }
+ }
+ return false;
+ };
-var _events2 = _interopRequireDefault(_events);
+ // feed incoming data to the front of the parsing pipeline
-var _eventHandler = _dereq_(34);
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
+ AACDemuxer.prototype.append = function append(data, timeOffset, contiguous, accurateTimeOffset) {
+ var track = this._audioTrack;
+ var id3Data = id3["a" /* default */].getID3Data(data, 0) || [];
+ var timestamp = id3["a" /* default */].getTimeStamp(id3Data);
+ var pts = timestamp ? 90 * timestamp : timeOffset * 90000;
+ var frameIndex = 0;
+ var stamp = pts;
+ var length = data.length;
+ var offset = id3Data.length;
-var _bufferHelper = _dereq_(37);
+ var id3Samples = [{ pts: stamp, dts: stamp, data: id3Data }];
-var _bufferHelper2 = _interopRequireDefault(_bufferHelper);
+ while (offset < length - 1) {
+ if (isHeader(data, offset) && offset + 5 < length) {
+ initTrackConfig(track, this.observer, data, offset, track.manifestCodec);
+ var frame = appendFrame(track, data, offset, pts, frameIndex);
+ if (frame) {
+ offset += frame.length;
+ stamp = frame.sample.pts;
+ frameIndex++;
+ } else {
+ logger["b" /* logger */].log('Unable to parse AAC frame');
+ break;
+ }
+ } else if (id3["a" /* default */].isHeader(data, offset)) {
+ id3Data = id3["a" /* default */].getID3Data(data, offset);
+ id3Samples.push({ pts: stamp, dts: stamp, data: id3Data });
+ offset += id3Data.length;
+ } else {
+ //nothing found, keep looking
+ offset++;
+ }
+ }
-var _errors = _dereq_(33);
+ this.remuxer.remux(track, { samples: [] }, { samples: id3Samples, inputTimeScale: 90000 }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset);
+ };
-var _logger = _dereq_(53);
+ AACDemuxer.prototype.destroy = function destroy() {};
-var _ewmaBandwidthEstimator = _dereq_(51);
+ return AACDemuxer;
+}();
-var _ewmaBandwidthEstimator2 = _interopRequireDefault(_ewmaBandwidthEstimator);
+/* harmony default export */ var aacdemuxer = (aacdemuxer_AACDemuxer);
+// CONCATENATED MODULE: ./src/demux/mp4demuxer.js
+function mp4demuxer__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+/**
+ * MP4 demuxer
+ */
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * simple ABR Controller
- * - compute next level based on last fragment bw heuristics
- * - implement an abandon rules triggered if we have less than 2 frag buffered and if computed bw shows that we risk buffer stalling
- */
+var UINT32_MAX = Math.pow(2, 32) - 1;
-var AbrController = function (_EventHandler) {
- _inherits(AbrController, _EventHandler);
+var mp4demuxer_MP4Demuxer = function () {
+ function MP4Demuxer(observer, remuxer) {
+ mp4demuxer__classCallCheck(this, MP4Demuxer);
- function AbrController(hls) {
- _classCallCheck(this, AbrController);
+ this.observer = observer;
+ this.remuxer = remuxer;
+ }
- var _this = _possibleConstructorReturn(this, (AbrController.__proto__ || Object.getPrototypeOf(AbrController)).call(this, hls, _events2.default.FRAG_LOADING, _events2.default.FRAG_LOADED, _events2.default.FRAG_BUFFERED, _events2.default.ERROR));
+ MP4Demuxer.prototype.resetTimeStamp = function resetTimeStamp(initPTS) {
+ this.initPTS = initPTS;
+ };
- _this.lastLoadedFragLevel = 0;
- _this._nextAutoLevel = -1;
- _this.hls = hls;
- _this.onCheck = _this._abandonRulesCheck.bind(_this);
- return _this;
- }
+ MP4Demuxer.prototype.resetInitSegment = function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {
+ //jshint unused:false
+ if (initSegment && initSegment.byteLength) {
+ var initData = this.initData = MP4Demuxer.parseInitSegment(initSegment);
- _createClass(AbrController, [{
- key: 'destroy',
- value: function destroy() {
- this.clearTimer();
- _eventHandler2.default.prototype.destroy.call(this);
- }
- }, {
- key: 'onFragLoading',
- value: function onFragLoading(data) {
- var frag = data.frag;
- if (frag.type === 'main') {
- if (!this.timer) {
- this.timer = setInterval(this.onCheck, 100);
- }
- // lazy init of bw Estimator, rationale is that we use different params for Live/VoD
- // so we need to wait for stream manifest / playlist type to instantiate it.
- if (!this._bwEstimator) {
- var hls = this.hls,
- level = data.frag.level,
- isLive = hls.levels[level].details.live,
- config = hls.config,
- ewmaFast = void 0,
- ewmaSlow = void 0;
-
- if (isLive) {
- ewmaFast = config.abrEwmaFastLive;
- ewmaSlow = config.abrEwmaSlowLive;
- } else {
- ewmaFast = config.abrEwmaFastVoD;
- ewmaSlow = config.abrEwmaSlowVoD;
- }
- this._bwEstimator = new _ewmaBandwidthEstimator2.default(hls, ewmaSlow, ewmaFast, config.abrEwmaDefaultEstimate);
- }
- this.fragCurrent = frag;
+ // default audio codec if nothing specified
+ // TODO : extract that from initsegment
+ if (audioCodec == null) {
+ audioCodec = 'mp4a.40.5';
}
- }
- }, {
- key: '_abandonRulesCheck',
- value: function _abandonRulesCheck() {
- /*
- monitor fragment retrieval time...
- we compute expected time of arrival of the complete fragment.
- we compare it to expected time of buffer starvation
- */
- var hls = this.hls,
- v = hls.media,
- frag = this.fragCurrent,
- loader = frag.loader,
- minAutoLevel = hls.minAutoLevel;
-
- // if loader has been destroyed or loading has been aborted, stop timer and return
- if (!loader || loader.stats && loader.stats.aborted) {
- _logger.logger.warn('frag loader destroy or aborted, disarm abandonRules');
- this.clearTimer();
- return;
+ if (videoCodec == null) {
+ videoCodec = 'avc1.42e01e';
}
- var stats = loader.stats;
- /* only monitor frag retrieval time if
- (video not paused OR first fragment being loaded(ready state === HAVE_NOTHING = 0)) AND autoswitching enabled AND not lowest level (=> means that we have several levels) */
- if (v && (!v.paused && v.playbackRate !== 0 || !v.readyState) && frag.autoLevel && frag.level) {
- var requestDelay = performance.now() - stats.trequest,
- playbackRate = Math.abs(v.playbackRate);
- // monitor fragment load progress after half of expected fragment duration,to stabilize bitrate
- if (requestDelay > 500 * frag.duration / playbackRate) {
- var levels = hls.levels,
- loadRate = Math.max(1, stats.bw ? stats.bw / 8 : stats.loaded * 1000 / requestDelay),
- // byte/s; at least 1 byte/s to avoid division by zero
- // compute expected fragment length using frag duration and level bitrate. also ensure that expected len is gte than already loaded size
- level = levels[frag.level],
- levelBitrate = level.realBitrate ? Math.max(level.realBitrate, level.bitrate) : level.bitrate,
- expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levelBitrate / 8)),
- pos = v.currentTime,
- fragLoadedDelay = (expectedLen - stats.loaded) / loadRate,
- bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, hls.config.maxBufferHole).end - pos) / playbackRate;
- // consider emergency switch down only if we have less than 2 frag buffered AND
- // time to finish loading current fragment is bigger than buffer starvation delay
- // ie if we risk buffer starvation if bw does not increase quickly
- if (bufferStarvationDelay < 2 * frag.duration / playbackRate && fragLoadedDelay > bufferStarvationDelay) {
- var fragLevelNextLoadedDelay = void 0,
- nextLoadLevel = void 0;
- // lets iterate through lower level and try to find the biggest one that could avoid rebuffering
- // we start from current level - 1 and we step down , until we find a matching level
- for (nextLoadLevel = frag.level - 1; nextLoadLevel > minAutoLevel; nextLoadLevel--) {
- // compute time to load next fragment at lower level
- // 0.8 : consider only 80% of current bw to be conservative
- // 8 = bits per byte (bps/Bps)
- var levelNextBitrate = levels[nextLoadLevel].realBitrate ? Math.max(levels[nextLoadLevel].realBitrate, levels[nextLoadLevel].bitrate) : levels[nextLoadLevel].bitrate;
- fragLevelNextLoadedDelay = frag.duration * levelNextBitrate / (8 * 0.8 * loadRate);
- if (fragLevelNextLoadedDelay < bufferStarvationDelay) {
- // we found a lower level that be rebuffering free with current estimated bw !
- break;
- }
- }
- // only emergency switch down if it takes less time to load new fragment at lowest level instead
- // of finishing loading current one ...
- if (fragLevelNextLoadedDelay < fragLoadedDelay) {
- _logger.logger.warn('loading too slow, abort fragment loading and switch to level ' + nextLoadLevel + ':fragLoadedDelay[' + nextLoadLevel + ']<fragLoadedDelay[' + (frag.level - 1) + '];bufferStarvationDelay:' + fragLevelNextLoadedDelay.toFixed(1) + '<' + fragLoadedDelay.toFixed(1) + ':' + bufferStarvationDelay.toFixed(1));
- // force next load level in auto mode
- hls.nextLoadLevel = nextLoadLevel;
- // update bw estimate for this fragment before cancelling load (this will help reducing the bw)
- this._bwEstimator.sample(requestDelay, stats.loaded);
- //abort fragment loading
- loader.abort();
- // stop abandon rules timer
- this.clearTimer();
- hls.trigger(_events2.default.FRAG_LOAD_EMERGENCY_ABORTED, { frag: frag, stats: stats });
- }
- }
+ var tracks = {};
+ if (initData.audio && initData.video) {
+ tracks.audiovideo = { container: 'video/mp4', codec: audioCodec + ',' + videoCodec, initSegment: duration ? initSegment : null };
+ } else {
+ if (initData.audio) {
+ tracks.audio = { container: 'audio/mp4', codec: audioCodec, initSegment: duration ? initSegment : null };
}
+ if (initData.video) {
+ tracks.video = { container: 'video/mp4', codec: videoCodec, initSegment: duration ? initSegment : null };
+ }
+ }
+ this.observer.trigger(events["a" /* default */].FRAG_PARSING_INIT_SEGMENT, { tracks: tracks });
+ } else {
+ if (audioCodec) {
+ this.audioCodec = audioCodec;
+ }
+ if (videoCodec) {
+ this.videoCodec = videoCodec;
}
}
- }, {
- key: 'onFragLoaded',
- value: function onFragLoaded(data) {
- var frag = data.frag;
- if (frag.type === 'main' && !isNaN(frag.sn)) {
- // stop monitoring bw once frag loaded
- this.clearTimer();
- // store level id after successful fragment load
- this.lastLoadedFragLevel = frag.level;
- // reset forced auto level value so that next level will be selected
- this._nextAutoLevel = -1;
+ };
- // compute level average bitrate
- if (this.hls.config.abrMaxWithRealBitrate) {
- var level = this.hls.levels[frag.level];
- var loadedBytes = (level.loaded ? level.loaded.bytes : 0) + data.stats.loaded;
- var loadedDuration = (level.loaded ? level.loaded.duration : 0) + data.frag.duration;
- level.loaded = { bytes: loadedBytes, duration: loadedDuration };
- level.realBitrate = Math.round(8 * loadedBytes / loadedDuration);
- }
- // if fragment has been loaded to perform a bitrate test,
- if (data.frag.bitrateTest) {
- var stats = data.stats;
- stats.tparsed = stats.tbuffered = stats.tload;
- this.onFragBuffered(data);
- }
- }
+ MP4Demuxer.probe = function probe(data) {
+ // ensure we find a moof box in the first 16 kB
+ return MP4Demuxer.findBox({ data: data, start: 0, end: Math.min(data.length, 16384) }, ['moof']).length > 0;
+ };
+
+ MP4Demuxer.bin2str = function bin2str(buffer) {
+ return String.fromCharCode.apply(null, buffer);
+ };
+
+ MP4Demuxer.readUint32 = function readUint32(buffer, offset) {
+ if (buffer.data) {
+ offset += buffer.start;
+ buffer = buffer.data;
}
- }, {
- key: 'onFragBuffered',
- value: function onFragBuffered(data) {
- var stats = data.stats,
- frag = data.frag;
- // only update stats on first frag buffering
- // if same frag is loaded multiple times, it might be in browser cache, and loaded quickly
- // and leading to wrong bw estimation
- // on bitrate test, also only update stats once (if tload = tbuffered == on FRAG_LOADED)
- if (stats.aborted !== true && frag.loadCounter === 1 && frag.type === 'main' && !isNaN(frag.sn) && (!frag.bitrateTest || stats.tload === stats.tbuffered)) {
- // use tparsed-trequest instead of tbuffered-trequest to compute fragLoadingProcessing; rationale is that buffer appending only happens once media is attached
- // in case we use config.startFragPrefetch while media is not attached yet, fragment might be parsed while media not attached yet, but it will only be buffered on media attached
- // as a consequence it could happen really late in the process. meaning that appending duration might appears huge ... leading to underestimated throughput estimation
- var fragLoadingProcessingMs = stats.tparsed - stats.trequest;
- _logger.logger.log('latency/loading/parsing/append/kbps:' + Math.round(stats.tfirst - stats.trequest) + '/' + Math.round(stats.tload - stats.tfirst) + '/' + Math.round(stats.tparsed - stats.tload) + '/' + Math.round(stats.tbuffered - stats.tparsed) + '/' + Math.round(8 * stats.loaded / (stats.tbuffered - stats.trequest)));
- this._bwEstimator.sample(fragLoadingProcessingMs, stats.loaded);
- stats.bwEstimate = this._bwEstimator.getEstimate();
- // if fragment has been loaded to perform a bitrate test, (hls.startLevel = -1), store bitrate test delay duration
- if (frag.bitrateTest) {
- this.bitrateTestDelay = fragLoadingProcessingMs / 1000;
- } else {
- this.bitrateTestDelay = 0;
- }
- }
+
+ var val = buffer[offset] << 24 | buffer[offset + 1] << 16 | buffer[offset + 2] << 8 | buffer[offset + 3];
+ return val < 0 ? 4294967296 + val : val;
+ };
+
+ MP4Demuxer.writeUint32 = function writeUint32(buffer, offset, value) {
+ if (buffer.data) {
+ offset += buffer.start;
+ buffer = buffer.data;
}
- }, {
- key: 'onError',
- value: function onError(data) {
- // stop timer in case of frag loading error
- switch (data.details) {
- case _errors.ErrorDetails.FRAG_LOAD_ERROR:
- case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:
- this.clearTimer();
- break;
- default:
- break;
- }
+ buffer[offset] = value >> 24;
+ buffer[offset + 1] = value >> 16 & 0xff;
+ buffer[offset + 2] = value >> 8 & 0xff;
+ buffer[offset + 3] = value & 0xff;
+ };
+
+ // Find the data for a box specified by its path
+
+
+ MP4Demuxer.findBox = function findBox(data, path) {
+ var results = [],
+ i,
+ size,
+ type,
+ end,
+ subresults,
+ start,
+ endbox;
+
+ if (data.data) {
+ start = data.start;
+ end = data.end;
+ data = data.data;
+ } else {
+ start = 0;
+ end = data.byteLength;
}
- }, {
- key: 'clearTimer',
- value: function clearTimer() {
- if (this.timer) {
- clearInterval(this.timer);
- this.timer = null;
- }
+
+ if (!path.length) {
+ // short-circuit the search for empty paths
+ return null;
}
- // return next auto level
+ for (i = start; i < end;) {
+ size = MP4Demuxer.readUint32(data, i);
+ type = MP4Demuxer.bin2str(data.subarray(i + 4, i + 8));
+ endbox = size > 1 ? i + size : end;
- }, {
- key: '_findBestLevel',
- value: function _findBestLevel(currentLevel, currentFragDuration, currentBw, minAutoLevel, maxAutoLevel, maxFetchDuration, bwFactor, bwUpFactor, levels) {
- for (var i = maxAutoLevel; i >= minAutoLevel; i--) {
- var levelInfo = levels[i],
- levelDetails = levelInfo.details,
- avgDuration = levelDetails ? levelDetails.totalduration / levelDetails.fragments.length : currentFragDuration,
- live = levelDetails ? levelDetails.live : false,
- adjustedbw = void 0;
- // follow algorithm captured from stagefright :
- // https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp
- // Pick the highest bandwidth stream below or equal to estimated bandwidth.
- // consider only 80% of the available bandwidth, but if we are switching up,
- // be even more conservative (70%) to avoid overestimating and immediately
- // switching back.
- if (i <= currentLevel) {
- adjustedbw = bwFactor * currentBw;
+ if (type === path[0]) {
+
+ if (path.length === 1) {
+ // this is the end of the path and we've found the box we were
+ // looking for
+ results.push({ data: data, start: i + 8, end: endbox });
} else {
- adjustedbw = bwUpFactor * currentBw;
- }
- var bitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate,
- fetchDuration = bitrate * avgDuration / adjustedbw;
-
- _logger.logger.trace('level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: ' + i + '/' + Math.round(adjustedbw) + '/' + bitrate + '/' + avgDuration + '/' + maxFetchDuration + '/' + fetchDuration);
- // if adjusted bw is greater than level bitrate AND
- if (adjustedbw > bitrate && (
- // fragment fetchDuration unknown OR live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches
- // we don't account for max Fetch Duration for live streams, this is to avoid switching down when near the edge of live sliding window ...
- // special case to support startLevel = -1 (bitrateTest) on live streams : in that case we should not exit loop so that _findBestLevel will return -1
- !fetchDuration || live && !this.bitrateTestDelay || fetchDuration < maxFetchDuration)) {
- // as we are looping from highest to lowest, this will return the best achievable quality level
- return i;
+ // recursively search for the next box along the path
+ subresults = MP4Demuxer.findBox({ data: data, start: i + 8, end: endbox }, path.slice(1));
+ if (subresults.length) {
+ results = results.concat(subresults);
+ }
}
}
- // not enough time budget even with quality level 0 ... rebuffering might happen
- return -1;
+ i = endbox;
}
- }, {
- key: 'nextAutoLevel',
- get: function get() {
- var forcedAutoLevel = this._nextAutoLevel;
- var bwEstimator = this._bwEstimator;
- // in case next auto level has been forced, and bw not available or not reliable, return forced value
- if (forcedAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {
- return forcedAutoLevel;
- }
- // compute next level using ABR logic
- var nextABRAutoLevel = this._nextABRAutoLevel;
- // if forced auto level has been defined, use it to cap ABR computed quality level
- if (forcedAutoLevel !== -1) {
- nextABRAutoLevel = Math.min(forcedAutoLevel, nextABRAutoLevel);
- }
- return nextABRAutoLevel;
- },
- set: function set(nextLevel) {
- this._nextAutoLevel = nextLevel;
- }
- }, {
- key: '_nextABRAutoLevel',
- get: function get() {
- var hls = this.hls,
- maxAutoLevel = hls.maxAutoLevel,
- levels = hls.levels,
- config = hls.config,
- minAutoLevel = hls.minAutoLevel;
- var v = hls.media,
- currentLevel = this.lastLoadedFragLevel,
- currentFragDuration = this.fragCurrent ? this.fragCurrent.duration : 0,
- pos = v ? v.currentTime : 0,
- // playbackRate is the absolute value of the playback rate; if v.playbackRate is 0, we use 1 to load as
- // if we're playing back at the normal rate.
- playbackRate = v && v.playbackRate !== 0 ? Math.abs(v.playbackRate) : 1.0,
- avgbw = this._bwEstimator ? this._bwEstimator.getEstimate() : config.abrEwmaDefaultEstimate,
+ // we've finished searching all of data
+ return results;
+ };
- // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.
- bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, config.maxBufferHole).end - pos) / playbackRate;
+ /**
+ * Parses an MP4 initialization segment and extracts stream type and
+ * timescale values for any declared tracks. Timescale values indicate the
+ * number of clock ticks per second to assume for time-based values
+ * elsewhere in the MP4.
+ *
+ * To determine the start time of an MP4, you need two pieces of
+ * information: the timescale unit and the earliest base media decode
+ * time. Multiple timescales can be specified within an MP4 but the
+ * base media decode time is always expressed in the timescale from
+ * the media header box for the track:
+ * ```
+ * moov > trak > mdia > mdhd.timescale
+ * moov > trak > mdia > hdlr
+ * ```
+ * @param init {Uint8Array} the bytes of the init segment
+ * @return {object} a hash of track type to timescale values or null if
+ * the init segment is malformed.
+ */
- // First, look to see if we can find a level matching with our avg bandwidth AND that could also guarantee no rebuffering at all
- var bestLevel = this._findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay, config.abrBandWidthFactor, config.abrBandWidthUpFactor, levels);
- if (bestLevel >= 0) {
- return bestLevel;
- } else {
- _logger.logger.trace('rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering');
- // not possible to get rid of rebuffering ... let's try to find level that will guarantee less than maxStarvationDelay of rebuffering
- // if no matching level found, logic will return 0
- var maxStarvationDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxStarvationDelay) : config.maxStarvationDelay,
- bwFactor = config.abrBandWidthFactor,
- bwUpFactor = config.abrBandWidthUpFactor;
- if (bufferStarvationDelay === 0) {
- // in case buffer is empty, let's check if previous fragment was loaded to perform a bitrate test
- var bitrateTestDelay = this.bitrateTestDelay;
- if (bitrateTestDelay) {
- // if it is the case, then we need to adjust our max starvation delay using maxLoadingDelay config value
- // max video loading delay used in automatic start level selection :
- // in that mode ABR controller will ensure that video loading time (ie the time to fetch the first fragment at lowest quality level +
- // the time to fetch the fragment at the appropriate quality level is less than ```maxLoadingDelay``` )
- // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration
- var maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxLoadingDelay) : config.maxLoadingDelay;
- maxStarvationDelay = maxLoadingDelay - bitrateTestDelay;
- _logger.logger.trace('bitrate test took ' + Math.round(1000 * bitrateTestDelay) + 'ms, set first fragment max fetchDuration to ' + Math.round(1000 * maxStarvationDelay) + ' ms');
- // don't use conservative factor on bitrate test
- bwFactor = bwUpFactor = 1;
+
+ MP4Demuxer.parseInitSegment = function parseInitSegment(initSegment) {
+ var result = [];
+ var traks = MP4Demuxer.findBox(initSegment, ['moov', 'trak']);
+
+ traks.forEach(function (trak) {
+ var tkhd = MP4Demuxer.findBox(trak, ['tkhd'])[0];
+ if (tkhd) {
+ var version = tkhd.data[tkhd.start];
+ var index = version === 0 ? 12 : 20;
+ var trackId = MP4Demuxer.readUint32(tkhd, index);
+
+ var mdhd = MP4Demuxer.findBox(trak, ['mdia', 'mdhd'])[0];
+ if (mdhd) {
+ version = mdhd.data[mdhd.start];
+ index = version === 0 ? 12 : 20;
+ var timescale = MP4Demuxer.readUint32(mdhd, index);
+
+ var hdlr = MP4Demuxer.findBox(trak, ['mdia', 'hdlr'])[0];
+ if (hdlr) {
+ var hdlrType = MP4Demuxer.bin2str(hdlr.data.subarray(hdlr.start + 8, hdlr.start + 12));
+ var type = { 'soun': 'audio', 'vide': 'video' }[hdlrType];
+ if (type) {
+ // extract codec info. TODO : parse codec details to be able to build MIME type
+ var codecBox = MP4Demuxer.findBox(trak, ['mdia', 'minf', 'stbl', 'stsd']);
+ if (codecBox.length) {
+ codecBox = codecBox[0];
+ var codecType = MP4Demuxer.bin2str(codecBox.data.subarray(codecBox.start + 12, codecBox.start + 16));
+ logger["b" /* logger */].log('MP4Demuxer:' + type + ':' + codecType + ' found');
+ }
+ result[trackId] = { timescale: timescale, type: type };
+ result[type] = { timescale: timescale, id: trackId };
+ }
}
}
- bestLevel = this._findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay + maxStarvationDelay, bwFactor, bwUpFactor, levels);
- return Math.max(bestLevel, 0);
}
- }
- }]);
+ });
+ return result;
+ };
- return AbrController;
-}(_eventHandler2.default);
+ /**
+ * Determine the base media decode start time, in seconds, for an MP4
+ * fragment. If multiple fragments are specified, the earliest time is
+ * returned.
+ *
+ * The base media decode time can be parsed from track fragment
+ * metadata:
+ * ```
+ * moof > traf > tfdt.baseMediaDecodeTime
+ * ```
+ * It requires the timescale value from the mdhd to interpret.
+ *
+ * @param timescale {object} a hash of track ids to timescale values.
+ * @return {number} the earliest base media decode start time for the
+ * fragment, in seconds
+ */
-exports.default = AbrController;
-},{"33":33,"34":34,"35":35,"37":37,"51":51,"53":53}],6:[function(_dereq_,module,exports){
-'use strict';
+ MP4Demuxer.getStartDTS = function getStartDTS(initData, fragment) {
+ var trafs, baseTimes, result;
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ // we need info from two childrend of each track fragment box
+ trafs = MP4Demuxer.findBox(fragment, ['moof', 'traf']);
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+ // determine the start times for each track
+ baseTimes = [].concat.apply([], trafs.map(function (traf) {
+ return MP4Demuxer.findBox(traf, ['tfhd']).map(function (tfhd) {
+ var id, scale, baseTime;
-var _binarySearch = _dereq_(48);
+ // get the track id from the tfhd
+ id = MP4Demuxer.readUint32(tfhd, 4);
+ // assume a 90kHz clock if no timescale was specified
+ scale = initData[id].timescale || 90e3;
-var _binarySearch2 = _interopRequireDefault(_binarySearch);
+ // get the base media decode time from the tfdt
+ baseTime = MP4Demuxer.findBox(traf, ['tfdt']).map(function (tfdt) {
+ var version, result;
-var _bufferHelper = _dereq_(37);
+ version = tfdt.data[tfdt.start];
+ result = MP4Demuxer.readUint32(tfdt, 4);
+ if (version === 1) {
+ result *= Math.pow(2, 32);
-var _bufferHelper2 = _interopRequireDefault(_bufferHelper);
+ result += MP4Demuxer.readUint32(tfdt, 8);
+ }
+ return result;
+ })[0];
+ // convert base time to seconds
+ return baseTime / scale;
+ });
+ }));
-var _demuxer = _dereq_(25);
+ // return the minimum
+ result = Math.min.apply(null, baseTimes);
+ return isFinite(result) ? result : 0;
+ };
+
+ MP4Demuxer.offsetStartDTS = function offsetStartDTS(initData, fragment, timeOffset) {
+ MP4Demuxer.findBox(fragment, ['moof', 'traf']).map(function (traf) {
+ return MP4Demuxer.findBox(traf, ['tfhd']).map(function (tfhd) {
+ // get the track id from the tfhd
+ var id = MP4Demuxer.readUint32(tfhd, 4);
+ // assume a 90kHz clock if no timescale was specified
+ var timescale = initData[id].timescale || 90e3;
+
+ // get the base media decode time from the tfdt
+ MP4Demuxer.findBox(traf, ['tfdt']).map(function (tfdt) {
+ var version = tfdt.data[tfdt.start];
+ var baseMediaDecodeTime = MP4Demuxer.readUint32(tfdt, 4);
+ if (version === 0) {
+ MP4Demuxer.writeUint32(tfdt, 4, baseMediaDecodeTime - timeOffset * timescale);
+ } else {
+ baseMediaDecodeTime *= Math.pow(2, 32);
+ baseMediaDecodeTime += MP4Demuxer.readUint32(tfdt, 8);
+ baseMediaDecodeTime -= timeOffset * timescale;
+ baseMediaDecodeTime = Math.max(baseMediaDecodeTime, 0);
+ var upper = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1));
+ var lower = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));
+ MP4Demuxer.writeUint32(tfdt, 4, upper);
+ MP4Demuxer.writeUint32(tfdt, 8, lower);
+ }
+ });
+ });
+ });
+ };
-var _demuxer2 = _interopRequireDefault(_demuxer);
+ // feed incoming data to the front of the parsing pipeline
-var _events = _dereq_(35);
-var _events2 = _interopRequireDefault(_events);
+ MP4Demuxer.prototype.append = function append(data, timeOffset, contiguous, accurateTimeOffset) {
+ var initData = this.initData;
+ if (!initData) {
+ this.resetInitSegment(data, this.audioCodec, this.videoCodec);
+ initData = this.initData;
+ }
+ var startDTS = void 0,
+ initPTS = this.initPTS;
+ if (initPTS === undefined) {
+ var _startDTS = MP4Demuxer.getStartDTS(initData, data);
+ this.initPTS = initPTS = _startDTS - timeOffset;
+ this.observer.trigger(events["a" /* default */].INIT_PTS_FOUND, { initPTS: initPTS });
+ }
+ MP4Demuxer.offsetStartDTS(initData, data, initPTS);
+ startDTS = MP4Demuxer.getStartDTS(initData, data);
+ this.remuxer.remux(initData.audio, initData.video, null, null, startDTS, contiguous, accurateTimeOffset, data);
+ };
-var _eventHandler = _dereq_(34);
+ MP4Demuxer.prototype.destroy = function destroy() {};
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
+ return MP4Demuxer;
+}();
-var _levelHelper = _dereq_(38);
+/* harmony default export */ var mp4demuxer = (mp4demuxer_MP4Demuxer);
+// CONCATENATED MODULE: ./src/demux/mpegaudio.js
+/**
+ * MPEG parser helper
+ */
-var _levelHelper2 = _interopRequireDefault(_levelHelper);
+var MpegAudio = {
-var _timeRanges = _dereq_(54);
+ BitratesMap: [32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160],
+
+ SamplingRateMap: [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000],
+
+ SamplesCoefficients: [
+ // MPEG 2.5
+ [0, // Reserved
+ 72, // Layer3
+ 144, // Layer2
+ 12 // Layer1
+ ],
+ // Reserved
+ [0, // Reserved
+ 0, // Layer3
+ 0, // Layer2
+ 0 // Layer1
+ ],
+ // MPEG 2
+ [0, // Reserved
+ 72, // Layer3
+ 144, // Layer2
+ 12 // Layer1
+ ],
+ // MPEG 1
+ [0, // Reserved
+ 144, // Layer3
+ 144, // Layer2
+ 12 // Layer1
+ ]],
+
+ BytesInSlot: [0, // Reserved
+ 1, // Layer3
+ 1, // Layer2
+ 4 // Layer1
+ ],
+
+ appendFrame: function appendFrame(track, data, offset, pts, frameIndex) {
+ // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference
+ if (offset + 24 > data.length) {
+ return undefined;
+ }
+
+ var header = this.parseHeader(data, offset);
+ if (header && offset + header.frameLength <= data.length) {
+ var frameDuration = header.samplesPerFrame * 90000 / header.sampleRate;
+ var stamp = pts + frameIndex * frameDuration;
+ var sample = { unit: data.subarray(offset, offset + header.frameLength), pts: stamp, dts: stamp };
+
+ track.config = [];
+ track.channelCount = header.channelCount;
+ track.samplerate = header.sampleRate;
+ track.samples.push(sample);
+ track.len += header.frameLength;
+
+ return { sample: sample, length: header.frameLength };
+ }
-var _timeRanges2 = _interopRequireDefault(_timeRanges);
+ return undefined;
+ },
-var _errors = _dereq_(33);
+ parseHeader: function parseHeader(data, offset) {
+ var headerB = data[offset + 1] >> 3 & 3;
+ var headerC = data[offset + 1] >> 1 & 3;
+ var headerE = data[offset + 2] >> 4 & 15;
+ var headerF = data[offset + 2] >> 2 & 3;
+ var headerG = data[offset + 2] >> 1 & 1;
+ if (headerB !== 1 && headerE !== 0 && headerE !== 15 && headerF !== 3) {
+ var columnInBitrates = headerB === 3 ? 3 - headerC : headerC === 3 ? 3 : 4;
+ var bitRate = MpegAudio.BitratesMap[columnInBitrates * 14 + headerE - 1] * 1000;
+ var columnInSampleRates = headerB === 3 ? 0 : headerB === 2 ? 1 : 2;
+ var sampleRate = MpegAudio.SamplingRateMap[columnInSampleRates * 3 + headerF];
+ var channelCount = data[offset + 3] >> 6 === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)
+ var sampleCoefficient = MpegAudio.SamplesCoefficients[headerB][headerC];
+ var bytesInSlot = MpegAudio.BytesInSlot[headerC];
+ var samplesPerFrame = sampleCoefficient * 8 * bytesInSlot;
+ var frameLength = parseInt(sampleCoefficient * bitRate / sampleRate + headerG, 10) * bytesInSlot;
+
+ return { sampleRate: sampleRate, channelCount: channelCount, frameLength: frameLength, samplesPerFrame: samplesPerFrame };
+ }
-var _logger = _dereq_(53);
+ return undefined;
+ },
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ isHeaderPattern: function isHeaderPattern(data, offset) {
+ return data[offset] === 0xff && (data[offset + 1] & 0xe0) === 0xe0 && (data[offset + 1] & 0x06) !== 0x00;
+ },
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ isHeader: function isHeader(data, offset) {
+ // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1
+ // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)
+ // More info http://www.mp3-tech.org/programmer/frame_header.html
+ if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {
+ return true;
+ }
+ return false;
+ },
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+ probe: function probe(data, offset) {
+ // same as isHeader but we also check that MPEG frame follows last MPEG frame
+ // or end of data is reached
+ if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {
+ // MPEG header Length
+ var headerLength = 4;
+ // MPEG frame Length
+ var header = this.parseHeader(data, offset);
+ var frameLength = headerLength;
+ if (header && header.frameLength) {
+ frameLength = header.frameLength;
+ }
+ var newOffset = offset + frameLength;
+ if (newOffset === data.length || newOffset + 1 < data.length && this.isHeaderPattern(data, newOffset)) {
+ return true;
+ }
+ }
+ return false;
+ }
+};
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * Audio Stream Controller
- */
+/* harmony default export */ var mpegaudio = (MpegAudio);
+// CONCATENATED MODULE: ./src/demux/exp-golomb.js
+function exp_golomb__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var State = {
- STOPPED: 'STOPPED',
- STARTING: 'STARTING',
- IDLE: 'IDLE',
- PAUSED: 'PAUSED',
- KEY_LOADING: 'KEY_LOADING',
- FRAG_LOADING: 'FRAG_LOADING',
- FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',
- WAITING_TRACK: 'WAITING_TRACK',
- PARSING: 'PARSING',
- PARSED: 'PARSED',
- BUFFER_FLUSHING: 'BUFFER_FLUSHING',
- ENDED: 'ENDED',
- ERROR: 'ERROR',
- WAITING_INIT_PTS: 'WAITING_INIT_PTS'
-};
+/**
+ * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.
+*/
-var AudioStreamController = function (_EventHandler) {
- _inherits(AudioStreamController, _EventHandler);
- function AudioStreamController(hls) {
- _classCallCheck(this, AudioStreamController);
- var _this = _possibleConstructorReturn(this, (AudioStreamController.__proto__ || Object.getPrototypeOf(AudioStreamController)).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.AUDIO_TRACKS_UPDATED, _events2.default.AUDIO_TRACK_SWITCHING, _events2.default.AUDIO_TRACK_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED, _events2.default.INIT_PTS_FOUND));
+var exp_golomb_ExpGolomb = function () {
+ function ExpGolomb(data) {
+ exp_golomb__classCallCheck(this, ExpGolomb);
- _this.config = hls.config;
- _this.audioCodecSwap = false;
- _this.ticks = 0;
- _this._state = State.STOPPED;
- _this.ontick = _this.tick.bind(_this);
- _this.initPTS = [];
- _this.waitingFragment = null;
- return _this;
+ this.data = data;
+ // the number of bytes left to examine in this.data
+ this.bytesAvailable = data.byteLength;
+ // the current word being examined
+ this.word = 0; // :uint
+ // the number of bits left to examine in the current word
+ this.bitsAvailable = 0; // :uint
}
- _createClass(AudioStreamController, [{
- key: 'destroy',
- value: function destroy() {
- this.stopLoad();
- if (this.timer) {
- clearInterval(this.timer);
- this.timer = null;
- }
- _eventHandler2.default.prototype.destroy.call(this);
- this.state = State.STOPPED;
- }
+ // ():void
- //Signal that video PTS was found
- }, {
- key: 'onInitPtsFound',
- value: function onInitPtsFound(data) {
- var demuxerId = data.id,
- cc = data.frag.cc,
- initPTS = data.initPTS;
- if (demuxerId === 'main') {
- //Always update the new INIT PTS
- //Can change due level switch
- this.initPTS[cc] = initPTS;
- _logger.logger.log('InitPTS for cc:' + cc + ' found from video track:' + initPTS);
-
- //If we are waiting we need to demux/remux the waiting frag
- //With the new initPTS
- if (this.state === State.WAITING_INIT_PTS) {
- _logger.logger.log('sending pending audio frag to demuxer');
- this.state = State.FRAG_LOADING;
- //We have audio frag waiting or video pts
- //Let process it
- this.onFragLoaded(this.waitingFragment);
- //Lets clean the waiting frag
- this.waitingFragment = null;
- }
- }
- }
- }, {
- key: 'startLoad',
- value: function startLoad(startPosition) {
- if (this.tracks) {
- var lastCurrentTime = this.lastCurrentTime;
- this.stopLoad();
- if (!this.timer) {
- this.timer = setInterval(this.ontick, 100);
- }
- this.fragLoadError = 0;
- if (lastCurrentTime > 0 && startPosition === -1) {
- _logger.logger.log('audio:override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));
- this.state = State.IDLE;
- } else {
- this.lastCurrentTime = this.startPosition ? this.startPosition : startPosition;
- this.state = State.STARTING;
- }
- this.nextLoadPosition = this.startPosition = this.lastCurrentTime;
- this.tick();
- } else {
- this.startPosition = startPosition;
- this.state = State.STOPPED;
- }
+ ExpGolomb.prototype.loadWord = function loadWord() {
+ var data = this.data,
+ bytesAvailable = this.bytesAvailable,
+ position = data.byteLength - bytesAvailable,
+ workingBytes = new Uint8Array(4),
+ availableBytes = Math.min(4, bytesAvailable);
+ if (availableBytes === 0) {
+ throw new Error('no bytes available');
}
- }, {
- key: 'stopLoad',
- value: function stopLoad() {
- var frag = this.fragCurrent;
- if (frag) {
- if (frag.loader) {
- frag.loader.abort();
- }
- this.fragCurrent = null;
- }
- this.fragPrevious = null;
- if (this.demuxer) {
- this.demuxer.destroy();
- this.demuxer = null;
- }
- this.state = State.STOPPED;
- }
- }, {
- key: 'tick',
- value: function tick() {
- this.ticks++;
- if (this.ticks === 1) {
- this.doTick();
- if (this.ticks > 1) {
- setTimeout(this.tick, 1);
- }
- this.ticks = 0;
- }
- }
- }, {
- key: 'doTick',
- value: function doTick() {
- var pos,
- track,
- trackDetails,
- hls = this.hls,
- config = hls.config;
- //logger.log('audioStream:' + this.state);
- switch (this.state) {
- case State.ERROR:
- //don't do anything in error state to avoid breaking further ...
- case State.PAUSED:
- //don't do anything in paused state either ...
- case State.BUFFER_FLUSHING:
- break;
- case State.STARTING:
- this.state = State.WAITING_TRACK;
- this.loadedmetadata = false;
- break;
- case State.IDLE:
- var tracks = this.tracks;
- // audio tracks not received => exit loop
- if (!tracks) {
- break;
- }
- // if video not attached AND
- // start fragment already requested OR start frag prefetch disable
- // exit loop
- // => if media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop
- if (!this.media && (this.startFragRequested || !config.startFragPrefetch)) {
- break;
- }
- // determine next candidate fragment to be loaded, based on current position and
- // end of buffer position
- // if we have not yet loaded any fragment, start loading from start position
- if (this.loadedmetadata) {
- pos = this.media.currentTime;
- } else {
- pos = this.nextLoadPosition;
- }
- var media = this.mediaBuffer ? this.mediaBuffer : this.media,
- bufferInfo = _bufferHelper2.default.bufferInfo(media, pos, config.maxBufferHole),
- bufferLen = bufferInfo.len,
- bufferEnd = bufferInfo.end,
- fragPrevious = this.fragPrevious,
- maxBufLen = config.maxMaxBufferLength,
- audioSwitch = this.audioSwitch,
- trackId = this.trackId;
-
- // if buffer length is less than maxBufLen try to load a new fragment
- if ((bufferLen < maxBufLen || audioSwitch) && trackId < tracks.length) {
- trackDetails = tracks[trackId].details;
- // if track info not retrieved yet, switch state and wait for track retrieval
- if (typeof trackDetails === 'undefined') {
- this.state = State.WAITING_TRACK;
- break;
- }
+ workingBytes.set(data.subarray(position, position + availableBytes));
+ this.word = new DataView(workingBytes.buffer).getUint32(0);
+ // track the amount of this.data that has been processed
+ this.bitsAvailable = availableBytes * 8;
+ this.bytesAvailable -= availableBytes;
+ };
- // we just got done loading the final fragment, check if we need to finalize media stream
- if (!audioSwitch && !trackDetails.live && fragPrevious && fragPrevious.sn === trackDetails.endSN) {
- // if we are not seeking or if we are seeking but everything (almost) til the end is buffered, let's signal eos
- // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference when switching
- // between different renditions. using half frag duration should help cope with these cases.
- if (!this.media.seeking || this.media.duration - bufferEnd < fragPrevious.duration / 2) {
- // Finalize the media stream
- this.hls.trigger(_events2.default.BUFFER_EOS, { type: 'audio' });
- this.state = State.ENDED;
- break;
- }
- }
+ // (count:int):void
- // find fragment index, contiguous with end of buffer position
- var fragments = trackDetails.fragments,
- fragLen = fragments.length,
- start = fragments[0].start,
- end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,
- frag = void 0;
-
- // When switching audio track, reload audio as close as possible to currentTime
- if (audioSwitch) {
- if (trackDetails.live && !trackDetails.PTSKnown) {
- _logger.logger.log('switching audiotrack, live stream, unknown PTS,load first fragment');
- bufferEnd = 0;
- } else {
- bufferEnd = pos;
- // if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime
- if (trackDetails.PTSKnown && pos < start) {
- // if everything is buffered from pos to start or if audio buffer upfront, let's seek to start
- if (bufferInfo.end > start || bufferInfo.nextStart) {
- _logger.logger.log('alt audio track ahead of main track, seek to start of alt audio track');
- this.media.currentTime = start + 0.05;
- } else {
- return;
- }
- }
- }
- }
- if (trackDetails.initSegment && !trackDetails.initSegment.data) {
- frag = trackDetails.initSegment;
- }
- // if bufferEnd before start of playlist, load first fragment
- else if (bufferEnd <= start) {
- frag = fragments[0];
- if (trackDetails.live && frag.loadIdx && frag.loadIdx === this.fragLoadIdx) {
- // we just loaded this first fragment, and we are still lagging behind the start of the live playlist
- // let's force seek to start
- var nextBuffered = bufferInfo.nextStart ? bufferInfo.nextStart : start;
- _logger.logger.log('no alt audio available @currentTime:' + this.media.currentTime + ', seeking @' + (nextBuffered + 0.05));
- this.media.currentTime = nextBuffered + 0.05;
- return;
- }
- } else {
- var foundFrag = void 0;
- var maxFragLookUpTolerance = config.maxFragLookUpTolerance;
- var fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;
- var fragmentWithinToleranceTest = function fragmentWithinToleranceTest(candidate) {
- // offset should be within fragment boundary - config.maxFragLookUpTolerance
- // this is to cope with situations like
- // bufferEnd = 9.991
- // frag[Ø] : [0,10]
- // frag[1] : [10,20]
- // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here
- // frag start frag start+duration
- // |-----------------------------|
- // <---> <--->
- // ...--------><-----------------------------><---------....
- // previous frag matching fragment next frag
- // return -1 return 0 return 1
- //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);
- // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments
- var candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);
- if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {
- return 1;
- } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element
- else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {
- return -1;
- }
- return 0;
- };
- if (bufferEnd < end) {
- if (bufferEnd > end - maxFragLookUpTolerance) {
- maxFragLookUpTolerance = 0;
- }
- // Prefer the next fragment if it's within tolerance
- if (fragNext && !fragmentWithinToleranceTest(fragNext)) {
- foundFrag = fragNext;
- } else {
- foundFrag = _binarySearch2.default.search(fragments, fragmentWithinToleranceTest);
- }
- } else {
- // reach end of playlist
- foundFrag = fragments[fragLen - 1];
- }
- if (foundFrag) {
- frag = foundFrag;
- start = foundFrag.start;
- //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);
- if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {
- if (frag.sn < trackDetails.endSN) {
- frag = fragments[frag.sn + 1 - trackDetails.startSN];
- _logger.logger.log('SN just loaded, load next one: ' + frag.sn);
- } else {
- frag = null;
- }
- }
- }
- }
- if (frag) {
- //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));
- if (frag.decryptdata && frag.decryptdata.uri != null && frag.decryptdata.key == null) {
- _logger.logger.log('Loading key for ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + trackId);
- this.state = State.KEY_LOADING;
- hls.trigger(_events2.default.KEY_LOADING, { frag: frag });
- } else {
- _logger.logger.log('Loading ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + trackId + ', currentTime:' + pos + ',bufferEnd:' + bufferEnd.toFixed(3));
- // ensure that we are not reloading the same fragments in loop ...
- if (this.fragLoadIdx !== undefined) {
- this.fragLoadIdx++;
- } else {
- this.fragLoadIdx = 0;
- }
- if (frag.loadCounter) {
- frag.loadCounter++;
- var maxThreshold = config.fragLoadingLoopThreshold;
- // if this frag has already been loaded 3 times, and if it has been reloaded recently
- if (frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold) {
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });
- return;
- }
- } else {
- frag.loadCounter = 1;
- }
- frag.loadIdx = this.fragLoadIdx;
- this.fragCurrent = frag;
- this.startFragRequested = true;
- if (!isNaN(frag.sn)) {
- this.nextLoadPosition = frag.start + frag.duration;
- }
- hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });
- this.state = State.FRAG_LOADING;
- }
- }
- }
- break;
- case State.WAITING_TRACK:
- track = this.tracks[this.trackId];
- // check if playlist is already loaded
- if (track && track.details) {
- this.state = State.IDLE;
- }
- break;
- case State.FRAG_LOADING_WAITING_RETRY:
- var now = performance.now();
- var retryDate = this.retryDate;
- media = this.media;
- var isSeeking = media && media.seeking;
- // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading
- if (!retryDate || now >= retryDate || isSeeking) {
- _logger.logger.log('audioStreamController: retryDate reached, switch back to IDLE state');
- this.state = State.IDLE;
- }
- break;
- case State.WAITING_INIT_PTS:
- case State.STOPPED:
- case State.FRAG_LOADING:
- case State.PARSING:
- case State.PARSED:
- case State.ENDED:
- break;
- default:
- break;
- }
- }
- }, {
- key: 'onMediaAttached',
- value: function onMediaAttached(data) {
- var media = this.media = this.mediaBuffer = data.media;
- this.onvseeking = this.onMediaSeeking.bind(this);
- this.onvended = this.onMediaEnded.bind(this);
- media.addEventListener('seeking', this.onvseeking);
- media.addEventListener('ended', this.onvended);
- var config = this.config;
- if (this.tracks && config.autoStartLoad) {
- this.startLoad(config.startPosition);
- }
- }
- }, {
- key: 'onMediaDetaching',
- value: function onMediaDetaching() {
- var media = this.media;
- if (media && media.ended) {
- _logger.logger.log('MSE detaching and video ended, reset startPosition');
- this.startPosition = this.lastCurrentTime = 0;
- }
-
- // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery
- var tracks = this.tracks;
- if (tracks) {
- // reset fragment load counter
- tracks.forEach(function (track) {
- if (track.details) {
- track.details.fragments.forEach(function (fragment) {
- fragment.loadCounter = undefined;
- });
- }
- });
- }
- // remove video listeners
- if (media) {
- media.removeEventListener('seeking', this.onvseeking);
- media.removeEventListener('ended', this.onvended);
- this.onvseeking = this.onvseeked = this.onvended = null;
- }
- this.media = this.mediaBuffer = null;
- this.loadedmetadata = false;
- this.stopLoad();
+ ExpGolomb.prototype.skipBits = function skipBits(count) {
+ var skipBytes; // :int
+ if (this.bitsAvailable > count) {
+ this.word <<= count;
+ this.bitsAvailable -= count;
+ } else {
+ count -= this.bitsAvailable;
+ skipBytes = count >> 3;
+ count -= skipBytes >> 3;
+ this.bytesAvailable -= skipBytes;
+ this.loadWord();
+ this.word <<= count;
+ this.bitsAvailable -= count;
}
- }, {
- key: 'onMediaSeeking',
- value: function onMediaSeeking() {
- if (this.state === State.ENDED) {
- // switch to IDLE state to check for potential new fragment
- this.state = State.IDLE;
- }
- if (this.media) {
- this.lastCurrentTime = this.media.currentTime;
- }
- // avoid reporting fragment loop loading error in case user is seeking several times on same position
- if (this.fragLoadIdx !== undefined) {
- this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;
- }
- // tick to speed up processing
- this.tick();
+ };
+
+ // (size:int):uint
+
+
+ ExpGolomb.prototype.readBits = function readBits(size) {
+ var bits = Math.min(this.bitsAvailable, size),
+ // :uint
+ valu = this.word >>> 32 - bits; // :uint
+ if (size > 32) {
+ logger["b" /* logger */].error('Cannot read more than 32 bits at a time');
}
- }, {
- key: 'onMediaEnded',
- value: function onMediaEnded() {
- // reset startPosition and lastCurrentTime to restart playback @ stream beginning
- this.startPosition = this.lastCurrentTime = 0;
+ this.bitsAvailable -= bits;
+ if (this.bitsAvailable > 0) {
+ this.word <<= bits;
+ } else if (this.bytesAvailable > 0) {
+ this.loadWord();
}
- }, {
- key: 'onAudioTracksUpdated',
- value: function onAudioTracksUpdated(data) {
- _logger.logger.log('audio tracks updated');
- this.tracks = data.audioTracks;
+ bits = size - bits;
+ if (bits > 0 && this.bitsAvailable) {
+ return valu << bits | this.readBits(bits);
+ } else {
+ return valu;
}
- }, {
- key: 'onAudioTrackSwitching',
- value: function onAudioTrackSwitching(data) {
- // if any URL found on new audio track, it is an alternate audio track
- var altAudio = !!data.url;
- this.trackId = data.id;
- this.state = State.IDLE;
+ };
- this.fragCurrent = null;
- this.state = State.PAUSED;
- this.waitingFragment = null;
- // destroy useless demuxer when switching audio to main
- if (!altAudio) {
- if (this.demuxer) {
- this.demuxer.destroy();
- this.demuxer = null;
- }
- } else {
- // switching to audio track, start timer if not already started
- if (!this.timer) {
- this.timer = setInterval(this.ontick, 100);
- }
- }
+ // ():uint
- //should we switch tracks ?
- if (altAudio) {
- this.audioSwitch = true;
- //main audio track are handled by stream-controller, just do something if switching to alt audio track
- this.state = State.IDLE;
- // increase fragment load Index to avoid frag loop loading error after buffer flush
- if (this.fragLoadIdx !== undefined) {
- this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;
- }
+
+ ExpGolomb.prototype.skipLZ = function skipLZ() {
+ var leadingZeroCount; // :uint
+ for (leadingZeroCount = 0; leadingZeroCount < this.bitsAvailable; ++leadingZeroCount) {
+ if (0 !== (this.word & 0x80000000 >>> leadingZeroCount)) {
+ // the first bit of working word is 1
+ this.word <<= leadingZeroCount;
+ this.bitsAvailable -= leadingZeroCount;
+ return leadingZeroCount;
}
- this.tick();
}
- }, {
- key: 'onAudioTrackLoaded',
- value: function onAudioTrackLoaded(data) {
- var newDetails = data.details,
- trackId = data.id,
- track = this.tracks[trackId],
- duration = newDetails.totalduration,
- sliding = 0;
+ // we exhausted word and still have not found a 1
+ this.loadWord();
+ return leadingZeroCount + this.skipLZ();
+ };
- _logger.logger.log('track ' + trackId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);
+ // ():void
- if (newDetails.live) {
- var curDetails = track.details;
- if (curDetails && newDetails.fragments.length > 0) {
- // we already have details for that level, merge them
- _levelHelper2.default.mergeDetails(curDetails, newDetails);
- sliding = newDetails.fragments[0].start;
- // TODO
- //this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);
- if (newDetails.PTSKnown) {
- _logger.logger.log('live audio playlist sliding:' + sliding.toFixed(3));
- } else {
- _logger.logger.log('live audio playlist - outdated PTS, unknown sliding');
- }
- } else {
- newDetails.PTSKnown = false;
- _logger.logger.log('live audio playlist - first load, unknown sliding');
- }
- } else {
- newDetails.PTSKnown = false;
- }
- track.details = newDetails;
- // compute start position
- if (!this.startFragRequested) {
- // compute start position if set to -1. use it straight away if value is defined
- if (this.startPosition === -1) {
- // first, check if start time offset has been set in playlist, if yes, use this value
- var startTimeOffset = newDetails.startTimeOffset;
- if (!isNaN(startTimeOffset)) {
- _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);
- this.startPosition = startTimeOffset;
- } else {
- this.startPosition = 0;
- }
- }
- this.nextLoadPosition = this.startPosition;
- }
- // only switch batck to IDLE state if we were waiting for track to start downloading a new fragment
- if (this.state === State.WAITING_TRACK) {
- this.state = State.IDLE;
- }
- //trigger handler right now
- this.tick();
- }
- }, {
- key: 'onKeyLoaded',
- value: function onKeyLoaded() {
- if (this.state === State.KEY_LOADING) {
- this.state = State.IDLE;
- this.tick();
- }
- }
- }, {
- key: 'onFragLoaded',
- value: function onFragLoaded(data) {
- var fragCurrent = this.fragCurrent,
- fragLoaded = data.frag;
- if (this.state === State.FRAG_LOADING && fragCurrent && fragLoaded.type === 'audio' && fragLoaded.level === fragCurrent.level && fragLoaded.sn === fragCurrent.sn) {
- var track = this.tracks[this.trackId],
- details = track.details,
- duration = details.totalduration,
- trackId = fragCurrent.level,
- sn = fragCurrent.sn,
- cc = fragCurrent.cc,
- audioCodec = this.config.defaultAudioCodec || track.audioCodec || 'mp4a.40.2',
- stats = this.stats = data.stats;
- if (sn === 'initSegment') {
- this.state = State.IDLE;
-
- stats.tparsed = stats.tbuffered = performance.now();
- details.initSegment.data = data.payload;
- this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'audio' });
- this.tick();
- } else {
- this.state = State.PARSING;
- // transmux the MPEG-TS data to ISO-BMFF segments
- this.appended = false;
- if (!this.demuxer) {
- this.demuxer = new _demuxer2.default(this.hls, 'audio');
- }
- //Check if we have video initPTS
- // If not we need to wait for it
- var initPTS = this.initPTS[cc];
- var initSegmentData = details.initSegment ? details.initSegment.data : [];
- if (details.initSegment || initPTS !== undefined) {
- this.pendingBuffering = true;
- _logger.logger.log('Demuxing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);
- // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)
- var accurateTimeOffset = false; //details.PTSKnown || !details.live;
- this.demuxer.push(data.payload, initSegmentData, audioCodec, null, fragCurrent, duration, accurateTimeOffset, initPTS);
- } else {
- _logger.logger.log('unknown video PTS for continuity counter ' + cc + ', waiting for video PTS before demuxing audio frag ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);
- this.waitingFragment = data;
- this.state = State.WAITING_INIT_PTS;
- }
- }
- }
- this.fragLoadError = 0;
- }
- }, {
- key: 'onFragParsingInitSegment',
- value: function onFragParsingInitSegment(data) {
- var fragCurrent = this.fragCurrent;
- var fragNew = data.frag;
- if (fragCurrent && data.id === 'audio' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === State.PARSING) {
- var tracks = data.tracks,
- track = void 0;
-
- // delete any video track found on audio demuxer
- if (tracks.video) {
- delete tracks.video;
- }
-
- // include levelCodec in audio and video tracks
- track = tracks.audio;
- if (track) {
- track.levelCodec = 'mp4a.40.2';
- track.id = data.id;
- this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);
- _logger.logger.log('audio track:audio,container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');
- var initSegment = track.initSegment;
- if (initSegment) {
- var appendObj = { type: 'audio', data: initSegment, parent: 'audio', content: 'initSegment' };
- if (this.audioSwitch) {
- this.pendingData = [appendObj];
- } else {
- this.appended = true;
- // arm pending Buffering flag before appending a segment
- this.pendingBuffering = true;
- this.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);
- }
- }
- //trigger handler right now
- this.tick();
- }
- }
- }
- }, {
- key: 'onFragParsingData',
- value: function onFragParsingData(data) {
- var _this2 = this;
+ ExpGolomb.prototype.skipUEG = function skipUEG() {
+ this.skipBits(1 + this.skipLZ());
+ };
- var fragCurrent = this.fragCurrent;
- var fragNew = data.frag;
- if (fragCurrent && data.id === 'audio' && data.type === 'audio' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === State.PARSING) {
- var trackId = this.trackId,
- track = this.tracks[trackId],
- hls = this.hls;
+ // ():void
- if (isNaN(data.endPTS)) {
- data.endPTS = data.startPTS + fragCurrent.duration;
- data.endDTS = data.startDTS + fragCurrent.duration;
- }
-
- _logger.logger.log('parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb);
- _levelHelper2.default.updateFragPTSDTS(track.details, fragCurrent, data.startPTS, data.endPTS);
-
- var audioSwitch = this.audioSwitch,
- media = this.media,
- appendOnBufferFlush = false;
- //Only flush audio from old audio tracks when PTS is known on new audio track
- if (audioSwitch && media) {
- if (media.readyState) {
- var currentTime = media.currentTime;
- _logger.logger.log('switching audio track : currentTime:' + currentTime);
- if (currentTime >= data.startPTS) {
- _logger.logger.log('switching audio track : flushing all audio');
- this.state = State.BUFFER_FLUSHING;
- hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });
- appendOnBufferFlush = true;
- //Lets announce that the initial audio track switch flush occur
- this.audioSwitch = false;
- hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });
- }
- } else {
- //Lets announce that the initial audio track switch flush occur
- this.audioSwitch = false;
- hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });
- }
- }
- var pendingData = this.pendingData;
- if (!this.audioSwitch) {
- [data.data1, data.data2].forEach(function (buffer) {
- if (buffer && buffer.length) {
- pendingData.push({ type: data.type, data: buffer, parent: 'audio', content: 'data' });
- }
- });
- if (!appendOnBufferFlush && pendingData.length) {
- pendingData.forEach(function (appendObj) {
- // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)
- // in that case it is useless to append following segments
- if (_this2.state === State.PARSING) {
- // arm pending Buffering flag before appending a segment
- _this2.pendingBuffering = true;
- _this2.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);
- }
- });
- this.pendingData = [];
- this.appended = true;
- }
- }
- //trigger handler right now
- this.tick();
- }
- }
- }, {
- key: 'onFragParsed',
- value: function onFragParsed(data) {
- var fragCurrent = this.fragCurrent;
- var fragNew = data.frag;
- if (fragCurrent && data.id === 'audio' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === State.PARSING) {
- this.stats.tparsed = performance.now();
- this.state = State.PARSED;
- this._checkAppendedParsed();
- }
- }
- }, {
- key: 'onBufferCreated',
- value: function onBufferCreated(data) {
- var audioTrack = data.tracks.audio;
- if (audioTrack) {
- this.mediaBuffer = audioTrack.buffer;
- this.loadedmetadata = true;
- }
- }
- }, {
- key: 'onBufferAppended',
- value: function onBufferAppended(data) {
- if (data.parent === 'audio') {
- var state = this.state;
- if (state === State.PARSING || state === State.PARSED) {
- // check if all buffers have been appended
- this.pendingBuffering = data.pending > 0;
- this._checkAppendedParsed();
- }
- }
- }
- }, {
- key: '_checkAppendedParsed',
- value: function _checkAppendedParsed() {
- //trigger handler right now
- if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {
- var frag = this.fragCurrent,
- stats = this.stats,
- hls = this.hls;
- if (frag) {
- this.fragPrevious = frag;
- stats.tbuffered = performance.now();
- hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'audio' });
- var media = this.mediaBuffer ? this.mediaBuffer : this.media;
- _logger.logger.log('audio buffered : ' + _timeRanges2.default.toString(media.buffered));
- if (this.audioSwitch && this.appended) {
- this.audioSwitch = false;
- hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: this.trackId });
- }
- this.state = State.IDLE;
- }
- this.tick();
- }
- }
- }, {
- key: 'onError',
- value: function onError(data) {
- var frag = data.frag;
- // don't handle frag error not related to audio fragment
- if (frag && frag.type !== 'audio') {
- return;
- }
- switch (data.details) {
- case _errors.ErrorDetails.FRAG_LOAD_ERROR:
- case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:
- if (!data.fatal) {
- var loadError = this.fragLoadError;
- if (loadError) {
- loadError++;
- } else {
- loadError = 1;
- }
- var config = this.config;
- if (loadError <= config.fragLoadingMaxRetry) {
- this.fragLoadError = loadError;
- // reset load counter to avoid frag loop loading error
- frag.loadCounter = 0;
- // exponential backoff capped to config.fragLoadingMaxRetryTimeout
- var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);
- _logger.logger.warn('audioStreamController: frag loading failed, retry in ' + delay + ' ms');
- this.retryDate = performance.now() + delay;
- // retry loading state
- this.state = State.FRAG_LOADING_WAITING_RETRY;
- } else {
- _logger.logger.error('audioStreamController: ' + data.details + ' reaches max retry, redispatch as fatal ...');
- // switch error to fatal
- data.fatal = true;
- this.state = State.ERROR;
- }
- }
- break;
- case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:
- case _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:
- case _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:
- case _errors.ErrorDetails.KEY_LOAD_ERROR:
- case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:
- // when in ERROR state, don't switch back to IDLE state in case a non-fatal error is received
- if (this.state !== State.ERROR) {
- // if fatal error, stop processing, otherwise move to IDLE to retry loading
- this.state = data.fatal ? State.ERROR : State.IDLE;
- _logger.logger.warn('audioStreamController: ' + data.details + ' while loading frag,switch to ' + this.state + ' state ...');
- }
- break;
- case _errors.ErrorDetails.BUFFER_FULL_ERROR:
- // if in appending state
- if (data.parent === 'audio' && (this.state === State.PARSING || this.state === State.PARSED)) {
- var media = this.mediaBuffer,
- currentTime = this.media.currentTime,
- mediaBuffered = media && _bufferHelper2.default.isBuffered(media, currentTime) && _bufferHelper2.default.isBuffered(media, currentTime + 0.5);
- // reduce max buf len if current position is buffered
- if (mediaBuffered) {
- var _config = this.config;
- if (_config.maxMaxBufferLength >= _config.maxBufferLength) {
- // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...
- _config.maxMaxBufferLength /= 2;
- _logger.logger.warn('audio:reduce max buffer length to ' + _config.maxMaxBufferLength + 's');
- // increase fragment load Index to avoid frag loop loading error after buffer flush
- this.fragLoadIdx += 2 * _config.fragLoadingLoopThreshold;
- }
- this.state = State.IDLE;
- } else {
- // current position is not buffered, but browser is still complaining about buffer full error
- // this happens on IE/Edge, refer to https://github.com/video-dev/hls.js/pull/708
- // in that case flush the whole audio buffer to recover
- _logger.logger.warn('buffer full error also media.currentTime is not buffered, flush audio buffer');
- this.fragCurrent = null;
- // flush everything
- this.state = State.BUFFER_FLUSHING;
- this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });
- }
- }
- break;
- default:
- break;
- }
- }
- }, {
- key: 'onBufferFlushed',
- value: function onBufferFlushed() {
- var _this3 = this;
+ ExpGolomb.prototype.skipEG = function skipEG() {
+ this.skipBits(1 + this.skipLZ());
+ };
- var pendingData = this.pendingData;
- if (pendingData && pendingData.length) {
- _logger.logger.log('appending pending audio data on Buffer Flushed');
- pendingData.forEach(function (appendObj) {
- _this3.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);
- });
- this.appended = true;
- this.pendingData = [];
- this.state = State.PARSED;
- } else {
- // move to IDLE once flush complete. this should trigger new fragment loading
- this.state = State.IDLE;
- // reset reference to frag
- this.fragPrevious = null;
- this.tick();
- }
- }
- }, {
- key: 'state',
- set: function set(nextState) {
- if (this.state !== nextState) {
- var previousState = this.state;
- this._state = nextState;
- _logger.logger.log('audio stream:' + previousState + '->' + nextState);
- }
- },
- get: function get() {
- return this._state;
- }
- }]);
+ // ():uint
- return AudioStreamController;
-}(_eventHandler2.default);
-exports.default = AudioStreamController;
+ ExpGolomb.prototype.readUEG = function readUEG() {
+ var clz = this.skipLZ(); // :uint
+ return this.readBits(clz + 1) - 1;
+ };
-},{"25":25,"33":33,"34":34,"35":35,"37":37,"38":38,"48":48,"53":53,"54":54}],7:[function(_dereq_,module,exports){
-'use strict';
+ // ():int
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+ ExpGolomb.prototype.readEG = function readEG() {
+ var valu = this.readUEG(); // :int
+ if (0x01 & valu) {
+ // the number is odd if the low order bit is set
+ return 1 + valu >>> 1; // add 1 to make it even, and divide by 2
+ } else {
+ return -1 * (valu >>> 1); // divide by two then make it negative
+ }
+ };
-var _events = _dereq_(35);
+ // Some convenience functions
+ // :Boolean
-var _events2 = _interopRequireDefault(_events);
-var _eventHandler = _dereq_(34);
+ ExpGolomb.prototype.readBoolean = function readBoolean() {
+ return 1 === this.readBits(1);
+ };
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
+ // ():int
-var _logger = _dereq_(53);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ ExpGolomb.prototype.readUByte = function readUByte() {
+ return this.readBits(8);
+ };
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ // ():int
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * audio track controller
- */
+ ExpGolomb.prototype.readUShort = function readUShort() {
+ return this.readBits(16);
+ };
+ // ():int
-var AudioTrackController = function (_EventHandler) {
- _inherits(AudioTrackController, _EventHandler);
- function AudioTrackController(hls) {
- _classCallCheck(this, AudioTrackController);
+ ExpGolomb.prototype.readUInt = function readUInt() {
+ return this.readBits(32);
+ };
- var _this = _possibleConstructorReturn(this, (AudioTrackController.__proto__ || Object.getPrototypeOf(AudioTrackController)).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_LOADED, _events2.default.AUDIO_TRACK_LOADED));
+ /**
+ * Advance the ExpGolomb decoder past a scaling list. The scaling
+ * list is optionally transmitted as part of a sequence parameter
+ * set and is not relevant to transmuxing.
+ * @param count {number} the number of entries in this scaling list
+ * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1
+ */
- _this.ticks = 0;
- _this.ontick = _this.tick.bind(_this);
- return _this;
- }
- _createClass(AudioTrackController, [{
- key: 'destroy',
- value: function destroy() {
- _eventHandler2.default.prototype.destroy.call(this);
- }
- }, {
- key: 'tick',
- value: function tick() {
- this.ticks++;
- if (this.ticks === 1) {
- this.doTick();
- if (this.ticks > 1) {
- setTimeout(this.tick, 1);
- }
- this.ticks = 0;
- }
- }
- }, {
- key: 'doTick',
- value: function doTick() {
- this.updateTrack(this.trackId);
- }
- }, {
- key: 'onManifestLoading',
- value: function onManifestLoading() {
- // reset audio tracks on manifest loading
- this.tracks = [];
- this.trackId = -1;
- }
- }, {
- key: 'onManifestLoaded',
- value: function onManifestLoaded(data) {
- var _this2 = this;
-
- var tracks = data.audioTracks || [];
- var defaultFound = false;
- this.tracks = tracks;
- this.hls.trigger(_events2.default.AUDIO_TRACKS_UPDATED, { audioTracks: tracks });
- // loop through available audio tracks and autoselect default if needed
- var id = 0;
- tracks.forEach(function (track) {
- if (track.default) {
- _this2.audioTrack = id;
- defaultFound = true;
- return;
- }
- id++;
- });
- if (defaultFound === false && tracks.length) {
- _logger.logger.log('no default audio track defined, use first audio track as default');
- this.audioTrack = 0;
- }
- }
- }, {
- key: 'onAudioTrackLoaded',
- value: function onAudioTrackLoaded(data) {
- if (data.id < this.tracks.length) {
- _logger.logger.log('audioTrack ' + data.id + ' loaded');
- this.tracks[data.id].details = data.details;
- // check if current playlist is a live playlist
- if (data.details.live && !this.timer) {
- // if live playlist we will have to reload it periodically
- // set reload period to playlist target duration
- this.timer = setInterval(this.ontick, 1000 * data.details.targetduration);
- }
- if (!data.details.live && this.timer) {
- // playlist is not live and timer is armed : stopping it
- clearInterval(this.timer);
- this.timer = null;
- }
+ ExpGolomb.prototype.skipScalingList = function skipScalingList(count) {
+ var lastScale = 8,
+ nextScale = 8,
+ j,
+ deltaScale;
+ for (j = 0; j < count; j++) {
+ if (nextScale !== 0) {
+ deltaScale = this.readEG();
+ nextScale = (lastScale + deltaScale + 256) % 256;
}
+ lastScale = nextScale === 0 ? lastScale : nextScale;
}
+ };
- /** get alternate audio tracks list from playlist **/
+ /**
+ * Read a sequence parameter set and return some interesting video
+ * properties. A sequence parameter set is the H264 metadata that
+ * describes the properties of upcoming video frames.
+ * @param data {Uint8Array} the bytes of a sequence parameter set
+ * @return {object} an object with configuration parsed from the
+ * sequence parameter set, including the dimensions of the
+ * associated video frames.
+ */
- }, {
- key: 'setAudioTrackInternal',
- value: function setAudioTrackInternal(newId) {
- // check if level idx is valid
- if (newId >= 0 && newId < this.tracks.length) {
- // stopping live reloading timer if any
- if (this.timer) {
- clearInterval(this.timer);
- this.timer = null;
- }
- this.trackId = newId;
- _logger.logger.log('switching to audioTrack ' + newId);
- var audioTrack = this.tracks[newId],
- hls = this.hls,
- type = audioTrack.type,
- url = audioTrack.url,
- eventObj = { id: newId, type: type, url: url };
- // keep AUDIO_TRACK_SWITCH for legacy reason
- hls.trigger(_events2.default.AUDIO_TRACK_SWITCH, eventObj);
- hls.trigger(_events2.default.AUDIO_TRACK_SWITCHING, eventObj);
- // check if we need to load playlist for this audio Track
- var details = audioTrack.details;
- if (url && (details === undefined || details.live === true)) {
- // track not retrieved yet, or live playlist we need to (re)load it
- _logger.logger.log('(re)loading playlist for audioTrack ' + newId);
- hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });
+
+ ExpGolomb.prototype.readSPS = function readSPS() {
+ var frameCropLeftOffset = 0,
+ frameCropRightOffset = 0,
+ frameCropTopOffset = 0,
+ frameCropBottomOffset = 0,
+ profileIdc,
+ profileCompat,
+ levelIdc,
+ numRefFramesInPicOrderCntCycle,
+ picWidthInMbsMinus1,
+ picHeightInMapUnitsMinus1,
+ frameMbsOnlyFlag,
+ scalingListCount,
+ i,
+ readUByte = this.readUByte.bind(this),
+ readBits = this.readBits.bind(this),
+ readUEG = this.readUEG.bind(this),
+ readBoolean = this.readBoolean.bind(this),
+ skipBits = this.skipBits.bind(this),
+ skipEG = this.skipEG.bind(this),
+ skipUEG = this.skipUEG.bind(this),
+ skipScalingList = this.skipScalingList.bind(this);
+
+ readUByte();
+ profileIdc = readUByte(); // profile_idc
+ profileCompat = readBits(5); // constraint_set[0-4]_flag, u(5)
+ skipBits(3); // reserved_zero_3bits u(3),
+ levelIdc = readUByte(); //level_idc u(8)
+ skipUEG(); // seq_parameter_set_id
+ // some profiles have more optional data we don't need
+ if (profileIdc === 100 || profileIdc === 110 || profileIdc === 122 || profileIdc === 244 || profileIdc === 44 || profileIdc === 83 || profileIdc === 86 || profileIdc === 118 || profileIdc === 128) {
+ var chromaFormatIdc = readUEG();
+ if (chromaFormatIdc === 3) {
+ skipBits(1); // separate_colour_plane_flag
+ }
+ skipUEG(); // bit_depth_luma_minus8
+ skipUEG(); // bit_depth_chroma_minus8
+ skipBits(1); // qpprime_y_zero_transform_bypass_flag
+ if (readBoolean()) {
+ // seq_scaling_matrix_present_flag
+ scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;
+ for (i = 0; i < scalingListCount; i++) {
+ if (readBoolean()) {
+ // seq_scaling_list_present_flag[ i ]
+ if (i < 6) {
+ skipScalingList(16);
+ } else {
+ skipScalingList(64);
+ }
+ }
}
}
}
- }, {
- key: 'updateTrack',
- value: function updateTrack(newId) {
- // check if level idx is valid
- if (newId >= 0 && newId < this.tracks.length) {
- // stopping live reloading timer if any
- if (this.timer) {
- clearInterval(this.timer);
- this.timer = null;
- }
- this.trackId = newId;
- _logger.logger.log('updating audioTrack ' + newId);
- var audioTrack = this.tracks[newId],
- url = audioTrack.url;
- // check if we need to load playlist for this audio Track
- var details = audioTrack.details;
- if (url && (details === undefined || details.live === true)) {
- // track not retrieved yet, or live playlist we need to (re)load it
- _logger.logger.log('(re)loading playlist for audioTrack ' + newId);
- this.hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });
+ skipUEG(); // log2_max_frame_num_minus4
+ var picOrderCntType = readUEG();
+ if (picOrderCntType === 0) {
+ readUEG(); //log2_max_pic_order_cnt_lsb_minus4
+ } else if (picOrderCntType === 1) {
+ skipBits(1); // delta_pic_order_always_zero_flag
+ skipEG(); // offset_for_non_ref_pic
+ skipEG(); // offset_for_top_to_bottom_field
+ numRefFramesInPicOrderCntCycle = readUEG();
+ for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {
+ skipEG(); // offset_for_ref_frame[ i ]
+ }
+ }
+ skipUEG(); // max_num_ref_frames
+ skipBits(1); // gaps_in_frame_num_value_allowed_flag
+ picWidthInMbsMinus1 = readUEG();
+ picHeightInMapUnitsMinus1 = readUEG();
+ frameMbsOnlyFlag = readBits(1);
+ if (frameMbsOnlyFlag === 0) {
+ skipBits(1); // mb_adaptive_frame_field_flag
+ }
+ skipBits(1); // direct_8x8_inference_flag
+ if (readBoolean()) {
+ // frame_cropping_flag
+ frameCropLeftOffset = readUEG();
+ frameCropRightOffset = readUEG();
+ frameCropTopOffset = readUEG();
+ frameCropBottomOffset = readUEG();
+ }
+ var pixelRatio = [1, 1];
+ if (readBoolean()) {
+ // vui_parameters_present_flag
+ if (readBoolean()) {
+ // aspect_ratio_info_present_flag
+ var aspectRatioIdc = readUByte();
+ switch (aspectRatioIdc) {
+ case 1:
+ pixelRatio = [1, 1];break;
+ case 2:
+ pixelRatio = [12, 11];break;
+ case 3:
+ pixelRatio = [10, 11];break;
+ case 4:
+ pixelRatio = [16, 11];break;
+ case 5:
+ pixelRatio = [40, 33];break;
+ case 6:
+ pixelRatio = [24, 11];break;
+ case 7:
+ pixelRatio = [20, 11];break;
+ case 8:
+ pixelRatio = [32, 11];break;
+ case 9:
+ pixelRatio = [80, 33];break;
+ case 10:
+ pixelRatio = [18, 11];break;
+ case 11:
+ pixelRatio = [15, 11];break;
+ case 12:
+ pixelRatio = [64, 33];break;
+ case 13:
+ pixelRatio = [160, 99];break;
+ case 14:
+ pixelRatio = [4, 3];break;
+ case 15:
+ pixelRatio = [3, 2];break;
+ case 16:
+ pixelRatio = [2, 1];break;
+ case 255:
+ {
+ pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];
+ break;
+ }
}
}
}
- }, {
- key: 'audioTracks',
- get: function get() {
- return this.tracks;
- }
-
- /** get index of the selected audio track (index in audio track lists) **/
+ return {
+ width: Math.ceil((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2),
+ height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - (frameMbsOnlyFlag ? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset),
+ pixelRatio: pixelRatio
+ };
+ };
- }, {
- key: 'audioTrack',
- get: function get() {
- return this.trackId;
- }
+ ExpGolomb.prototype.readSliceType = function readSliceType() {
+ // skip NALu type
+ this.readUByte();
+ // discard first_mb_in_slice
+ this.readUEG();
+ // return slice_type
+ return this.readUEG();
+ };
- /** select an audio track, based on its index in audio track lists**/
- ,
- set: function set(audioTrackId) {
- if (this.trackId !== audioTrackId || this.tracks[audioTrackId].details === undefined) {
- this.setAudioTrackInternal(audioTrackId);
- }
- }
- }]);
+ return ExpGolomb;
+}();
- return AudioTrackController;
-}(_eventHandler2.default);
+/* harmony default export */ var exp_golomb = (exp_golomb_ExpGolomb);
+// CONCATENATED MODULE: ./src/demux/sample-aes.js
+function sample_aes__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-exports.default = AudioTrackController;
+/**
+ * SAMPLE-AES decrypter
+*/
-},{"34":34,"35":35,"53":53}],8:[function(_dereq_,module,exports){
-'use strict';
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+var sample_aes_SampleAesDecrypter = function () {
+ function SampleAesDecrypter(observer, config, decryptdata, discardEPB) {
+ sample_aes__classCallCheck(this, SampleAesDecrypter);
-var _events = _dereq_(35);
+ this.decryptdata = decryptdata;
+ this.discardEPB = discardEPB;
+ this.decrypter = new crypt_decrypter["a" /* default */](observer, config);
+ }
-var _events2 = _interopRequireDefault(_events);
+ SampleAesDecrypter.prototype.decryptBuffer = function decryptBuffer(encryptedData, callback) {
+ this.decrypter.decrypt(encryptedData, this.decryptdata.key.buffer, this.decryptdata.iv.buffer, callback);
+ };
-var _eventHandler = _dereq_(34);
+ // AAC - encrypt all full 16 bytes blocks starting from offset 16
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
-var _logger = _dereq_(53);
+ SampleAesDecrypter.prototype.decryptAacSample = function decryptAacSample(samples, sampleIndex, callback, sync) {
+ var curUnit = samples[sampleIndex].unit;
+ var encryptedData = curUnit.subarray(16, curUnit.length - curUnit.length % 16);
+ var encryptedBuffer = encryptedData.buffer.slice(encryptedData.byteOffset, encryptedData.byteOffset + encryptedData.length);
-var _errors = _dereq_(33);
+ var localthis = this;
+ this.decryptBuffer(encryptedBuffer, function (decryptedData) {
+ decryptedData = new Uint8Array(decryptedData);
+ curUnit.set(decryptedData, 16);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ if (!sync) {
+ localthis.decryptAacSamples(samples, sampleIndex + 1, callback);
+ }
+ });
+ };
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ SampleAesDecrypter.prototype.decryptAacSamples = function decryptAacSamples(samples, sampleIndex, callback) {
+ for (;; sampleIndex++) {
+ if (sampleIndex >= samples.length) {
+ callback();
+ return;
+ }
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+ if (samples[sampleIndex].unit.length < 32) {
+ continue;
+ }
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * Buffer Controller
- */
+ var sync = this.decrypter.isSync();
-var BufferController = function (_EventHandler) {
- _inherits(BufferController, _EventHandler);
+ this.decryptAacSample(samples, sampleIndex, callback, sync);
- function BufferController(hls) {
- _classCallCheck(this, BufferController);
+ if (!sync) {
+ return;
+ }
+ }
+ };
- // the value that we have set mediasource.duration to
- // (the actual duration may be tweaked slighly by the browser)
- var _this = _possibleConstructorReturn(this, (BufferController.__proto__ || Object.getPrototypeOf(BufferController)).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_PARSED, _events2.default.BUFFER_RESET, _events2.default.BUFFER_APPENDING, _events2.default.BUFFER_CODECS, _events2.default.BUFFER_EOS, _events2.default.BUFFER_FLUSHING, _events2.default.LEVEL_PTS_UPDATED, _events2.default.LEVEL_UPDATED));
+ // AVC - encrypt one 16 bytes block out of ten, starting from offset 32
- _this._msDuration = null;
- // the value that we want to set mediaSource.duration to
- _this._levelDuration = null;
- // Source Buffer listeners
- _this.onsbue = _this.onSBUpdateEnd.bind(_this);
- _this.onsbe = _this.onSBUpdateError.bind(_this);
- _this.pendingTracks = {};
- _this.tracks = {};
- return _this;
- }
+ SampleAesDecrypter.prototype.getAvcEncryptedData = function getAvcEncryptedData(decodedData) {
+ var encryptedDataLen = Math.floor((decodedData.length - 48) / 160) * 16 + 16;
+ var encryptedData = new Int8Array(encryptedDataLen);
+ var outputPos = 0;
+ for (var inputPos = 32; inputPos <= decodedData.length - 16; inputPos += 160, outputPos += 16) {
+ encryptedData.set(decodedData.subarray(inputPos, inputPos + 16), outputPos);
+ }
+ return encryptedData;
+ };
- _createClass(BufferController, [{
- key: 'destroy',
- value: function destroy() {
- _eventHandler2.default.prototype.destroy.call(this);
+ SampleAesDecrypter.prototype.getAvcDecryptedUnit = function getAvcDecryptedUnit(decodedData, decryptedData) {
+ decryptedData = new Uint8Array(decryptedData);
+ var inputPos = 0;
+ for (var outputPos = 32; outputPos <= decodedData.length - 16; outputPos += 160, inputPos += 16) {
+ decodedData.set(decryptedData.subarray(inputPos, inputPos + 16), outputPos);
}
- }, {
- key: 'onLevelPtsUpdated',
- value: function onLevelPtsUpdated(data) {
- var type = data.type;
- var audioTrack = this.tracks.audio;
-
- // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)
- // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`
- // is greater than 100ms (this is enough to handle seek for VOD or level change for LIVE videos). At the time of change we issue
- // `SourceBuffer.abort()` and adjusting `SourceBuffer.timestampOffset` if `SourceBuffer.updating` is false or awaiting `updateend`
- // event if SB is in updating state.
- // More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486
-
- if (type === 'audio' && audioTrack && audioTrack.container === 'audio/mpeg') {
- // Chrome audio mp3 track
- var audioBuffer = this.sourceBuffer.audio;
- var delta = Math.abs(audioBuffer.timestampOffset - data.start);
-
- // adjust timestamp offset if time delta is greater than 100ms
- if (delta > 0.1) {
- var updating = audioBuffer.updating;
+ return decodedData;
+ };
- try {
- audioBuffer.abort();
- } catch (err) {
- updating = true;
- _logger.logger.warn('can not abort audio buffer: ' + err);
- }
+ SampleAesDecrypter.prototype.decryptAvcSample = function decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync) {
+ var decodedData = this.discardEPB(curUnit.data);
+ var encryptedData = this.getAvcEncryptedData(decodedData);
+ var localthis = this;
- if (!updating) {
- _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + data.start);
- audioBuffer.timestampOffset = data.start;
- } else {
- this.audioTimestampOffset = data.start;
- }
- }
+ this.decryptBuffer(encryptedData.buffer, function (decryptedData) {
+ curUnit.data = localthis.getAvcDecryptedUnit(decodedData, decryptedData);
+
+ if (!sync) {
+ localthis.decryptAvcSamples(samples, sampleIndex, unitIndex + 1, callback);
}
- }
- }, {
- key: 'onManifestParsed',
- value: function onManifestParsed(data) {
- var audioExpected = data.audio,
- videoExpected = data.video,
- sourceBufferNb = 0;
- // in case of alt audio 2 BUFFER_CODECS events will be triggered, one per stream controller
- // sourcebuffers will be created all at once when the expected nb of tracks will be reached
- // in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller
- // it will contain the expected nb of source buffers, no need to compute it
- if (data.altAudio && (audioExpected || videoExpected)) {
- sourceBufferNb = (audioExpected ? 1 : 0) + (videoExpected ? 1 : 0);
- _logger.logger.log(sourceBufferNb + ' sourceBuffer(s) expected');
- }
- this.sourceBufferNb = sourceBufferNb;
- }
- }, {
- key: 'onMediaAttaching',
- value: function onMediaAttaching(data) {
- var media = this.media = data.media;
- if (media) {
- // setup the media source
- var ms = this.mediaSource = new MediaSource();
- //Media Source listeners
- this.onmso = this.onMediaSourceOpen.bind(this);
- this.onmse = this.onMediaSourceEnded.bind(this);
- this.onmsc = this.onMediaSourceClose.bind(this);
- ms.addEventListener('sourceopen', this.onmso);
- ms.addEventListener('sourceended', this.onmse);
- ms.addEventListener('sourceclose', this.onmsc);
- // link video and media Source
- media.src = URL.createObjectURL(ms);
+ });
+ };
+
+ SampleAesDecrypter.prototype.decryptAvcSamples = function decryptAvcSamples(samples, sampleIndex, unitIndex, callback) {
+ for (;; sampleIndex++, unitIndex = 0) {
+ if (sampleIndex >= samples.length) {
+ callback();
+ return;
}
- }
- }, {
- key: 'onMediaDetaching',
- value: function onMediaDetaching() {
- _logger.logger.log('media source detaching');
- var ms = this.mediaSource;
- if (ms) {
- if (ms.readyState === 'open') {
- try {
- // endOfStream could trigger exception if any sourcebuffer is in updating state
- // we don't really care about checking sourcebuffer state here,
- // as we are anyway detaching the MediaSource
- // let's just avoid this exception to propagate
- ms.endOfStream();
- } catch (err) {
- _logger.logger.warn('onMediaDetaching:' + err.message + ' while calling endOfStream');
- }
+
+ var curUnits = samples[sampleIndex].units;
+ for (;; unitIndex++) {
+ if (unitIndex >= curUnits.length) {
+ break;
}
- ms.removeEventListener('sourceopen', this.onmso);
- ms.removeEventListener('sourceended', this.onmse);
- ms.removeEventListener('sourceclose', this.onmsc);
- // Detach properly the MediaSource from the HTMLMediaElement as
- // suggested in https://github.com/w3c/media-source/issues/53.
- if (this.media) {
- URL.revokeObjectURL(this.media.src);
- this.media.removeAttribute('src');
- this.media.load();
+ var curUnit = curUnits[unitIndex];
+ if (curUnit.length <= 48 || curUnit.type !== 1 && curUnit.type !== 5) {
+ continue;
}
- this.mediaSource = null;
- this.media = null;
- this.pendingTracks = {};
- this.tracks = {};
- this.sourceBuffer = {};
- this.flushRange = [];
- this.segments = [];
- this.appended = 0;
- }
- this.onmso = this.onmse = this.onmsc = null;
- this.hls.trigger(_events2.default.MEDIA_DETACHED);
- }
- }, {
- key: 'onMediaSourceOpen',
- value: function onMediaSourceOpen() {
- _logger.logger.log('media source opened');
- this.hls.trigger(_events2.default.MEDIA_ATTACHED, { media: this.media });
- var mediaSource = this.mediaSource;
- if (mediaSource) {
- // once received, don't listen anymore to sourceopen event
- mediaSource.removeEventListener('sourceopen', this.onmso);
- }
- this.checkPendingTracks();
- }
- }, {
- key: 'checkPendingTracks',
- value: function checkPendingTracks() {
- // if any buffer codecs pending, check if we have enough to create sourceBuffers
- var pendingTracks = this.pendingTracks,
- pendingTracksNb = Object.keys(pendingTracks).length;
- // if any pending tracks and (if nb of pending tracks gt or equal than expected nb or if unknown expected nb)
- if (pendingTracksNb && (this.sourceBufferNb <= pendingTracksNb || this.sourceBufferNb === 0)) {
- // ok, let's create them now !
- this.createSourceBuffers(pendingTracks);
- this.pendingTracks = {};
- // append any pending segments now !
- this.doAppending();
+ var sync = this.decrypter.isSync();
+
+ this.decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync);
+
+ if (!sync) {
+ return;
+ }
}
}
- }, {
- key: 'onMediaSourceClose',
- value: function onMediaSourceClose() {
- _logger.logger.log('media source closed');
- }
- }, {
- key: 'onMediaSourceEnded',
- value: function onMediaSourceEnded() {
- _logger.logger.log('media source ended');
- }
- }, {
- key: 'onSBUpdateEnd',
- value: function onSBUpdateEnd() {
- // update timestampOffset
- if (this.audioTimestampOffset) {
- var audioBuffer = this.sourceBuffer.audio;
- _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + this.audioTimestampOffset);
- audioBuffer.timestampOffset = this.audioTimestampOffset;
- delete this.audioTimestampOffset;
- }
+ };
- if (this._needsFlush) {
- this.doFlush();
- }
+ return SampleAesDecrypter;
+}();
- if (this._needsEos) {
- this.checkEos();
- }
- this.appending = false;
- var parent = this.parent;
- // count nb of pending segments waiting for appending on this sourcebuffer
- var pending = this.segments.reduce(function (counter, segment) {
- return segment.parent === parent ? counter + 1 : counter;
- }, 0);
- this.hls.trigger(_events2.default.BUFFER_APPENDED, { parent: parent, pending: pending });
+/* harmony default export */ var sample_aes = (sample_aes_SampleAesDecrypter);
+// CONCATENATED MODULE: ./src/demux/tsdemuxer.js
+function tsdemuxer__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- // don't append in flushing mode
- if (!this._needsFlush) {
- this.doAppending();
- }
+/**
+ * highly optimized TS demuxer:
+ * parse PAT, PMT
+ * extract PES packet from audio and video PIDs
+ * extract AVC/H264 NAL units and AAC/ADTS samples from PES packet
+ * trigger the remuxer upon parsing completion
+ * it also tries to workaround as best as it can audio codec switch (HE-AAC to AAC and vice versa), without having to restart the MediaSource.
+ * it also controls the remuxing process :
+ * upon discontinuity or level switch detection, it will also notifies the remuxer so that it can reset its state.
+*/
- this.updateMediaElementDuration();
- }
- }, {
- key: 'onSBUpdateError',
- value: function onSBUpdateError(event) {
- _logger.logger.error('sourceBuffer error:', event);
- // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error
- // this error might not always be fatal (it is fatal if decode error is set, in that case
- // it will be followed by a mediaElement error ...)
- this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false });
- // we don't need to do more than that, as accordin to the spec, updateend will be fired just after
- }
- }, {
- key: 'onBufferReset',
- value: function onBufferReset() {
- var sourceBuffer = this.sourceBuffer;
- for (var type in sourceBuffer) {
- var sb = sourceBuffer[type];
- try {
- this.mediaSource.removeSourceBuffer(sb);
- sb.removeEventListener('updateend', this.onsbue);
- sb.removeEventListener('error', this.onsbe);
- } catch (err) {}
- }
- this.sourceBuffer = {};
- this.flushRange = [];
- this.segments = [];
- this.appended = 0;
- }
- }, {
- key: 'onBufferCodecs',
- value: function onBufferCodecs(tracks) {
- // if source buffer(s) not created yet, appended buffer tracks in this.pendingTracks
- // if sourcebuffers already created, do nothing ...
- if (Object.keys(this.sourceBuffer).length === 0) {
- for (var trackName in tracks) {
- this.pendingTracks[trackName] = tracks[trackName];
- }
- var mediaSource = this.mediaSource;
- if (mediaSource && mediaSource.readyState === 'open') {
- // try to create sourcebuffers if mediasource opened
- this.checkPendingTracks();
- }
- }
+
+
+
+
+
+// import Hex from '../utils/hex';
+
+
+
+// We are using fixed track IDs for driving the MP4 remuxer
+// instead of following the TS PIDs.
+// There is no reason not to do this and some browsers/SourceBuffer-demuxers
+// may not like if there are TrackID "switches"
+// See https://github.com/video-dev/hls.js/issues/1331
+// Here we are mapping our internal track types to constant MP4 track IDs
+// With MSE currently one can only have one track of each, and we are muxing
+// whatever video/audio rendition in them.
+var RemuxerTrackIdConfig = {
+ video: 0,
+ audio: 1,
+ id3: 2,
+ text: 3
+};
+
+var tsdemuxer_TSDemuxer = function () {
+ function TSDemuxer(observer, remuxer, config, typeSupported) {
+ tsdemuxer__classCallCheck(this, TSDemuxer);
+
+ this.observer = observer;
+ this.config = config;
+ this.typeSupported = typeSupported;
+ this.remuxer = remuxer;
+ this.sampleAes = null;
+ }
+
+ TSDemuxer.prototype.setDecryptData = function setDecryptData(decryptdata) {
+ if (decryptdata != null && decryptdata.key != null && decryptdata.method === 'SAMPLE-AES') {
+ this.sampleAes = new sample_aes(this.observer, this.config, decryptdata, this.discardEPB);
+ } else {
+ this.sampleAes = null;
}
- }, {
- key: 'createSourceBuffers',
- value: function createSourceBuffers(tracks) {
- var sourceBuffer = this.sourceBuffer,
- mediaSource = this.mediaSource;
+ };
- for (var trackName in tracks) {
- if (!sourceBuffer[trackName]) {
- var track = tracks[trackName];
- // use levelCodec as first priority
- var codec = track.levelCodec || track.codec;
- var mimeType = track.container + ';codecs=' + codec;
- _logger.logger.log('creating sourceBuffer(' + mimeType + ')');
- try {
- var sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);
- sb.addEventListener('updateend', this.onsbue);
- sb.addEventListener('error', this.onsbe);
- this.tracks[trackName] = { codec: codec, container: track.container };
- track.buffer = sb;
- } catch (err) {
- _logger.logger.error('error while trying to add sourceBuffer:' + err.message);
- this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_ADD_CODEC_ERROR, fatal: false, err: err, mimeType: mimeType });
- }
- }
+ TSDemuxer.probe = function probe(data) {
+ var syncOffset = TSDemuxer._syncOffset(data);
+ if (syncOffset < 0) {
+ return false;
+ } else {
+ if (syncOffset) {
+ logger["b" /* logger */].warn('MPEG2-TS detected but first sync word found @ offset ' + syncOffset + ', junk ahead ?');
}
- this.hls.trigger(_events2.default.BUFFER_CREATED, { tracks: tracks });
+ return true;
}
- }, {
- key: 'onBufferAppending',
- value: function onBufferAppending(data) {
- if (!this._needsFlush) {
- if (!this.segments) {
- this.segments = [data];
- } else {
- this.segments.push(data);
- }
- this.doAppending();
+ };
+
+ TSDemuxer._syncOffset = function _syncOffset(data) {
+ // scan 1000 first bytes
+ var scanwindow = Math.min(1000, data.length - 3 * 188);
+ var i = 0;
+ while (i < scanwindow) {
+ // a TS fragment should contain at least 3 TS packets, a PAT, a PMT, and one PID, each starting with 0x47
+ if (data[i] === 0x47 && data[i + 188] === 0x47 && data[i + 2 * 188] === 0x47) {
+ return i;
+ } else {
+ i++;
}
}
- }, {
- key: 'onBufferAppendFail',
- value: function onBufferAppendFail(data) {
- _logger.logger.error('sourceBuffer error:', data.event);
- // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error
- // this error might not always be fatal (it is fatal if decode error is set, in that case
- // it will be followed by a mediaElement error ...)
- this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false });
- }
+ return -1;
+ };
- // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()
+ /**
+ * Creates a track model internal to demuxer used to drive remuxing input
+ *
+ * @param {string} type 'audio' | 'video' | 'id3' | 'text'
+ * @param {number} duration
+ * @return {object} TSDemuxer's internal track model
+ */
- }, {
- key: 'onBufferEos',
- value: function onBufferEos(data) {
- var sb = this.sourceBuffer;
- var dataType = data.type;
- for (var type in sb) {
- if (!dataType || type === dataType) {
- if (!sb[type].ended) {
- sb[type].ended = true;
- _logger.logger.log(type + ' sourceBuffer now EOS');
- }
- }
- }
- this.checkEos();
- }
- // if all source buffers are marked as ended, signal endOfStream() to MediaSource.
+ TSDemuxer.createTrack = function createTrack(type, duration) {
+ return {
+ container: type === 'video' || type === 'audio' ? 'video/mp2t' : undefined,
+ type: type,
+ id: RemuxerTrackIdConfig[type],
+ pid: -1,
+ inputTimeScale: 90000,
+ sequenceNumber: 0,
+ samples: [],
+ len: 0,
+ dropped: type === 'video' ? 0 : undefined,
+ isAAC: type === 'audio' ? true : undefined,
+ duration: type === 'audio' ? duration : undefined
+ };
+ };
- }, {
- key: 'checkEos',
- value: function checkEos() {
- var sb = this.sourceBuffer,
- mediaSource = this.mediaSource;
- if (!mediaSource || mediaSource.readyState !== 'open') {
- this._needsEos = false;
- return;
- }
- for (var type in sb) {
- var sbobj = sb[type];
- if (!sbobj.ended) {
- return;
- }
- if (sbobj.updating) {
- this._needsEos = true;
- return;
- }
- }
- _logger.logger.log('all media data available, signal endOfStream() to MediaSource and stop loading fragment');
- //Notify the media element that it now has all of the media data
- try {
- mediaSource.endOfStream();
- } catch (e) {
- _logger.logger.warn('exception while calling mediaSource.endOfStream()');
- }
- this._needsEos = false;
- }
- }, {
- key: 'onBufferFlushing',
- value: function onBufferFlushing(data) {
- this.flushRange.push({ start: data.startOffset, end: data.endOffset, type: data.type });
- // attempt flush immediatly
- this.flushBufferCounter = 0;
- this.doFlush();
- }
- }, {
- key: 'onLevelUpdated',
- value: function onLevelUpdated(event) {
- var details = event.details;
- if (details.fragments.length === 0) {
- return;
- }
- this._levelDuration = details.totalduration + details.fragments[0].start;
- this.updateMediaElementDuration();
- }
+ /**
+ * Initializes a new init segment on the demuxer/remuxer interface. Needed for discontinuities/track-switches (or at stream start)
+ * Resets all internal track instances of the demuxer.
+ *
+ * @override Implements generic demuxing/remuxing interface (see DemuxerInline)
+ * @param {object} initSegment
+ * @param {string} audioCodec
+ * @param {string} videoCodec
+ * @param {number} duration (in TS timescale = 90kHz)
+ */
- // https://github.com/video-dev/hls.js/issues/355
- }, {
- key: 'updateMediaElementDuration',
- value: function updateMediaElementDuration() {
- var media = this.media,
- mediaSource = this.mediaSource,
- sourceBuffer = this.sourceBuffer,
- levelDuration = this._levelDuration;
- if (levelDuration === null || !media || !mediaSource || !sourceBuffer || media.readyState === 0 || mediaSource.readyState !== 'open') {
- return;
- }
- for (var type in sourceBuffer) {
- if (sourceBuffer[type].updating) {
- // can't set duration whilst a buffer is updating
- return;
- }
- }
- if (this._msDuration === null) {
- // initialise to the value that the media source is reporting
- this._msDuration = mediaSource.duration;
- }
- var duration = media.duration;
- // levelDuration was the last value we set.
- // not using mediaSource.duration as the browser may tweak this value
- // only update mediasource duration if its value increase, this is to avoid
- // flushing already buffered portion when switching between quality level
- if (levelDuration > this._msDuration && levelDuration > duration || duration === Infinity || isNaN(duration)) {
- _logger.logger.log('Updating mediasource duration to ' + levelDuration.toFixed(3));
- this._msDuration = mediaSource.duration = levelDuration;
- }
- }
- }, {
- key: 'doFlush',
- value: function doFlush() {
- // loop through all buffer ranges to flush
- while (this.flushRange.length) {
- var range = this.flushRange[0];
- // flushBuffer will abort any buffer append in progress and flush Audio/Video Buffer
- if (this.flushBuffer(range.start, range.end, range.type)) {
- // range flushed, remove from flush array
- this.flushRange.shift();
- this.flushBufferCounter = 0;
- } else {
- this._needsFlush = true;
- // avoid looping, wait for SB update end to retrigger a flush
- return;
- }
- }
- if (this.flushRange.length === 0) {
- // everything flushed
- this._needsFlush = false;
+ TSDemuxer.prototype.resetInitSegment = function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {
+ this.pmtParsed = false;
+ this._pmtId = -1;
- // let's recompute this.appended, which is used to avoid flush looping
- var appended = 0;
- var sourceBuffer = this.sourceBuffer;
- try {
- for (var type in sourceBuffer) {
- appended += sourceBuffer[type].buffered.length;
+ this._avcTrack = TSDemuxer.createTrack('video', duration);
+ this._audioTrack = TSDemuxer.createTrack('audio', duration);
+ this._id3Track = TSDemuxer.createTrack('id3', duration);
+ this._txtTrack = TSDemuxer.createTrack('text', duration);
+
+ // flush any partial content
+ this.aacOverFlow = null;
+ this.aacLastPTS = null;
+ this.avcSample = null;
+ this.audioCodec = audioCodec;
+ this.videoCodec = videoCodec;
+ this._duration = duration;
+ };
+
+ /**
+ *
+ * @override
+ */
+
+
+ TSDemuxer.prototype.resetTimeStamp = function resetTimeStamp() {};
+
+ // feed incoming data to the front of the parsing pipeline
+
+
+ TSDemuxer.prototype.append = function append(data, timeOffset, contiguous, accurateTimeOffset) {
+ var start,
+ len = data.length,
+ stt,
+ pid,
+ atf,
+ offset,
+ pes,
+ unknownPIDs = false;
+ this.contiguous = contiguous;
+ var pmtParsed = this.pmtParsed,
+ avcTrack = this._avcTrack,
+ audioTrack = this._audioTrack,
+ id3Track = this._id3Track,
+ avcId = avcTrack.pid,
+ audioId = audioTrack.pid,
+ id3Id = id3Track.pid,
+ pmtId = this._pmtId,
+ avcData = avcTrack.pesData,
+ audioData = audioTrack.pesData,
+ id3Data = id3Track.pesData,
+ parsePAT = this._parsePAT,
+ parsePMT = this._parsePMT,
+ parsePES = this._parsePES,
+ parseAVCPES = this._parseAVCPES.bind(this),
+ parseAACPES = this._parseAACPES.bind(this),
+ parseMPEGPES = this._parseMPEGPES.bind(this),
+ parseID3PES = this._parseID3PES.bind(this);
+
+ var syncOffset = TSDemuxer._syncOffset(data);
+
+ // don't parse last TS packet if incomplete
+ len -= (len + syncOffset) % 188;
+
+ // loop through TS packets
+ for (start = syncOffset; start < len; start += 188) {
+ if (data[start] === 0x47) {
+ stt = !!(data[start + 1] & 0x40);
+ // pid is a 13-bit field starting at the last bit of TS[1]
+ pid = ((data[start + 1] & 0x1f) << 8) + data[start + 2];
+ atf = (data[start + 3] & 0x30) >> 4;
+ // if an adaption field is present, its length is specified by the fifth byte of the TS packet header.
+ if (atf > 1) {
+ offset = start + 5 + data[start + 4];
+ // continue if there is only adaptation field
+ if (offset === start + 188) {
+ continue;
}
- } catch (error) {
- // error could be thrown while accessing buffered, in case sourcebuffer has already been removed from MediaSource
- // this is harmess at this stage, catch this to avoid reporting an internal exception
- _logger.logger.error('error while accessing sourceBuffer.buffered');
- }
- this.appended = appended;
- this.hls.trigger(_events2.default.BUFFER_FLUSHED);
- }
- }
- }, {
- key: 'doAppending',
- value: function doAppending() {
- var hls = this.hls,
- sourceBuffer = this.sourceBuffer,
- segments = this.segments;
- if (Object.keys(sourceBuffer).length) {
- if (this.media.error) {
- this.segments = [];
- _logger.logger.error('trying to append although a media error occured, flush segment and abort');
- return;
- }
- if (this.appending) {
- //logger.log(`sb appending in progress`);
- return;
+ } else {
+ offset = start + 4;
}
- if (segments && segments.length) {
- var segment = segments.shift();
- try {
- var type = segment.type,
- sb = sourceBuffer[type];
- if (sb) {
- if (!sb.updating) {
- // reset sourceBuffer ended flag before appending segment
- sb.ended = false;
- //logger.log(`appending ${segment.content} ${type} SB, size:${segment.data.length}, ${segment.parent}`);
- this.parent = segment.parent;
- sb.appendBuffer(segment.data);
- this.appendError = 0;
- this.appended++;
- this.appending = true;
- } else {
- segments.unshift(segment);
+ switch (pid) {
+ case avcId:
+ if (stt) {
+ if (avcData && (pes = parsePES(avcData))) {
+ parseAVCPES(pes, false);
}
- } else {
- // in case we don't have any source buffer matching with this segment type,
- // it means that Mediasource fails to create sourcebuffer
- // discard this segment, and trigger update end
- this.onSBUpdateEnd();
+ avcData = { data: [], size: 0 };
}
- } catch (err) {
- // in case any error occured while appending, put back segment in segments table
- _logger.logger.error('error while trying to append buffer:' + err.message);
- segments.unshift(segment);
- var event = { type: _errors.ErrorTypes.MEDIA_ERROR, parent: segment.parent };
- if (err.code !== 22) {
- if (this.appendError) {
- this.appendError++;
- } else {
- this.appendError = 1;
- }
- event.details = _errors.ErrorDetails.BUFFER_APPEND_ERROR;
- /* with UHD content, we could get loop of quota exceeded error until
- browser is able to evict some data from sourcebuffer. retrying help recovering this
- */
- if (this.appendError > hls.config.appendErrorMaxRetry) {
- _logger.logger.log('fail ' + hls.config.appendErrorMaxRetry + ' times to append segment in sourceBuffer');
- segments = [];
- event.fatal = true;
- hls.trigger(_events2.default.ERROR, event);
- return;
- } else {
- event.fatal = false;
- hls.trigger(_events2.default.ERROR, event);
+ if (avcData) {
+ avcData.data.push(data.subarray(offset, start + 188));
+ avcData.size += start + 188 - offset;
+ }
+ break;
+ case audioId:
+ if (stt) {
+ if (audioData && (pes = parsePES(audioData))) {
+ if (audioTrack.isAAC) {
+ parseAACPES(pes);
+ } else {
+ parseMPEGPES(pes);
+ }
}
- } else {
- // QuotaExceededError: http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror
- // let's stop appending any segments, and report BUFFER_FULL_ERROR error
- this.segments = [];
- event.details = _errors.ErrorDetails.BUFFER_FULL_ERROR;
- event.fatal = false;
- hls.trigger(_events2.default.ERROR, event);
- return;
+ audioData = { data: [], size: 0 };
}
- }
- }
- }
- }
-
- /*
- flush specified buffered range,
- return true once range has been flushed.
- as sourceBuffer.remove() is asynchronous, flushBuffer will be retriggered on sourceBuffer update end
- */
-
- }, {
- key: 'flushBuffer',
- value: function flushBuffer(startOffset, endOffset, typeIn) {
- var sb,
- i,
- bufStart,
- bufEnd,
- flushStart,
- flushEnd,
- sourceBuffer = this.sourceBuffer;
- if (Object.keys(sourceBuffer).length) {
- _logger.logger.log('flushBuffer,pos/start/end: ' + this.media.currentTime.toFixed(3) + '/' + startOffset + '/' + endOffset);
- // safeguard to avoid infinite looping : don't try to flush more than the nb of appended segments
- if (this.flushBufferCounter < this.appended) {
- for (var type in sourceBuffer) {
- // check if sourcebuffer type is defined (typeIn): if yes, let's only flush this one
- // if no, let's flush all sourcebuffers
- if (typeIn && type !== typeIn) {
- continue;
+ if (audioData) {
+ audioData.data.push(data.subarray(offset, start + 188));
+ audioData.size += start + 188 - offset;
}
- sb = sourceBuffer[type];
- // we are going to flush buffer, mark source buffer as 'not ended'
- sb.ended = false;
- if (!sb.updating) {
- try {
- for (i = 0; i < sb.buffered.length; i++) {
- bufStart = sb.buffered.start(i);
- bufEnd = sb.buffered.end(i);
- // workaround firefox not able to properly flush multiple buffered range.
- if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1 && endOffset === Number.POSITIVE_INFINITY) {
- flushStart = startOffset;
- flushEnd = endOffset;
- } else {
- flushStart = Math.max(bufStart, startOffset);
- flushEnd = Math.min(bufEnd, endOffset);
- }
- /* sometimes sourcebuffer.remove() does not flush
- the exact expected time range.
- to avoid rounding issues/infinite loop,
- only flush buffer range of length greater than 500ms.
- */
- if (Math.min(flushEnd, bufEnd) - flushStart > 0.5) {
- this.flushBufferCounter++;
- _logger.logger.log('flush ' + type + ' [' + flushStart + ',' + flushEnd + '], of [' + bufStart + ',' + bufEnd + '], pos:' + this.media.currentTime);
- sb.remove(flushStart, flushEnd);
- return false;
- }
- }
- } catch (e) {
- _logger.logger.warn('exception while accessing sourcebuffer, it might have been removed from MediaSource');
+ break;
+ case id3Id:
+ if (stt) {
+ if (id3Data && (pes = parsePES(id3Data))) {
+ parseID3PES(pes);
}
- } else {
- //logger.log('abort ' + type + ' append in progress');
- // this will abort any appending in progress
- //sb.abort();
- _logger.logger.warn('cannot flush, sb updating in progress');
- return false;
+ id3Data = { data: [], size: 0 };
}
- }
- } else {
- _logger.logger.warn('abort flushing too many retries');
+ if (id3Data) {
+ id3Data.data.push(data.subarray(offset, start + 188));
+ id3Data.size += start + 188 - offset;
+ }
+ break;
+ case 0:
+ if (stt) {
+ offset += data[offset] + 1;
+ }
+ pmtId = this._pmtId = parsePAT(data, offset);
+ break;
+ case pmtId:
+ if (stt) {
+ offset += data[offset] + 1;
+ }
+ var parsedPIDs = parsePMT(data, offset, this.typeSupported.mpeg === true || this.typeSupported.mp3 === true, this.sampleAes != null);
+
+ // only update track id if track PID found while parsing PMT
+ // this is to avoid resetting the PID to -1 in case
+ // track PID transiently disappears from the stream
+ // this could happen in case of transient missing audio samples for example
+ // NOTE this is only the PID of the track as found in TS,
+ // but we are not using this for MP4 track IDs.
+ avcId = parsedPIDs.avc;
+ if (avcId > 0) {
+ avcTrack.pid = avcId;
+ }
+ audioId = parsedPIDs.audio;
+ if (audioId > 0) {
+ audioTrack.pid = audioId;
+ audioTrack.isAAC = parsedPIDs.isAAC;
+ }
+ id3Id = parsedPIDs.id3;
+ if (id3Id > 0) {
+ id3Track.pid = id3Id;
+ }
+ if (unknownPIDs && !pmtParsed) {
+ logger["b" /* logger */].log('reparse from beginning');
+ unknownPIDs = false;
+ // we set it to -188, the += 188 in the for loop will reset start to 0
+ start = syncOffset - 188;
+ }
+ pmtParsed = this.pmtParsed = true;
+ break;
+ case 17:
+ case 0x1fff:
+ break;
+ default:
+ unknownPIDs = true;
+ break;
}
- _logger.logger.log('buffer flushed');
+ } else {
+ this.observer.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].FRAG_PARSING_ERROR, fatal: false, reason: 'TS packet did not start with 0x47' });
}
- // everything flushed !
- return true;
}
- }]);
-
- return BufferController;
-}(_eventHandler2.default);
-
-exports.default = BufferController;
-
-},{"33":33,"34":34,"35":35,"53":53}],9:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+ // try to parse last PES packets
+ if (avcData && (pes = parsePES(avcData))) {
+ parseAVCPES(pes, true);
+ avcTrack.pesData = null;
+ } else {
+ // either avcData null or PES truncated, keep it for next frag parsing
+ avcTrack.pesData = avcData;
+ }
-var _events = _dereq_(35);
+ if (audioData && (pes = parsePES(audioData))) {
+ if (audioTrack.isAAC) {
+ parseAACPES(pes);
+ } else {
+ parseMPEGPES(pes);
+ }
+ audioTrack.pesData = null;
+ } else {
+ if (audioData && audioData.size) {
+ logger["b" /* logger */].log('last AAC PES packet truncated,might overlap between fragments');
+ }
+ // either audioData null or PES truncated, keep it for next frag parsing
+ audioTrack.pesData = audioData;
+ }
-var _events2 = _interopRequireDefault(_events);
+ if (id3Data && (pes = parsePES(id3Data))) {
+ parseID3PES(pes);
+ id3Track.pesData = null;
+ } else {
+ // either id3Data null or PES truncated, keep it for next frag parsing
+ id3Track.pesData = id3Data;
+ }
-var _eventHandler = _dereq_(34);
+ if (this.sampleAes == null) {
+ this.remuxer.remux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);
+ } else {
+ this.decryptAndRemux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);
+ }
+ };
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
+ TSDemuxer.prototype.decryptAndRemux = function decryptAndRemux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {
+ if (audioTrack.samples && audioTrack.isAAC) {
+ var localthis = this;
+ this.sampleAes.decryptAacSamples(audioTrack.samples, 0, function () {
+ localthis.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);
+ });
+ } else {
+ this.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);
+ }
+ };
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ TSDemuxer.prototype.decryptAndRemuxAvc = function decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {
+ if (videoTrack.samples) {
+ var localthis = this;
+ this.sampleAes.decryptAvcSamples(videoTrack.samples, 0, 0, function () {
+ localthis.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);
+ });
+ } else {
+ this.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);
+ }
+ };
+
+ TSDemuxer.prototype.destroy = function destroy() {
+ this._initPTS = this._initDTS = undefined;
+ this._duration = 0;
+ };
+
+ TSDemuxer.prototype._parsePAT = function _parsePAT(data, offset) {
+ // skip the PSI header and parse the first PMT entry
+ return (data[offset + 10] & 0x1F) << 8 | data[offset + 11];
+ //logger.log('PMT PID:' + this._pmtId);
+ };
+
+ TSDemuxer.prototype._parsePMT = function _parsePMT(data, offset, mpegSupported, isSampleAes) {
+ var sectionLength,
+ tableEnd,
+ programInfoLength,
+ pid,
+ result = { audio: -1, avc: -1, id3: -1, isAAC: true };
+ sectionLength = (data[offset + 1] & 0x0f) << 8 | data[offset + 2];
+ tableEnd = offset + 3 + sectionLength - 4;
+ // to determine where the table is, we have to figure out how
+ // long the program info descriptors are
+ programInfoLength = (data[offset + 10] & 0x0f) << 8 | data[offset + 11];
+ // advance the offset to the first entry in the mapping table
+ offset += 12 + programInfoLength;
+ while (offset < tableEnd) {
+ pid = (data[offset + 1] & 0x1F) << 8 | data[offset + 2];
+ switch (data[offset]) {
+ case 0xcf:
+ // SAMPLE-AES AAC
+ if (!isSampleAes) {
+ logger["b" /* logger */].log('unkown stream type:' + data[offset]);
+ break;
+ }
+ /* falls through */
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ // ISO/IEC 13818-7 ADTS AAC (MPEG-2 lower bit-rate audio)
+ case 0x0f:
+ //logger.log('AAC PID:' + pid);
+ if (result.audio === -1) {
+ result.audio = pid;
+ }
+ break;
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+ // Packetized metadata (ID3)
+ case 0x15:
+ //logger.log('ID3 PID:' + pid);
+ if (result.id3 === -1) {
+ result.id3 = pid;
+ }
+ break;
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * cap stream level to media size dimension controller
- */
+ case 0xdb:
+ // SAMPLE-AES AVC
+ if (!isSampleAes) {
+ logger["b" /* logger */].log('unkown stream type:' + data[offset]);
+ break;
+ }
+ /* falls through */
-var CapLevelController = function (_EventHandler) {
- _inherits(CapLevelController, _EventHandler);
+ // ITU-T Rec. H.264 and ISO/IEC 14496-10 (lower bit-rate video)
+ case 0x1b:
+ //logger.log('AVC PID:' + pid);
+ if (result.avc === -1) {
+ result.avc = pid;
+ }
+ break;
- function CapLevelController(hls) {
- _classCallCheck(this, CapLevelController);
+ // ISO/IEC 11172-3 (MPEG-1 audio)
+ // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)
+ case 0x03:
+ case 0x04:
+ //logger.log('MPEG PID:' + pid);
+ if (!mpegSupported) {
+ logger["b" /* logger */].log('MPEG audio found, not supported in this browser for now');
+ } else if (result.audio === -1) {
+ result.audio = pid;
+ result.isAAC = false;
+ }
+ break;
- return _possibleConstructorReturn(this, (CapLevelController.__proto__ || Object.getPrototypeOf(CapLevelController)).call(this, hls, _events2.default.FPS_DROP_LEVEL_CAPPING, _events2.default.MEDIA_ATTACHING, _events2.default.MANIFEST_PARSED));
- }
+ case 0x24:
+ logger["b" /* logger */].warn('HEVC stream type found, not supported for now');
+ break;
- _createClass(CapLevelController, [{
- key: 'destroy',
- value: function destroy() {
- if (this.hls.config.capLevelToPlayerSize) {
- this.media = this.restrictedLevels = null;
- this.autoLevelCapping = Number.POSITIVE_INFINITY;
- if (this.timer) {
- this.timer = clearInterval(this.timer);
- }
- }
- }
- }, {
- key: 'onFpsDropLevelCapping',
- value: function onFpsDropLevelCapping(data) {
- if (!this.restrictedLevels) {
- this.restrictedLevels = [];
- }
- if (!this.isLevelRestricted(data.droppedLevel)) {
- this.restrictedLevels.push(data.droppedLevel);
+ default:
+ logger["b" /* logger */].log('unkown stream type:' + data[offset]);
+ break;
}
+ // move to the next table entry
+ // skip past the elementary stream descriptors, if present
+ offset += ((data[offset + 3] & 0x0F) << 8 | data[offset + 4]) + 5;
}
- }, {
- key: 'onMediaAttaching',
- value: function onMediaAttaching(data) {
- this.media = data.media instanceof HTMLVideoElement ? data.media : null;
+ return result;
+ };
+
+ TSDemuxer.prototype._parsePES = function _parsePES(stream) {
+ var i = 0,
+ frag,
+ pesFlags,
+ pesPrefix,
+ pesLen,
+ pesHdrLen,
+ pesData,
+ pesPts,
+ pesDts,
+ payloadStartOffset,
+ data = stream.data;
+ // safety check
+ if (!stream || stream.size === 0) {
+ return null;
}
- }, {
- key: 'onManifestParsed',
- value: function onManifestParsed(data) {
- var hls = this.hls;
- if (hls.config.capLevelToPlayerSize) {
- this.autoLevelCapping = Number.POSITIVE_INFINITY;
- this.levels = data.levels;
- hls.firstLevel = this.getMaxLevel(data.firstLevel);
- clearInterval(this.timer);
- this.timer = setInterval(this.detectPlayerSize.bind(this), 1000);
- this.detectPlayerSize();
+
+ // we might need up to 19 bytes to read PES header
+ // if first chunk of data is less than 19 bytes, let's merge it with following ones until we get 19 bytes
+ // usually only one merge is needed (and this is rare ...)
+ while (data[0].length < 19 && data.length > 1) {
+ var newData = new Uint8Array(data[0].length + data[1].length);
+ newData.set(data[0]);
+ newData.set(data[1], data[0].length);
+ data[0] = newData;
+ data.splice(1, 1);
+ }
+ //retrieve PTS/DTS from first fragment
+ frag = data[0];
+ pesPrefix = (frag[0] << 16) + (frag[1] << 8) + frag[2];
+ if (pesPrefix === 1) {
+ pesLen = (frag[4] << 8) + frag[5];
+ // if PES parsed length is not zero and greater than total received length, stop parsing. PES might be truncated
+ // minus 6 : PES header size
+ if (pesLen && pesLen > stream.size - 6) {
+ return null;
}
- }
- }, {
- key: 'detectPlayerSize',
- value: function detectPlayerSize() {
- if (this.media) {
- var levelsLength = this.levels ? this.levels.length : 0;
- if (levelsLength) {
- var hls = this.hls;
- hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);
- if (hls.autoLevelCapping > this.autoLevelCapping) {
- // if auto level capping has a higher value for the previous one, flush the buffer using nextLevelSwitch
- // usually happen when the user go to the fullscreen mode.
- hls.streamController.nextLevelSwitch();
+ pesFlags = frag[7];
+ if (pesFlags & 0xC0) {
+ /* PES header described here : http://dvd.sourceforge.net/dvdinfo/pes-hdr.html
+ as PTS / DTS is 33 bit we cannot use bitwise operator in JS,
+ as Bitwise operators treat their operands as a sequence of 32 bits */
+ pesPts = (frag[9] & 0x0E) * 536870912 + // 1 << 29
+ (frag[10] & 0xFF) * 4194304 + // 1 << 22
+ (frag[11] & 0xFE) * 16384 + // 1 << 14
+ (frag[12] & 0xFF) * 128 + // 1 << 7
+ (frag[13] & 0xFE) / 2;
+ // check if greater than 2^32 -1
+ if (pesPts > 4294967295) {
+ // decrement 2^33
+ pesPts -= 8589934592;
+ }
+ if (pesFlags & 0x40) {
+ pesDts = (frag[14] & 0x0E) * 536870912 + // 1 << 29
+ (frag[15] & 0xFF) * 4194304 + // 1 << 22
+ (frag[16] & 0xFE) * 16384 + // 1 << 14
+ (frag[17] & 0xFF) * 128 + // 1 << 7
+ (frag[18] & 0xFE) / 2;
+ // check if greater than 2^32 -1
+ if (pesDts > 4294967295) {
+ // decrement 2^33
+ pesDts -= 8589934592;
+ }
+ if (pesPts - pesDts > 60 * 90000) {
+ logger["b" /* logger */].warn(Math.round((pesPts - pesDts) / 90000) + 's delta between PTS and DTS, align them');
+ pesPts = pesDts;
+ }
+ } else {
+ pesDts = pesPts;
+ }
+ }
+ pesHdrLen = frag[8];
+ // 9 bytes : 6 bytes for PES header + 3 bytes for PES extension
+ payloadStartOffset = pesHdrLen + 9;
+
+ stream.size -= payloadStartOffset;
+ //reassemble PES packet
+ pesData = new Uint8Array(stream.size);
+ for (var j = 0, dataLen = data.length; j < dataLen; j++) {
+ frag = data[j];
+ var len = frag.byteLength;
+ if (payloadStartOffset) {
+ if (payloadStartOffset > len) {
+ // trim full frag if PES header bigger than frag
+ payloadStartOffset -= len;
+ continue;
+ } else {
+ // trim partial frag if PES header smaller than frag
+ frag = frag.subarray(payloadStartOffset);
+ len -= payloadStartOffset;
+ payloadStartOffset = 0;
}
- this.autoLevelCapping = hls.autoLevelCapping;
}
+ pesData.set(frag, i);
+ i += len;
}
- }
-
- /*
- * returns level should be the one with the dimensions equal or greater than the media (player) dimensions (so the video will be downscaled)
- */
-
- }, {
- key: 'getMaxLevel',
- value: function getMaxLevel(capLevelIndex) {
- var result = 0,
- i = void 0,
- level = void 0,
- mWidth = this.mediaWidth,
- mHeight = this.mediaHeight,
- lWidth = 0,
- lHeight = 0;
-
- for (i = 0; i <= capLevelIndex; i++) {
- level = this.levels[i];
- if (this.isLevelRestricted(i)) {
- break;
- }
- result = i;
- lWidth = level.width;
- lHeight = level.height;
- if (mWidth <= lWidth || mHeight <= lHeight) {
- break;
- }
+ if (pesLen) {
+ // payload size : remove PES header + PES extension
+ pesLen -= pesHdrLen + 3;
}
- return result;
- }
- }, {
- key: 'isLevelRestricted',
- value: function isLevelRestricted(level) {
- return this.restrictedLevels && this.restrictedLevels.indexOf(level) !== -1 ? true : false;
- }
- }, {
- key: 'contentScaleFactor',
- get: function get() {
- var pixelRatio = 1;
- try {
- pixelRatio = window.devicePixelRatio;
- } catch (e) {}
- return pixelRatio;
+ return { data: pesData, pts: pesPts, dts: pesDts, len: pesLen };
+ } else {
+ return null;
}
- }, {
- key: 'mediaWidth',
- get: function get() {
- var width = void 0;
- var media = this.media;
- if (media) {
- width = media.width || media.clientWidth || media.offsetWidth;
- width *= this.contentScaleFactor;
+ };
+
+ TSDemuxer.prototype.pushAccesUnit = function pushAccesUnit(avcSample, avcTrack) {
+ if (avcSample.units.length && avcSample.frame) {
+ var samples = avcTrack.samples;
+ var nbSamples = samples.length;
+ // only push AVC sample if starting with a keyframe is not mandatory OR
+ // if keyframe already found in this fragment OR
+ // keyframe found in last fragment (track.sps) AND
+ // samples already appended (we already found a keyframe in this fragment) OR fragment is contiguous
+ if (!this.config.forceKeyFrameOnDiscontinuity || avcSample.key === true || avcTrack.sps && (nbSamples || this.contiguous)) {
+ avcSample.id = nbSamples;
+ samples.push(avcSample);
+ } else {
+ // dropped samples, track it
+ avcTrack.dropped++;
}
- return width;
}
- }, {
- key: 'mediaHeight',
- get: function get() {
- var height = void 0;
- var media = this.media;
- if (media) {
- height = media.height || media.clientHeight || media.offsetHeight;
- height *= this.contentScaleFactor;
- }
- return height;
+ if (avcSample.debug.length) {
+ logger["b" /* logger */].log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug);
}
- }]);
+ };
- return CapLevelController;
-}(_eventHandler2.default);
+ TSDemuxer.prototype._parseAVCPES = function _parseAVCPES(pes, last) {
+ var _this = this;
-exports.default = CapLevelController;
+ //logger.log('parse new PES');
+ var track = this._avcTrack,
+ units = this._parseAVCNALu(pes.data),
+ debug = false,
+ expGolombDecoder,
+ avcSample = this.avcSample,
+ push,
+ spsfound = false,
+ i,
+ pushAccesUnit = this.pushAccesUnit.bind(this),
+ createAVCSample = function createAVCSample(key, pts, dts, debug) {
+ return { key: key, pts: pts, dts: dts, units: [], debug: debug };
+ };
+ //free pes.data to save up some memory
+ pes.data = null;
-},{"34":34,"35":35}],10:[function(_dereq_,module,exports){
-'use strict';
+ // if new NAL units found and last sample still there, let's push ...
+ // this helps parsing streams with missing AUD (only do this if AUD never found)
+ if (avcSample && units.length && !track.audFound) {
+ pushAccesUnit(avcSample, track);
+ avcSample = this.avcSample = createAVCSample(false, pes.pts, pes.dts, '');
+ }
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ units.forEach(function (unit) {
+ switch (unit.type) {
+ //NDR
+ case 1:
+ push = true;
+ if (!avcSample) {
+ avcSample = _this.avcSample = createAVCSample(true, pes.pts, pes.dts, '');
+ }
+ if (debug) {
+ avcSample.debug += 'NDR ';
+ }
+ avcSample.frame = true;
+ var data = unit.data;
+ // only check slice type to detect KF in case SPS found in same packet (any keyframe is preceded by SPS ...)
+ if (spsfound && data.length > 4) {
+ // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR
+ var sliceType = new exp_golomb(data).readSliceType();
+ // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice
+ // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.
+ // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.
+ // I slice: A slice that is not an SI slice that is decoded using intra prediction only.
+ //if (sliceType === 2 || sliceType === 7) {
+ if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {
+ avcSample.key = true;
+ }
+ }
+ break;
+ //IDR
+ case 5:
+ push = true;
+ // handle PES not starting with AUD
+ if (!avcSample) {
+ avcSample = _this.avcSample = createAVCSample(true, pes.pts, pes.dts, '');
+ }
+ if (debug) {
+ avcSample.debug += 'IDR ';
+ }
+ avcSample.key = true;
+ avcSample.frame = true;
+ break;
+ //SEI
+ case 6:
+ push = true;
+ if (debug && avcSample) {
+ avcSample.debug += 'SEI ';
+ }
+ expGolombDecoder = new exp_golomb(_this.discardEPB(unit.data));
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+ // skip frameType
+ expGolombDecoder.readUByte();
-var _events = _dereq_(35);
+ var payloadType = 0;
+ var payloadSize = 0;
+ var endOfCaptions = false;
+ var b = 0;
-var _events2 = _interopRequireDefault(_events);
+ while (!endOfCaptions && expGolombDecoder.bytesAvailable > 1) {
+ payloadType = 0;
+ do {
+ b = expGolombDecoder.readUByte();
+ payloadType += b;
+ } while (b === 0xFF);
-var _eventHandler = _dereq_(34);
+ // Parse payload size.
+ payloadSize = 0;
+ do {
+ b = expGolombDecoder.readUByte();
+ payloadSize += b;
+ } while (b === 0xFF);
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
+ // TODO: there can be more than one payload in an SEI packet...
+ // TODO: need to read type and size in a while loop to get them all
+ if (payloadType === 4 && expGolombDecoder.bytesAvailable !== 0) {
-var _logger = _dereq_(53);
+ endOfCaptions = true;
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ var countryCode = expGolombDecoder.readUByte();
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ if (countryCode === 181) {
+ var providerCode = expGolombDecoder.readUShort();
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+ if (providerCode === 49) {
+ var userStructure = expGolombDecoder.readUInt();
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * FPS Controller
- */
+ if (userStructure === 0x47413934) {
+ var userDataType = expGolombDecoder.readUByte();
-var FPSController = function (_EventHandler) {
- _inherits(FPSController, _EventHandler);
+ // Raw CEA-608 bytes wrapped in CEA-708 packet
+ if (userDataType === 3) {
+ var firstByte = expGolombDecoder.readUByte();
+ var secondByte = expGolombDecoder.readUByte();
- function FPSController(hls) {
- _classCallCheck(this, FPSController);
+ var totalCCs = 31 & firstByte;
+ var byteArray = [firstByte, secondByte];
- return _possibleConstructorReturn(this, (FPSController.__proto__ || Object.getPrototypeOf(FPSController)).call(this, hls, _events2.default.MEDIA_ATTACHING));
- }
+ for (i = 0; i < totalCCs; i++) {
+ // 3 bytes per CC
+ byteArray.push(expGolombDecoder.readUByte());
+ byteArray.push(expGolombDecoder.readUByte());
+ byteArray.push(expGolombDecoder.readUByte());
+ }
- _createClass(FPSController, [{
- key: 'destroy',
- value: function destroy() {
- if (this.timer) {
- clearInterval(this.timer);
+ _this._insertSampleInOrder(_this._txtTrack.samples, { type: 3, pts: pes.pts, bytes: byteArray });
+ }
+ }
+ }
+ }
+ } else if (payloadSize < expGolombDecoder.bytesAvailable) {
+ for (i = 0; i < payloadSize; i++) {
+ expGolombDecoder.readUByte();
+ }
+ }
+ }
+ break;
+ //SPS
+ case 7:
+ push = true;
+ spsfound = true;
+ if (debug && avcSample) {
+ avcSample.debug += 'SPS ';
+ }
+ if (!track.sps) {
+ expGolombDecoder = new exp_golomb(unit.data);
+ var config = expGolombDecoder.readSPS();
+ track.width = config.width;
+ track.height = config.height;
+ track.pixelRatio = config.pixelRatio;
+ track.sps = [unit.data];
+ track.duration = _this._duration;
+ var codecarray = unit.data.subarray(1, 4);
+ var codecstring = 'avc1.';
+ for (i = 0; i < 3; i++) {
+ var h = codecarray[i].toString(16);
+ if (h.length < 2) {
+ h = '0' + h;
+ }
+ codecstring += h;
+ }
+ track.codec = codecstring;
+ }
+ break;
+ //PPS
+ case 8:
+ push = true;
+ if (debug && avcSample) {
+ avcSample.debug += 'PPS ';
+ }
+ if (!track.pps) {
+ track.pps = [unit.data];
+ }
+ break;
+ // AUD
+ case 9:
+ push = false;
+ track.audFound = true;
+ if (avcSample) {
+ pushAccesUnit(avcSample, track);
+ }
+ avcSample = _this.avcSample = createAVCSample(false, pes.pts, pes.dts, debug ? 'AUD ' : '');
+ break;
+ // Filler Data
+ case 12:
+ push = false;
+ break;
+ default:
+ push = false;
+ if (avcSample) {
+ avcSample.debug += 'unknown NAL ' + unit.type + ' ';
+ }
+ break;
+ }
+ if (avcSample && push) {
+ var _units = avcSample.units;
+ _units.push(unit);
}
- this.isVideoPlaybackQualityAvailable = false;
+ });
+ // if last PES packet, push samples
+ if (last && avcSample) {
+ pushAccesUnit(avcSample, track);
+ this.avcSample = null;
}
- }, {
- key: 'onMediaAttaching',
- value: function onMediaAttaching(data) {
- var config = this.hls.config;
- if (config.capLevelOnFPSDrop) {
- var video = this.video = data.media instanceof HTMLVideoElement ? data.media : null;
- if (typeof video.getVideoPlaybackQuality === 'function') {
- this.isVideoPlaybackQualityAvailable = true;
+ };
+
+ TSDemuxer.prototype._insertSampleInOrder = function _insertSampleInOrder(arr, data) {
+ var len = arr.length;
+ if (len > 0) {
+ if (data.pts >= arr[len - 1].pts) {
+ arr.push(data);
+ } else {
+ for (var pos = len - 1; pos >= 0; pos--) {
+ if (data.pts < arr[pos].pts) {
+ arr.splice(pos, 0, data);
+ break;
+ }
}
- clearInterval(this.timer);
- this.timer = setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);
}
+ } else {
+ arr.push(data);
}
- }, {
- key: 'checkFPS',
- value: function checkFPS(video, decodedFrames, droppedFrames) {
- var currentTime = performance.now();
- if (decodedFrames) {
- if (this.lastTime) {
- var currentPeriod = currentTime - this.lastTime,
- currentDropped = droppedFrames - this.lastDroppedFrames,
- currentDecoded = decodedFrames - this.lastDecodedFrames,
- droppedFPS = 1000 * currentDropped / currentPeriod,
- hls = this.hls;
- hls.trigger(_events2.default.FPS_DROP, { currentDropped: currentDropped, currentDecoded: currentDecoded, totalDroppedFrames: droppedFrames });
- if (droppedFPS > 0) {
- //logger.log('checkFPS : droppedFPS/decodedFPS:' + droppedFPS/(1000 * currentDecoded / currentPeriod));
- if (currentDropped > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {
- var currentLevel = hls.currentLevel;
- _logger.logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);
- if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {
- currentLevel = currentLevel - 1;
- hls.trigger(_events2.default.FPS_DROP_LEVEL_CAPPING, { level: currentLevel, droppedLevel: hls.currentLevel });
- hls.autoLevelCapping = currentLevel;
- hls.streamController.nextLevelSwitch();
+ };
+
+ TSDemuxer.prototype._getLastNalUnit = function _getLastNalUnit() {
+ var avcSample = this.avcSample,
+ lastUnit = void 0;
+ // try to fallback to previous sample if current one is empty
+ if (!avcSample || avcSample.units.length === 0) {
+ var track = this._avcTrack,
+ samples = track.samples;
+ avcSample = samples[samples.length - 1];
+ }
+ if (avcSample) {
+ var units = avcSample.units;
+ lastUnit = units[units.length - 1];
+ }
+ return lastUnit;
+ };
+
+ TSDemuxer.prototype._parseAVCNALu = function _parseAVCNALu(array) {
+ var i = 0,
+ len = array.byteLength,
+ value,
+ overflow,
+ track = this._avcTrack,
+ state = track.naluState || 0,
+ lastState = state;
+ var units = [],
+ unit,
+ unitType,
+ lastUnitStart = -1,
+ lastUnitType;
+ //logger.log('PES:' + Hex.hexDump(array));
+
+ if (state === -1) {
+ // special use case where we found 3 or 4-byte start codes exactly at the end of previous PES packet
+ lastUnitStart = 0;
+ // NALu type is value read from offset 0
+ lastUnitType = array[0] & 0x1f;
+ state = 0;
+ i = 1;
+ }
+
+ while (i < len) {
+ value = array[i++];
+ // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case
+ if (!state) {
+ state = value ? 0 : 1;
+ continue;
+ }
+ if (state === 1) {
+ state = value ? 0 : 2;
+ continue;
+ }
+ // here we have state either equal to 2 or 3
+ if (!value) {
+ state = 3;
+ } else if (value === 1) {
+ if (lastUnitStart >= 0) {
+ unit = { data: array.subarray(lastUnitStart, i - state - 1), type: lastUnitType };
+ //logger.log('pushing NALU, type/size:' + unit.type + '/' + unit.data.byteLength);
+ units.push(unit);
+ } else {
+ // lastUnitStart is undefined => this is the first start code found in this PES packet
+ // first check if start code delimiter is overlapping between 2 PES packets,
+ // ie it started in last packet (lastState not zero)
+ // and ended at the beginning of this PES packet (i <= 4 - lastState)
+ var lastUnit = this._getLastNalUnit();
+ if (lastUnit) {
+ if (lastState && i <= 4 - lastState) {
+ // start delimiter overlapping between PES packets
+ // strip start delimiter bytes from the end of last NAL unit
+ // check if lastUnit had a state different from zero
+ if (lastUnit.state) {
+ // strip last bytes
+ lastUnit.data = lastUnit.data.subarray(0, lastUnit.data.byteLength - lastState);
}
}
+ // If NAL units are not starting right at the beginning of the PES packet, push preceding data into previous NAL unit.
+ overflow = i - state - 1;
+ if (overflow > 0) {
+ //logger.log('first NALU found with overflow:' + overflow);
+ var tmp = new Uint8Array(lastUnit.data.byteLength + overflow);
+ tmp.set(lastUnit.data, 0);
+ tmp.set(array.subarray(0, overflow), lastUnit.data.byteLength);
+ lastUnit.data = tmp;
+ }
}
}
- this.lastTime = currentTime;
- this.lastDroppedFrames = droppedFrames;
- this.lastDecodedFrames = decodedFrames;
- }
- }
- }, {
- key: 'checkFPSInterval',
- value: function checkFPSInterval() {
- var video = this.video;
- if (video) {
- if (this.isVideoPlaybackQualityAvailable) {
- var videoPlaybackQuality = video.getVideoPlaybackQuality();
- this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);
+ // check if we can read unit type
+ if (i < len) {
+ unitType = array[i] & 0x1f;
+ //logger.log('find NALU @ offset:' + i + ',type:' + unitType);
+ lastUnitStart = i;
+ lastUnitType = unitType;
+ state = 0;
} else {
- this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);
+ // not enough byte to read unit type. let's read it on next PES parsing
+ state = -1;
}
+ } else {
+ state = 0;
}
}
- }]);
-
- return FPSController;
-}(_eventHandler2.default);
-
-exports.default = FPSController;
-
-},{"34":34,"35":35,"53":53}],11:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _events = _dereq_(35);
-
-var _events2 = _interopRequireDefault(_events);
-
-var _eventHandler = _dereq_(34);
-
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * id3 metadata track controller
- */
+ if (lastUnitStart >= 0 && state >= 0) {
+ unit = { data: array.subarray(lastUnitStart, len), type: lastUnitType, state: state };
+ units.push(unit);
+ //logger.log('pushing NALU, type/size/state:' + unit.type + '/' + unit.data.byteLength + '/' + state);
+ }
+ // no NALu found
+ if (units.length === 0) {
+ // append pes.data to previous NAL unit
+ var _lastUnit = this._getLastNalUnit();
+ if (_lastUnit) {
+ var _tmp = new Uint8Array(_lastUnit.data.byteLength + array.byteLength);
+ _tmp.set(_lastUnit.data, 0);
+ _tmp.set(array, _lastUnit.data.byteLength);
+ _lastUnit.data = _tmp;
+ }
+ }
+ track.naluState = state;
+ return units;
+ };
-var ID3TrackController = function (_EventHandler) {
- _inherits(ID3TrackController, _EventHandler);
+ /**
+ * remove Emulation Prevention bytes from a RBSP
+ */
- function ID3TrackController(hls) {
- _classCallCheck(this, ID3TrackController);
- var _this = _possibleConstructorReturn(this, (ID3TrackController.__proto__ || Object.getPrototypeOf(ID3TrackController)).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.FRAG_PARSING_METADATA));
+ TSDemuxer.prototype.discardEPB = function discardEPB(data) {
+ var length = data.byteLength,
+ EPBPositions = [],
+ i = 1,
+ newLength,
+ newData;
- _this.id3Track = undefined;
- _this.media = undefined;
- return _this;
- }
+ // Find all `Emulation Prevention Bytes`
+ while (i < length - 2) {
+ if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {
+ EPBPositions.push(i + 2);
+ i += 2;
+ } else {
+ i++;
+ }
+ }
- _createClass(ID3TrackController, [{
- key: 'destroy',
- value: function destroy() {
- _eventHandler2.default.prototype.destroy.call(this);
+ // If no Emulation Prevention Bytes were found just return the original
+ // array
+ if (EPBPositions.length === 0) {
+ return data;
}
- // Add ID3 metatadata text track.
+ // Create a new array to hold the NAL unit data
+ newLength = length - EPBPositions.length;
+ newData = new Uint8Array(newLength);
+ var sourceIndex = 0;
- }, {
- key: 'onMediaAttached',
- value: function onMediaAttached(data) {
- this.media = data.media;
- if (!this.media) {
- return;
+ for (i = 0; i < newLength; sourceIndex++, i++) {
+ if (sourceIndex === EPBPositions[0]) {
+ // Skip this byte
+ sourceIndex++;
+ // Remove this position index
+ EPBPositions.shift();
}
-
- this.id3Track = this.media.addTextTrack('metadata', 'id3');
- this.id3Track.mode = 'hidden';
- }
- }, {
- key: 'onMediaDetaching',
- value: function onMediaDetaching() {
- this.media = undefined;
+ newData[i] = data[sourceIndex];
}
- }, {
- key: 'onFragParsingMetadata',
- value: function onFragParsingMetadata(data) {
- var fragment = data.frag;
- var samples = data.samples;
- var startTime = fragment.start;
- var endTime = fragment.start + fragment.duration;
- // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE
- if (startTime === endTime) {
- endTime += 0.0001;
- }
-
- // Attempt to recreate Safari functionality by creating
- // WebKitDataCue objects when available and store the decoded
- // ID3 data in the value property of the cue
- var Cue = window.WebKitDataCue || window.VTTCue || window.TextTrackCue;
+ return newData;
+ };
- for (var i = 0; i < samples.length; i++) {
- var id3Frame = this.parseID3Frame(samples[i].data);
- var frame = this.decodeID3Frame(id3Frame);
- if (frame) {
- var cue = new Cue(startTime, endTime, '');
- cue.value = frame;
- this.id3Track.addCue(cue);
- }
+ TSDemuxer.prototype._parseAACPES = function _parseAACPES(pes) {
+ var track = this._audioTrack,
+ data = pes.data,
+ pts = pes.pts,
+ startOffset = 0,
+ aacOverFlow = this.aacOverFlow,
+ aacLastPTS = this.aacLastPTS,
+ frameDuration,
+ frameIndex,
+ offset,
+ stamp,
+ len;
+ if (aacOverFlow) {
+ var tmp = new Uint8Array(aacOverFlow.byteLength + data.byteLength);
+ tmp.set(aacOverFlow, 0);
+ tmp.set(data, aacOverFlow.byteLength);
+ //logger.log(`AAC: append overflowing ${aacOverFlow.byteLength} bytes to beginning of new PES`);
+ data = tmp;
+ }
+ // look for ADTS header (0xFFFx)
+ for (offset = startOffset, len = data.length; offset < len - 1; offset++) {
+ if (isHeader(data, offset)) {
+ break;
}
}
- }, {
- key: 'parseID3Frame',
- value: function parseID3Frame(data) {
- if (data.length < 21) {
- return undefined;
+ // if ADTS header does not start straight from the beginning of the PES payload, raise an error
+ if (offset) {
+ var reason, fatal;
+ if (offset < len - 1) {
+ reason = 'AAC PES did not start with ADTS header,offset:' + offset;
+ fatal = false;
+ } else {
+ reason = 'no ADTS header found in AAC PES';
+ fatal = true;
}
+ logger["b" /* logger */].warn('parsing error:' + reason);
+ this.observer.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].FRAG_PARSING_ERROR, fatal: fatal, reason: reason });
+ if (fatal) {
+ return;
+ }
+ }
- /* http://id3.org/id3v2.3.0
- [0] = 'I'
- [1] = 'D'
- [2] = '3'
- [3,4] = {Version}
- [5] = {Flags}
- [6-9] = {ID3 Size}
- [10-13] = {Frame ID}
- [14-17] = {Frame Size}
- [18,19] = {Frame Flags}
- */
- if (data[0] === 73 && // I
- data[1] === 68 && // D
- data[2] === 51) {
- // 3
+ initTrackConfig(track, this.observer, data, offset, this.audioCodec);
+ frameIndex = 0;
+ frameDuration = getFrameDuration(track.samplerate);
- var type = String.fromCharCode(data[10], data[11], data[12], data[13]);
- data = data.subarray(20);
- return { type: type, data: data };
+ // if last AAC frame is overflowing, we should ensure timestamps are contiguous:
+ // first sample PTS should be equal to last sample PTS + frameDuration
+ if (aacOverFlow && aacLastPTS) {
+ var newPTS = aacLastPTS + frameDuration;
+ if (Math.abs(newPTS - pts) > 1) {
+ logger["b" /* logger */].log('AAC: align PTS for overlapping frames by ' + Math.round((newPTS - pts) / 90));
+ pts = newPTS;
}
}
- }, {
- key: 'decodeID3Frame',
- value: function decodeID3Frame(frame) {
- if (frame.type === 'TXXX') {
- return this.decodeTxxxFrame(frame);
- } else if (frame.type === 'PRIV') {
- return this.decodePrivFrame(frame);
- } else if (frame.type[0] === 'T') {
- return this.decodeTextFrame(frame);
+
+ //scan for aac samples
+ while (offset < len) {
+ if (isHeader(data, offset) && offset + 5 < len) {
+ var frame = appendFrame(track, data, offset, pts, frameIndex);
+ if (frame) {
+ //logger.log(`${Math.round(frame.sample.pts)} : AAC`);
+ offset += frame.length;
+ stamp = frame.sample.pts;
+ frameIndex++;
+ } else {
+ //logger.log('Unable to parse AAC frame');
+ break;
+ }
} else {
- return undefined;
+ //nothing found, keep looking
+ offset++;
}
}
- }, {
- key: 'decodeTxxxFrame',
- value: function decodeTxxxFrame(frame) {
- /*
- Format:
- [0] = {Text Encoding}
- [1-?] = {Description}\0{Value}
- */
- if (frame.size < 2) {
- return undefined;
- }
+ if (offset < len) {
+ aacOverFlow = data.subarray(offset, len);
+ //logger.log(`AAC: overflow detected:${len-offset}`);
+ } else {
+ aacOverFlow = null;
+ }
+ this.aacOverFlow = aacOverFlow;
+ this.aacLastPTS = stamp;
+ };
- if (frame.data[0] !== 3) {
- //only support UTF-8
- return undefined;
+ TSDemuxer.prototype._parseMPEGPES = function _parseMPEGPES(pes) {
+ var data = pes.data;
+ var length = data.length;
+ var frameIndex = 0;
+ var offset = 0;
+ var pts = pes.pts;
+
+ while (offset < length) {
+ if (mpegaudio.isHeader(data, offset)) {
+ var frame = mpegaudio.appendFrame(this._audioTrack, data, offset, pts, frameIndex);
+ if (frame) {
+ offset += frame.length;
+ frameIndex++;
+ } else {
+ //logger.log('Unable to parse Mpeg audio frame');
+ break;
+ }
+ } else {
+ //nothing found, keep looking
+ offset++;
}
+ }
+ };
- var index = 1;
- var description = this.utf8ArrayToStr(frame.data.subarray(index));
+ TSDemuxer.prototype._parseID3PES = function _parseID3PES(pes) {
+ this._id3Track.samples.push(pes);
+ };
- index += description.length + 1;
- var value = this.utf8ArrayToStr(frame.data.subarray(index));
+ return TSDemuxer;
+}();
- return { key: 'TXXX', description: description, data: value };
- }
- }, {
- key: 'decodeTextFrame',
- value: function decodeTextFrame(frame) {
- /*
- Format:
- [0] = {Text Encoding}
- [1-?] = {Value}
- */
+/* harmony default export */ var tsdemuxer = (tsdemuxer_TSDemuxer);
+// CONCATENATED MODULE: ./src/demux/mp3demuxer.js
+function mp3demuxer__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- if (frame.size < 2) {
- return undefined;
- }
+/**
+ * MP3 demuxer
+ */
- if (frame.data[0] !== 3) {
- //only support UTF-8
- return undefined;
- }
- var data = frame.data.subarray(1);
- return { key: frame.type, data: this.utf8ArrayToStr(data) };
- }
- }, {
- key: 'decodePrivFrame',
- value: function decodePrivFrame(frame) {
- /*
- Format: <text string>\0<binary data>
- */
- if (frame.size < 2) {
- return undefined;
- }
- var owner = this.utf8ArrayToStr(frame.data);
- var privateData = frame.data.subarray(owner.length + 1);
+var mp3demuxer_MP3Demuxer = function () {
+ function MP3Demuxer(observer, remuxer, config) {
+ mp3demuxer__classCallCheck(this, MP3Demuxer);
- return { key: 'PRIV', info: owner, data: privateData.buffer };
- }
+ this.observer = observer;
+ this.config = config;
+ this.remuxer = remuxer;
+ }
- // http://stackoverflow.com/questions/8936984/uint8array-to-string-in-javascript/22373197
- // http://www.onicos.com/staff/iz/amuse/javascript/expert/utf.txt
- /* utf.js - UTF-8 <=> UTF-16 convertion
- *
- * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
- * Version: 1.0
- * LastModified: Dec 25 1999
- * This library is free. You can redistribute it and/or modify it.
- */
+ MP3Demuxer.prototype.resetInitSegment = function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {
+ this._audioTrack = { container: 'audio/mpeg', type: 'audio', id: -1, sequenceNumber: 0, isAAC: false, samples: [], len: 0, manifestCodec: audioCodec, duration: duration, inputTimeScale: 90000 };
+ };
- }, {
- key: 'utf8ArrayToStr',
- value: function utf8ArrayToStr(array) {
-
- var char2 = void 0;
- var char3 = void 0;
- var out = '';
- var i = 0;
- var length = array.length;
-
- while (i < length) {
- var c = array[i++];
- switch (c >> 4) {
- case 0:
- return out;
- case 1:case 2:case 3:case 4:case 5:case 6:case 7:
- // 0xxxxxxx
- out += String.fromCharCode(c);
- break;
- case 12:case 13:
- // 110x xxxx 10xx xxxx
- char2 = array[i++];
- out += String.fromCharCode((c & 0x1F) << 6 | char2 & 0x3F);
- break;
- case 14:
- // 1110 xxxx 10xx xxxx 10xx xxxx
- char2 = array[i++];
- char3 = array[i++];
- out += String.fromCharCode((c & 0x0F) << 12 | (char2 & 0x3F) << 6 | (char3 & 0x3F) << 0);
- break;
+ MP3Demuxer.prototype.resetTimeStamp = function resetTimeStamp() {};
+
+ MP3Demuxer.probe = function probe(data) {
+ // check if data contains ID3 timestamp and MPEG sync word
+ var offset, length;
+ var id3Data = id3["a" /* default */].getID3Data(data, 0);
+ if (id3Data && id3["a" /* default */].getTimeStamp(id3Data) !== undefined) {
+ // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1
+ // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)
+ // More info http://www.mp3-tech.org/programmer/frame_header.html
+ for (offset = id3Data.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {
+ if (mpegaudio.probe(data, offset)) {
+ logger["b" /* logger */].log('MPEG Audio sync word found !');
+ return true;
}
}
-
- return out;
}
- }]);
-
- return ID3TrackController;
-}(_eventHandler2.default);
+ return false;
+ };
-exports.default = ID3TrackController;
+ // feed incoming data to the front of the parsing pipeline
-},{"34":34,"35":35}],12:[function(_dereq_,module,exports){
-'use strict';
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ MP3Demuxer.prototype.append = function append(data, timeOffset, contiguous, accurateTimeOffset) {
+ var id3Data = id3["a" /* default */].getID3Data(data, 0);
+ var timestamp = id3["a" /* default */].getTimeStamp(id3Data);
+ var pts = timestamp ? 90 * timestamp : timeOffset * 90000;
+ var offset = id3Data.length;
+ var length = data.length;
+ var frameIndex = 0,
+ stamp = 0;
+ var track = this._audioTrack;
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+ var id3Samples = [{ pts: pts, dts: pts, data: id3Data }];
-var _events = _dereq_(35);
-
-var _events2 = _interopRequireDefault(_events);
-
-var _eventHandler = _dereq_(34);
+ while (offset < length) {
+ if (mpegaudio.isHeader(data, offset)) {
+ var frame = mpegaudio.appendFrame(track, data, offset, pts, frameIndex);
+ if (frame) {
+ offset += frame.length;
+ stamp = frame.sample.pts;
+ frameIndex++;
+ } else {
+ //logger.log('Unable to parse Mpeg audio frame');
+ break;
+ }
+ } else if (id3["a" /* default */].isHeader(data, offset)) {
+ id3Data = id3["a" /* default */].getID3Data(data, offset);
+ id3Samples.push({ pts: stamp, dts: stamp, data: id3Data });
+ offset += id3Data.length;
+ } else {
+ //nothing found, keep looking
+ offset++;
+ }
+ }
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
+ this.remuxer.remux(track, { samples: [] }, { samples: id3Samples, inputTimeScale: 90000 }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset);
+ };
-var _logger = _dereq_(53);
+ MP3Demuxer.prototype.destroy = function destroy() {};
-var _errors = _dereq_(33);
+ return MP3Demuxer;
+}();
-var _bufferHelper = _dereq_(37);
+/* harmony default export */ var mp3demuxer = (mp3demuxer_MP3Demuxer);
+// CONCATENATED MODULE: ./src/helper/aac.js
+function aac__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var _bufferHelper2 = _interopRequireDefault(_bufferHelper);
+/**
+ * AAC helper
+ */
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+var AAC = function () {
+ function AAC() {
+ aac__classCallCheck(this, AAC);
+ }
+
+ AAC.getSilentFrame = function getSilentFrame(codec, channelCount) {
+ switch (codec) {
+ case 'mp4a.40.2':
+ if (channelCount === 1) {
+ return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x23, 0x80]);
+ } else if (channelCount === 2) {
+ return new Uint8Array([0x21, 0x00, 0x49, 0x90, 0x02, 0x19, 0x00, 0x23, 0x80]);
+ } else if (channelCount === 3) {
+ return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x8e]);
+ } else if (channelCount === 4) {
+ return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x80, 0x2c, 0x80, 0x08, 0x02, 0x38]);
+ } else if (channelCount === 5) {
+ return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x38]);
+ } else if (channelCount === 6) {
+ return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x00, 0xb2, 0x00, 0x20, 0x08, 0xe0]);
+ }
+ break;
+ // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)
+ default:
+ if (channelCount === 1) {
+ // ffmpeg -y -f lavfi -i "aevalsrc=0:d=0.05" -c:a libfdk_aac -profile:a aac_he -b:a 4k output.aac && hexdump -v -e '16/1 "0x%x," "\n"' -v output.aac
+ return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x4e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x1c, 0x6, 0xf1, 0xc1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);
+ } else if (channelCount === 2) {
+ // ffmpeg -y -f lavfi -i "aevalsrc=0|0:d=0.05" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 "0x%x," "\n"' -v output.aac
+ return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);
+ } else if (channelCount === 3) {
+ // ffmpeg -y -f lavfi -i "aevalsrc=0|0|0:d=0.05" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 "0x%x," "\n"' -v output.aac
+ return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);
+ }
+ break;
+ }
+ return null;
+ };
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ return AAC;
+}();
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+/* harmony default export */ var aac = (AAC);
+// CONCATENATED MODULE: ./src/remux/mp4-generator.js
+function mp4_generator__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * Level Controller
- */
+/**
+ * Generate MP4 Box
+*/
-var LevelController = function (_EventHandler) {
- _inherits(LevelController, _EventHandler);
+//import Hex from '../utils/hex';
- function LevelController(hls) {
- _classCallCheck(this, LevelController);
+var mp4_generator_UINT32_MAX = Math.pow(2, 32) - 1;
- var _this = _possibleConstructorReturn(this, (LevelController.__proto__ || Object.getPrototypeOf(LevelController)).call(this, hls, _events2.default.MANIFEST_LOADED, _events2.default.LEVEL_LOADED, _events2.default.FRAG_LOADED, _events2.default.ERROR));
+var MP4 = function () {
+ function MP4() {
+ mp4_generator__classCallCheck(this, MP4);
+ }
+
+ MP4.init = function init() {
+ MP4.types = {
+ avc1: [], // codingname
+ avcC: [],
+ btrt: [],
+ dinf: [],
+ dref: [],
+ esds: [],
+ ftyp: [],
+ hdlr: [],
+ mdat: [],
+ mdhd: [],
+ mdia: [],
+ mfhd: [],
+ minf: [],
+ moof: [],
+ moov: [],
+ mp4a: [],
+ '.mp3': [],
+ mvex: [],
+ mvhd: [],
+ pasp: [],
+ sdtp: [],
+ stbl: [],
+ stco: [],
+ stsc: [],
+ stsd: [],
+ stsz: [],
+ stts: [],
+ tfdt: [],
+ tfhd: [],
+ traf: [],
+ trak: [],
+ trun: [],
+ trex: [],
+ tkhd: [],
+ vmhd: [],
+ smhd: []
+ };
- _this.ontick = _this.tick.bind(_this);
- _this._manualLevel = -1;
- return _this;
- }
+ var i;
+ for (i in MP4.types) {
+ if (MP4.types.hasOwnProperty(i)) {
+ MP4.types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];
+ }
+ }
+
+ var videoHdlr = new Uint8Array([0x00, // version 0
+ 0x00, 0x00, 0x00, // flags
+ 0x00, 0x00, 0x00, 0x00, // pre_defined
+ 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'
+ 0x00, 0x00, 0x00, 0x00, // reserved
+ 0x00, 0x00, 0x00, 0x00, // reserved
+ 0x00, 0x00, 0x00, 0x00, // reserved
+ 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'
+ ]);
+
+ var audioHdlr = new Uint8Array([0x00, // version 0
+ 0x00, 0x00, 0x00, // flags
+ 0x00, 0x00, 0x00, 0x00, // pre_defined
+ 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'
+ 0x00, 0x00, 0x00, 0x00, // reserved
+ 0x00, 0x00, 0x00, 0x00, // reserved
+ 0x00, 0x00, 0x00, 0x00, // reserved
+ 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'
+ ]);
+
+ MP4.HDLR_TYPES = {
+ 'video': videoHdlr,
+ 'audio': audioHdlr
+ };
- _createClass(LevelController, [{
- key: 'destroy',
- value: function destroy() {
- if (this.timer) {
- clearTimeout(this.timer);
- this.timer = null;
- }
- this._manualLevel = -1;
+ var dref = new Uint8Array([0x00, // version 0
+ 0x00, 0x00, 0x00, // flags
+ 0x00, 0x00, 0x00, 0x01, // entry_count
+ 0x00, 0x00, 0x00, 0x0c, // entry_size
+ 0x75, 0x72, 0x6c, 0x20, // 'url' type
+ 0x00, // version 0
+ 0x00, 0x00, 0x01 // entry_flags
+ ]);
+
+ var stco = new Uint8Array([0x00, // version
+ 0x00, 0x00, 0x00, // flags
+ 0x00, 0x00, 0x00, 0x00 // entry_count
+ ]);
+
+ MP4.STTS = MP4.STSC = MP4.STCO = stco;
+
+ MP4.STSZ = new Uint8Array([0x00, // version
+ 0x00, 0x00, 0x00, // flags
+ 0x00, 0x00, 0x00, 0x00, // sample_size
+ 0x00, 0x00, 0x00, 0x00]);
+ MP4.VMHD = new Uint8Array([0x00, // version
+ 0x00, 0x00, 0x01, // flags
+ 0x00, 0x00, // graphicsmode
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor
+ ]);
+ MP4.SMHD = new Uint8Array([0x00, // version
+ 0x00, 0x00, 0x00, // flags
+ 0x00, 0x00, // balance
+ 0x00, 0x00 // reserved
+ ]);
+
+ MP4.STSD = new Uint8Array([0x00, // version 0
+ 0x00, 0x00, 0x00, // flags
+ 0x00, 0x00, 0x00, 0x01]); // entry_count
+
+ var majorBrand = new Uint8Array([105, 115, 111, 109]); // isom
+ var avc1Brand = new Uint8Array([97, 118, 99, 49]); // avc1
+ var minorVersion = new Uint8Array([0, 0, 0, 1]);
+
+ MP4.FTYP = MP4.box(MP4.types.ftyp, majorBrand, minorVersion, majorBrand, avc1Brand);
+ MP4.DINF = MP4.box(MP4.types.dinf, MP4.box(MP4.types.dref, dref));
+ };
+
+ MP4.box = function box(type) {
+ var payload = Array.prototype.slice.call(arguments, 1),
+ size = 8,
+ i = payload.length,
+ len = i,
+ result;
+ // calculate the total size we need to allocate
+ while (i--) {
+ size += payload[i].byteLength;
+ }
+ result = new Uint8Array(size);
+ result[0] = size >> 24 & 0xff;
+ result[1] = size >> 16 & 0xff;
+ result[2] = size >> 8 & 0xff;
+ result[3] = size & 0xff;
+ result.set(type, 4);
+ // copy the payload into the result
+ for (i = 0, size = 8; i < len; i++) {
+ // copy payload[i] array @ offset size
+ result.set(payload[i], size);
+ size += payload[i].byteLength;
}
- }, {
- key: 'startLoad',
- value: function startLoad() {
- this.canload = true;
- var levels = this._levels;
- // clean up live level details to force reload them, and reset load errors
- if (levels) {
- levels.forEach(function (level) {
- level.loadError = 0;
- var levelDetails = level.details;
- if (levelDetails && levelDetails.live) {
- level.details = undefined;
- }
- });
- }
- // speed up live playlist refresh if timer exists
- if (this.timer) {
- this.tick();
- }
- }
- }, {
- key: 'stopLoad',
- value: function stopLoad() {
- this.canload = false;
- }
- }, {
- key: 'onManifestLoaded',
- value: function onManifestLoaded(data) {
- var levels0 = [],
- levels = [],
- bitrateStart,
- bitrateSet = {},
- videoCodecFound = false,
- audioCodecFound = false,
- hls = this.hls,
- brokenmp4inmp3 = /chrome|firefox/.test(navigator.userAgent.toLowerCase()),
- checkSupported = function checkSupported(type, codec) {
- return MediaSource.isTypeSupported(type + '/mp4;codecs=' + codec);
- };
+ return result;
+ };
- // regroup redundant level together
- data.levels.forEach(function (level) {
- if (level.videoCodec) {
- videoCodecFound = true;
- }
- // erase audio codec info if browser does not support mp4a.40.34. demuxer will autodetect codec and fallback to mpeg/audio
- if (brokenmp4inmp3 && level.audioCodec && level.audioCodec.indexOf('mp4a.40.34') !== -1) {
- level.audioCodec = undefined;
- }
- if (level.audioCodec || level.attrs && level.attrs.AUDIO) {
- audioCodecFound = true;
- }
- var redundantLevelId = bitrateSet[level.bitrate];
- if (redundantLevelId === undefined) {
- bitrateSet[level.bitrate] = levels0.length;
- level.url = [level.url];
- level.urlId = 0;
- levels0.push(level);
- } else {
- levels0[redundantLevelId].url.push(level.url);
- }
- });
+ MP4.hdlr = function hdlr(type) {
+ return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);
+ };
- // remove audio-only level if we also have levels with audio+video codecs signalled
- if (videoCodecFound && audioCodecFound) {
- levels0.forEach(function (level) {
- if (level.videoCodec) {
- levels.push(level);
- }
- });
- } else {
- levels = levels0;
- }
- // only keep level with supported audio/video codecs
- levels = levels.filter(function (level) {
- var audioCodec = level.audioCodec,
- videoCodec = level.videoCodec;
- return (!audioCodec || checkSupported('audio', audioCodec)) && (!videoCodec || checkSupported('video', videoCodec));
- });
+ MP4.mdat = function mdat(data) {
+ return MP4.box(MP4.types.mdat, data);
+ };
- if (levels.length) {
- // start bitrate is the first bitrate of the manifest
- bitrateStart = levels[0].bitrate;
- // sort level on bitrate
- levels.sort(function (a, b) {
- return a.bitrate - b.bitrate;
- });
- this._levels = levels;
- // find index of first level in sorted levels
- for (var i = 0; i < levels.length; i++) {
- if (levels[i].bitrate === bitrateStart) {
- this._firstLevel = i;
- _logger.logger.log('manifest loaded,' + levels.length + ' level(s) found, first bitrate:' + bitrateStart);
- break;
- }
- }
- hls.trigger(_events2.default.MANIFEST_PARSED, { levels: levels, firstLevel: this._firstLevel, stats: data.stats, audio: audioCodecFound, video: videoCodecFound, altAudio: data.audioTracks.length > 0 });
- } else {
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR, fatal: true, url: hls.url, reason: 'no level with compatible codecs found in manifest' });
- }
- return;
- }
- }, {
- key: 'setLevelInternal',
- value: function setLevelInternal(newLevel) {
- var levels = this._levels;
- var hls = this.hls;
- // check if level idx is valid
- if (newLevel >= 0 && newLevel < levels.length) {
- // stopping live reloading timer if any
- if (this.timer) {
- clearTimeout(this.timer);
- this.timer = null;
- }
- if (this._level !== newLevel) {
- _logger.logger.log('switching to level ' + newLevel);
- this._level = newLevel;
- var levelProperties = levels[newLevel];
- levelProperties.level = newLevel;
- // LEVEL_SWITCH to be deprecated in next major release
- hls.trigger(_events2.default.LEVEL_SWITCH, levelProperties);
- hls.trigger(_events2.default.LEVEL_SWITCHING, levelProperties);
- }
- var level = levels[newLevel],
- levelDetails = level.details;
- // check if we need to load playlist for this level
- if (!levelDetails || levelDetails.live === true) {
- // level not retrieved yet, or live playlist we need to (re)load it
- var urlId = level.urlId;
- hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: newLevel, id: urlId });
- }
- } else {
- // invalid level id given, trigger error
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx' });
- }
- }
- }, {
- key: 'onError',
- value: function onError(data) {
- if (data.fatal) {
- return;
- }
+ MP4.mdhd = function mdhd(timescale, duration) {
+ duration *= timescale;
+ var upperWordDuration = Math.floor(duration / (mp4_generator_UINT32_MAX + 1));
+ var lowerWordDuration = Math.floor(duration % (mp4_generator_UINT32_MAX + 1));
+ return MP4.box(MP4.types.mdhd, new Uint8Array([0x01, // version 1
+ 0x00, 0x00, 0x00, // flags
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time
+ timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale
+ upperWordDuration >> 24, upperWordDuration >> 16 & 0xFF, upperWordDuration >> 8 & 0xFF, upperWordDuration & 0xFF, lowerWordDuration >> 24, lowerWordDuration >> 16 & 0xFF, lowerWordDuration >> 8 & 0xFF, lowerWordDuration & 0xFF, 0x55, 0xc4, // 'und' language (undetermined)
+ 0x00, 0x00]));
+ };
- var details = data.details,
- hls = this.hls,
- levelId = void 0,
- level = void 0,
- levelError = false;
- // try to recover not fatal errors
- switch (details) {
- case _errors.ErrorDetails.FRAG_LOAD_ERROR:
- case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:
- case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:
- case _errors.ErrorDetails.KEY_LOAD_ERROR:
- case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:
- levelId = data.frag.level;
- break;
- case _errors.ErrorDetails.LEVEL_LOAD_ERROR:
- case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:
- levelId = data.context.level;
- levelError = true;
- break;
- case _errors.ErrorDetails.REMUX_ALLOC_ERROR:
- levelId = data.level;
- break;
- default:
- break;
- }
- /* try to switch to a redundant stream if any available.
- * if no redundant stream available, emergency switch down (if in auto mode and current level not 0)
- * otherwise, we cannot recover this network error ...
- */
- if (levelId !== undefined) {
- level = this._levels[levelId];
- if (!level.loadError) {
- level.loadError = 1;
- } else {
- level.loadError++;
- }
- // if any redundant streams available and if we haven't try them all (level.loadError is reseted on successful frag/level load.
- // if level.loadError reaches nbRedundantLevel it means that we tried them all, no hope => let's switch down
- var nbRedundantLevel = level.url.length;
- if (nbRedundantLevel > 1 && level.loadError < nbRedundantLevel) {
- level.urlId = (level.urlId + 1) % nbRedundantLevel;
- level.details = undefined;
- _logger.logger.warn('level controller,' + details + ' for level ' + levelId + ': switching to redundant stream id ' + level.urlId);
- } else {
- // we could try to recover if in auto mode and current level not lowest level (0)
- var recoverable = this._manualLevel === -1 && levelId;
- if (recoverable) {
- _logger.logger.warn('level controller,' + details + ': switch-down for next fragment');
- hls.nextAutoLevel = Math.max(0, levelId - 1);
- } else if (level && level.details && level.details.live) {
- _logger.logger.warn('level controller,' + details + ' on live stream, discard');
- if (levelError) {
- // reset this._level so that another call to set level() will retrigger a frag load
- this._level = undefined;
- }
- // other errors are handled by stream controller
- } else if (details === _errors.ErrorDetails.LEVEL_LOAD_ERROR || details === _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT) {
- var media = hls.media,
-
- // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end
- mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);
- if (mediaBuffered) {
- var retryDelay = hls.config.levelLoadingRetryDelay;
- _logger.logger.warn('level controller,' + details + ', but media buffered, retry in ' + retryDelay + 'ms');
- this.timer = setTimeout(this.ontick, retryDelay);
- // boolean used to inform stream controller not to switch back to IDLE on non fatal error
- data.levelRetry = true;
- } else {
- _logger.logger.error('cannot recover ' + details + ' error');
- this._level = undefined;
- // stopping live reloading timer if any
- if (this.timer) {
- clearTimeout(this.timer);
- this.timer = null;
- }
- // switch error to fatal
- data.fatal = true;
- }
- }
- }
- }
- }
+ MP4.mdia = function mdia(track) {
+ return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale, track.duration), MP4.hdlr(track.type), MP4.minf(track));
+ };
- // reset level load error counter on successful frag loaded
+ MP4.mfhd = function mfhd(sequenceNumber) {
+ return MP4.box(MP4.types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags
+ sequenceNumber >> 24, sequenceNumber >> 16 & 0xFF, sequenceNumber >> 8 & 0xFF, sequenceNumber & 0xFF]) // sequence_number
+ );
+ };
- }, {
- key: 'onFragLoaded',
- value: function onFragLoaded(data) {
- var fragLoaded = data.frag;
- if (fragLoaded && fragLoaded.type === 'main') {
- var level = this._levels[fragLoaded.level];
- if (level) {
- level.loadError = 0;
- }
- }
- }
- }, {
- key: 'onLevelLoaded',
- value: function onLevelLoaded(data) {
- var levelId = data.level;
- // only process level loaded events matching with expected level
- if (levelId === this._level) {
- var curLevel = this._levels[levelId];
- // reset level load error counter on successful level loaded
- curLevel.loadError = 0;
- var newDetails = data.details;
- // if current playlist is a live playlist, arm a timer to reload it
- if (newDetails.live) {
- var reloadInterval = 1000 * (newDetails.averagetargetduration ? newDetails.averagetargetduration : newDetails.targetduration),
- curDetails = curLevel.details;
- if (curDetails && newDetails.endSN === curDetails.endSN) {
- // follow HLS Spec, If the client reloads a Playlist file and finds that it has not
- // changed then it MUST wait for a period of one-half the target
- // duration before retrying.
- reloadInterval /= 2;
- _logger.logger.log('same live playlist, reload twice faster');
- }
- // decrement reloadInterval with level loading delay
- reloadInterval -= performance.now() - data.stats.trequest;
- // in any case, don't reload more than every second
- reloadInterval = Math.max(1000, Math.round(reloadInterval));
- _logger.logger.log('live playlist, reload in ' + reloadInterval + ' ms');
- this.timer = setTimeout(this.ontick, reloadInterval);
- } else {
- this.timer = null;
- }
- }
- }
- }, {
- key: 'tick',
- value: function tick() {
- var levelId = this._level;
- if (levelId !== undefined && this.canload) {
- var level = this._levels[levelId];
- if (level && level.url) {
- var urlId = level.urlId;
- this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: levelId, id: urlId });
- }
- }
- }
- }, {
- key: 'levels',
- get: function get() {
- return this._levels;
- }
- }, {
- key: 'level',
- get: function get() {
- return this._level;
- },
- set: function set(newLevel) {
- var levels = this._levels;
- if (levels && levels.length > newLevel) {
- if (this._level !== newLevel || levels[newLevel].details === undefined) {
- this.setLevelInternal(newLevel);
- }
- }
- }
- }, {
- key: 'manualLevel',
- get: function get() {
- return this._manualLevel;
- },
- set: function set(newLevel) {
- this._manualLevel = newLevel;
- if (this._startLevel === undefined) {
- this._startLevel = newLevel;
- }
- if (newLevel !== -1) {
- this.level = newLevel;
- }
- }
- }, {
- key: 'firstLevel',
- get: function get() {
- return this._firstLevel;
- },
- set: function set(newLevel) {
- this._firstLevel = newLevel;
- }
- }, {
- key: 'startLevel',
- get: function get() {
- // hls.startLevel takes precedence over config.startLevel
- // if none of these values are defined, fallback on this._firstLevel (first quality level appearing in variant manifest)
- if (this._startLevel === undefined) {
- var configStartLevel = this.hls.config.startLevel;
- if (configStartLevel !== undefined) {
- return configStartLevel;
- } else {
- return this._firstLevel;
- }
- } else {
- return this._startLevel;
- }
- },
- set: function set(newLevel) {
- this._startLevel = newLevel;
- }
- }, {
- key: 'nextLoadLevel',
- get: function get() {
- if (this._manualLevel !== -1) {
- return this._manualLevel;
- } else {
- return this.hls.nextAutoLevel;
- }
- },
- set: function set(nextLevel) {
- this.level = nextLevel;
- if (this._manualLevel === -1) {
- this.hls.nextAutoLevel = nextLevel;
- }
+ MP4.minf = function minf(track) {
+ if (track.type === 'audio') {
+ return MP4.box(MP4.types.minf, MP4.box(MP4.types.smhd, MP4.SMHD), MP4.DINF, MP4.stbl(track));
+ } else {
+ return MP4.box(MP4.types.minf, MP4.box(MP4.types.vmhd, MP4.VMHD), MP4.DINF, MP4.stbl(track));
}
- }]);
+ };
- return LevelController;
-}(_eventHandler2.default);
+ MP4.moof = function moof(sn, baseMediaDecodeTime, track) {
+ return MP4.box(MP4.types.moof, MP4.mfhd(sn), MP4.traf(track, baseMediaDecodeTime));
+ };
+ /**
+ * @param tracks... (optional) {array} the tracks associated with this movie
+ */
-exports.default = LevelController;
-},{"33":33,"34":34,"35":35,"37":37,"53":53}],13:[function(_dereq_,module,exports){
-'use strict';
+ MP4.moov = function moov(tracks) {
+ var i = tracks.length,
+ boxes = [];
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ while (i--) {
+ boxes[i] = MP4.trak(tracks[i]);
+ }
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+ return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale, tracks[0].duration)].concat(boxes).concat(MP4.mvex(tracks)));
+ };
-var _binarySearch = _dereq_(48);
+ MP4.mvex = function mvex(tracks) {
+ var i = tracks.length,
+ boxes = [];
-var _binarySearch2 = _interopRequireDefault(_binarySearch);
+ while (i--) {
+ boxes[i] = MP4.trex(tracks[i]);
+ }
+ return MP4.box.apply(null, [MP4.types.mvex].concat(boxes));
+ };
-var _bufferHelper = _dereq_(37);
+ MP4.mvhd = function mvhd(timescale, duration) {
+ duration *= timescale;
+ var upperWordDuration = Math.floor(duration / (mp4_generator_UINT32_MAX + 1));
+ var lowerWordDuration = Math.floor(duration % (mp4_generator_UINT32_MAX + 1));
+ var bytes = new Uint8Array([0x01, // version 1
+ 0x00, 0x00, 0x00, // flags
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time
+ timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale
+ upperWordDuration >> 24, upperWordDuration >> 16 & 0xFF, upperWordDuration >> 8 & 0xFF, upperWordDuration & 0xFF, lowerWordDuration >> 24, lowerWordDuration >> 16 & 0xFF, lowerWordDuration >> 8 & 0xFF, lowerWordDuration & 0xFF, 0x00, 0x01, 0x00, 0x00, // 1.0 rate
+ 0x01, 0x00, // 1.0 volume
+ 0x00, 0x00, // reserved
+ 0x00, 0x00, 0x00, 0x00, // reserved
+ 0x00, 0x00, 0x00, 0x00, // reserved
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined
+ 0xff, 0xff, 0xff, 0xff // next_track_ID
+ ]);
+ return MP4.box(MP4.types.mvhd, bytes);
+ };
-var _bufferHelper2 = _interopRequireDefault(_bufferHelper);
+ MP4.sdtp = function sdtp(track) {
+ var samples = track.samples || [],
+ bytes = new Uint8Array(4 + samples.length),
+ flags,
+ i;
+ // leave the full box header (4 bytes) all zero
+ // write the sample table
+ for (i = 0; i < samples.length; i++) {
+ flags = samples[i].flags;
+ bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;
+ }
-var _demuxer = _dereq_(25);
+ return MP4.box(MP4.types.sdtp, bytes);
+ };
-var _demuxer2 = _interopRequireDefault(_demuxer);
+ MP4.stbl = function stbl(track) {
+ return MP4.box(MP4.types.stbl, MP4.stsd(track), MP4.box(MP4.types.stts, MP4.STTS), MP4.box(MP4.types.stsc, MP4.STSC), MP4.box(MP4.types.stsz, MP4.STSZ), MP4.box(MP4.types.stco, MP4.STCO));
+ };
-var _events = _dereq_(35);
+ MP4.avc1 = function avc1(track) {
+ var sps = [],
+ pps = [],
+ i,
+ data,
+ len;
+ // assemble the SPSs
+
+ for (i = 0; i < track.sps.length; i++) {
+ data = track.sps[i];
+ len = data.byteLength;
+ sps.push(len >>> 8 & 0xFF);
+ sps.push(len & 0xFF);
+ sps = sps.concat(Array.prototype.slice.call(data)); // SPS
+ }
+
+ // assemble the PPSs
+ for (i = 0; i < track.pps.length; i++) {
+ data = track.pps[i];
+ len = data.byteLength;
+ pps.push(len >>> 8 & 0xFF);
+ pps.push(len & 0xFF);
+ pps = pps.concat(Array.prototype.slice.call(data));
+ }
+
+ var avcc = MP4.box(MP4.types.avcC, new Uint8Array([0x01, // version
+ sps[3], // profile
+ sps[4], // profile compat
+ sps[5], // level
+ 0xfc | 3, // lengthSizeMinusOne, hard-coded to 4 bytes
+ 0xE0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets
+ ].concat(sps).concat([track.pps.length // numOfPictureParameterSets
+ ]).concat(pps))),
+ // "PPS"
+ width = track.width,
+ height = track.height,
+ hSpacing = track.pixelRatio[0],
+ vSpacing = track.pixelRatio[1];
+ //console.log('avcc:' + Hex.hexDump(avcc));
+ return MP4.box(MP4.types.avc1, new Uint8Array([0x00, 0x00, 0x00, // reserved
+ 0x00, 0x00, 0x00, // reserved
+ 0x00, 0x01, // data_reference_index
+ 0x00, 0x00, // pre_defined
+ 0x00, 0x00, // reserved
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined
+ width >> 8 & 0xFF, width & 0xff, // width
+ height >> 8 & 0xFF, height & 0xff, // height
+ 0x00, 0x48, 0x00, 0x00, // horizresolution
+ 0x00, 0x48, 0x00, 0x00, // vertresolution
+ 0x00, 0x00, 0x00, 0x00, // reserved
+ 0x00, 0x01, // frame_count
+ 0x12, 0x64, 0x61, 0x69, 0x6C, //dailymotion/hls.js
+ 0x79, 0x6D, 0x6F, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x68, 0x6C, 0x73, 0x2E, 0x6A, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname
+ 0x00, 0x18, // depth = 24
+ 0x11, 0x11]), // pre_defined = -1
+ avcc, MP4.box(MP4.types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB
+ 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate
+ 0x00, 0x2d, 0xc6, 0xc0])), // avgBitrate
+ MP4.box(MP4.types.pasp, new Uint8Array([hSpacing >> 24, // hSpacing
+ hSpacing >> 16 & 0xFF, hSpacing >> 8 & 0xFF, hSpacing & 0xFF, vSpacing >> 24, // vSpacing
+ vSpacing >> 16 & 0xFF, vSpacing >> 8 & 0xFF, vSpacing & 0xFF])));
+ };
+
+ MP4.esds = function esds(track) {
+ var configlen = track.config.length;
+ return new Uint8Array([0x00, // version 0
+ 0x00, 0x00, 0x00, // flags
+
+ 0x03, // descriptor_type
+ 0x17 + configlen, // length
+ 0x00, 0x01, //es_id
+ 0x00, // stream_priority
+
+ 0x04, // descriptor_type
+ 0x0f + configlen, // length
+ 0x40, //codec : mpeg4_audio
+ 0x15, // stream_type
+ 0x00, 0x00, 0x00, // buffer_size
+ 0x00, 0x00, 0x00, 0x00, // maxBitrate
+ 0x00, 0x00, 0x00, 0x00, // avgBitrate
+
+ 0x05 // descriptor_type
+ ].concat([configlen]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor
+ };
+
+ MP4.mp4a = function mp4a(track) {
+ var samplerate = track.samplerate;
+ return MP4.box(MP4.types.mp4a, new Uint8Array([0x00, 0x00, 0x00, // reserved
+ 0x00, 0x00, 0x00, // reserved
+ 0x00, 0x01, // data_reference_index
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved
+ 0x00, track.channelCount, // channelcount
+ 0x00, 0x10, // sampleSize:16bits
+ 0x00, 0x00, 0x00, 0x00, // reserved2
+ samplerate >> 8 & 0xFF, samplerate & 0xff, //
+ 0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));
+ };
+
+ MP4.mp3 = function mp3(track) {
+ var samplerate = track.samplerate;
+ return MP4.box(MP4.types['.mp3'], new Uint8Array([0x00, 0x00, 0x00, // reserved
+ 0x00, 0x00, 0x00, // reserved
+ 0x00, 0x01, // data_reference_index
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved
+ 0x00, track.channelCount, // channelcount
+ 0x00, 0x10, // sampleSize:16bits
+ 0x00, 0x00, 0x00, 0x00, // reserved2
+ samplerate >> 8 & 0xFF, samplerate & 0xff, //
+ 0x00, 0x00]));
+ };
+
+ MP4.stsd = function stsd(track) {
+ if (track.type === 'audio') {
+ if (!track.isAAC && track.codec === 'mp3') {
+ return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));
+ }
+ return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp4a(track));
+ } else {
+ return MP4.box(MP4.types.stsd, MP4.STSD, MP4.avc1(track));
+ }
+ };
+
+ MP4.tkhd = function tkhd(track) {
+ var id = track.id,
+ duration = track.duration * track.timescale,
+ width = track.width,
+ height = track.height,
+ upperWordDuration = Math.floor(duration / (mp4_generator_UINT32_MAX + 1)),
+ lowerWordDuration = Math.floor(duration % (mp4_generator_UINT32_MAX + 1));
+ return MP4.box(MP4.types.tkhd, new Uint8Array([0x01, // version 1
+ 0x00, 0x00, 0x07, // flags
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time
+ id >> 24 & 0xFF, id >> 16 & 0xFF, id >> 8 & 0xFF, id & 0xFF, // track_ID
+ 0x00, 0x00, 0x00, 0x00, // reserved
+ upperWordDuration >> 24, upperWordDuration >> 16 & 0xFF, upperWordDuration >> 8 & 0xFF, upperWordDuration & 0xFF, lowerWordDuration >> 24, lowerWordDuration >> 16 & 0xFF, lowerWordDuration >> 8 & 0xFF, lowerWordDuration & 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved
+ 0x00, 0x00, // layer
+ 0x00, 0x00, // alternate_group
+ 0x00, 0x00, // non-audio track volume
+ 0x00, 0x00, // reserved
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix
+ width >> 8 & 0xFF, width & 0xFF, 0x00, 0x00, // width
+ height >> 8 & 0xFF, height & 0xFF, 0x00, 0x00 // height
+ ]));
+ };
+
+ MP4.traf = function traf(track, baseMediaDecodeTime) {
+ var sampleDependencyTable = MP4.sdtp(track),
+ id = track.id,
+ upperWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime / (mp4_generator_UINT32_MAX + 1)),
+ lowerWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime % (mp4_generator_UINT32_MAX + 1));
+ return MP4.box(MP4.types.traf, MP4.box(MP4.types.tfhd, new Uint8Array([0x00, // version 0
+ 0x00, 0x00, 0x00, // flags
+ id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF]) // track_ID
+ ), MP4.box(MP4.types.tfdt, new Uint8Array([0x01, // version 1
+ 0x00, 0x00, 0x00, // flags
+ upperWordBaseMediaDecodeTime >> 24, upperWordBaseMediaDecodeTime >> 16 & 0XFF, upperWordBaseMediaDecodeTime >> 8 & 0XFF, upperWordBaseMediaDecodeTime & 0xFF, lowerWordBaseMediaDecodeTime >> 24, lowerWordBaseMediaDecodeTime >> 16 & 0XFF, lowerWordBaseMediaDecodeTime >> 8 & 0XFF, lowerWordBaseMediaDecodeTime & 0xFF])), MP4.trun(track, sampleDependencyTable.length + 16 + // tfhd
+ 20 + // tfdt
+ 8 + // traf header
+ 16 + // mfhd
+ 8 + // moof header
+ 8), // mdat header
+ sampleDependencyTable);
+ };
-var _events2 = _interopRequireDefault(_events);
+ /**
+ * Generate a track box.
+ * @param track {object} a track definition
+ * @return {Uint8Array} the track box
+ */
-var _eventHandler = _dereq_(34);
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
+ MP4.trak = function trak(track) {
+ track.duration = track.duration || 0xffffffff;
+ return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));
+ };
+
+ MP4.trex = function trex(track) {
+ var id = track.id;
+ return MP4.box(MP4.types.trex, new Uint8Array([0x00, // version 0
+ 0x00, 0x00, 0x00, // flags
+ id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF, // track_ID
+ 0x00, 0x00, 0x00, 0x01, // default_sample_description_index
+ 0x00, 0x00, 0x00, 0x00, // default_sample_duration
+ 0x00, 0x00, 0x00, 0x00, // default_sample_size
+ 0x00, 0x01, 0x00, 0x01 // default_sample_flags
+ ]));
+ };
+
+ MP4.trun = function trun(track, offset) {
+ var samples = track.samples || [],
+ len = samples.length,
+ arraylen = 12 + 16 * len,
+ array = new Uint8Array(arraylen),
+ i,
+ sample,
+ duration,
+ size,
+ flags,
+ cts;
+ offset += 8 + arraylen;
+ array.set([0x00, // version 0
+ 0x00, 0x0f, 0x01, // flags
+ len >>> 24 & 0xFF, len >>> 16 & 0xFF, len >>> 8 & 0xFF, len & 0xFF, // sample_count
+ offset >>> 24 & 0xFF, offset >>> 16 & 0xFF, offset >>> 8 & 0xFF, offset & 0xFF // data_offset
+ ], 0);
+ for (i = 0; i < len; i++) {
+ sample = samples[i];
+ duration = sample.duration;
+ size = sample.size;
+ flags = sample.flags;
+ cts = sample.cts;
+ array.set([duration >>> 24 & 0xFF, duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, // sample_duration
+ size >>> 24 & 0xFF, size >>> 16 & 0xFF, size >>> 8 & 0xFF, size & 0xFF, // sample_size
+ flags.isLeading << 2 | flags.dependsOn, flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.paddingValue << 1 | flags.isNonSync, flags.degradPrio & 0xF0 << 8, flags.degradPrio & 0x0F, // sample_flags
+ cts >>> 24 & 0xFF, cts >>> 16 & 0xFF, cts >>> 8 & 0xFF, cts & 0xFF // sample_composition_time_offset
+ ], 12 + 16 * i);
+ }
+ return MP4.box(MP4.types.trun, array);
+ };
+
+ MP4.initSegment = function initSegment(tracks) {
+ if (!MP4.types) {
+ MP4.init();
+ }
+ var movie = MP4.moov(tracks),
+ result;
+ result = new Uint8Array(MP4.FTYP.byteLength + movie.byteLength);
+ result.set(MP4.FTYP);
+ result.set(movie, MP4.FTYP.byteLength);
+ return result;
+ };
-var _levelHelper = _dereq_(38);
+ return MP4;
+}();
-var _levelHelper2 = _interopRequireDefault(_levelHelper);
+/* harmony default export */ var mp4_generator = (MP4);
+// CONCATENATED MODULE: ./src/remux/mp4-remuxer.js
+function mp4_remuxer__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var _timeRanges = _dereq_(54);
+/**
+* fMP4 remuxer
+*/
-var _timeRanges2 = _interopRequireDefault(_timeRanges);
-var _errors = _dereq_(33);
-var _logger = _dereq_(53);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * Stream Controller
- */
+// 10 seconds
+var MAX_SILENT_FRAME_DURATION = 10 * 1000;
-var State = {
- STOPPED: 'STOPPED',
- IDLE: 'IDLE',
- KEY_LOADING: 'KEY_LOADING',
- FRAG_LOADING: 'FRAG_LOADING',
- FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',
- WAITING_LEVEL: 'WAITING_LEVEL',
- PARSING: 'PARSING',
- PARSED: 'PARSED',
- BUFFER_FLUSHING: 'BUFFER_FLUSHING',
- ENDED: 'ENDED',
- ERROR: 'ERROR'
-};
+var mp4_remuxer_MP4Remuxer = function () {
+ function MP4Remuxer(observer, config, typeSupported, vendor) {
+ mp4_remuxer__classCallCheck(this, MP4Remuxer);
-var StreamController = function (_EventHandler) {
- _inherits(StreamController, _EventHandler);
+ this.observer = observer;
+ this.config = config;
+ this.typeSupported = typeSupported;
+ var userAgent = navigator.userAgent;
+ this.isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');
+ this.ISGenerated = false;
+ }
- function StreamController(hls) {
- _classCallCheck(this, StreamController);
+ MP4Remuxer.prototype.destroy = function destroy() {};
- var _this = _possibleConstructorReturn(this, (StreamController.__proto__ || Object.getPrototypeOf(StreamController)).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_PARSED, _events2.default.LEVEL_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_LOAD_EMERGENCY_ABORTED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.AUDIO_TRACK_SWITCHING, _events2.default.AUDIO_TRACK_SWITCHED, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED));
+ MP4Remuxer.prototype.resetTimeStamp = function resetTimeStamp(defaultTimeStamp) {
+ this._initPTS = this._initDTS = defaultTimeStamp;
+ };
- _this.config = hls.config;
- _this.audioCodecSwap = false;
- _this.ticks = 0;
- _this._state = State.STOPPED;
- _this.ontick = _this.tick.bind(_this);
- return _this;
- }
+ MP4Remuxer.prototype.resetInitSegment = function resetInitSegment() {
+ this.ISGenerated = false;
+ };
- _createClass(StreamController, [{
- key: 'destroy',
- value: function destroy() {
- this.stopLoad();
- if (this.timer) {
- clearInterval(this.timer);
- this.timer = null;
- }
- _eventHandler2.default.prototype.destroy.call(this);
- this.state = State.STOPPED;
- }
- }, {
- key: 'startLoad',
- value: function startLoad(startPosition) {
- if (this.levels) {
- var lastCurrentTime = this.lastCurrentTime,
- hls = this.hls;
- this.stopLoad();
- if (!this.timer) {
- this.timer = setInterval(this.ontick, 100);
- }
- this.level = -1;
- this.fragLoadError = 0;
- if (!this.startFragRequested) {
- // determine load level
- var startLevel = hls.startLevel;
- if (startLevel === -1) {
- // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level
- startLevel = 0;
- this.bitrateTest = true;
+ MP4Remuxer.prototype.remux = function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {
+ // generate Init Segment if needed
+ if (!this.ISGenerated) {
+ this.generateIS(audioTrack, videoTrack, timeOffset);
+ }
+
+ if (this.ISGenerated) {
+ var nbAudioSamples = audioTrack.samples.length;
+ var nbVideoSamples = videoTrack.samples.length;
+ var audioTimeOffset = timeOffset;
+ var videoTimeOffset = timeOffset;
+ if (nbAudioSamples && nbVideoSamples) {
+ // timeOffset is expected to be the offset of the first timestamp of this fragment (first DTS)
+ // if first audio DTS is not aligned with first video DTS then we need to take that into account
+ // when providing timeOffset to remuxAudio / remuxVideo. if we don't do that, there might be a permanent / small
+ // drift between audio and video streams
+ var audiovideoDeltaDts = (audioTrack.samples[0].dts - videoTrack.samples[0].dts) / videoTrack.inputTimeScale;
+ audioTimeOffset += Math.max(0, audiovideoDeltaDts);
+ videoTimeOffset += Math.max(0, -audiovideoDeltaDts);
+ }
+ // Purposefully remuxing audio before video, so that remuxVideo can use nextAudioPts, which is
+ // calculated in remuxAudio.
+ //logger.log('nb AAC samples:' + audioTrack.samples.length);
+ if (nbAudioSamples) {
+ // if initSegment was generated without video samples, regenerate it again
+ if (!audioTrack.timescale) {
+ logger["b" /* logger */].warn('regenerate InitSegment as audio detected');
+ this.generateIS(audioTrack, videoTrack, timeOffset);
+ }
+ var audioData = this.remuxAudio(audioTrack, audioTimeOffset, contiguous, accurateTimeOffset);
+ //logger.log('nb AVC samples:' + videoTrack.samples.length);
+ if (nbVideoSamples) {
+ var audioTrackLength = void 0;
+ if (audioData) {
+ audioTrackLength = audioData.endPTS - audioData.startPTS;
}
- // set new level to playlist loader : this will trigger start level load
- // hls.nextLoadLevel remains until it is set to a new value or until a new frag is successfully loaded
- this.level = hls.nextLoadLevel = startLevel;
- this.loadedmetadata = false;
- }
- // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime
- if (lastCurrentTime > 0 && startPosition === -1) {
- _logger.logger.log('override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));
- startPosition = lastCurrentTime;
+ // if initSegment was generated without video samples, regenerate it again
+ if (!videoTrack.timescale) {
+ logger["b" /* logger */].warn('regenerate InitSegment as video detected');
+ this.generateIS(audioTrack, videoTrack, timeOffset);
+ }
+ this.remuxVideo(videoTrack, videoTimeOffset, contiguous, audioTrackLength, accurateTimeOffset);
}
- this.state = State.IDLE;
- this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;
- this.tick();
} else {
- this.forceStartLoad = true;
- this.state = State.STOPPED;
- }
- }
- }, {
- key: 'stopLoad',
- value: function stopLoad() {
- var frag = this.fragCurrent;
- if (frag) {
- if (frag.loader) {
- frag.loader.abort();
+ var videoData = void 0;
+ //logger.log('nb AVC samples:' + videoTrack.samples.length);
+ if (nbVideoSamples) {
+ videoData = this.remuxVideo(videoTrack, videoTimeOffset, contiguous, accurateTimeOffset);
+ }
+ if (videoData && audioTrack.codec) {
+ this.remuxEmptyAudio(audioTrack, audioTimeOffset, contiguous, videoData);
+ }
+ }
+ }
+ //logger.log('nb ID3 samples:' + audioTrack.samples.length);
+ if (id3Track.samples.length) {
+ this.remuxID3(id3Track, timeOffset);
+ }
+ //logger.log('nb ID3 samples:' + audioTrack.samples.length);
+ if (textTrack.samples.length) {
+ this.remuxText(textTrack, timeOffset);
+ }
+ //notify end of parsing
+ this.observer.trigger(events["a" /* default */].FRAG_PARSED);
+ };
+
+ MP4Remuxer.prototype.generateIS = function generateIS(audioTrack, videoTrack, timeOffset) {
+ var observer = this.observer,
+ audioSamples = audioTrack.samples,
+ videoSamples = videoTrack.samples,
+ typeSupported = this.typeSupported,
+ container = 'audio/mp4',
+ tracks = {},
+ data = { tracks: tracks },
+ computePTSDTS = this._initPTS === undefined,
+ initPTS,
+ initDTS;
+
+ if (computePTSDTS) {
+ initPTS = initDTS = Infinity;
+ }
+ if (audioTrack.config && audioSamples.length) {
+ // let's use audio sampling rate as MP4 time scale.
+ // rationale is that there is a integer nb of audio frames per audio sample (1024 for AAC)
+ // using audio sampling rate here helps having an integer MP4 frame duration
+ // this avoids potential rounding issue and AV sync issue
+ audioTrack.timescale = audioTrack.samplerate;
+ logger["b" /* logger */].log('audio sampling rate : ' + audioTrack.samplerate);
+ if (!audioTrack.isAAC) {
+ if (typeSupported.mpeg) {
+ // Chrome and Safari
+ container = 'audio/mpeg';
+ audioTrack.codec = '';
+ } else if (typeSupported.mp3) {
+ // Firefox
+ audioTrack.codec = 'mp3';
+ }
+ }
+ tracks.audio = {
+ container: container,
+ codec: audioTrack.codec,
+ initSegment: !audioTrack.isAAC && typeSupported.mpeg ? new Uint8Array() : mp4_generator.initSegment([audioTrack]),
+ metadata: {
+ channelCount: audioTrack.channelCount
}
- this.fragCurrent = null;
- }
- this.fragPrevious = null;
- if (this.demuxer) {
- this.demuxer.destroy();
- this.demuxer = null;
+ };
+ if (computePTSDTS) {
+ // remember first PTS of this demuxing context. for audio, PTS = DTS
+ initPTS = initDTS = audioSamples[0].pts - audioTrack.inputTimeScale * timeOffset;
}
- this.state = State.STOPPED;
- this.forceStartLoad = false;
}
- }, {
- key: 'tick',
- value: function tick() {
- this.ticks++;
- if (this.ticks === 1) {
- this.doTick();
- if (this.ticks > 1) {
- setTimeout(this.tick, 1);
+
+ if (videoTrack.sps && videoTrack.pps && videoSamples.length) {
+ // let's use input time scale as MP4 video timescale
+ // we use input time scale straight away to avoid rounding issues on frame duration / cts computation
+ var inputTimeScale = videoTrack.inputTimeScale;
+ videoTrack.timescale = inputTimeScale;
+ tracks.video = {
+ container: 'video/mp4',
+ codec: videoTrack.codec,
+ initSegment: mp4_generator.initSegment([videoTrack]),
+ metadata: {
+ width: videoTrack.width,
+ height: videoTrack.height
}
- this.ticks = 0;
- }
- }
- }, {
- key: 'doTick',
- value: function doTick() {
- switch (this.state) {
- case State.ERROR:
- //don't do anything in error state to avoid breaking further ...
- break;
- case State.BUFFER_FLUSHING:
- // in buffer flushing state, reset fragLoadError counter
- this.fragLoadError = 0;
- break;
- case State.IDLE:
- this._doTickIdle();
- break;
- case State.WAITING_LEVEL:
- var level = this.levels[this.level];
- // check if playlist is already loaded
- if (level && level.details) {
- this.state = State.IDLE;
- }
- break;
- case State.FRAG_LOADING_WAITING_RETRY:
- var now = performance.now();
- var retryDate = this.retryDate;
- // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading
- if (!retryDate || now >= retryDate || this.media && this.media.seeking) {
- _logger.logger.log('mediaController: retryDate reached, switch back to IDLE state');
- this.state = State.IDLE;
- }
- break;
- case State.ERROR:
- case State.STOPPED:
- case State.FRAG_LOADING:
- case State.PARSING:
- case State.PARSED:
- case State.ENDED:
- break;
- default:
- break;
+ };
+ if (computePTSDTS) {
+ initPTS = Math.min(initPTS, videoSamples[0].pts - inputTimeScale * timeOffset);
+ initDTS = Math.min(initDTS, videoSamples[0].dts - inputTimeScale * timeOffset);
+ this.observer.trigger(events["a" /* default */].INIT_PTS_FOUND, { initPTS: initPTS });
}
- // check buffer
- this._checkBuffer();
- // check/update current fragment
- this._checkFragmentChanged();
}
- // Ironically the "idle" state is the on we do the most logic in it seems ....
- // NOTE: Maybe we could rather schedule a check for buffer length after half of the currently
- // played segment, or on pause/play/seek instead of naively checking every 100ms?
-
- }, {
- key: '_doTickIdle',
- value: function _doTickIdle() {
- var hls = this.hls,
- config = hls.config,
- media = this.media;
-
- // if video not attached AND
- // start fragment already requested OR start frag prefetch disable
- // exit loop
- // => if start level loaded and media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop
- if (this.levelLastLoaded !== undefined && !media && (this.startFragRequested || !config.startFragPrefetch)) {
- return;
+ if (Object.keys(tracks).length) {
+ observer.trigger(events["a" /* default */].FRAG_PARSING_INIT_SEGMENT, data);
+ this.ISGenerated = true;
+ if (computePTSDTS) {
+ this._initPTS = initPTS;
+ this._initDTS = initDTS;
}
+ } else {
+ observer.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].FRAG_PARSING_ERROR, fatal: false, reason: 'no audio/video samples found' });
+ }
+ };
+
+ MP4Remuxer.prototype.remuxVideo = function remuxVideo(track, timeOffset, contiguous, audioTrackLength, accurateTimeOffset) {
+ var offset = 8,
+ timeScale = track.timescale,
+ mp4SampleDuration,
+ mdat,
+ moof,
+ firstPTS,
+ firstDTS,
+ nextDTS,
+ lastPTS,
+ lastDTS,
+ inputSamples = track.samples,
+ outputSamples = [],
+ nbSamples = inputSamples.length,
+ ptsNormalize = this._PTSNormalize,
+ initDTS = this._initDTS;
+
+ // for (let i = 0; i < track.samples.length; i++) {
+ // let avcSample = track.samples[i];
+ // let units = avcSample.units;
+ // let unitsString = '';
+ // for (let j = 0; j < units.length ; j++) {
+ // unitsString += units[j].type + ',';
+ // if (units[j].data.length < 500) {
+ // unitsString += Hex.hexDump(units[j].data);
+ // }
+ // }
+ // logger.log(avcSample.pts + '/' + avcSample.dts + ',' + unitsString + avcSample.units.length);
+ // }
+
+ // if parsed fragment is contiguous with last one, let's use last DTS value as reference
+ var nextAvcDts = this.nextAvcDts;
+
+ var isSafari = this.isSafari;
+
+ // Safari does not like overlapping DTS on consecutive fragments. let's use nextAvcDts to overcome this if fragments are consecutive
+ if (isSafari) {
+ // also consider consecutive fragments as being contiguous (even if a level switch occurs),
+ // for sake of clarity:
+ // consecutive fragments are frags with
+ // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR
+ // - less than 200 ms PTS gaps (timeScale/5)
+ contiguous |= inputSamples.length && nextAvcDts && (accurateTimeOffset && Math.abs(timeOffset - nextAvcDts / timeScale) < 0.1 || Math.abs(inputSamples[0].pts - nextAvcDts - initDTS) < timeScale / 5);
+ }
- // if we have not yet loaded any fragment, start loading from start position
- var pos = void 0;
- if (this.loadedmetadata) {
- pos = media.currentTime;
- } else {
- pos = this.nextLoadPosition;
- }
- // determine next load level
- var level = hls.nextLoadLevel,
- levelInfo = this.levels[level];
+ if (!contiguous) {
+ // if not contiguous, let's use target timeOffset
+ nextAvcDts = timeOffset * timeScale;
+ }
- if (!levelInfo) {
- return;
- }
+ // PTS is coded on 33bits, and can loop from -2^32 to 2^32
+ // ptsNormalize will make PTS/DTS value monotonic, we use last known DTS value as reference value
+ inputSamples.forEach(function (sample) {
+ sample.pts = ptsNormalize(sample.pts - initDTS, nextAvcDts);
+ sample.dts = ptsNormalize(sample.dts - initDTS, nextAvcDts);
+ });
- var levelBitrate = levelInfo.bitrate,
- maxBufLen = void 0;
+ // sort video samples by DTS then PTS then demux id order
+ inputSamples.sort(function (a, b) {
+ var deltadts = a.dts - b.dts;
+ var deltapts = a.pts - b.pts;
+ return deltadts ? deltadts : deltapts ? deltapts : a.id - b.id;
+ });
- // compute max Buffer Length that we could get from this load level, based on level bitrate. don't buffer more than 60 MB and more than 30s
- if (levelBitrate) {
- maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, config.maxBufferLength);
+ // handle broken streams with PTS < DTS, tolerance up 200ms (18000 in 90kHz timescale)
+ var PTSDTSshift = inputSamples.reduce(function (prev, curr) {
+ return Math.max(Math.min(prev, curr.pts - curr.dts), -18000);
+ }, 0);
+ if (PTSDTSshift < 0) {
+ logger["b" /* logger */].warn('PTS < DTS detected in video samples, shifting DTS by ' + Math.round(PTSDTSshift / 90) + ' ms to overcome this issue');
+ for (var i = 0; i < inputSamples.length; i++) {
+ inputSamples[i].dts += PTSDTSshift;
+ }
+ }
+
+ // compute first DTS and last DTS, normalize them against reference value
+ var sample = inputSamples[0];
+ firstDTS = Math.max(sample.dts, 0);
+ firstPTS = Math.max(sample.pts, 0);
+
+ // check timestamp continuity accross consecutive fragments (this is to remove inter-fragment gap/hole)
+ var delta = Math.round((firstDTS - nextAvcDts) / 90);
+ // if fragment are contiguous, detect hole/overlapping between fragments
+ if (contiguous) {
+ if (delta) {
+ if (delta > 1) {
+ logger["b" /* logger */].log('AVC:' + delta + ' ms hole between fragments detected,filling it');
+ } else if (delta < -1) {
+ logger["b" /* logger */].log('AVC:' + -delta + ' ms overlapping between fragments detected');
+ }
+ // remove hole/gap : set DTS to next expected DTS
+ firstDTS = nextAvcDts;
+ inputSamples[0].dts = firstDTS;
+ // offset PTS as well, ensure that PTS is smaller or equal than new DTS
+ firstPTS = Math.max(firstPTS - delta, nextAvcDts);
+ inputSamples[0].pts = firstPTS;
+ logger["b" /* logger */].log('Video/PTS/DTS adjusted: ' + Math.round(firstPTS / 90) + '/' + Math.round(firstDTS / 90) + ',delta:' + delta + ' ms');
+ }
+ }
+ nextDTS = firstDTS;
+
+ // compute lastPTS/lastDTS
+ sample = inputSamples[inputSamples.length - 1];
+ lastDTS = Math.max(sample.dts, 0);
+ lastPTS = Math.max(sample.pts, 0, lastDTS);
+
+ // on Safari let's signal the same sample duration for all samples
+ // sample duration (as expected by trun MP4 boxes), should be the delta between sample DTS
+ // set this constant duration as being the avg delta between consecutive DTS.
+ if (isSafari) {
+ mp4SampleDuration = Math.round((lastDTS - firstDTS) / (inputSamples.length - 1));
+ }
+
+ var nbNalu = 0,
+ naluLen = 0;
+ for (var _i = 0; _i < nbSamples; _i++) {
+ // compute total/avc sample length and nb of NAL units
+ var _sample = inputSamples[_i],
+ units = _sample.units,
+ nbUnits = units.length,
+ sampleLen = 0;
+ for (var j = 0; j < nbUnits; j++) {
+ sampleLen += units[j].data.length;
+ }
+ naluLen += sampleLen;
+ nbNalu += nbUnits;
+ _sample.length = sampleLen;
+
+ // normalize PTS/DTS
+ if (isSafari) {
+ // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples
+ _sample.dts = firstDTS + _i * mp4SampleDuration;
} else {
- maxBufLen = config.maxBufferLength;
- }
- maxBufLen = Math.min(maxBufLen, config.maxMaxBufferLength);
-
- // determine next candidate fragment to be loaded, based on current position and end of buffer position
- // ensure up to `config.maxMaxBufferLength` of buffer upfront
-
- var bufferInfo = _bufferHelper2.default.bufferInfo(this.mediaBuffer ? this.mediaBuffer : media, pos, config.maxBufferHole),
- bufferLen = bufferInfo.len;
- // Stay idle if we are still with buffer margins
- if (bufferLen >= maxBufLen) {
- return;
- }
-
- // if buffer length is less than maxBufLen try to load a new fragment ...
- _logger.logger.trace('buffer length of ' + bufferLen.toFixed(3) + ' is below max of ' + maxBufLen.toFixed(3) + '. checking for more payload ...');
-
- // set next load level : this will trigger a playlist load if needed
- this.level = hls.nextLoadLevel = level;
-
- var levelDetails = levelInfo.details;
- // if level info not retrieved yet, switch state and wait for level retrieval
- // if live playlist, ensure that new playlist has been refreshed to avoid loading/try to load
- // a useless and outdated fragment (that might even introduce load error if it is already out of the live playlist)
- if (typeof levelDetails === 'undefined' || levelDetails.live && this.levelLastLoaded !== level) {
- this.state = State.WAITING_LEVEL;
- return;
+ // ensure sample monotonic DTS
+ _sample.dts = Math.max(_sample.dts, firstDTS);
}
-
- // we just got done loading the final fragment, check if we need to finalize media stream
- var fragPrevious = this.fragPrevious;
- if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN) {
- // fragPrevious is last fragment. retrieve level duration using last frag start offset + duration
- // real duration might be lower than initial duration if there are drifts between real frag duration and playlist signaling
- var duration = Math.min(media.duration, fragPrevious.start + fragPrevious.duration);
- // if everything (almost) til the end is buffered, let's signal eos
- // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference (audio/video offsets...)
- // tolerate up to one frag duration to cope with these cases.
- // also cope with almost zero last frag duration (max last frag duration with 200ms) refer to https://github.com/video-dev/hls.js/pull/657
- if (duration - Math.max(bufferInfo.end, fragPrevious.start) <= Math.max(0.2, fragPrevious.duration)) {
- // Finalize the media stream
- var data = {};
- if (this.altAudio) {
- data.type = 'video';
- }
- this.hls.trigger(_events2.default.BUFFER_EOS, data);
- this.state = State.ENDED;
- return;
- }
- }
-
- // if we have the levelDetails for the selected variant, lets continue enrichen our stream (load keys/fragments or trigger EOS, etc..)
- this._fetchPayloadOrEos(pos, bufferInfo, levelDetails);
+ // ensure that computed value is greater or equal than sample DTS
+ _sample.pts = Math.max(_sample.pts, _sample.dts);
}
- }, {
- key: '_fetchPayloadOrEos',
- value: function _fetchPayloadOrEos(pos, bufferInfo, levelDetails) {
- var fragPrevious = this.fragPrevious,
- level = this.level,
- fragments = levelDetails.fragments,
- fragLen = fragments.length;
-
- // empty playlist
- if (fragLen === 0) {
- return;
- }
-
- // find fragment index, contiguous with end of buffer position
- var start = fragments[0].start,
- end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,
- bufferEnd = bufferInfo.end,
- frag = void 0;
- if (levelDetails.initSegment && !levelDetails.initSegment.data) {
- frag = levelDetails.initSegment;
- } else {
- // in case of live playlist we need to ensure that requested position is not located before playlist start
- if (levelDetails.live) {
- var initialLiveManifestSize = this.config.initialLiveManifestSize;
- if (fragLen < initialLiveManifestSize) {
- _logger.logger.warn('Can not start playback of a level, reason: not enough fragments ' + fragLen + ' < ' + initialLiveManifestSize);
- return;
- }
-
- frag = this._ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen);
- // if it explicitely returns null don't load any fragment and exit function now
- if (frag === null) {
- return;
- }
- } else {
- // VoD playlist: if bufferEnd before start of playlist, load first fragment
- if (bufferEnd < start) {
- frag = fragments[0];
- }
- }
- }
- if (!frag) {
- frag = this._findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails);
- }
- if (frag) {
- this._loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd);
- }
+ /* concatenate the video data and construct the mdat in place
+ (need 8 more bytes to fill length and mpdat type) */
+ var mdatSize = naluLen + 4 * nbNalu + 8;
+ try {
+ mdat = new Uint8Array(mdatSize);
+ } catch (err) {
+ this.observer.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MUX_ERROR, details: errors["a" /* ErrorDetails */].REMUX_ALLOC_ERROR, fatal: false, bytes: mdatSize, reason: 'fail allocating video mdat ' + mdatSize });
return;
}
- }, {
- key: '_ensureFragmentAtLivePoint',
- value: function _ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen) {
- var config = this.hls.config,
- media = this.media;
-
- var frag = void 0;
-
- // check if requested position is within seekable boundaries :
- //logger.log(`start/pos/bufEnd/seeking:${start.toFixed(3)}/${pos.toFixed(3)}/${bufferEnd.toFixed(3)}/${this.media.seeking}`);
- var maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount * levelDetails.targetduration;
-
- if (bufferEnd < Math.max(start - config.maxFragLookUpTolerance, end - maxLatency)) {
- var liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);
- _logger.logger.log('buffer end: ' + bufferEnd.toFixed(3) + ' is located too far from the end of live sliding playlist, reset currentTime to : ' + liveSyncPosition.toFixed(3));
- bufferEnd = liveSyncPosition;
- if (media && media.readyState && media.duration > liveSyncPosition) {
- media.currentTime = liveSyncPosition;
- }
- }
-
- // if end of buffer greater than live edge, don't load any fragment
- // this could happen if live playlist intermittently slides in the past.
- // level 1 loaded [182580161,182580167]
- // level 1 loaded [182580162,182580169]
- // Loading 182580168 of [182580162 ,182580169],level 1 ..
- // Loading 182580169 of [182580162 ,182580169],level 1 ..
- // level 1 loaded [182580162,182580168] <============= here we should have bufferEnd > end. in that case break to avoid reloading 182580168
- // level 1 loaded [182580164,182580171]
- //
- // don't return null in case media not loaded yet (readystate === 0)
- if (levelDetails.PTSKnown && bufferEnd > end && media && media.readyState) {
- return null;
- }
-
- if (this.startFragRequested && !levelDetails.PTSKnown) {
- /* we are switching level on live playlist, but we don't have any PTS info for that quality level ...
- try to load frag matching with next SN.
- even if SN are not synchronized between playlists, loading this frag will help us
- compute playlist sliding and find the right one after in case it was not the right consecutive one */
- if (fragPrevious) {
- var targetSN = fragPrevious.sn + 1;
- if (targetSN >= levelDetails.startSN && targetSN <= levelDetails.endSN) {
- frag = fragments[targetSN - levelDetails.startSN];
- _logger.logger.log('live playlist, switching playlist, load frag with next SN: ' + frag.sn);
- }
- }
- if (!frag) {
- /* we have no idea about which fragment should be loaded.
- so let's load mid fragment. it will help computing playlist sliding and find the right one
- */
- frag = fragments[Math.min(fragLen - 1, Math.round(fragLen / 2))];
- _logger.logger.log('live playlist, switching playlist, unknown, load middle frag : ' + frag.sn);
- }
+ var view = new DataView(mdat.buffer);
+ view.setUint32(0, mdatSize);
+ mdat.set(mp4_generator.types.mdat, 4);
+
+ for (var _i2 = 0; _i2 < nbSamples; _i2++) {
+ var avcSample = inputSamples[_i2],
+ avcSampleUnits = avcSample.units,
+ mp4SampleLength = 0,
+ compositionTimeOffset = void 0;
+ // convert NALU bitstream to MP4 format (prepend NALU with size field)
+ for (var _j = 0, _nbUnits = avcSampleUnits.length; _j < _nbUnits; _j++) {
+ var unit = avcSampleUnits[_j],
+ unitData = unit.data,
+ unitDataLen = unit.data.byteLength;
+ view.setUint32(offset, unitDataLen);
+ offset += 4;
+ mdat.set(unitData, offset);
+ offset += unitDataLen;
+ mp4SampleLength += 4 + unitDataLen;
}
- return frag;
- }
- }, {
- key: '_findFragment',
- value: function _findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails) {
- var config = this.hls.config;
- var frag = void 0;
- var foundFrag = void 0;
- var maxFragLookUpTolerance = config.maxFragLookUpTolerance;
- var fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;
- var fragmentWithinToleranceTest = function fragmentWithinToleranceTest(candidate) {
- // offset should be within fragment boundary - config.maxFragLookUpTolerance
- // this is to cope with situations like
- // bufferEnd = 9.991
- // frag[Ø] : [0,10]
- // frag[1] : [10,20]
- // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here
- // frag start frag start+duration
- // |-----------------------------|
- // <---> <--->
- // ...--------><-----------------------------><---------....
- // previous frag matching fragment next frag
- // return -1 return 0 return 1
- //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);
- // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments
- var candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);
- if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {
- return 1;
- } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element
- else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {
- return -1;
- }
- return 0;
- };
- if (bufferEnd < end) {
- if (bufferEnd > end - maxFragLookUpTolerance) {
- maxFragLookUpTolerance = 0;
- }
- // Prefer the next fragment if it's within tolerance
- if (fragNext && !fragmentWithinToleranceTest(fragNext)) {
- foundFrag = fragNext;
+ if (!isSafari) {
+ // expected sample duration is the Decoding Timestamp diff of consecutive samples
+ if (_i2 < nbSamples - 1) {
+ mp4SampleDuration = inputSamples[_i2 + 1].dts - avcSample.dts;
} else {
- foundFrag = _binarySearch2.default.search(fragments, fragmentWithinToleranceTest);
- }
- } else {
- // reach end of playlist
- foundFrag = fragments[fragLen - 1];
- }
- if (foundFrag) {
- frag = foundFrag;
- var curSNIdx = frag.sn - levelDetails.startSN;
- var sameLevel = fragPrevious && frag.level === fragPrevious.level;
- var prevFrag = fragments[curSNIdx - 1];
- var nextFrag = fragments[curSNIdx + 1];
- //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);
- if (fragPrevious && frag.sn === fragPrevious.sn) {
- if (sameLevel && !frag.backtracked) {
- if (frag.sn < levelDetails.endSN) {
- var deltaPTS = fragPrevious.deltaPTS;
- // if there is a significant delta between audio and video, larger than max allowed hole,
- // and if previous remuxed fragment did not start with a keyframe. (fragPrevious.dropped)
- // let's try to load previous fragment again to get last keyframe
- // then we will reload again current fragment (that way we should be able to fill the buffer hole ...)
- if (deltaPTS && deltaPTS > config.maxBufferHole && fragPrevious.dropped && curSNIdx) {
- frag = prevFrag;
- _logger.logger.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');
- // decrement previous frag load counter to avoid frag loop loading error when next fragment will get reloaded
- fragPrevious.loadCounter--;
- } else {
- frag = nextFrag;
- _logger.logger.log('SN just loaded, load next one: ' + frag.sn);
+ var config = this.config,
+ lastFrameDuration = avcSample.dts - inputSamples[_i2 > 0 ? _i2 - 1 : _i2].dts;
+ if (config.stretchShortVideoTrack) {
+ // In some cases, a segment's audio track duration may exceed the video track duration.
+ // Since we've already remuxed audio, and we know how long the audio track is, we look to
+ // see if the delta to the next segment is longer than the minimum of maxBufferHole and
+ // maxSeekHole. If so, playback would potentially get stuck, so we artificially inflate
+ // the duration of the last frame to minimize any potential gap between segments.
+ var maxBufferHole = config.maxBufferHole,
+ maxSeekHole = config.maxSeekHole,
+ gapTolerance = Math.floor(Math.min(maxBufferHole, maxSeekHole) * timeScale),
+ deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * timeScale : this.nextAudioPts) - avcSample.pts;
+ if (deltaToFrameEnd > gapTolerance) {
+ // We subtract lastFrameDuration from deltaToFrameEnd to try to prevent any video
+ // frame overlap. maxBufferHole/maxSeekHole should be >> lastFrameDuration anyway.
+ mp4SampleDuration = deltaToFrameEnd - lastFrameDuration;
+ if (mp4SampleDuration < 0) {
+ mp4SampleDuration = lastFrameDuration;
}
+ logger["b" /* logger */].log('It is approximately ' + deltaToFrameEnd / 90 + ' ms to the next segment; using duration ' + mp4SampleDuration / 90 + ' ms for the last video frame.');
} else {
- frag = null;
- }
- } else if (frag.backtracked) {
- // Only backtrack a max of 1 consecutive fragment to prevent sliding back too far when little or no frags start with keyframes
- if (nextFrag && nextFrag.backtracked) {
- _logger.logger.warn('Already backtracked from fragment ' + nextFrag.sn + ', will not backtrack to fragment ' + frag.sn + '. Loading fragment ' + nextFrag.sn);
- frag = nextFrag;
- } else {
- // If a fragment has dropped frames and it's in a same level/sequence, load the previous fragment to try and find the keyframe
- // Reset the dropped count now since it won't be reset until we parse the fragment again, which prevents infinite backtracking on the same segment
- _logger.logger.warn('Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe');
- frag.dropped = 0;
- if (prevFrag) {
- if (prevFrag.loadCounter) {
- prevFrag.loadCounter--;
- }
- frag = prevFrag;
- frag.backtracked = true;
- } else {
- frag = null;
- }
+ mp4SampleDuration = lastFrameDuration;
}
+ } else {
+ mp4SampleDuration = lastFrameDuration;
}
}
- }
- return frag;
- }
- }, {
- key: '_loadFragmentOrKey',
- value: function _loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd) {
- var hls = this.hls,
- config = hls.config;
-
- //logger.log('loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));
- if (frag.decryptdata && frag.decryptdata.uri != null && frag.decryptdata.key == null) {
- _logger.logger.log('Loading key for ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level);
- this.state = State.KEY_LOADING;
- hls.trigger(_events2.default.KEY_LOADING, { frag: frag });
+ compositionTimeOffset = Math.round(avcSample.pts - avcSample.dts);
} else {
- _logger.logger.log('Loading ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level + ', currentTime:' + pos.toFixed(3) + ',bufferEnd:' + bufferEnd.toFixed(3));
- // ensure that we are not reloading the same fragments in loop ...
- if (this.fragLoadIdx !== undefined) {
- this.fragLoadIdx++;
- } else {
- this.fragLoadIdx = 0;
- }
- if (frag.loadCounter) {
- frag.loadCounter++;
- var maxThreshold = config.fragLoadingLoopThreshold;
- // if this frag has already been loaded 3 times, and if it has been reloaded recently
- if (frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold) {
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });
- return;
- }
- } else {
- frag.loadCounter = 1;
- }
- frag.loadIdx = this.fragLoadIdx;
- this.fragCurrent = frag;
- this.startFragRequested = true;
- if (!isNaN(frag.sn)) {
- this.nextLoadPosition = frag.start + frag.duration;
- }
- frag.autoLevel = hls.autoLevelEnabled;
- frag.bitrateTest = this.bitrateTest;
- hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });
- // lazy demuxer init, as this could take some time ... do it during frag loading
- if (!this.demuxer) {
- this.demuxer = new _demuxer2.default(hls, 'main');
- }
- this.state = State.FRAG_LOADING;
- return;
- }
- }
- }, {
- key: 'getBufferedFrag',
- value: function getBufferedFrag(position) {
- return _binarySearch2.default.search(this._bufferedFrags, function (frag) {
- if (position < frag.startPTS) {
- return -1;
- } else if (position > frag.endPTS) {
- return 1;
+ compositionTimeOffset = Math.max(0, mp4SampleDuration * Math.round((avcSample.pts - avcSample.dts) / mp4SampleDuration));
+ }
+
+ //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(avcSample.pts/4294967296).toFixed(3)}');
+ outputSamples.push({
+ size: mp4SampleLength,
+ // constant duration
+ duration: mp4SampleDuration,
+ cts: compositionTimeOffset,
+ flags: {
+ isLeading: 0,
+ isDependedOn: 0,
+ hasRedundancy: 0,
+ degradPrio: 0,
+ dependsOn: avcSample.key ? 2 : 1,
+ isNonSync: avcSample.key ? 0 : 1
}
- return 0;
});
}
- }, {
- key: 'followingBufferedFrag',
- value: function followingBufferedFrag(frag) {
- if (frag) {
- // try to get range of next fragment (500ms after this range)
- return this.getBufferedFrag(frag.endPTS + 0.5);
- }
- return null;
- }
- }, {
- key: '_checkFragmentChanged',
- value: function _checkFragmentChanged() {
- var fragPlayingCurrent,
- currentTime,
- video = this.media;
- if (video && video.readyState && video.seeking === false) {
- currentTime = video.currentTime;
- /* if video element is in seeked state, currentTime can only increase.
- (assuming that playback rate is positive ...)
- As sometimes currentTime jumps back to zero after a
- media decode error, check this, to avoid seeking back to
- wrong position after a media decode error
- */
- if (currentTime > video.playbackRate * this.lastCurrentTime) {
- this.lastCurrentTime = currentTime;
- }
- if (_bufferHelper2.default.isBuffered(video, currentTime)) {
- fragPlayingCurrent = this.getBufferedFrag(currentTime);
- } else if (_bufferHelper2.default.isBuffered(video, currentTime + 0.1)) {
- /* ensure that FRAG_CHANGED event is triggered at startup,
- when first video frame is displayed and playback is paused.
- add a tolerance of 100ms, in case current position is not buffered,
- check if current pos+100ms is buffered and use that buffer range
- for FRAG_CHANGED event reporting */
- fragPlayingCurrent = this.getBufferedFrag(currentTime + 0.1);
- }
- if (fragPlayingCurrent) {
- var fragPlaying = fragPlayingCurrent;
- if (fragPlaying !== this.fragPlaying) {
- this.hls.trigger(_events2.default.FRAG_CHANGED, { frag: fragPlaying });
- var fragPlayingLevel = fragPlaying.level;
- if (!this.fragPlaying || this.fragPlaying.level !== fragPlayingLevel) {
- this.hls.trigger(_events2.default.LEVEL_SWITCHED, { level: fragPlayingLevel });
- }
- this.fragPlaying = fragPlaying;
- }
- }
- }
- }
+ // next AVC sample DTS should be equal to last sample DTS + last sample duration (in PES timescale)
+ this.nextAvcDts = lastDTS + mp4SampleDuration;
+ var dropped = track.dropped;
+ track.len = 0;
+ track.nbNalu = 0;
+ track.dropped = 0;
+ if (outputSamples.length && navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
+ var flags = outputSamples[0].flags;
+ // chrome workaround, mark first sample as being a Random Access Point to avoid sourcebuffer append issue
+ // https://code.google.com/p/chromium/issues/detail?id=229412
+ flags.dependsOn = 2;
+ flags.isNonSync = 0;
+ }
+ track.samples = outputSamples;
+ moof = mp4_generator.moof(track.sequenceNumber++, firstDTS, track);
+ track.samples = [];
+
+ var data = {
+ data1: moof,
+ data2: mdat,
+ startPTS: firstPTS / timeScale,
+ endPTS: (lastPTS + mp4SampleDuration) / timeScale,
+ startDTS: firstDTS / timeScale,
+ endDTS: this.nextAvcDts / timeScale,
+ type: 'video',
+ nb: outputSamples.length,
+ dropped: dropped
+ };
+ this.observer.trigger(events["a" /* default */].FRAG_PARSING_DATA, data);
+ return data;
+ };
+
+ MP4Remuxer.prototype.remuxAudio = function remuxAudio(track, timeOffset, contiguous, accurateTimeOffset) {
+ var inputTimeScale = track.inputTimeScale,
+ mp4timeScale = track.timescale,
+ scaleFactor = inputTimeScale / mp4timeScale,
+ mp4SampleDuration = track.isAAC ? 1024 : 1152,
+ inputSampleDuration = mp4SampleDuration * scaleFactor,
+ ptsNormalize = this._PTSNormalize,
+ initDTS = this._initDTS,
+ rawMPEG = !track.isAAC && this.typeSupported.mpeg;
+
+ var offset,
+ mp4Sample,
+ fillFrame,
+ mdat,
+ moof,
+ firstPTS,
+ lastPTS,
+ inputSamples = track.samples,
+ outputSamples = [],
+ nextAudioPts = this.nextAudioPts;
+
+ // for audio samples, also consider consecutive fragments as being contiguous (even if a level switch occurs),
+ // for sake of clarity:
+ // consecutive fragments are frags with
+ // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR
+ // - less than 20 audio frames distance
+ // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)
+ // this helps ensuring audio continuity
+ // and this also avoids audio glitches/cut when switching quality, or reporting wrong duration on first audio frame
+ contiguous |= inputSamples.length && nextAudioPts && (accurateTimeOffset && Math.abs(timeOffset - nextAudioPts / inputTimeScale) < 0.1 || Math.abs(inputSamples[0].pts - nextAudioPts - initDTS) < 20 * inputSampleDuration);
+
+ // compute normalized PTS
+ inputSamples.forEach(function (sample) {
+ sample.pts = sample.dts = ptsNormalize(sample.pts - initDTS, timeOffset * inputTimeScale);
+ });
- /*
- on immediate level switch :
- - pause playback if playing
- - cancel any pending load request
- - and trigger a buffer flush
- */
+ // filter out sample with negative PTS that are not playable anyway
+ // if we don't remove these negative samples, they will shift all audio samples forward.
+ // leading to audio overlap between current / next fragment
+ inputSamples = inputSamples.filter(function (sample) {
+ return sample.pts >= 0;
+ });
- }, {
- key: 'immediateLevelSwitch',
- value: function immediateLevelSwitch() {
- _logger.logger.log('immediateLevelSwitch');
- if (!this.immediateSwitch) {
- this.immediateSwitch = true;
- var media = this.media,
- previouslyPaused = void 0;
- if (media) {
- previouslyPaused = media.paused;
- media.pause();
- } else {
- // don't restart playback after instant level switch in case media not attached
- previouslyPaused = true;
- }
- this.previouslyPaused = previouslyPaused;
- }
- var fragCurrent = this.fragCurrent;
- if (fragCurrent && fragCurrent.loader) {
- fragCurrent.loader.abort();
- }
- this.fragCurrent = null;
- // increase fragment load Index to avoid frag loop loading error after buffer flush
- this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;
- // flush everything
- this.flushMainBuffer(0, Number.POSITIVE_INFINITY);
+ // in case all samples have negative PTS, and have been filtered out, return now
+ if (inputSamples.length === 0) {
+ return;
}
- /*
- on immediate level switch end, after new fragment has been buffered :
- - nudge video decoder by slightly adjusting video currentTime (if currentTime buffered)
- - resume the playback if needed
- */
-
- }, {
- key: 'immediateLevelSwitchEnd',
- value: function immediateLevelSwitchEnd() {
- var media = this.media;
- if (media && media.buffered.length) {
- this.immediateSwitch = false;
- if (_bufferHelper2.default.isBuffered(media, media.currentTime)) {
- // only nudge if currentTime is buffered
- media.currentTime -= 0.0001;
- }
- if (!this.previouslyPaused) {
- media.play();
- }
- }
- }
- }, {
- key: 'nextLevelSwitch',
- value: function nextLevelSwitch() {
- /* try to switch ASAP without breaking video playback :
- in order to ensure smooth but quick level switching,
- we need to find the next flushable buffer range
- we should take into account new segment fetch time
- */
- var media = this.media;
- // ensure that media is defined and that metadata are available (to retrieve currentTime)
- if (media && media.readyState) {
- var fetchdelay = void 0,
- fragPlayingCurrent = void 0,
- nextBufferedFrag = void 0;
- // increase fragment load Index to avoid frag loop loading error after buffer flush
- this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;
- fragPlayingCurrent = this.getBufferedFrag(media.currentTime);
- if (fragPlayingCurrent && fragPlayingCurrent.startPTS > 1) {
- // flush buffer preceding current fragment (flush until current fragment start offset)
- // minus 1s to avoid video freezing, that could happen if we flush keyframe of current video ...
- this.flushMainBuffer(0, fragPlayingCurrent.startPTS - 1);
- }
- if (!media.paused) {
- // add a safety delay of 1s
- var nextLevelId = this.hls.nextLoadLevel,
- nextLevel = this.levels[nextLevelId],
- fragLastKbps = this.fragLastKbps;
- if (fragLastKbps && this.fragCurrent) {
- fetchdelay = this.fragCurrent.duration * nextLevel.bitrate / (1000 * fragLastKbps) + 1;
- } else {
- fetchdelay = 0;
- }
- } else {
- fetchdelay = 0;
- }
- //logger.log('fetchdelay:'+fetchdelay);
- // find buffer range that will be reached once new fragment will be fetched
- nextBufferedFrag = this.getBufferedFrag(media.currentTime + fetchdelay);
- if (nextBufferedFrag) {
- // we can flush buffer range following this one without stalling playback
- nextBufferedFrag = this.followingBufferedFrag(nextBufferedFrag);
- if (nextBufferedFrag) {
- // if we are here, we can also cancel any loading/demuxing in progress, as they are useless
- var fragCurrent = this.fragCurrent;
- if (fragCurrent && fragCurrent.loader) {
- fragCurrent.loader.abort();
- }
- this.fragCurrent = null;
- // flush position is the start position of this new buffer
- this.flushMainBuffer(nextBufferedFrag.startPTS, Number.POSITIVE_INFINITY);
- }
- }
- }
- }
- }, {
- key: 'flushMainBuffer',
- value: function flushMainBuffer(startOffset, endOffset) {
- this.state = State.BUFFER_FLUSHING;
- var flushScope = { startOffset: startOffset, endOffset: endOffset };
- // if alternate audio tracks are used, only flush video, otherwise flush everything
- if (this.altAudio) {
- flushScope.type = 'video';
- }
- this.hls.trigger(_events2.default.BUFFER_FLUSHING, flushScope);
- }
- }, {
- key: 'onMediaAttached',
- value: function onMediaAttached(data) {
- var media = this.media = this.mediaBuffer = data.media;
- this.onvseeking = this.onMediaSeeking.bind(this);
- this.onvseeked = this.onMediaSeeked.bind(this);
- this.onvended = this.onMediaEnded.bind(this);
- media.addEventListener('seeking', this.onvseeking);
- media.addEventListener('seeked', this.onvseeked);
- media.addEventListener('ended', this.onvended);
- var config = this.config;
- if (this.levels && config.autoStartLoad) {
- this.hls.startLoad(config.startPosition);
+ if (!contiguous) {
+ if (!accurateTimeOffset) {
+ // if frag are mot contiguous and if we cant trust time offset, let's use first sample PTS as next audio PTS
+ nextAudioPts = inputSamples[0].pts;
+ } else {
+ // if timeOffset is accurate, let's use it as predicted next audio PTS
+ nextAudioPts = timeOffset * inputTimeScale;
}
}
- }, {
- key: 'onMediaDetaching',
- value: function onMediaDetaching() {
- var media = this.media;
- if (media && media.ended) {
- _logger.logger.log('MSE detaching and video ended, reset startPosition');
- this.startPosition = this.lastCurrentTime = 0;
- }
- // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery
- var levels = this.levels;
- if (levels) {
- // reset fragment load counter
- levels.forEach(function (level) {
- if (level.details) {
- level.details.fragments.forEach(function (fragment) {
- fragment.loadCounter = undefined;
- fragment.backtracked = undefined;
- });
- }
- });
- }
- // remove video listeners
- if (media) {
- media.removeEventListener('seeking', this.onvseeking);
- media.removeEventListener('seeked', this.onvseeked);
- media.removeEventListener('ended', this.onvended);
- this.onvseeking = this.onvseeked = this.onvended = null;
- }
- this.media = this.mediaBuffer = null;
- this.loadedmetadata = false;
- this.stopLoad();
- }
- }, {
- key: 'onMediaSeeking',
- value: function onMediaSeeking() {
- var media = this.media,
- currentTime = media ? media.currentTime : undefined,
- config = this.config;
- if (!isNaN(currentTime)) {
- _logger.logger.log('media seeking to ' + currentTime.toFixed(3));
- }
- var mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media;
- var bufferInfo = _bufferHelper2.default.bufferInfo(mediaBuffer, currentTime, this.config.maxBufferHole);
- if (this.state === State.FRAG_LOADING) {
- var fragCurrent = this.fragCurrent;
- // check if we are seeking to a unbuffered area AND if frag loading is in progress
- if (bufferInfo.len === 0 && fragCurrent) {
- var tolerance = config.maxFragLookUpTolerance,
- fragStartOffset = fragCurrent.start - tolerance,
- fragEndOffset = fragCurrent.start + fragCurrent.duration + tolerance;
- // check if we seek position will be out of currently loaded frag range : if out cancel frag load, if in, don't do anything
- if (currentTime < fragStartOffset || currentTime > fragEndOffset) {
- if (fragCurrent.loader) {
- _logger.logger.log('seeking outside of buffer while fragment load in progress, cancel fragment load');
- fragCurrent.loader.abort();
+ // If the audio track is missing samples, the frames seem to get "left-shifted" within the
+ // resulting mp4 segment, causing sync issues and leaving gaps at the end of the audio segment.
+ // In an effort to prevent this from happening, we inject frames here where there are gaps.
+ // When possible, we inject a silent frame; when that's not possible, we duplicate the last
+ // frame.
+
+ if (track.isAAC) {
+ var maxAudioFramesDrift = this.config.maxAudioFramesDrift;
+ for (var i = 0, nextPts = nextAudioPts; i < inputSamples.length;) {
+ // First, let's see how far off this frame is from where we expect it to be
+ var sample = inputSamples[i],
+ delta;
+ var pts = sample.pts;
+ delta = pts - nextPts;
+
+ //console.log(Math.round(pts) + '/' + Math.round(nextPts) + '/' + Math.round(delta));
+ var duration = Math.abs(1000 * delta / inputTimeScale);
+
+ // If we're overlapping by more than a duration, drop this sample
+ if (delta <= -maxAudioFramesDrift * inputSampleDuration) {
+ logger["b" /* logger */].warn('Dropping 1 audio frame @ ' + (nextPts / inputTimeScale).toFixed(3) + 's due to ' + Math.round(duration) + ' ms overlap.');
+ inputSamples.splice(i, 1);
+ track.len -= sample.unit.length;
+ // Don't touch nextPtsNorm or i
+ }
+
+ // Insert missing frames if:
+ // 1: We're more than maxAudioFramesDrift frame away
+ // 2: Not more than MAX_SILENT_FRAME_DURATION away
+ // 3: currentTime (aka nextPtsNorm) is not 0
+ else if (delta >= maxAudioFramesDrift * inputSampleDuration && duration < MAX_SILENT_FRAME_DURATION && nextPts) {
+ var missing = Math.round(delta / inputSampleDuration);
+ logger["b" /* logger */].warn('Injecting ' + missing + ' audio frame @ ' + (nextPts / inputTimeScale).toFixed(3) + 's due to ' + Math.round(1000 * delta / inputTimeScale) + ' ms gap.');
+ for (var j = 0; j < missing; j++) {
+ var newStamp = Math.max(nextPts, 0);
+ fillFrame = aac.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);
+ if (!fillFrame) {
+ logger["b" /* logger */].log('Unable to get silent frame for given audio codec; duplicating last frame instead.');
+ fillFrame = sample.unit.subarray();
+ }
+ inputSamples.splice(i, 0, { unit: fillFrame, pts: newStamp, dts: newStamp });
+ track.len += fillFrame.length;
+ nextPts += inputSampleDuration;
+ i++;
}
- this.fragCurrent = null;
- this.fragPrevious = null;
- // switch to IDLE state to load new fragment
- this.state = State.IDLE;
+
+ // Adjust sample to next expected pts
+ sample.pts = sample.dts = nextPts;
+ nextPts += inputSampleDuration;
+ i++;
} else {
- _logger.logger.log('seeking outside of buffer but within currently loaded fragment range');
- }
- }
- } else if (this.state === State.ENDED) {
- // if seeking to unbuffered area, clean up fragPrevious
- if (bufferInfo.len === 0) {
- this.fragPrevious = 0;
- }
- // switch to IDLE state to check for potential new fragment
- this.state = State.IDLE;
- }
- if (media) {
- this.lastCurrentTime = currentTime;
- }
- // avoid reporting fragment loop loading error in case user is seeking several times on same position
- if (this.state !== State.FRAG_LOADING && this.fragLoadIdx !== undefined) {
- this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;
- }
- // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target
- if (!this.loadedmetadata) {
- this.nextLoadPosition = this.startPosition = currentTime;
- }
- // tick to speed up processing
- this.tick();
- }
- }, {
- key: 'onMediaSeeked',
- value: function onMediaSeeked() {
- var media = this.media,
- currentTime = media ? media.currentTime : undefined;
- if (!isNaN(currentTime)) {
- _logger.logger.log('media seeked to ' + currentTime.toFixed(3));
- }
- // tick to speed up FRAGMENT_PLAYING triggering
- this.tick();
- }
- }, {
- key: 'onMediaEnded',
- value: function onMediaEnded() {
- _logger.logger.log('media ended');
- // reset startPosition and lastCurrentTime to restart playback @ stream beginning
- this.startPosition = this.lastCurrentTime = 0;
- }
- }, {
- key: 'onManifestLoading',
- value: function onManifestLoading() {
- // reset buffer on manifest loading
- _logger.logger.log('trigger BUFFER_RESET');
- this.hls.trigger(_events2.default.BUFFER_RESET);
- this._bufferedFrags = [];
- this.stalled = false;
- this.startPosition = this.lastCurrentTime = 0;
- }
- }, {
- key: 'onManifestParsed',
- value: function onManifestParsed(data) {
- var aac = false,
- heaac = false,
- codec;
- data.levels.forEach(function (level) {
- // detect if we have different kind of audio codecs used amongst playlists
- codec = level.audioCodec;
- if (codec) {
- if (codec.indexOf('mp4a.40.2') !== -1) {
- aac = true;
- }
- if (codec.indexOf('mp4a.40.5') !== -1) {
- heaac = true;
+ // Otherwise, just adjust pts
+ if (Math.abs(delta) > 0.1 * inputSampleDuration) {
+ //logger.log(`Invalid frame delta ${Math.round(delta + inputSampleDuration)} at PTS ${Math.round(pts / 90)} (should be ${Math.round(inputSampleDuration)}).`);
+ }
+ sample.pts = sample.dts = nextPts;
+ nextPts += inputSampleDuration;
+ i++;
}
- }
- });
- this.audioCodecSwitch = aac && heaac;
- if (this.audioCodecSwitch) {
- _logger.logger.log('both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC');
- }
- this.levels = data.levels;
- this.startLevelLoaded = false;
- this.startFragRequested = false;
- var config = this.config;
- if (config.autoStartLoad || this.forceStartLoad) {
- this.hls.startLoad(config.startPosition);
}
}
- }, {
- key: 'onLevelLoaded',
- value: function onLevelLoaded(data) {
- var newDetails = data.details,
- newLevelId = data.level,
- curLevel = this.levels[newLevelId],
- duration = newDetails.totalduration,
- sliding = 0;
- _logger.logger.log('level ' + newLevelId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);
- this.levelLastLoaded = newLevelId;
-
- if (newDetails.live) {
- var curDetails = curLevel.details;
- if (curDetails && newDetails.fragments.length > 0) {
- // we already have details for that level, merge them
- _levelHelper2.default.mergeDetails(curDetails, newDetails);
- sliding = newDetails.fragments[0].start;
- this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);
- if (newDetails.PTSKnown) {
- _logger.logger.log('live playlist sliding:' + sliding.toFixed(3));
- } else {
- _logger.logger.log('live playlist - outdated PTS, unknown sliding');
- }
- } else {
- newDetails.PTSKnown = false;
- _logger.logger.log('live playlist - first load, unknown sliding');
- }
+ for (var _j2 = 0, _nbSamples = inputSamples.length; _j2 < _nbSamples; _j2++) {
+ var audioSample = inputSamples[_j2];
+ var unit = audioSample.unit;
+ var _pts = audioSample.pts;
+ //logger.log(`Audio/PTS:${Math.round(pts/90)}`);
+ // if not first sample
+ if (lastPTS !== undefined) {
+ mp4Sample.duration = Math.round((_pts - lastPTS) / scaleFactor);
} else {
- newDetails.PTSKnown = false;
- }
- // override level info
- curLevel.details = newDetails;
- this.hls.trigger(_events2.default.LEVEL_UPDATED, { details: newDetails, level: newLevelId });
-
- if (this.startFragRequested === false) {
- // compute start position if set to -1. use it straight away if value is defined
- if (this.startPosition === -1 || this.lastCurrentTime === -1) {
- // first, check if start time offset has been set in playlist, if yes, use this value
- var startTimeOffset = newDetails.startTimeOffset;
- if (!isNaN(startTimeOffset)) {
- if (startTimeOffset < 0) {
- _logger.logger.log('negative start time offset ' + startTimeOffset + ', count from end of last fragment');
- startTimeOffset = sliding + duration + startTimeOffset;
- }
- _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);
- this.startPosition = startTimeOffset;
- } else {
- // if live playlist, set start position to be fragment N-this.config.liveSyncDurationCount (usually 3)
- if (newDetails.live) {
- this.startPosition = this.computeLivePosition(sliding, newDetails);
- _logger.logger.log('configure startPosition to ' + this.startPosition);
- } else {
- this.startPosition = 0;
+ var _delta = Math.round(1000 * (_pts - nextAudioPts) / inputTimeScale),
+ numMissingFrames = 0;
+ // if fragment are contiguous, detect hole/overlapping between fragments
+ // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)
+ if (contiguous && track.isAAC) {
+ // log delta
+ if (_delta) {
+ if (_delta > 0 && _delta < MAX_SILENT_FRAME_DURATION) {
+ numMissingFrames = Math.round((_pts - nextAudioPts) / inputSampleDuration);
+ logger["b" /* logger */].log(_delta + ' ms hole between AAC samples detected,filling it');
+ if (numMissingFrames > 0) {
+ fillFrame = aac.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);
+ if (!fillFrame) {
+ fillFrame = unit.subarray();
+ }
+ track.len += numMissingFrames * fillFrame.length;
+ }
+ // if we have frame overlap, overlapping for more than half a frame duraion
+ } else if (_delta < -12) {
+ // drop overlapping audio frames... browser will deal with it
+ logger["b" /* logger */].log('drop overlapping AAC sample, expected/parsed/delta:' + (nextAudioPts / inputTimeScale).toFixed(3) + 's/' + (_pts / inputTimeScale).toFixed(3) + 's/' + -_delta + 'ms');
+ track.len -= unit.byteLength;
+ continue;
}
+ // set PTS/DTS to expected PTS/DTS
+ _pts = nextAudioPts;
}
- this.lastCurrentTime = this.startPosition;
}
- this.nextLoadPosition = this.startPosition;
- }
- // only switch batck to IDLE state if we were waiting for level to start downloading a new fragment
- if (this.state === State.WAITING_LEVEL) {
- this.state = State.IDLE;
- }
- //trigger handler right now
- this.tick();
- }
- }, {
- key: 'onKeyLoaded',
- value: function onKeyLoaded() {
- if (this.state === State.KEY_LOADING) {
- this.state = State.IDLE;
- this.tick();
- }
- }
- }, {
- key: 'onFragLoaded',
- value: function onFragLoaded(data) {
- var fragCurrent = this.fragCurrent,
- fragLoaded = data.frag;
- if (this.state === State.FRAG_LOADING && fragCurrent && fragLoaded.type === 'main' && fragLoaded.level === fragCurrent.level && fragLoaded.sn === fragCurrent.sn) {
- var stats = data.stats,
- currentLevel = this.levels[fragCurrent.level],
- details = currentLevel.details;
- _logger.logger.log('Loaded ' + fragCurrent.sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + fragCurrent.level);
- // reset frag bitrate test in any case after frag loaded event
- this.bitrateTest = false;
- this.stats = stats;
- // if this frag was loaded to perform a bitrate test AND if hls.nextLoadLevel is greater than 0
- // then this means that we should be able to load a fragment at a higher quality level
- if (fragLoaded.bitrateTest === true && this.hls.nextLoadLevel) {
- // switch back to IDLE state ... we just loaded a fragment to determine adequate start bitrate and initialize autoswitch algo
- this.state = State.IDLE;
- this.startFragRequested = false;
- stats.tparsed = stats.tbuffered = performance.now();
- this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'main' });
- this.tick();
- } else if (fragLoaded.sn === 'initSegment') {
- this.state = State.IDLE;
- stats.tparsed = stats.tbuffered = performance.now();
- details.initSegment.data = data.payload;
- this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'main' });
- this.tick();
- } else {
- this.state = State.PARSING;
- // transmux the MPEG-TS data to ISO-BMFF segments
- var duration = details.totalduration,
- level = fragCurrent.level,
- sn = fragCurrent.sn,
- audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;
- if (this.audioCodecSwap) {
- _logger.logger.log('swapping playlist audio codec');
- if (audioCodec === undefined) {
- audioCodec = this.lastAudioCodec;
- }
- if (audioCodec) {
- if (audioCodec.indexOf('mp4a.40.5') !== -1) {
- audioCodec = 'mp4a.40.2';
- } else {
- audioCodec = 'mp4a.40.5';
- }
- }
+ // remember first PTS of our audioSamples
+ firstPTS = _pts;
+ if (track.len > 0) {
+ /* concatenate the audio data and construct the mdat in place
+ (need 8 more bytes to fill length and mdat type) */
+ var mdatSize = rawMPEG ? track.len : track.len + 8;
+ offset = rawMPEG ? 0 : 8;
+ try {
+ mdat = new Uint8Array(mdatSize);
+ } catch (err) {
+ this.observer.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MUX_ERROR, details: errors["a" /* ErrorDetails */].REMUX_ALLOC_ERROR, fatal: false, bytes: mdatSize, reason: 'fail allocating audio mdat ' + mdatSize });
+ return;
}
- this.pendingBuffering = true;
- this.appended = false;
- _logger.logger.log('Parsing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + level + ', cc ' + fragCurrent.cc);
- var demuxer = this.demuxer;
- if (!demuxer) {
- demuxer = this.demuxer = new _demuxer2.default(this.hls, 'main');
+ if (!rawMPEG) {
+ var view = new DataView(mdat.buffer);
+ view.setUint32(0, mdatSize);
+ mdat.set(mp4_generator.types.mdat, 4);
}
- // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live) and if media is not seeking (this is to overcome potential timestamp drifts between playlists and fragments)
- var media = this.media;
- var mediaSeeking = media && media.seeking;
- var accurateTimeOffset = !mediaSeeking && (details.PTSKnown || !details.live);
- var initSegmentData = details.initSegment ? details.initSegment.data : [];
- demuxer.push(data.payload, initSegmentData, audioCodec, currentLevel.videoCodec, fragCurrent, duration, accurateTimeOffset, undefined);
+ } else {
+ // no audio samples
+ return;
}
- }
- this.fragLoadError = 0;
- }
- }, {
- key: 'onFragParsingInitSegment',
- value: function onFragParsingInitSegment(data) {
- var fragCurrent = this.fragCurrent;
- var fragNew = data.frag;
- if (fragCurrent && data.id === 'main' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === State.PARSING) {
- var tracks = data.tracks,
- trackName,
- track;
-
- // if audio track is expected to come from audio stream controller, discard any coming from main
- if (tracks.audio && this.altAudio) {
- delete tracks.audio;
- }
- // include levelCodec in audio and video tracks
- track = tracks.audio;
- if (track) {
- var audioCodec = this.levels[this.level].audioCodec,
- ua = navigator.userAgent.toLowerCase();
- if (audioCodec && this.audioCodecSwap) {
- _logger.logger.log('swapping playlist audio codec');
- if (audioCodec.indexOf('mp4a.40.5') !== -1) {
- audioCodec = 'mp4a.40.2';
- } else {
- audioCodec = 'mp4a.40.5';
- }
+ for (var _i3 = 0; _i3 < numMissingFrames; _i3++) {
+ fillFrame = aac.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);
+ if (!fillFrame) {
+ logger["b" /* logger */].log('Unable to get silent frame for given audio codec; duplicating this frame instead.');
+ fillFrame = unit.subarray();
}
- // in case AAC and HE-AAC audio codecs are signalled in manifest
- // force HE-AAC , as it seems that most browsers prefers that way,
- // except for mono streams OR on FF
- // these conditions might need to be reviewed ...
- if (this.audioCodecSwitch) {
- // don't force HE-AAC if mono stream
- if (track.metadata.channelCount !== 1 &&
- // don't force HE-AAC if firefox
- ua.indexOf('firefox') === -1) {
- audioCodec = 'mp4a.40.5';
+ mdat.set(fillFrame, offset);
+ offset += fillFrame.byteLength;
+ mp4Sample = {
+ size: fillFrame.byteLength,
+ cts: 0,
+ duration: 1024,
+ flags: {
+ isLeading: 0,
+ isDependedOn: 0,
+ hasRedundancy: 0,
+ degradPrio: 0,
+ dependsOn: 1
}
- }
- // HE-AAC is broken on Android, always signal audio codec as AAC even if variant manifest states otherwise
- if (ua.indexOf('android') !== -1 && track.container !== 'audio/mpeg') {
- // Exclude mpeg audio
- audioCodec = 'mp4a.40.2';
- _logger.logger.log('Android: force audio codec to ' + audioCodec);
- }
- track.levelCodec = audioCodec;
- track.id = data.id;
- }
- track = tracks.video;
- if (track) {
- track.levelCodec = this.levels[this.level].videoCodec;
- track.id = data.id;
- }
- this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);
- // loop through tracks that are going to be provided to bufferController
- for (trackName in tracks) {
- track = tracks[trackName];
- _logger.logger.log('main track:' + trackName + ',container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');
- var initSegment = track.initSegment;
- if (initSegment) {
- this.appended = true;
- // arm pending Buffering flag before appending a segment
- this.pendingBuffering = true;
- this.hls.trigger(_events2.default.BUFFER_APPENDING, { type: trackName, data: initSegment, parent: 'main', content: 'initSegment' });
- }
+ };
+ outputSamples.push(mp4Sample);
+ }
+ }
+ mdat.set(unit, offset);
+ var unitLen = unit.byteLength;
+ offset += unitLen;
+ //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${audioSample.pts}/${audioSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(audioSample.pts/4294967296).toFixed(3)}');
+ mp4Sample = {
+ size: unitLen,
+ cts: 0,
+ duration: 0,
+ flags: {
+ isLeading: 0,
+ isDependedOn: 0,
+ hasRedundancy: 0,
+ degradPrio: 0,
+ dependsOn: 1
}
- //trigger handler right now
- this.tick();
+ };
+ outputSamples.push(mp4Sample);
+ lastPTS = _pts;
+ }
+ var lastSampleDuration = 0;
+ var nbSamples = outputSamples.length;
+ //set last sample duration as being identical to previous sample
+ if (nbSamples >= 2) {
+ lastSampleDuration = outputSamples[nbSamples - 2].duration;
+ mp4Sample.duration = lastSampleDuration;
+ }
+ if (nbSamples) {
+ // next audio sample PTS should be equal to last sample PTS + duration
+ this.nextAudioPts = nextAudioPts = lastPTS + scaleFactor * lastSampleDuration;
+ //logger.log('Audio/PTS/PTSend:' + audioSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));
+ track.len = 0;
+ track.samples = outputSamples;
+ if (rawMPEG) {
+ moof = new Uint8Array();
+ } else {
+ moof = mp4_generator.moof(track.sequenceNumber++, firstPTS / scaleFactor, track);
}
+ track.samples = [];
+ var start = firstPTS / inputTimeScale;
+ var end = nextAudioPts / inputTimeScale;
+ var audioData = {
+ data1: moof,
+ data2: mdat,
+ startPTS: start,
+ endPTS: end,
+ startDTS: start,
+ endDTS: end,
+ type: 'audio',
+ nb: nbSamples
+ };
+ this.observer.trigger(events["a" /* default */].FRAG_PARSING_DATA, audioData);
+ return audioData;
}
- }, {
- key: 'onFragParsingData',
- value: function onFragParsingData(data) {
- var _this2 = this;
+ return null;
+ };
- var fragCurrent = this.fragCurrent;
- var fragNew = data.frag;
- if (fragCurrent && data.id === 'main' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && !(data.type === 'audio' && this.altAudio) && // filter out main audio if audio track is loaded through audio stream controller
- this.state === State.PARSING) {
- var level = this.levels[this.level],
- frag = fragCurrent;
- if (isNaN(data.endPTS)) {
- data.endPTS = data.startPTS + fragCurrent.duration;
- data.endDTS = data.startDTS + fragCurrent.duration;
- }
-
- _logger.logger.log('Parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb + ',dropped:' + (data.dropped || 0));
-
- // Detect gaps in a fragment and try to fix it by finding a keyframe in the previous fragment (see _findFragments)
- if (data.type === 'video') {
- frag.dropped = data.dropped;
- if (frag.dropped) {
- if (!frag.backtracked) {
- _logger.logger.warn('missing video frame(s), backtracking fragment');
- // Return back to the IDLE state without appending to buffer
- // Causes findFragments to backtrack a segment and find the keyframe
- // Audio fragments arriving before video sets the nextLoadPosition, causing _findFragments to skip the backtracked fragment
- frag.backtracked = true;
- this.nextLoadPosition = data.startPTS;
- this.state = State.IDLE;
- this.fragPrevious = frag;
- this.tick();
- return;
- } else {
- _logger.logger.warn('Already backtracked on this fragment, appending with the gap');
- }
- } else {
- // Only reset the backtracked flag if we've loaded the frag without any dropped frames
- frag.backtracked = false;
- }
- }
+ MP4Remuxer.prototype.remuxEmptyAudio = function remuxEmptyAudio(track, timeOffset, contiguous, videoData) {
+ var inputTimeScale = track.inputTimeScale,
+ mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale,
+ scaleFactor = inputTimeScale / mp4timeScale,
+ nextAudioPts = this.nextAudioPts,
- var drift = _levelHelper2.default.updateFragPTSDTS(level.details, frag, data.startPTS, data.endPTS, data.startDTS, data.endDTS),
- hls = this.hls;
- hls.trigger(_events2.default.LEVEL_PTS_UPDATED, { details: level.details, level: this.level, drift: drift, type: data.type, start: data.startPTS, end: data.endPTS });
- // has remuxer dropped video frames located before first keyframe ?
- [data.data1, data.data2].forEach(function (buffer) {
- // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)
- // in that case it is useless to append following segments
- if (buffer && buffer.length && _this2.state === State.PARSING) {
- _this2.appended = true;
- // arm pending Buffering flag before appending a segment
- _this2.pendingBuffering = true;
- hls.trigger(_events2.default.BUFFER_APPENDING, { type: data.type, data: buffer, parent: 'main', content: 'data' });
- }
- });
- //trigger handler right now
- this.tick();
- }
- }
- }, {
- key: 'onFragParsed',
- value: function onFragParsed(data) {
- var fragCurrent = this.fragCurrent;
- var fragNew = data.frag;
- if (fragCurrent && data.id === 'main' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === State.PARSING) {
- this.stats.tparsed = performance.now();
- this.state = State.PARSED;
- this._checkAppendedParsed();
- }
- }
- }, {
- key: 'onAudioTrackSwitching',
- value: function onAudioTrackSwitching(data) {
- // if any URL found on new audio track, it is an alternate audio track
- var altAudio = !!data.url,
- trackId = data.id;
- // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered
- // don't do anything if we switch to alt audio: audio stream controller is handling it.
- // we will just have to change buffer scheduling on audioTrackSwitched
- if (!altAudio) {
- if (this.mediaBuffer !== this.media) {
- _logger.logger.log('switching on main audio, use media.buffered to schedule main fragment loading');
- this.mediaBuffer = this.media;
- var fragCurrent = this.fragCurrent;
- // we need to refill audio buffer from main: cancel any frag loading to speed up audio switch
- if (fragCurrent.loader) {
- _logger.logger.log('switching to main audio track, cancel main fragment load');
- fragCurrent.loader.abort();
- }
- this.fragCurrent = null;
- this.fragPrevious = null;
- // destroy demuxer to force init segment generation (following audio switch)
- if (this.demuxer) {
- this.demuxer.destroy();
- this.demuxer = null;
- }
- // switch to IDLE state to load new fragment
- this.state = State.IDLE;
- }
- var hls = this.hls;
- // switching to main audio, flush all audio and trigger track switched
- hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });
- hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });
- this.altAudio = false;
- }
- }
- }, {
- key: 'onAudioTrackSwitched',
- value: function onAudioTrackSwitched(data) {
- var trackId = data.id,
- altAudio = !!this.hls.audioTracks[trackId].url;
- if (altAudio) {
- var videoBuffer = this.videoBuffer;
- // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered
- if (videoBuffer && this.mediaBuffer !== videoBuffer) {
- _logger.logger.log('switching on alternate audio, use video.buffered to schedule main fragment loading');
- this.mediaBuffer = videoBuffer;
- }
- }
- this.altAudio = altAudio;
- this.tick();
- }
- }, {
- key: 'onBufferCreated',
- value: function onBufferCreated(data) {
- var tracks = data.tracks,
- mediaTrack = void 0,
- name = void 0,
- alternate = false;
- for (var type in tracks) {
- var track = tracks[type];
- if (track.id === 'main') {
- name = type;
- mediaTrack = track;
- // keep video source buffer reference
- if (type === 'video') {
- this.videoBuffer = tracks[type].buffer;
- }
- } else {
- alternate = true;
- }
- }
- if (alternate && mediaTrack) {
- _logger.logger.log('alternate track found, use ' + name + '.buffered to schedule main fragment loading');
- this.mediaBuffer = mediaTrack.buffer;
- } else {
- this.mediaBuffer = this.media;
- }
- }
- }, {
- key: 'onBufferAppended',
- value: function onBufferAppended(data) {
- if (data.parent === 'main') {
- var state = this.state;
- if (state === State.PARSING || state === State.PARSED) {
- // check if all buffers have been appended
- this.pendingBuffering = data.pending > 0;
- this._checkAppendedParsed();
- }
- }
- }
- }, {
- key: '_checkAppendedParsed',
- value: function _checkAppendedParsed() {
- //trigger handler right now
- if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {
- var frag = this.fragCurrent;
- if (frag) {
- var media = this.mediaBuffer ? this.mediaBuffer : this.media;
- _logger.logger.log('main buffered : ' + _timeRanges2.default.toString(media.buffered));
- // filter fragments potentially evicted from buffer. this is to avoid memleak on live streams
- var bufferedFrags = this._bufferedFrags.filter(function (frag) {
- return _bufferHelper2.default.isBuffered(media, (frag.startPTS + frag.endPTS) / 2);
- });
- // push new range
- bufferedFrags.push(frag);
- // sort frags, as we use BinarySearch for lookup in getBufferedFrag ...
- this._bufferedFrags = bufferedFrags.sort(function (a, b) {
- return a.startPTS - b.startPTS;
- });
- this.fragPrevious = frag;
- var stats = this.stats;
- stats.tbuffered = performance.now();
- // we should get rid of this.fragLastKbps
- this.fragLastKbps = Math.round(8 * stats.total / (stats.tbuffered - stats.tfirst));
- this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'main' });
- this.state = State.IDLE;
- }
- this.tick();
- }
- }
- }, {
- key: 'onError',
- value: function onError(data) {
- var frag = data.frag || this.fragCurrent;
- // don't handle frag error not related to main fragment
- if (frag && frag.type !== 'main') {
- return;
- }
- var media = this.media,
+ // sync with video's timestamp
+ startDTS = (nextAudioPts !== undefined ? nextAudioPts : videoData.startDTS * inputTimeScale) + this._initDTS,
+ endDTS = videoData.endDTS * inputTimeScale + this._initDTS,
- // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end
- mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);
- switch (data.details) {
- case _errors.ErrorDetails.FRAG_LOAD_ERROR:
- case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:
- case _errors.ErrorDetails.KEY_LOAD_ERROR:
- case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:
- if (!data.fatal) {
- var loadError = this.fragLoadError;
- if (loadError) {
- loadError++;
- } else {
- loadError = 1;
- }
- var config = this.config;
- // keep retrying / don't raise fatal network error if current position is buffered or if in automode with current level not 0
- if (loadError <= config.fragLoadingMaxRetry || mediaBuffered || frag.autoLevel && frag.level) {
- this.fragLoadError = loadError;
- // reset load counter to avoid frag loop loading error
- frag.loadCounter = 0;
- // exponential backoff capped to config.fragLoadingMaxRetryTimeout
- var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);
- _logger.logger.warn('mediaController: frag loading failed, retry in ' + delay + ' ms');
- this.retryDate = performance.now() + delay;
- // retry loading state
- // if loadedmetadata is not set, it means that we are emergency switch down on first frag
- // in that case, reset startFragRequested flag
- if (!this.loadedmetadata) {
- this.startFragRequested = false;
- this.nextLoadPosition = this.startPosition;
- }
- this.state = State.FRAG_LOADING_WAITING_RETRY;
- } else {
- _logger.logger.error('mediaController: ' + data.details + ' reaches max retry, redispatch as fatal ...');
- // switch error to fatal
- data.fatal = true;
- this.state = State.ERROR;
- }
- }
- break;
- case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:
- if (!data.fatal) {
- // if buffer is not empty
- if (mediaBuffered) {
- // try to reduce max buffer length : rationale is that we could get
- // frag loop loading error because of buffer eviction
- this._reduceMaxBufferLength(frag.duration);
- this.state = State.IDLE;
- } else {
- // buffer empty. report as fatal if in manual mode or if lowest level.
- // level controller takes care of emergency switch down logic
- if (!frag.autoLevel || frag.level === 0) {
- // switch error to fatal
- data.fatal = true;
- this.state = State.ERROR;
- }
- }
- }
- break;
- case _errors.ErrorDetails.LEVEL_LOAD_ERROR:
- case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:
- if (this.state !== State.ERROR) {
- if (data.fatal) {
- // if fatal error, stop processing
- this.state = State.ERROR;
- _logger.logger.warn('streamController: ' + data.details + ',switch to ' + this.state + ' state ...');
- } else {
- // in case of non fatal error while loading level, if level controller is not retrying to load level , switch back to IDLE
- if (!data.levelRetry && this.state === State.WAITING_LEVEL) {
- this.state = State.IDLE;
- }
- }
- }
- break;
- case _errors.ErrorDetails.BUFFER_FULL_ERROR:
- // if in appending state
- if (data.parent === 'main' && (this.state === State.PARSING || this.state === State.PARSED)) {
- // reduce max buf len if current position is buffered
- if (mediaBuffered) {
- this._reduceMaxBufferLength(this.config.maxBufferLength);
- this.state = State.IDLE;
- } else {
- // current position is not buffered, but browser is still complaining about buffer full error
- // this happens on IE/Edge, refer to https://github.com/video-dev/hls.js/pull/708
- // in that case flush the whole buffer to recover
- _logger.logger.warn('buffer full error also media.currentTime is not buffered, flush everything');
- this.fragCurrent = null;
- // flush everything
- this.flushMainBuffer(0, Number.POSITIVE_INFINITY);
- }
- }
- break;
- default:
- break;
- }
- }
- }, {
- key: '_reduceMaxBufferLength',
- value: function _reduceMaxBufferLength(minLength) {
- var config = this.config;
- if (config.maxMaxBufferLength >= minLength) {
- // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...
- config.maxMaxBufferLength /= 2;
- _logger.logger.warn('main:reduce max buffer length to ' + config.maxMaxBufferLength + 's');
- // increase fragment load Index to avoid frag loop loading error after buffer flush
- this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;
- }
- }
- }, {
- key: '_checkBuffer',
- value: function _checkBuffer() {
- var media = this.media;
- // if ready state different from HAVE_NOTHING (numeric value 0), we are allowed to seek
- if (media && media.readyState) {
- var currentTime = media.currentTime,
- mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media,
- buffered = mediaBuffer.buffered;
- // adjust currentTime to start position on loaded metadata
- if (!this.loadedmetadata && buffered.length) {
- this.loadedmetadata = true;
- // only adjust currentTime if different from startPosition or if startPosition not buffered
- // at that stage, there should be only one buffered range, as we reach that code after first fragment has been buffered
- var startPosition = media.seeking ? currentTime : this.startPosition,
- startPositionBuffered = _bufferHelper2.default.isBuffered(mediaBuffer, startPosition);
- // if currentTime not matching with expected startPosition or startPosition not buffered
- if (currentTime !== startPosition || !startPositionBuffered) {
- _logger.logger.log('target start position:' + startPosition);
- // if startPosition not buffered, let's seek to buffered.start(0)
- if (!startPositionBuffered) {
- startPosition = buffered.start(0);
- _logger.logger.log('target start position not buffered, seek to buffered.start(0) ' + startPosition);
- }
- _logger.logger.log('adjust currentTime from ' + currentTime + ' to ' + startPosition);
- media.currentTime = startPosition;
- }
- } else if (this.immediateSwitch) {
- this.immediateLevelSwitchEnd();
- } else {
- var bufferInfo = _bufferHelper2.default.bufferInfo(media, currentTime, 0),
- expectedPlaying = !(media.paused || // not playing when media is paused
- media.ended || // not playing when media is ended
- media.buffered.length === 0),
- // not playing if nothing buffered
- jumpThreshold = 0.5,
- // tolerance needed as some browsers stalls playback before reaching buffered range end
- playheadMoving = currentTime !== this.lastCurrentTime,
- config = this.config;
-
- if (playheadMoving) {
- // played moving, but was previously stalled => now not stuck anymore
- if (this.stallReported) {
- _logger.logger.warn('playback not stuck anymore @' + currentTime + ', after ' + Math.round(performance.now() - this.stalled) + 'ms');
- this.stallReported = false;
- }
- this.stalled = undefined;
- this.nudgeRetry = 0;
- } else {
- // playhead not moving
- if (expectedPlaying) {
- // playhead not moving BUT media expected to play
- var tnow = performance.now();
- var hls = this.hls;
- if (!this.stalled) {
- // stall just detected, store current time
- this.stalled = tnow;
- this.stallReported = false;
- } else {
- // playback already stalled, check stalling duration
- // if stalling for more than a given threshold, let's try to recover
- var stalledDuration = tnow - this.stalled;
- var bufferLen = bufferInfo.len;
- var nudgeRetry = this.nudgeRetry || 0;
- // have we reached stall deadline ?
- if (bufferLen <= jumpThreshold && stalledDuration > config.lowBufferWatchdogPeriod * 1000) {
- // report stalled error once
- if (!this.stallReported) {
- this.stallReported = true;
- _logger.logger.warn('playback stalling in low buffer @' + currentTime);
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });
- }
- // if buffer len is below threshold, try to jump to start of next buffer range if close
- // no buffer available @ currentTime, check if next buffer is close (within a config.maxSeekHole second range)
- var nextBufferStart = bufferInfo.nextStart,
- delta = nextBufferStart - currentTime;
- if (nextBufferStart && delta < config.maxSeekHole && delta > 0) {
- this.nudgeRetry = ++nudgeRetry;
- var nudgeOffset = nudgeRetry * config.nudgeOffset;
- // next buffer is close ! adjust currentTime to nextBufferStart
- // this will ensure effective video decoding
- _logger.logger.log('adjust currentTime from ' + media.currentTime + ' to next buffered @ ' + nextBufferStart + ' + nudge ' + nudgeOffset);
- media.currentTime = nextBufferStart + nudgeOffset;
- // reset stalled so to rearm watchdog timer
- this.stalled = undefined;
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole: nextBufferStart + nudgeOffset - currentTime });
- }
- } else if (bufferLen > jumpThreshold && stalledDuration > config.highBufferWatchdogPeriod * 1000) {
- // report stalled error once
- if (!this.stallReported) {
- this.stallReported = true;
- _logger.logger.warn('playback stalling in high buffer @' + currentTime);
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });
- }
- // reset stalled so to rearm watchdog timer
- this.stalled = undefined;
- this.nudgeRetry = ++nudgeRetry;
- if (nudgeRetry < config.nudgeMaxRetry) {
- var _currentTime = media.currentTime;
- var targetTime = _currentTime + nudgeRetry * config.nudgeOffset;
- _logger.logger.log('adjust currentTime from ' + _currentTime + ' to ' + targetTime);
- // playback stalled in buffered area ... let's nudge currentTime to try to overcome this
- media.currentTime = targetTime;
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_NUDGE_ON_STALL, fatal: false });
- } else {
- _logger.logger.error('still stuck in high buffer @' + currentTime + ' after ' + config.nudgeMaxRetry + ', raise fatal error');
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: true });
- }
- }
- }
- }
- }
- }
- }
- }
- }, {
- key: 'onFragLoadEmergencyAborted',
- value: function onFragLoadEmergencyAborted() {
- this.state = State.IDLE;
- // if loadedmetadata is not set, it means that we are emergency switch down on first frag
- // in that case, reset startFragRequested flag
- if (!this.loadedmetadata) {
- this.startFragRequested = false;
- this.nextLoadPosition = this.startPosition;
- }
- this.tick();
- }
- }, {
- key: 'onBufferFlushed',
- value: function onBufferFlushed() {
- /* after successful buffer flushing, filter flushed fragments from bufferedFrags
- use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)
- */
- var media = this.mediaBuffer ? this.mediaBuffer : this.media;
- this._bufferedFrags = this._bufferedFrags.filter(function (frag) {
- return _bufferHelper2.default.isBuffered(media, (frag.startPTS + frag.endPTS) / 2);
- });
+ // one sample's duration value
+ sampleDuration = 1024,
+ frameDuration = scaleFactor * sampleDuration,
- // increase fragment load Index to avoid frag loop loading error after buffer flush
- this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;
- // move to IDLE once flush complete. this should trigger new fragment loading
- this.state = State.IDLE;
- // reset reference to frag
- this.fragPrevious = null;
- }
- }, {
- key: 'swapAudioCodec',
- value: function swapAudioCodec() {
- this.audioCodecSwap = !this.audioCodecSwap;
+
+ // samples count of this segment's duration
+ nbSamples = Math.ceil((endDTS - startDTS) / frameDuration),
+
+
+ // silent frame
+ silentFrame = aac.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);
+
+ logger["b" /* logger */].warn('remux empty Audio');
+ // Can't remux if we can't generate a silent frame...
+ if (!silentFrame) {
+ logger["b" /* logger */].trace('Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!');
+ return;
}
- }, {
- key: 'computeLivePosition',
- value: function computeLivePosition(sliding, levelDetails) {
- var targetLatency = this.config.liveSyncDuration !== undefined ? this.config.liveSyncDuration : this.config.liveSyncDurationCount * levelDetails.targetduration;
- return sliding + Math.max(0, levelDetails.totalduration - targetLatency);
+
+ var samples = [];
+ for (var i = 0; i < nbSamples; i++) {
+ var stamp = startDTS + i * frameDuration;
+ samples.push({ unit: silentFrame, pts: stamp, dts: stamp });
+ track.len += silentFrame.length;
}
- }, {
- key: 'state',
- set: function set(nextState) {
- if (this.state !== nextState) {
- var previousState = this.state;
- this._state = nextState;
- _logger.logger.log('main stream:' + previousState + '->' + nextState);
- this.hls.trigger(_events2.default.STREAM_STATE_TRANSITION, { previousState: previousState, nextState: nextState });
+ track.samples = samples;
+
+ this.remuxAudio(track, timeOffset, contiguous);
+ };
+
+ MP4Remuxer.prototype.remuxID3 = function remuxID3(track, timeOffset) {
+ var length = track.samples.length,
+ sample;
+ var inputTimeScale = track.inputTimeScale;
+ var initPTS = this._initPTS;
+ var initDTS = this._initDTS;
+ // consume samples
+ if (length) {
+ for (var index = 0; index < length; index++) {
+ sample = track.samples[index];
+ // setting id3 pts, dts to relative time
+ // using this._initPTS and this._initDTS to calculate relative time
+ sample.pts = (sample.pts - initPTS) / inputTimeScale;
+ sample.dts = (sample.dts - initDTS) / inputTimeScale;
}
- },
- get: function get() {
- return this._state;
+ this.observer.trigger(events["a" /* default */].FRAG_PARSING_METADATA, {
+ samples: track.samples
+ });
}
- }, {
- key: 'currentLevel',
- get: function get() {
- var media = this.media;
- if (media) {
- var frag = this.getBufferedFrag(media.currentTime);
- if (frag) {
- return frag.level;
- }
- }
- return -1;
+
+ track.samples = [];
+ timeOffset = timeOffset;
+ };
+
+ MP4Remuxer.prototype.remuxText = function remuxText(track, timeOffset) {
+ track.samples.sort(function (a, b) {
+ return a.pts - b.pts;
+ });
+
+ var length = track.samples.length,
+ sample;
+ var inputTimeScale = track.inputTimeScale;
+ var initPTS = this._initPTS;
+ // consume samples
+ if (length) {
+ for (var index = 0; index < length; index++) {
+ sample = track.samples[index];
+ // setting text pts, dts to relative time
+ // using this._initPTS and this._initDTS to calculate relative time
+ sample.pts = (sample.pts - initPTS) / inputTimeScale;
+ }
+ this.observer.trigger(events["a" /* default */].FRAG_PARSING_USERDATA, {
+ samples: track.samples
+ });
}
- }, {
- key: 'nextBufferedFrag',
- get: function get() {
- var media = this.media;
- if (media) {
- // first get end range of current fragment
- return this.followingBufferedFrag(this.getBufferedFrag(media.currentTime));
- } else {
- return null;
- }
+
+ track.samples = [];
+ timeOffset = timeOffset;
+ };
+
+ MP4Remuxer.prototype._PTSNormalize = function _PTSNormalize(value, reference) {
+ var offset;
+ if (reference === undefined) {
+ return value;
}
- }, {
- key: 'nextLevel',
- get: function get() {
- var frag = this.nextBufferedFrag;
- if (frag) {
- return frag.level;
- } else {
- return -1;
- }
+ if (reference < value) {
+ // - 2^33
+ offset = -8589934592;
+ } else {
+ // + 2^33
+ offset = 8589934592;
}
- }, {
- key: 'liveSyncPosition',
- get: function get() {
- return this._liveSyncPosition;
- },
- set: function set(value) {
- this._liveSyncPosition = value;
+ /* PTS is 33bit (from 0 to 2^33 -1)
+ if diff between value and reference is bigger than half of the amplitude (2^32) then it means that
+ PTS looping occured. fill the gap */
+ while (Math.abs(value - reference) > 4294967296) {
+ value += offset;
}
- }]);
+ return value;
+ };
- return StreamController;
-}(_eventHandler2.default);
+ return MP4Remuxer;
+}();
-exports.default = StreamController;
+/* harmony default export */ var mp4_remuxer = (mp4_remuxer_MP4Remuxer);
+// CONCATENATED MODULE: ./src/remux/passthrough-remuxer.js
+function passthrough_remuxer__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-},{"25":25,"33":33,"34":34,"35":35,"37":37,"38":38,"48":48,"53":53,"54":54}],14:[function(_dereq_,module,exports){
-'use strict';
+/**
+ * passthrough remuxer
+*/
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+var passthrough_remuxer_PassThroughRemuxer = function () {
+ function PassThroughRemuxer(observer) {
+ passthrough_remuxer__classCallCheck(this, PassThroughRemuxer);
-var _events = _dereq_(35);
+ this.observer = observer;
+ }
-var _events2 = _interopRequireDefault(_events);
+ PassThroughRemuxer.prototype.destroy = function destroy() {};
-var _eventHandler = _dereq_(34);
+ PassThroughRemuxer.prototype.resetTimeStamp = function resetTimeStamp() {};
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
+ PassThroughRemuxer.prototype.resetInitSegment = function resetInitSegment() {};
-var _logger = _dereq_(53);
+ PassThroughRemuxer.prototype.remux = function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset, rawData) {
+ var observer = this.observer;
+ var streamType = '';
+ if (audioTrack) {
+ streamType += 'audio';
+ }
+ if (videoTrack) {
+ streamType += 'video';
+ }
+ observer.trigger(events["a" /* default */].FRAG_PARSING_DATA, {
+ data1: rawData,
+ startPTS: timeOffset,
+ startDTS: timeOffset,
+ type: streamType,
+ nb: 1,
+ dropped: 0
+ });
+ //notify end of parsing
+ observer.trigger(events["a" /* default */].FRAG_PARSED);
+ };
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ return PassThroughRemuxer;
+}();
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+/* harmony default export */ var passthrough_remuxer = (passthrough_remuxer_PassThroughRemuxer);
+// CONCATENATED MODULE: ./src/demux/demuxer-inline.js
+function demuxer_inline__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+/* inline demuxer.
+ * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)
+ */
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * Subtitle Stream Controller
- */
-var SubtitleStreamController = function (_EventHandler) {
- _inherits(SubtitleStreamController, _EventHandler);
- function SubtitleStreamController(hls) {
- _classCallCheck(this, SubtitleStreamController);
- var _this = _possibleConstructorReturn(this, (SubtitleStreamController.__proto__ || Object.getPrototypeOf(SubtitleStreamController)).call(this, hls, _events2.default.ERROR, _events2.default.SUBTITLE_TRACKS_UPDATED, _events2.default.SUBTITLE_TRACK_SWITCH, _events2.default.SUBTITLE_TRACK_LOADED, _events2.default.SUBTITLE_FRAG_PROCESSED));
- _this.config = hls.config;
- _this.vttFragSNsProcessed = {};
- _this.vttFragQueues = undefined;
- _this.currentlyProcessing = null;
- _this.currentTrackId = -1;
- return _this;
- }
- _createClass(SubtitleStreamController, [{
- key: 'destroy',
- value: function destroy() {
- _eventHandler2.default.prototype.destroy.call(this);
- }
- // Remove all queued items and create a new, empty queue for each track.
- }, {
- key: 'clearVttFragQueues',
- value: function clearVttFragQueues() {
- var _this2 = this;
- this.vttFragQueues = {};
- this.tracks.forEach(function (track) {
- _this2.vttFragQueues[track.id] = [];
- });
- }
- // If no frag is being processed and queue isn't empty, initiate processing of next frag in line.
- }, {
- key: 'nextFrag',
- value: function nextFrag() {
- if (this.currentlyProcessing === null && this.currentTrackId > -1 && this.vttFragQueues[this.currentTrackId].length) {
- var frag = this.currentlyProcessing = this.vttFragQueues[this.currentTrackId].shift();
- this.hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });
- }
- }
+var demuxer_inline_DemuxerInline = function () {
+ function DemuxerInline(observer, typeSupported, config, vendor) {
+ demuxer_inline__classCallCheck(this, DemuxerInline);
- // When fragment has finished processing, add sn to list of completed if successful.
+ this.observer = observer;
+ this.typeSupported = typeSupported;
+ this.config = config;
+ this.vendor = vendor;
+ }
- }, {
- key: 'onSubtitleFragProcessed',
- value: function onSubtitleFragProcessed(data) {
- if (data.success) {
- this.vttFragSNsProcessed[data.frag.trackId].push(data.frag.sn);
- }
- this.currentlyProcessing = null;
- this.nextFrag();
+ DemuxerInline.prototype.destroy = function destroy() {
+ var demuxer = this.demuxer;
+ if (demuxer) {
+ demuxer.destroy();
}
+ };
- // If something goes wrong, procede to next frag, if we were processing one.
-
- }, {
- key: 'onError',
- value: function onError(data) {
- var frag = data.frag;
- // don't handle frag error not related to subtitle fragment
- if (frag && frag.type !== 'subtitle') {
- return;
+ DemuxerInline.prototype.push = function push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {
+ if (data.byteLength > 0 && decryptdata != null && decryptdata.key != null && decryptdata.method === 'AES-128') {
+ var decrypter = this.decrypter;
+ if (decrypter == null) {
+ decrypter = this.decrypter = new crypt_decrypter["a" /* default */](this.observer, this.config);
}
- if (this.currentlyProcessing) {
- this.currentlyProcessing = null;
- this.nextFrag();
+ var localthis = this;
+ // performance.now() not available on WebWorker, at least on Safari Desktop
+ var startTime;
+ try {
+ startTime = performance.now();
+ } catch (error) {
+ startTime = Date.now();
}
- }
-
- // Got all new subtitle tracks.
-
- }, {
- key: 'onSubtitleTracksUpdated',
- value: function onSubtitleTracksUpdated(data) {
- var _this3 = this;
-
- _logger.logger.log('subtitle tracks updated');
- this.tracks = data.subtitleTracks;
- this.clearVttFragQueues();
- this.vttFragSNsProcessed = {};
- this.tracks.forEach(function (track) {
- _this3.vttFragSNsProcessed[track.id] = [];
+ decrypter.decrypt(data, decryptdata.key.buffer, decryptdata.iv.buffer, function (decryptedData) {
+ var endTime;
+ try {
+ endTime = performance.now();
+ } catch (error) {
+ endTime = Date.now();
+ }
+ localthis.observer.trigger(events["a" /* default */].FRAG_DECRYPTED, { stats: { tstart: startTime, tdecrypt: endTime } });
+ localthis.pushDecrypted(new Uint8Array(decryptedData), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);
});
+ } else {
+ this.pushDecrypted(new Uint8Array(data), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);
}
- }, {
- key: 'onSubtitleTrackSwitch',
- value: function onSubtitleTrackSwitch(data) {
- this.currentTrackId = data.id;
- this.clearVttFragQueues();
- }
-
- // Got a new set of subtitle fragments.
-
- }, {
- key: 'onSubtitleTrackLoaded',
- value: function onSubtitleTrackLoaded(data) {
- var processedFragSNs = this.vttFragSNsProcessed[data.id],
- fragQueue = this.vttFragQueues[data.id],
- currentFragSN = !!this.currentlyProcessing ? this.currentlyProcessing.sn : -1;
-
- var alreadyProcessed = function alreadyProcessed(frag) {
- return processedFragSNs.indexOf(frag.sn) > -1;
- };
-
- var alreadyInQueue = function alreadyInQueue(frag) {
- return fragQueue.some(function (fragInQueue) {
- return fragInQueue.sn === frag.sn;
- });
- };
+ };
- // Add all fragments that haven't been, aren't currently being and aren't waiting to be processed, to queue.
- data.details.fragments.forEach(function (frag) {
- if (!(alreadyProcessed(frag) || frag.sn === currentFragSN || alreadyInQueue(frag))) {
- // Frags don't know their subtitle track ID, so let's just add that...
- frag.trackId = data.id;
- fragQueue.push(frag);
+ DemuxerInline.prototype.pushDecrypted = function pushDecrypted(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {
+ var demuxer = this.demuxer;
+ if (!demuxer ||
+ // in case of continuity change, we might switch from content type (AAC container to TS container for example)
+ // so let's check that current demuxer is still valid
+ discontinuity && !this.probe(data)) {
+ var observer = this.observer;
+ var typeSupported = this.typeSupported;
+ var config = this.config;
+ // probing order is TS/AAC/MP3/MP4
+ var muxConfig = [{ demux: tsdemuxer, remux: mp4_remuxer }, { demux: mp4demuxer, remux: passthrough_remuxer }, { demux: aacdemuxer, remux: mp4_remuxer }, { demux: mp3demuxer, remux: mp4_remuxer }];
+
+ // probe for content type
+ for (var i = 0, len = muxConfig.length; i < len; i++) {
+ var mux = muxConfig[i];
+ var probe = mux.demux.probe;
+ if (probe(data)) {
+ var _remuxer = this.remuxer = new mux.remux(observer, config, typeSupported, this.vendor);
+ demuxer = new mux.demux(observer, _remuxer, config, typeSupported);
+ this.probe = probe;
+ break;
}
- });
-
- this.nextFrag();
+ }
+ if (!demuxer) {
+ observer.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found' });
+ return;
+ }
+ this.demuxer = demuxer;
}
- }]);
-
- return SubtitleStreamController;
-}(_eventHandler2.default);
+ var remuxer = this.remuxer;
-exports.default = SubtitleStreamController;
+ if (discontinuity || trackSwitch) {
+ demuxer.resetInitSegment(initSegment, audioCodec, videoCodec, duration);
+ remuxer.resetInitSegment();
+ }
+ if (discontinuity) {
+ demuxer.resetTimeStamp(defaultInitPTS);
+ remuxer.resetTimeStamp(defaultInitPTS);
+ }
+ if (typeof demuxer.setDecryptData === 'function') {
+ demuxer.setDecryptData(decryptdata);
+ }
+ demuxer.append(data, timeOffset, contiguous, accurateTimeOffset);
+ };
-},{"34":34,"35":35,"53":53}],15:[function(_dereq_,module,exports){
-'use strict';
+ return DemuxerInline;
+}();
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+/* harmony default export */ var demuxer_inline = __webpack_exports__["a"] = (demuxer_inline_DemuxerInline);
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+/***/ }),
+/* 8 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
-var _events = _dereq_(35);
+"use strict";
+Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
+var cues_namespaceObject = {};
+__webpack_require__.d(cues_namespaceObject, "newCue", function() { return newCue; });
-var _events2 = _interopRequireDefault(_events);
+// EXTERNAL MODULE: ./node_modules/url-toolkit/src/url-toolkit.js
+var url_toolkit = __webpack_require__(6);
+var url_toolkit_default = /*#__PURE__*/__webpack_require__.n(url_toolkit);
-var _eventHandler = _dereq_(34);
+// EXTERNAL MODULE: ./src/events.js
+var events = __webpack_require__(1);
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
+// EXTERNAL MODULE: ./src/errors.js
+var errors = __webpack_require__(2);
-var _logger = _dereq_(53);
+// EXTERNAL MODULE: ./src/utils/logger.js
+var logger = __webpack_require__(0);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+// CONCATENATED MODULE: ./src/event-handler.js
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+/*
+*
+* All objects in the event handling chain should inherit from this class
+*
+*/
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * audio track controller
- */
-function filterSubtitleTracks(textTrackList) {
- var tracks = [];
- for (var i = 0; i < textTrackList.length; i++) {
- if (textTrackList[i].kind === 'subtitles') {
- tracks.push(textTrackList[i]);
- }
- }
- return tracks;
-}
-var SubtitleTrackController = function (_EventHandler) {
- _inherits(SubtitleTrackController, _EventHandler);
- function SubtitleTrackController(hls) {
- _classCallCheck(this, SubtitleTrackController);
- var _this = _possibleConstructorReturn(this, (SubtitleTrackController.__proto__ || Object.getPrototypeOf(SubtitleTrackController)).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_LOADED, _events2.default.SUBTITLE_TRACK_LOADED));
+var event_handler_EventHandler = function () {
+ function EventHandler(hls) {
+ _classCallCheck(this, EventHandler);
- _this.tracks = [];
- _this.trackId = -1;
- _this.media = undefined;
- return _this;
- }
+ this.hls = hls;
+ this.onEvent = this.onEvent.bind(this);
- _createClass(SubtitleTrackController, [{
- key: 'destroy',
- value: function destroy() {
- _eventHandler2.default.prototype.destroy.call(this);
+ for (var _len = arguments.length, events = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ events[_key - 1] = arguments[_key];
}
- // Listen for subtitle track change, then extract the current track ID.
+ this.handledEvents = events;
+ this.useGenericHandler = true;
- }, {
- key: 'onMediaAttached',
- value: function onMediaAttached(data) {
- var _this2 = this;
+ this.registerListeners();
+ }
- this.media = data.media;
- if (!this.media) {
- return;
- }
+ EventHandler.prototype.destroy = function destroy() {
+ this.unregisterListeners();
+ };
- this.media.textTracks.addEventListener('change', function () {
- // Media is undefined when switching streams via loadSource()
- if (!_this2.media) {
- return;
- }
+ EventHandler.prototype.isEventHandler = function isEventHandler() {
+ return _typeof(this.handledEvents) === 'object' && this.handledEvents.length && typeof this.onEvent === 'function';
+ };
- var trackId = -1;
- var tracks = filterSubtitleTracks(_this2.media.textTracks);
- for (var id = 0; id < tracks.length; id++) {
- if (tracks[id].mode === 'showing') {
- trackId = id;
- }
+ EventHandler.prototype.registerListeners = function registerListeners() {
+ if (this.isEventHandler()) {
+ this.handledEvents.forEach(function (event) {
+ if (event === 'hlsEventGeneric') {
+ throw new Error('Forbidden event name: ' + event);
}
- // Setting current subtitleTrack will invoke code.
- _this2.subtitleTrack = trackId;
- });
+ this.hls.on(event, this.onEvent);
+ }, this);
}
- }, {
- key: 'onMediaDetaching',
- value: function onMediaDetaching() {
- // TODO: Remove event listeners.
- this.media = undefined;
+ };
+
+ EventHandler.prototype.unregisterListeners = function unregisterListeners() {
+ if (this.isEventHandler()) {
+ this.handledEvents.forEach(function (event) {
+ this.hls.off(event, this.onEvent);
+ }, this);
}
+ };
- // Reset subtitle tracks on manifest loading
+ /**
+ * arguments: event (string), data (any)
+ */
- }, {
- key: 'onManifestLoading',
- value: function onManifestLoading() {
- this.tracks = [];
- this.trackId = -1;
- }
- // Fired whenever a new manifest is loaded.
+ EventHandler.prototype.onEvent = function onEvent(event, data) {
+ this.onEventGeneric(event, data);
+ };
- }, {
- key: 'onManifestLoaded',
- value: function onManifestLoaded(data) {
- var _this3 = this;
-
- var tracks = data.subtitles || [];
- var defaultFound = false;
- this.tracks = tracks;
- this.trackId = -1;
- this.hls.trigger(_events2.default.SUBTITLE_TRACKS_UPDATED, { subtitleTracks: tracks });
-
- // loop through available subtitle tracks and autoselect default if needed
- // TODO: improve selection logic to handle forced, etc
- tracks.forEach(function (track) {
- if (track.default) {
- _this3.subtitleTrack = track.id;
- defaultFound = true;
- }
- });
+ EventHandler.prototype.onEventGeneric = function onEventGeneric(event, data) {
+ var eventToFunction = function eventToFunction(event, data) {
+ var funcName = 'on' + event.replace('hls', '');
+ if (typeof this[funcName] !== 'function') {
+ throw new Error('Event ' + event + ' has no generic handler in this ' + this.constructor.name + ' class (tried ' + funcName + ')');
+ }
+ return this[funcName].bind(this, data);
+ };
+ try {
+ eventToFunction.call(this, event, data).call();
+ } catch (err) {
+ logger["b" /* logger */].error('internal error happened while processing ' + event + ':' + err.message);
+ this.hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].OTHER_ERROR, details: errors["a" /* ErrorDetails */].INTERNAL_EXCEPTION, fatal: false, event: event, err: err });
}
+ };
- // Trigger subtitle track playlist reload.
+ return EventHandler;
+}();
- }, {
- key: 'onTick',
- value: function onTick() {
- var trackId = this.trackId;
- var subtitleTrack = this.tracks[trackId];
- if (!subtitleTrack) {
- return;
- }
+/* harmony default export */ var event_handler = (event_handler_EventHandler);
+// CONCATENATED MODULE: ./src/utils/attr-list.js
+function attr_list__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var details = subtitleTrack.details;
- // check if we need to load playlist for this subtitle Track
- if (details === undefined || details.live === true) {
- // track not retrieved yet, or live playlist we need to (re)load it
- _logger.logger.log('(re)loading playlist for subtitle track ' + trackId);
- this.hls.trigger(_events2.default.SUBTITLE_TRACK_LOADING, { url: subtitleTrack.url, id: trackId });
+var DECIMAL_RESOLUTION_REGEX = /^(\d+)x(\d+)$/;
+var ATTR_LIST_REGEX = /\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g;
+
+// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js
+
+var AttrList = function () {
+ function AttrList(attrs) {
+ attr_list__classCallCheck(this, AttrList);
+
+ if (typeof attrs === 'string') {
+ attrs = AttrList.parseAttrList(attrs);
+ }
+ for (var attr in attrs) {
+ if (attrs.hasOwnProperty(attr)) {
+ this[attr] = attrs[attr];
}
}
- }, {
- key: 'onSubtitleTrackLoaded',
- value: function onSubtitleTrackLoaded(data) {
- var _this4 = this;
+ }
- if (data.id < this.tracks.length) {
- _logger.logger.log('subtitle track ' + data.id + ' loaded');
- this.tracks[data.id].details = data.details;
- // check if current playlist is a live playlist
- if (data.details.live && !this.timer) {
- // if live playlist we will have to reload it periodically
- // set reload period to playlist target duration
- this.timer = setInterval(function () {
- _this4.onTick();
- }, 1000 * data.details.targetduration, this);
- }
- if (!data.details.live && this.timer) {
- // playlist is not live and timer is armed : stopping it
- clearInterval(this.timer);
- this.timer = null;
- }
- }
+ AttrList.prototype.decimalInteger = function decimalInteger(attrName) {
+ var intValue = parseInt(this[attrName], 10);
+ if (intValue > Number.MAX_SAFE_INTEGER) {
+ return Infinity;
}
+ return intValue;
+ };
- /** get alternate subtitle tracks list from playlist **/
+ AttrList.prototype.hexadecimalInteger = function hexadecimalInteger(attrName) {
+ if (this[attrName]) {
+ var stringValue = (this[attrName] || '0x').slice(2);
+ stringValue = (stringValue.length & 1 ? '0' : '') + stringValue;
- }, {
- key: 'setSubtitleTrackInternal',
- value: function setSubtitleTrackInternal(newId) {
- // check if level idx is valid
- if (newId >= 0 && newId < this.tracks.length) {
- // stopping live reloading timer if any
- if (this.timer) {
- clearInterval(this.timer);
- this.timer = null;
- }
- this.trackId = newId;
- _logger.logger.log('switching to subtitle track ' + newId);
- var subtitleTrack = this.tracks[newId];
- this.hls.trigger(_events2.default.SUBTITLE_TRACK_SWITCH, { id: newId });
- // check if we need to load playlist for this subtitle Track
- var details = subtitleTrack.details;
- if (details === undefined || details.live === true) {
- // track not retrieved yet, or live playlist we need to (re)load it
- _logger.logger.log('(re)loading playlist for subtitle track ' + newId);
- this.hls.trigger(_events2.default.SUBTITLE_TRACK_LOADING, { url: subtitleTrack.url, id: newId });
- }
+ var value = new Uint8Array(stringValue.length / 2);
+ for (var i = 0; i < stringValue.length / 2; i++) {
+ value[i] = parseInt(stringValue.slice(i * 2, i * 2 + 2), 16);
}
+ return value;
+ } else {
+ return null;
}
- }, {
- key: 'subtitleTracks',
- get: function get() {
- return this.tracks;
+ };
+
+ AttrList.prototype.hexadecimalIntegerAsNumber = function hexadecimalIntegerAsNumber(attrName) {
+ var intValue = parseInt(this[attrName], 16);
+ if (intValue > Number.MAX_SAFE_INTEGER) {
+ return Infinity;
}
+ return intValue;
+ };
- /** get index of the selected subtitle track (index in subtitle track lists) **/
+ AttrList.prototype.decimalFloatingPoint = function decimalFloatingPoint(attrName) {
+ return parseFloat(this[attrName]);
+ };
- }, {
- key: 'subtitleTrack',
- get: function get() {
- return this.trackId;
+ AttrList.prototype.enumeratedString = function enumeratedString(attrName) {
+ return this[attrName];
+ };
+
+ AttrList.prototype.decimalResolution = function decimalResolution(attrName) {
+ var res = DECIMAL_RESOLUTION_REGEX.exec(this[attrName]);
+ if (res === null) {
+ return undefined;
}
+ return {
+ width: parseInt(res[1], 10),
+ height: parseInt(res[2], 10)
+ };
+ };
- /** select a subtitle track, based on its index in subtitle track lists**/
- ,
- set: function set(subtitleTrackId) {
- if (this.trackId !== subtitleTrackId) {
- // || this.tracks[subtitleTrackId].details === undefined) {
- this.setSubtitleTrackInternal(subtitleTrackId);
+ AttrList.parseAttrList = function parseAttrList(input) {
+ var match,
+ attrs = {};
+ ATTR_LIST_REGEX.lastIndex = 0;
+ while ((match = ATTR_LIST_REGEX.exec(input)) !== null) {
+ var value = match[2],
+ quote = '"';
+
+ if (value.indexOf(quote) === 0 && value.lastIndexOf(quote) === value.length - 1) {
+ value = value.slice(1, -1);
}
+ attrs[match[1]] = value;
}
- }]);
+ return attrs;
+ };
- return SubtitleTrackController;
-}(_eventHandler2.default);
+ return AttrList;
+}();
+
+/* harmony default export */ var attr_list = (AttrList);
+// CONCATENATED MODULE: ./src/utils/codecs.js
+// from http://mp4ra.org/codecs.html
+var sampleEntryCodesISO = {
+ audio: {
+ 'a3ds': true,
+ 'ac-3': true,
+ 'ac-4': true,
+ 'alac': true,
+ 'alaw': true,
+ 'dra1': true,
+ 'dts+': true,
+ 'dts-': true,
+ 'dtsc': true,
+ 'dtse': true,
+ 'dtsh': true,
+ 'ec-3': true,
+ 'enca': true,
+ 'g719': true,
+ 'g726': true,
+ 'm4ae': true,
+ 'mha1': true,
+ 'mha2': true,
+ 'mhm1': true,
+ 'mhm2': true,
+ 'mlpa': true,
+ 'mp4a': true,
+ 'raw ': true,
+ 'Opus': true,
+ 'samr': true,
+ 'sawb': true,
+ 'sawp': true,
+ 'sevc': true,
+ 'sqcp': true,
+ 'ssmv': true,
+ 'twos': true,
+ 'ulaw': true
+ },
+ video: {
+ 'avc1': true,
+ 'avc2': true,
+ 'avc3': true,
+ 'avc4': true,
+ 'avcp': true,
+ 'drac': true,
+ 'dvav': true,
+ 'dvhe': true,
+ 'encv': true,
+ 'hev1': true,
+ 'hvc1': true,
+ 'mjp2': true,
+ 'mp4v': true,
+ 'mvc1': true,
+ 'mvc2': true,
+ 'mvc3': true,
+ 'mvc4': true,
+ 'resv': true,
+ 'rv60': true,
+ 's263': true,
+ 'svc1': true,
+ 'svc2': true,
+ 'vc-1': true,
+ 'vp08': true,
+ 'vp09': true
+ }
+};
-exports.default = SubtitleTrackController;
+function isCodecType(codec, type) {
+ var typeCodes = sampleEntryCodesISO[type];
+ return !!typeCodes && typeCodes[codec.slice(0, 4)] === true;
+}
-},{"34":34,"35":35,"53":53}],16:[function(_dereq_,module,exports){
-'use strict';
+function isCodecSupportedInMp4(codec, type) {
+ return MediaSource.isTypeSupported((type || 'video') + '/mp4;codecs="' + codec + '"');
+}
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+// CONCATENATED MODULE: ./src/loader/playlist-loader.js
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-var _events = _dereq_(35);
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-var _events2 = _interopRequireDefault(_events);
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-var _eventHandler = _dereq_(34);
+function playlist_loader__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
+/**
+ * Playlist Loader
+*/
-var _cea608Parser = _dereq_(49);
-var _cea608Parser2 = _interopRequireDefault(_cea608Parser);
-var _webvttParser = _dereq_(57);
-var _webvttParser2 = _interopRequireDefault(_webvttParser);
-var _logger = _dereq_(53);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * Timeline Controller
- */
+// https://regex101.com is your friend
+var MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g;
+var MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;
-function clearCurrentCues(track) {
- if (track && track.cues) {
- while (track.cues.length > 0) {
- track.removeCue(track.cues[0]);
- }
- }
-}
+var LEVEL_PLAYLIST_REGEX_FAST = new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source, // duration (#EXTINF:<duration>,<title>), group 1 => duration, group 2 => title
+/|(?!#)(\S+)/.source, // segment URI, group 3 => the URI (note newline is not eaten)
+/|#EXT-X-BYTERANGE:*(.+)/.source, // next segment's byterange, group 4 => range spec (x@y)
+/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source, // next segment's program date/time group 5 => the datetime spec
+/|#.*/.source // All other non-segment oriented tags will match with all groups empty
+].join(''), 'g');
-function reuseVttTextTrack(inUseTrack, manifestTrack) {
- return inUseTrack && inUseTrack.label === manifestTrack.name && !(inUseTrack.textTrack1 || inUseTrack.textTrack2);
-}
+var LEVEL_PLAYLIST_REGEX_SLOW = /(?:(?:#(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?/;
-function intersection(x1, x2, y1, y2) {
- return Math.min(x2, y2) - Math.max(x1, y1);
-}
+var playlist_loader_LevelKey = function () {
+ function LevelKey() {
+ playlist_loader__classCallCheck(this, LevelKey);
-var TimelineController = function (_EventHandler) {
- _inherits(TimelineController, _EventHandler);
+ this.method = null;
+ this.key = null;
+ this.iv = null;
+ this._uri = null;
+ }
- function TimelineController(hls) {
- _classCallCheck(this, TimelineController);
+ _createClass(LevelKey, [{
+ key: 'uri',
+ get: function get() {
+ if (!this._uri && this.reluri) {
+ this._uri = url_toolkit_default.a.buildAbsoluteURL(this.baseuri, this.reluri, { alwaysNormalize: true });
+ }
+ return this._uri;
+ }
+ }]);
- var _this = _possibleConstructorReturn(this, (TimelineController.__proto__ || Object.getPrototypeOf(TimelineController)).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.FRAG_PARSING_USERDATA, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_LOADED, _events2.default.FRAG_LOADED, _events2.default.LEVEL_SWITCHING, _events2.default.INIT_PTS_FOUND));
+ return LevelKey;
+}();
- _this.hls = hls;
- _this.config = hls.config;
- _this.enabled = true;
- _this.Cues = hls.config.cueHandler;
- _this.textTracks = [];
- _this.tracks = [];
- _this.unparsedVttFrags = [];
- _this.initPTS = undefined;
- _this.cueRanges = [];
+var playlist_loader_Fragment = function () {
+ function Fragment() {
+ playlist_loader__classCallCheck(this, Fragment);
- if (_this.config.enableCEA708Captions) {
- var self = _this;
- var sendAddTrackEvent = function sendAddTrackEvent(track, media) {
- var e = null;
- try {
- e = new window.Event('addtrack');
- } catch (err) {
- //for IE11
- e = document.createEvent('Event');
- e.initEvent('addtrack', false, false);
- }
- e.track = track;
- media.dispatchEvent(e);
- };
+ this._url = null;
+ this._byteRange = null;
+ this._decryptdata = null;
+ this.tagList = [];
+ }
- var channel1 = {
- 'newCue': function newCue(startTime, endTime, screen) {
- if (!self.textTrack1) {
- //Enable reuse of existing text track.
- var existingTrack1 = self.getExistingTrack('1');
- if (!existingTrack1) {
- var textTrack1 = self.createTextTrack('captions', self.config.captionsTextTrack1Label, self.config.captionsTextTrack1LanguageCode);
- if (textTrack1) {
- textTrack1.textTrack1 = true;
- self.textTrack1 = textTrack1;
- }
- } else {
- self.textTrack1 = existingTrack1;
- clearCurrentCues(self.textTrack1);
+ /**
+ * Utility method for parseLevelPlaylist to create an initialization vector for a given segment
+ * @returns {Uint8Array}
+ */
+ Fragment.prototype.createInitializationVector = function createInitializationVector(segmentNumber) {
+ var uint8View = new Uint8Array(16);
- sendAddTrackEvent(self.textTrack1, self.media);
- }
- }
- self.addCues('textTrack1', startTime, endTime, screen);
- }
- };
+ for (var i = 12; i < 16; i++) {
+ uint8View[i] = segmentNumber >> 8 * (15 - i) & 0xff;
+ }
- var channel2 = {
- 'newCue': function newCue(startTime, endTime, screen) {
- if (!self.textTrack2) {
- //Enable reuse of existing text track.
- var existingTrack2 = self.getExistingTrack('2');
- if (!existingTrack2) {
- var textTrack2 = self.createTextTrack('captions', self.config.captionsTextTrack2Label, self.config.captionsTextTrack1LanguageCode);
- if (textTrack2) {
- textTrack2.textTrack2 = true;
- self.textTrack2 = textTrack2;
- }
- } else {
- self.textTrack2 = existingTrack2;
- clearCurrentCues(self.textTrack2);
+ return uint8View;
+ };
- sendAddTrackEvent(self.textTrack2, self.media);
- }
- }
- self.addCues('textTrack2', startTime, endTime, screen);
- }
- };
+ /**
+ * Utility method for parseLevelPlaylist to get a fragment's decryption data from the currently parsed encryption key data
+ * @param levelkey - a playlist's encryption info
+ * @param segmentNumber - the fragment's segment number
+ * @returns {*} - an object to be applied as a fragment's decryptdata
+ */
- _this.cea608Parser = new _cea608Parser2.default(0, channel1, channel2);
- }
- return _this;
- }
- _createClass(TimelineController, [{
- key: 'addCues',
- value: function addCues(channel, startTime, endTime, screen) {
- // skip cues which overlap more than 50% with previously parsed time ranges
- var ranges = this.cueRanges;
- var merged = false;
- for (var i = ranges.length; i--;) {
- var cueRange = ranges[i];
- var overlap = intersection(cueRange[0], cueRange[1], startTime, endTime);
- if (overlap >= 0) {
- cueRange[0] = Math.min(cueRange[0], startTime);
- cueRange[1] = Math.max(cueRange[1], endTime);
- merged = true;
- if (overlap / (endTime - startTime) > 0.5) {
- return;
- }
- }
- }
- if (!merged) {
- ranges.push([startTime, endTime]);
- }
- this.Cues.newCue(this[channel], startTime, endTime, screen);
- }
+ Fragment.prototype.fragmentDecryptdataFromLevelkey = function fragmentDecryptdataFromLevelkey(levelkey, segmentNumber) {
+ var decryptdata = levelkey;
- // Triggered when an initial PTS is found; used for synchronisation of WebVTT.
+ if (levelkey && levelkey.method && levelkey.uri && !levelkey.iv) {
+ decryptdata = new playlist_loader_LevelKey();
+ decryptdata.method = levelkey.method;
+ decryptdata.baseuri = levelkey.baseuri;
+ decryptdata.reluri = levelkey.reluri;
+ decryptdata.iv = this.createInitializationVector(segmentNumber);
+ }
- }, {
- key: 'onInitPtsFound',
- value: function onInitPtsFound(data) {
- var _this2 = this;
+ return decryptdata;
+ };
- if (typeof this.initPTS === 'undefined') {
- this.initPTS = data.initPTS;
- }
+ Fragment.prototype.cloneObj = function cloneObj(obj) {
+ return JSON.parse(JSON.stringify(obj));
+ };
- // Due to asynchrony, initial PTS may arrive later than the first VTT fragments are loaded.
- // Parse any unparsed fragments upon receiving the initial PTS.
- if (this.unparsedVttFrags.length) {
- this.unparsedVttFrags.forEach(function (frag) {
- _this2.onFragLoaded(frag);
- });
- this.unparsedVttFrags = [];
- }
- }
- }, {
- key: 'getExistingTrack',
- value: function getExistingTrack(channelNumber) {
- var media = this.media;
- if (media) {
- for (var i = 0; i < media.textTracks.length; i++) {
- var textTrack = media.textTracks[i];
- var propName = 'textTrack' + channelNumber;
- if (textTrack[propName] === true) {
- return textTrack;
- }
- }
+ _createClass(Fragment, [{
+ key: 'url',
+ get: function get() {
+ if (!this._url && this.relurl) {
+ this._url = url_toolkit_default.a.buildAbsoluteURL(this.baseurl, this.relurl, { alwaysNormalize: true });
}
- return null;
+ return this._url;
+ },
+ set: function set(value) {
+ this._url = value;
}
}, {
- key: 'createTextTrack',
- value: function createTextTrack(kind, label, lang) {
- var media = this.media;
- if (media) {
- return media.addTextTrack(kind, label, lang);
+ key: 'programDateTime',
+ get: function get() {
+ if (!this._programDateTime && this.rawProgramDateTime) {
+ this._programDateTime = new Date(Date.parse(this.rawProgramDateTime));
}
+ return this._programDateTime;
}
}, {
- key: 'destroy',
- value: function destroy() {
- _eventHandler2.default.prototype.destroy.call(this);
- }
- }, {
- key: 'onMediaAttaching',
- value: function onMediaAttaching(data) {
- this.media = data.media;
- }
- }, {
- key: 'onMediaDetaching',
- value: function onMediaDetaching() {
- clearCurrentCues(this.textTrack1);
- clearCurrentCues(this.textTrack2);
- }
- }, {
- key: 'onManifestLoading',
- value: function onManifestLoading() {
- this.lastSn = -1; // Detect discontiguity in fragment parsing
- this.prevCC = -1;
- this.vttCCs = { ccOffset: 0, presentationOffset: 0 }; // Detect discontinuity in subtitle manifests
-
- // clear outdated subtitles
- var media = this.media;
- if (media) {
- var textTracks = media.textTracks;
- if (textTracks) {
- for (var i = 0; i < textTracks.length; i++) {
- clearCurrentCues(textTracks[i]);
+ key: 'byteRange',
+ get: function get() {
+ if (!this._byteRange) {
+ var byteRange = this._byteRange = [];
+ if (this.rawByteRange) {
+ var params = this.rawByteRange.split('@', 2);
+ if (params.length === 1) {
+ var lastByteRangeEndOffset = this.lastByteRangeEndOffset;
+ byteRange[0] = lastByteRangeEndOffset ? lastByteRangeEndOffset : 0;
+ } else {
+ byteRange[0] = parseInt(params[1]);
}
+ byteRange[1] = parseInt(params[0]) + byteRange[0];
}
}
+ return this._byteRange;
}
}, {
- key: 'onManifestLoaded',
- value: function onManifestLoaded(data) {
- var _this3 = this;
-
- this.textTracks = [];
- this.unparsedVttFrags = this.unparsedVttFrags || [];
- this.initPTS = undefined;
- this.cueRanges = [];
-
- if (this.config.enableWebVTT) {
- this.tracks = data.subtitles || [];
- var inUseTracks = this.media ? this.media.textTracks : [];
-
- this.tracks.forEach(function (track, index) {
- var textTrack = void 0;
- if (index < inUseTracks.length) {
- var inUseTrack = inUseTracks[index];
- // Reuse tracks with the same label, but do not reuse 608/708 tracks
- if (reuseVttTextTrack(inUseTrack, track)) {
- textTrack = inUseTrack;
- }
- }
- if (!textTrack) {
- textTrack = _this3.createTextTrack('subtitles', track.name, track.lang);
- }
- textTrack.mode = track.default ? 'showing' : 'hidden';
- _this3.textTracks.push(textTrack);
- });
- }
- }
- }, {
- key: 'onLevelSwitching',
- value: function onLevelSwitching() {
- this.enabled = this.hls.currentLevel.closedCaptions !== 'NONE';
- }
- }, {
- key: 'onFragLoaded',
- value: function onFragLoaded(data) {
- var frag = data.frag,
- payload = data.payload;
- if (frag.type === 'main') {
- var sn = frag.sn;
- // if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack
- if (sn !== this.lastSn + 1) {
- var cea608Parser = this.cea608Parser;
- if (cea608Parser) {
- cea608Parser.reset();
- }
- }
- this.lastSn = sn;
- }
- // If fragment is subtitle type, parse as WebVTT.
- else if (frag.type === 'subtitle') {
- if (payload.byteLength) {
- // We need an initial synchronisation PTS. Store fragments as long as none has arrived.
- if (typeof this.initPTS === 'undefined') {
- this.unparsedVttFrags.push(data);
- return;
- }
- var vttCCs = this.vttCCs;
- if (!vttCCs[frag.cc]) {
- vttCCs[frag.cc] = { start: frag.start, prevCC: this.prevCC, new: true };
- this.prevCC = frag.cc;
- }
- var textTracks = this.textTracks,
- hls = this.hls;
-
- // Parse the WebVTT file contents.
- _webvttParser2.default.parse(payload, this.initPTS, vttCCs, frag.cc, function (cues) {
- var currentTrack = textTracks[frag.trackId];
- // Add cues and trigger event with success true.
- cues.forEach(function (cue) {
- // Sometimes there are cue overlaps on segmented vtts so the same
- // cue can appear more than once in different vtt files.
- // This avoid showing duplicated cues with same timecode and text.
- if (!currentTrack.cues.getCueById(cue.id)) {
- currentTrack.addCue(cue);
- }
- });
- hls.trigger(_events2.default.SUBTITLE_FRAG_PROCESSED, { success: true, frag: frag });
- }, function (e) {
- // Something went wrong while parsing. Trigger event with success false.
- _logger.logger.log('Failed to parse VTT cue: ' + e);
- hls.trigger(_events2.default.SUBTITLE_FRAG_PROCESSED, { success: false, frag: frag });
- });
- } else {
- // In case there is no payload, finish unsuccessfully.
- this.hls.trigger(_events2.default.SUBTITLE_FRAG_PROCESSED, { success: false, frag: frag });
- }
- }
+ key: 'byteRangeStartOffset',
+ get: function get() {
+ return this.byteRange[0];
}
}, {
- key: 'onFragParsingUserdata',
- value: function onFragParsingUserdata(data) {
- // push all of the CEA-708 messages into the interpreter
- // immediately. It will create the proper timestamps based on our PTS value
- if (this.enabled && this.config.enableCEA708Captions) {
- for (var i = 0; i < data.samples.length; i++) {
- var ccdatas = this.extractCea608Data(data.samples[i].bytes);
- this.cea608Parser.addData(data.samples[i].pts, ccdatas);
- }
- }
+ key: 'byteRangeEndOffset',
+ get: function get() {
+ return this.byteRange[1];
}
}, {
- key: 'extractCea608Data',
- value: function extractCea608Data(byteArray) {
- var count = byteArray[0] & 31;
- var position = 2;
- var tmpByte, ccbyte1, ccbyte2, ccValid, ccType;
- var actualCCBytes = [];
-
- for (var j = 0; j < count; j++) {
- tmpByte = byteArray[position++];
- ccbyte1 = 0x7F & byteArray[position++];
- ccbyte2 = 0x7F & byteArray[position++];
- ccValid = (4 & tmpByte) !== 0;
- ccType = 3 & tmpByte;
-
- if (ccbyte1 === 0 && ccbyte2 === 0) {
- continue;
- }
-
- if (ccValid) {
- if (ccType === 0) // || ccType === 1
- {
- actualCCBytes.push(ccbyte1);
- actualCCBytes.push(ccbyte2);
- }
- }
+ key: 'decryptdata',
+ get: function get() {
+ if (!this._decryptdata) {
+ this._decryptdata = this.fragmentDecryptdataFromLevelkey(this.levelkey, this.sn);
}
- return actualCCBytes;
+ return this._decryptdata;
}
}]);
- return TimelineController;
-}(_eventHandler2.default);
-
-exports.default = TimelineController;
-
-},{"34":34,"35":35,"49":49,"53":53,"57":57}],17:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-var AESCrypto = function () {
- function AESCrypto(subtle, iv) {
- _classCallCheck(this, AESCrypto);
+ return Fragment;
+}();
- this.subtle = subtle;
- this.aesIV = iv;
+function findGroup(groups, mediaGroupId) {
+ if (!groups) {
+ return null;
}
- _createClass(AESCrypto, [{
- key: 'decrypt',
- value: function decrypt(data, key) {
- return this.subtle.decrypt({ name: 'AES-CBC', iv: this.aesIV }, key, data);
- }
- }]);
-
- return AESCrypto;
-}();
+ var matchingGroup = null;
-exports.default = AESCrypto;
+ for (var i = 0; i < groups.length; i++) {
+ var group = groups[i];
+ if (group.id === mediaGroupId) {
+ matchingGroup = group;
+ }
+ }
-},{}],18:[function(_dereq_,module,exports){
-'use strict';
+ return matchingGroup;
+}
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+var playlist_loader_PlaylistLoader = function (_EventHandler) {
+ _inherits(PlaylistLoader, _EventHandler);
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+ function PlaylistLoader(hls) {
+ playlist_loader__classCallCheck(this, PlaylistLoader);
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ var _this = _possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].MANIFEST_LOADING, events["a" /* default */].LEVEL_LOADING, events["a" /* default */].AUDIO_TRACK_LOADING, events["a" /* default */].SUBTITLE_TRACK_LOADING));
-var AESDecryptor = function () {
- function AESDecryptor() {
- _classCallCheck(this, AESDecryptor);
+ _this.loaders = {};
+ return _this;
+ }
- // Static after running initTable
- this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
- 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);
+ PlaylistLoader.prototype.destroy = function destroy() {
+ for (var loaderName in this.loaders) {
+ var loader = this.loaders[loaderName];
+ if (loader) {
+ loader.destroy();
+ }
+ }
+ this.loaders = {};
+ event_handler.prototype.destroy.call(this);
+ };
- // Changes during runtime
- this.key = new Uint32Array(0);
+ PlaylistLoader.prototype.onManifestLoading = function onManifestLoading(data) {
+ this.load(data.url, { type: 'manifest' });
+ };
- this.initTable();
- }
+ PlaylistLoader.prototype.onLevelLoading = function onLevelLoading(data) {
+ this.load(data.url, { type: 'level', level: data.level, id: data.id });
+ };
- // Using view.getUint32() also swaps the byte order.
+ PlaylistLoader.prototype.onAudioTrackLoading = function onAudioTrackLoading(data) {
+ this.load(data.url, { type: 'audioTrack', id: data.id });
+ };
+ PlaylistLoader.prototype.onSubtitleTrackLoading = function onSubtitleTrackLoading(data) {
+ this.load(data.url, { type: 'subtitleTrack', id: data.id });
+ };
- _createClass(AESDecryptor, [{
- key: 'uint8ArrayToUint32Array_',
- value: function uint8ArrayToUint32Array_(arrayBuffer) {
- var view = new DataView(arrayBuffer);
- var newArray = new Uint32Array(4);
- for (var i = 0; i < 4; i++) {
- newArray[i] = view.getUint32(i * 4);
+ PlaylistLoader.prototype.load = function load(url, context) {
+ var loader = this.loaders[context.type];
+ if (loader !== undefined) {
+ var loaderContext = loader.context;
+ if (loaderContext && loaderContext.url === url) {
+ logger["b" /* logger */].trace('playlist request ongoing');
+ return;
+ } else {
+ logger["b" /* logger */].warn('abort previous loader for type:' + context.type);
+ loader.abort();
}
- return newArray;
}
- }, {
- key: 'initTable',
- value: function initTable() {
- var sBox = this.sBox;
- var invSBox = this.invSBox;
- var subMix = this.subMix;
- var subMix0 = subMix[0];
- var subMix1 = subMix[1];
- var subMix2 = subMix[2];
- var subMix3 = subMix[3];
- var invSubMix = this.invSubMix;
- var invSubMix0 = invSubMix[0];
- var invSubMix1 = invSubMix[1];
- var invSubMix2 = invSubMix[2];
- var invSubMix3 = invSubMix[3];
-
- var d = new Uint32Array(256);
- var x = 0;
- var xi = 0;
- var i = 0;
- for (i = 0; i < 256; i++) {
- if (i < 128) {
- d[i] = i << 1;
- } else {
- d[i] = i << 1 ^ 0x11b;
- }
- }
-
- for (i = 0; i < 256; i++) {
- var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;
- sx = sx >>> 8 ^ sx & 0xff ^ 0x63;
- sBox[x] = sx;
- invSBox[sx] = x;
-
- // Compute multiplication
- var x2 = d[x];
- var x4 = d[x2];
- var x8 = d[x4];
-
- // Compute sub/invSub bytes, mix columns tables
- var t = d[sx] * 0x101 ^ sx * 0x1010100;
- subMix0[x] = t << 24 | t >>> 8;
- subMix1[x] = t << 16 | t >>> 16;
- subMix2[x] = t << 8 | t >>> 24;
- subMix3[x] = t;
-
- // Compute inv sub bytes, inv mix columns tables
- t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;
- invSubMix0[sx] = t << 24 | t >>> 8;
- invSubMix1[sx] = t << 16 | t >>> 16;
- invSubMix2[sx] = t << 8 | t >>> 24;
- invSubMix3[sx] = t;
-
- // Compute next counter
- if (!x) {
- x = xi = 1;
- } else {
- x = x2 ^ d[d[d[x8 ^ x2]]];
- xi ^= d[d[xi]];
- }
- }
+ var config = this.hls.config,
+ maxRetry = void 0,
+ timeout = void 0,
+ retryDelay = void 0,
+ maxRetryDelay = void 0;
+ if (context.type === 'manifest') {
+ maxRetry = config.manifestLoadingMaxRetry;
+ timeout = config.manifestLoadingTimeOut;
+ retryDelay = config.manifestLoadingRetryDelay;
+ maxRetryDelay = config.manifestLoadingMaxRetryTimeout;
+ } else if (context.type === 'level') {
+ // Disable internal loader retry logic, since we are managing retries in Level Controller
+ maxRetry = 0;
+ timeout = config.levelLoadingTimeOut;
+ } else {
+ // TODO Introduce retry settings for audio-track and subtitle-track, it should not use level retry config
+ maxRetry = config.levelLoadingMaxRetry;
+ timeout = config.levelLoadingTimeOut;
+ retryDelay = config.levelLoadingRetryDelay;
+ maxRetryDelay = config.levelLoadingMaxRetryTimeout;
+ logger["b" /* logger */].log('loading playlist for ' + context.type + ' ' + (context.level || context.id));
}
- }, {
- key: 'expandKey',
- value: function expandKey(keyBuffer) {
- // convert keyBuffer to Uint32Array
- var key = this.uint8ArrayToUint32Array_(keyBuffer);
- var sameKey = true;
- var offset = 0;
-
- while (offset < key.length && sameKey) {
- sameKey = key[offset] === this.key[offset];
- offset++;
- }
+ loader = this.loaders[context.type] = context.loader = typeof config.pLoader !== 'undefined' ? new config.pLoader(config) : new config.loader(config);
+ context.url = url;
+ context.responseType = '';
- if (sameKey) {
- return;
- }
-
- this.key = key;
- var keySize = this.keySize = key.length;
-
- if (keySize !== 4 && keySize !== 6 && keySize !== 8) {
- throw new Error('Invalid aes key size=' + keySize);
- }
-
- var ksRows = this.ksRows = (keySize + 6 + 1) * 4;
- var ksRow = void 0;
- var invKsRow = void 0;
+ var loaderConfig = void 0,
+ loaderCallbacks = void 0;
+ loaderConfig = { timeout: timeout, maxRetry: maxRetry, retryDelay: retryDelay, maxRetryDelay: maxRetryDelay };
+ loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };
+ loader.load(context, loaderConfig, loaderCallbacks);
+ };
- var keySchedule = this.keySchedule = new Uint32Array(ksRows);
- var invKeySchedule = this.invKeySchedule = new Uint32Array(ksRows);
- var sbox = this.sBox;
- var rcon = this.rcon;
+ PlaylistLoader.prototype.resolve = function resolve(url, baseUrl) {
+ return url_toolkit_default.a.buildAbsoluteURL(baseUrl, url, { alwaysNormalize: true });
+ };
- var invSubMix = this.invSubMix;
- var invSubMix0 = invSubMix[0];
- var invSubMix1 = invSubMix[1];
- var invSubMix2 = invSubMix[2];
- var invSubMix3 = invSubMix[3];
+ PlaylistLoader.prototype.parseMasterPlaylist = function parseMasterPlaylist(string, baseurl) {
+ var levels = [],
+ result = void 0;
+ MASTER_PLAYLIST_REGEX.lastIndex = 0;
- var prev = void 0;
- var t = void 0;
+ function setCodecs(codecs, level) {
+ ['video', 'audio'].forEach(function (type) {
+ var filtered = codecs.filter(function (codec) {
+ return isCodecType(codec, type);
+ });
+ if (filtered.length) {
+ var preferred = filtered.filter(function (codec) {
+ return codec.lastIndexOf('avc1', 0) === 0 || codec.lastIndexOf('mp4a', 0) === 0;
+ });
+ level[type + 'Codec'] = preferred.length > 0 ? preferred[0] : filtered[0];
- for (ksRow = 0; ksRow < ksRows; ksRow++) {
- if (ksRow < keySize) {
- prev = keySchedule[ksRow] = key[ksRow];
- continue;
+ // remove from list
+ codecs = codecs.filter(function (codec) {
+ return filtered.indexOf(codec) === -1;
+ });
}
- t = prev;
+ });
- if (ksRow % keySize === 0) {
- // Rot word
- t = t << 8 | t >>> 24;
+ level.unknownCodecs = codecs;
+ }
- // Sub word
- t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];
+ while ((result = MASTER_PLAYLIST_REGEX.exec(string)) != null) {
+ var level = {};
- // Mix Rcon
- t ^= rcon[ksRow / keySize | 0] << 24;
- } else if (keySize > 6 && ksRow % keySize === 4) {
- // Sub word
- t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];
- }
+ var attrs = level.attrs = new attr_list(result[1]);
+ level.url = this.resolve(result[2], baseurl);
- keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;
+ var resolution = attrs.decimalResolution('RESOLUTION');
+ if (resolution) {
+ level.width = resolution.width;
+ level.height = resolution.height;
}
+ level.bitrate = attrs.decimalInteger('AVERAGE-BANDWIDTH') || attrs.decimalInteger('BANDWIDTH');
+ level.name = attrs.NAME;
- for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {
- ksRow = ksRows - invKsRow;
- if (invKsRow & 3) {
- t = keySchedule[ksRow];
- } else {
- t = keySchedule[ksRow - 4];
- }
+ setCodecs([].concat((attrs.CODECS || '').split(/[ ,]+/)), level);
- if (invKsRow < 4 || ksRow <= 4) {
- invKeySchedule[invKsRow] = t;
- } else {
- invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[t >>> 16 & 0xff]] ^ invSubMix2[sbox[t >>> 8 & 0xff]] ^ invSubMix3[sbox[t & 0xff]];
- }
-
- invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;
+ if (level.videoCodec && level.videoCodec.indexOf('avc1') !== -1) {
+ level.videoCodec = this.avc1toavcoti(level.videoCodec);
}
- }
-
- // Adding this as a method greatly improves performance.
- }, {
- key: 'networkToHostOrderSwap',
- value: function networkToHostOrderSwap(word) {
- return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;
- }
- }, {
- key: 'decrypt',
- value: function decrypt(inputArrayBuffer, offset, aesIV) {
- var nRounds = this.keySize + 6;
- var invKeySchedule = this.invKeySchedule;
- var invSBOX = this.invSBox;
-
- var invSubMix = this.invSubMix;
- var invSubMix0 = invSubMix[0];
- var invSubMix1 = invSubMix[1];
- var invSubMix2 = invSubMix[2];
- var invSubMix3 = invSubMix[3];
-
- var initVector = this.uint8ArrayToUint32Array_(aesIV);
- var initVector0 = initVector[0];
- var initVector1 = initVector[1];
- var initVector2 = initVector[2];
- var initVector3 = initVector[3];
-
- var inputInt32 = new Int32Array(inputArrayBuffer);
- var outputInt32 = new Int32Array(inputInt32.length);
-
- var t0 = void 0,
- t1 = void 0,
- t2 = void 0,
- t3 = void 0;
- var s0 = void 0,
- s1 = void 0,
- s2 = void 0,
- s3 = void 0;
- var inputWords0 = void 0,
- inputWords1 = void 0,
- inputWords2 = void 0,
- inputWords3 = void 0;
-
- var ksRow, i;
- var swapWord = this.networkToHostOrderSwap;
-
- while (offset < inputInt32.length) {
- inputWords0 = swapWord(inputInt32[offset]);
- inputWords1 = swapWord(inputInt32[offset + 1]);
- inputWords2 = swapWord(inputInt32[offset + 2]);
- inputWords3 = swapWord(inputInt32[offset + 3]);
-
- s0 = inputWords0 ^ invKeySchedule[0];
- s1 = inputWords3 ^ invKeySchedule[1];
- s2 = inputWords2 ^ invKeySchedule[2];
- s3 = inputWords1 ^ invKeySchedule[3];
-
- ksRow = 4;
-
- // Iterate through the rounds of decryption
- for (i = 1; i < nRounds; i++) {
- t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[s1 >> 16 & 0xff] ^ invSubMix2[s2 >> 8 & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];
- t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[s2 >> 16 & 0xff] ^ invSubMix2[s3 >> 8 & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];
- t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[s3 >> 16 & 0xff] ^ invSubMix2[s0 >> 8 & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];
- t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[s0 >> 16 & 0xff] ^ invSubMix2[s1 >> 8 & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];
- // Update state
- s0 = t0;
- s1 = t1;
- s2 = t2;
- s3 = t3;
-
- ksRow = ksRow + 4;
- }
-
- // Shift rows, sub bytes, add round key
- t0 = invSBOX[s0 >>> 24] << 24 ^ invSBOX[s1 >> 16 & 0xff] << 16 ^ invSBOX[s2 >> 8 & 0xff] << 8 ^ invSBOX[s3 & 0xff] ^ invKeySchedule[ksRow];
- t1 = invSBOX[s1 >>> 24] << 24 ^ invSBOX[s2 >> 16 & 0xff] << 16 ^ invSBOX[s3 >> 8 & 0xff] << 8 ^ invSBOX[s0 & 0xff] ^ invKeySchedule[ksRow + 1];
- t2 = invSBOX[s2 >>> 24] << 24 ^ invSBOX[s3 >> 16 & 0xff] << 16 ^ invSBOX[s0 >> 8 & 0xff] << 8 ^ invSBOX[s1 & 0xff] ^ invKeySchedule[ksRow + 2];
- t3 = invSBOX[s3 >>> 24] << 24 ^ invSBOX[s0 >> 16 & 0xff] << 16 ^ invSBOX[s1 >> 8 & 0xff] << 8 ^ invSBOX[s2 & 0xff] ^ invKeySchedule[ksRow + 3];
- ksRow = ksRow + 3;
-
- // Write
- outputInt32[offset] = swapWord(t0 ^ initVector0);
- outputInt32[offset + 1] = swapWord(t3 ^ initVector1);
- outputInt32[offset + 2] = swapWord(t2 ^ initVector2);
- outputInt32[offset + 3] = swapWord(t1 ^ initVector3);
-
- // reset initVector to last 4 unsigned int
- initVector0 = inputWords0;
- initVector1 = inputWords1;
- initVector2 = inputWords2;
- initVector3 = inputWords3;
-
- offset = offset + 4;
- }
-
- return outputInt32.buffer;
+ levels.push(level);
}
- }, {
- key: 'destroy',
- value: function destroy() {
- this.key = undefined;
- this.keySize = undefined;
- this.ksRows = undefined;
+ return levels;
+ };
- this.sBox = undefined;
- this.invSBox = undefined;
- this.subMix = undefined;
- this.invSubMix = undefined;
- this.keySchedule = undefined;
- this.invKeySchedule = undefined;
+ PlaylistLoader.prototype.parseMasterPlaylistMedia = function parseMasterPlaylistMedia(string, baseurl, type) {
+ var audioGroups = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
- this.rcon = undefined;
+ var result = void 0;
+ var medias = [];
+ var id = 0;
+ MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;
+ while ((result = MASTER_PLAYLIST_MEDIA_REGEX.exec(string)) !== null) {
+ var media = {};
+ var attrs = new attr_list(result[1]);
+ if (attrs.TYPE === type) {
+ media.groupId = attrs['GROUP-ID'];
+ media.name = attrs.NAME;
+ media.type = type;
+ media.default = attrs.DEFAULT === 'YES';
+ media.autoselect = attrs.AUTOSELECT === 'YES';
+ media.forced = attrs.FORCED === 'YES';
+ if (attrs.URI) {
+ media.url = this.resolve(attrs.URI, baseurl);
+ }
+ media.lang = attrs.LANGUAGE;
+ if (!media.name) {
+ media.name = media.lang;
+ }
+ if (audioGroups.length) {
+ var groupCodec = findGroup(audioGroups, media.groupId);
+ media.audioCodec = groupCodec ? groupCodec.codec : audioGroups[0].codec;
+ }
+ media.id = id++;
+ medias.push(media);
+ }
}
- }]);
-
- return AESDecryptor;
-}();
-
-exports.default = AESDecryptor;
-
-},{}],19:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _aesCrypto = _dereq_(17);
-
-var _aesCrypto2 = _interopRequireDefault(_aesCrypto);
-
-var _fastAesKey = _dereq_(20);
-
-var _fastAesKey2 = _interopRequireDefault(_fastAesKey);
-
-var _aesDecryptor = _dereq_(18);
-
-var _aesDecryptor2 = _interopRequireDefault(_aesDecryptor);
-
-var _errors = _dereq_(33);
-
-var _logger = _dereq_(53);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ return medias;
+ };
-/*globals self: false */
+ PlaylistLoader.prototype.avc1toavcoti = function avc1toavcoti(codec) {
+ var result,
+ avcdata = codec.split('.');
+ if (avcdata.length > 2) {
+ result = avcdata.shift() + '.';
+ result += parseInt(avcdata.shift()).toString(16);
+ result += ('000' + parseInt(avcdata.shift()).toString(16)).substr(-4);
+ } else {
+ result = codec;
+ }
+ return result;
+ };
-var Decrypter = function () {
- function Decrypter(observer, config) {
- _classCallCheck(this, Decrypter);
+ PlaylistLoader.prototype.parseLevelPlaylist = function parseLevelPlaylist(string, baseurl, id, type) {
+ var currentSN = 0,
+ totalduration = 0,
+ level = { type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0 },
+ levelkey = new playlist_loader_LevelKey(),
+ cc = 0,
+ prevFrag = null,
+ frag = new playlist_loader_Fragment(),
+ result,
+ i;
- this.observer = observer;
- this.config = config;
- this.logEnabled = true;
- try {
- var browserCrypto = crypto ? crypto : self.crypto;
- this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;
- } catch (e) {}
- this.disableWebCrypto = !this.subtle;
- }
+ LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;
+
+ while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {
+ var duration = result[1];
+ if (duration) {
+ // INF
+ frag.duration = parseFloat(duration);
+ // avoid sliced strings https://github.com/video-dev/hls.js/issues/939
+ var title = (' ' + result[2]).slice(1);
+ frag.title = title ? title : null;
+ frag.tagList.push(title ? ['INF', duration, title] : ['INF', duration]);
+ } else if (result[3]) {
+ // url
+ if (!isNaN(frag.duration)) {
+ var sn = currentSN++;
+ frag.type = type;
+ frag.start = totalduration;
+ frag.levelkey = levelkey;
+ frag.sn = sn;
+ frag.level = id;
+ frag.cc = cc;
+ frag.baseurl = baseurl;
+ // avoid sliced strings https://github.com/video-dev/hls.js/issues/939
+ frag.relurl = (' ' + result[3]).slice(1);
- _createClass(Decrypter, [{
- key: 'isSync',
- value: function isSync() {
- return this.disableWebCrypto && this.config.enableSoftwareAES;
- }
- }, {
- key: 'decrypt',
- value: function decrypt(data, key, iv, callback) {
- var _this = this;
+ level.fragments.push(frag);
+ prevFrag = frag;
+ totalduration += frag.duration;
- if (this.disableWebCrypto && this.config.enableSoftwareAES) {
- if (this.logEnabled) {
- _logger.logger.log('JS AES decrypt');
- this.logEnabled = false;
+ frag = new playlist_loader_Fragment();
}
- var decryptor = this.decryptor;
- if (!decryptor) {
- this.decryptor = decryptor = new _aesDecryptor2.default();
+ } else if (result[4]) {
+ // X-BYTERANGE
+ frag.rawByteRange = (' ' + result[4]).slice(1);
+ if (prevFrag) {
+ var lastByteRangeEndOffset = prevFrag.byteRangeEndOffset;
+ if (lastByteRangeEndOffset) {
+ frag.lastByteRangeEndOffset = lastByteRangeEndOffset;
+ }
+ }
+ } else if (result[5]) {
+ // PROGRAM-DATE-TIME
+ // avoid sliced strings https://github.com/video-dev/hls.js/issues/939
+ frag.rawProgramDateTime = (' ' + result[5]).slice(1);
+ frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);
+ if (level.programDateTime === undefined) {
+ level.programDateTime = new Date(new Date(Date.parse(result[5])) - 1000 * totalduration);
}
- decryptor.expandKey(key);
- callback(decryptor.decrypt(data, 0, iv));
} else {
- if (this.logEnabled) {
- _logger.logger.log('WebCrypto AES decrypt');
- this.logEnabled = false;
- }
- var subtle = this.subtle;
- if (this.key !== key) {
- this.key = key;
- this.fastAesKey = new _fastAesKey2.default(subtle, key);
- }
-
- this.fastAesKey.expandKey().then(function (aesKey) {
- // decrypt using web crypto
- var crypto = new _aesCrypto2.default(subtle, iv);
- crypto.decrypt(data, aesKey).catch(function (err) {
- _this.onWebCryptoError(err, data, key, iv, callback);
- }).then(function (result) {
- callback(result);
- });
- }).catch(function (err) {
- _this.onWebCryptoError(err, data, key, iv, callback);
- });
+ result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);
+ for (i = 1; i < result.length; i++) {
+ if (result[i] !== undefined) {
+ break;
+ }
+ }
+
+ // avoid sliced strings https://github.com/video-dev/hls.js/issues/939
+ var value1 = (' ' + result[i + 1]).slice(1);
+ var value2 = (' ' + result[i + 2]).slice(1);
+
+ switch (result[i]) {
+ case '#':
+ frag.tagList.push(value2 ? [value1, value2] : [value1]);
+ break;
+ case 'PLAYLIST-TYPE':
+ level.type = value1.toUpperCase();
+ break;
+ case 'MEDIA-SEQUENCE':
+ currentSN = level.startSN = parseInt(value1);
+ break;
+ case 'TARGETDURATION':
+ level.targetduration = parseFloat(value1);
+ break;
+ case 'VERSION':
+ level.version = parseInt(value1);
+ break;
+ case 'EXTM3U':
+ break;
+ case 'ENDLIST':
+ level.live = false;
+ break;
+ case 'DIS':
+ cc++;
+ frag.tagList.push(['DIS']);
+ break;
+ case 'DISCONTINUITY-SEQ':
+ cc = parseInt(value1);
+ break;
+ case 'KEY':
+ // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4
+ var decryptparams = value1;
+ var keyAttrs = new attr_list(decryptparams);
+ var decryptmethod = keyAttrs.enumeratedString('METHOD'),
+ decrypturi = keyAttrs.URI,
+ decryptiv = keyAttrs.hexadecimalInteger('IV');
+ if (decryptmethod) {
+ levelkey = new playlist_loader_LevelKey();
+ if (decrypturi && ['AES-128', 'SAMPLE-AES'].indexOf(decryptmethod) >= 0) {
+ levelkey.method = decryptmethod;
+ // URI to get the key
+ levelkey.baseuri = baseurl;
+ levelkey.reluri = decrypturi;
+ levelkey.key = null;
+ // Initialization Vector (IV)
+ levelkey.iv = decryptiv;
+ }
+ }
+ break;
+ case 'START':
+ var startParams = value1;
+ var startAttrs = new attr_list(startParams);
+ var startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');
+ //TIME-OFFSET can be 0
+ if (!isNaN(startTimeOffset)) {
+ level.startTimeOffset = startTimeOffset;
+ }
+ break;
+ case 'MAP':
+ var mapAttrs = new attr_list(value1);
+ frag.relurl = mapAttrs.URI;
+ frag.rawByteRange = mapAttrs.BYTERANGE;
+ frag.baseurl = baseurl;
+ frag.level = id;
+ frag.type = type;
+ frag.sn = 'initSegment';
+ level.initSegment = frag;
+ frag = new playlist_loader_Fragment();
+ break;
+ default:
+ logger["b" /* logger */].warn('line parsed but not handled: ' + result);
+ break;
+ }
}
}
- }, {
- key: 'onWebCryptoError',
- value: function onWebCryptoError(err, data, key, iv, callback) {
- if (this.config.enableSoftwareAES) {
- _logger.logger.log('WebCrypto Error, disable WebCrypto API');
- this.disableWebCrypto = true;
- this.logEnabled = true;
- this.decrypt(data, key, iv, callback);
+ frag = prevFrag;
+ //logger.log('found ' + level.fragments.length + ' fragments');
+ if (frag && !frag.relurl) {
+ level.fragments.pop();
+ totalduration -= frag.duration;
+ }
+ level.totalduration = totalduration;
+ level.averagetargetduration = totalduration / level.fragments.length;
+ level.endSN = currentSN - 1;
+ level.startCC = level.fragments[0] ? level.fragments[0].cc : 0;
+ level.endCC = cc;
+ return level;
+ };
+
+ PlaylistLoader.prototype.loadsuccess = function loadsuccess(response, stats, context) {
+ var networkDetails = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
+
+ var string = response.data,
+ url = response.url,
+ type = context.type,
+ id = context.id,
+ level = context.level,
+ hls = this.hls;
+
+ this.loaders[type] = undefined;
+ // responseURL not supported on some browsers (it is used to detect URL redirection)
+ // data-uri mode also not supported (but no need to detect redirection)
+ if (url === undefined || url.indexOf('data:') === 0) {
+ // fallback to initial URL
+ url = context.url;
+ }
+ stats.tload = performance.now();
+ //stats.mtime = new Date(target.getResponseHeader('Last-Modified'));
+ if (string.indexOf('#EXTM3U') === 0) {
+ if (string.indexOf('#EXTINF:') > 0) {
+ var isLevel = type !== 'audioTrack' && type !== 'subtitleTrack',
+ levelId = !isNaN(level) ? level : !isNaN(id) ? id : 0,
+ levelDetails = this.parseLevelPlaylist(string, url, levelId, type === 'audioTrack' ? 'audio' : type === 'subtitleTrack' ? 'subtitle' : 'main');
+ levelDetails.tload = stats.tload;
+ if (type === 'manifest') {
+ // first request, stream manifest (no master playlist), fire manifest loaded event with level details
+ hls.trigger(events["a" /* default */].MANIFEST_LOADED, { levels: [{ url: url, details: levelDetails }], audioTracks: [], url: url, stats: stats, networkDetails: networkDetails });
+ }
+ stats.tparsed = performance.now();
+ if (levelDetails.targetduration) {
+ if (isLevel) {
+ hls.trigger(events["a" /* default */].LEVEL_LOADED, { details: levelDetails, level: level || 0, id: id || 0, stats: stats, networkDetails: networkDetails });
+ } else {
+ if (type === 'audioTrack') {
+ hls.trigger(events["a" /* default */].AUDIO_TRACK_LOADED, { details: levelDetails, id: id, stats: stats, networkDetails: networkDetails });
+ } else if (type === 'subtitleTrack') {
+ hls.trigger(events["a" /* default */].SUBTITLE_TRACK_LOADED, { details: levelDetails, id: id, stats: stats, networkDetails: networkDetails });
+ }
+ }
+ } else {
+ hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].NETWORK_ERROR, details: errors["a" /* ErrorDetails */].MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'invalid targetduration', networkDetails: networkDetails });
+ }
} else {
- _logger.logger.error('decrypting error : ' + err.message);
- this.observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_DECRYPT_ERROR, fatal: true, reason: err.message });
- }
- }
- }, {
- key: 'destroy',
- value: function destroy() {
- var decryptor = this.decryptor;
- if (decryptor) {
- decryptor.destroy();
- this.decryptor = undefined;
+ var levels = this.parseMasterPlaylist(string, url);
+ // multi level playlist, parse level info
+ if (levels.length) {
+ var audioGroups = levels.map(function (l) {
+ return { id: l.attrs.AUDIO, codec: l.audioCodec };
+ });
+ var audioTracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO', audioGroups);
+ var subtitles = this.parseMasterPlaylistMedia(string, url, 'SUBTITLES');
+ if (audioTracks.length) {
+ // check if we have found an audio track embedded in main playlist (audio track without URI attribute)
+ var embeddedAudioFound = false;
+ audioTracks.forEach(function (audioTrack) {
+ if (!audioTrack.url) {
+ embeddedAudioFound = true;
+ }
+ });
+ // if no embedded audio track defined, but audio codec signaled in quality level, we need to signal this main audio track
+ // this could happen with playlists with alt audio rendition in which quality levels (main) contains both audio+video. but with mixed audio track not signaled
+ if (embeddedAudioFound === false && levels[0].audioCodec && !levels[0].attrs.AUDIO) {
+ logger["b" /* logger */].log('audio codec signaled in quality level, but no embedded audio track signaled, create one');
+ audioTracks.unshift({ type: 'main', name: 'main' });
+ }
+ }
+ hls.trigger(events["a" /* default */].MANIFEST_LOADED, { levels: levels, audioTracks: audioTracks, subtitles: subtitles, url: url, stats: stats, networkDetails: networkDetails });
+ } else {
+ hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].NETWORK_ERROR, details: errors["a" /* ErrorDetails */].MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest', networkDetails: networkDetails });
+ }
}
+ } else {
+ hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].NETWORK_ERROR, details: errors["a" /* ErrorDetails */].MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter', networkDetails: networkDetails });
}
- }]);
-
- return Decrypter;
-}();
-
-exports.default = Decrypter;
-
-},{"17":17,"18":18,"20":20,"33":33,"53":53}],20:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+ };
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ PlaylistLoader.prototype.loaderror = function loaderror(response, context) {
+ var networkDetails = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
-var FastAESKey = function () {
- function FastAESKey(subtle, key) {
- _classCallCheck(this, FastAESKey);
+ var details,
+ fatal,
+ loader = context.loader;
+ switch (context.type) {
+ case 'manifest':
+ details = errors["a" /* ErrorDetails */].MANIFEST_LOAD_ERROR;
+ fatal = true;
+ break;
+ case 'level':
+ details = errors["a" /* ErrorDetails */].LEVEL_LOAD_ERROR;
+ fatal = false;
+ break;
+ case 'audioTrack':
+ details = errors["a" /* ErrorDetails */].AUDIO_TRACK_LOAD_ERROR;
+ fatal = false;
+ break;
+ }
+ if (loader) {
+ loader.abort();
+ this.loaders[context.type] = undefined;
+ }
+ this.hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context: context, networkDetails: networkDetails });
+ };
- this.subtle = subtle;
- this.key = key;
- }
+ PlaylistLoader.prototype.loadtimeout = function loadtimeout(stats, context) {
+ var networkDetails = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- _createClass(FastAESKey, [{
- key: 'expandKey',
- value: function expandKey() {
- return this.subtle.importKey('raw', this.key, { name: 'AES-CBC' }, false, ['encrypt', 'decrypt']);
+ var details,
+ fatal,
+ loader = context.loader;
+ switch (context.type) {
+ case 'manifest':
+ details = errors["a" /* ErrorDetails */].MANIFEST_LOAD_TIMEOUT;
+ fatal = true;
+ break;
+ case 'level':
+ details = errors["a" /* ErrorDetails */].LEVEL_LOAD_TIMEOUT;
+ fatal = false;
+ break;
+ case 'audioTrack':
+ details = errors["a" /* ErrorDetails */].AUDIO_TRACK_LOAD_TIMEOUT;
+ fatal = false;
+ break;
}
- }]);
-
- return FastAESKey;
-}();
+ if (loader) {
+ loader.abort();
+ this.loaders[context.type] = undefined;
+ }
+ this.hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context: context, networkDetails: networkDetails });
+ };
-exports.default = FastAESKey;
+ return PlaylistLoader;
+}(event_handler);
-},{}],21:[function(_dereq_,module,exports){
-'use strict';
+/* harmony default export */ var playlist_loader = (playlist_loader_PlaylistLoader);
+// CONCATENATED MODULE: ./src/loader/fragment-loader.js
+function fragment_loader__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+function fragment_loader__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
- * AAC demuxer
- */
+function fragment_loader__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+/*
+ * Fragment Loader
+*/
-var _adts = _dereq_(22);
-var _adts2 = _interopRequireDefault(_adts);
-var _logger = _dereq_(53);
-var _id = _dereq_(27);
-var _id2 = _interopRequireDefault(_id);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+var fragment_loader_FragmentLoader = function (_EventHandler) {
+ fragment_loader__inherits(FragmentLoader, _EventHandler);
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ function FragmentLoader(hls) {
+ fragment_loader__classCallCheck(this, FragmentLoader);
-var AACDemuxer = function () {
- function AACDemuxer(observer, remuxer, config) {
- _classCallCheck(this, AACDemuxer);
+ var _this = fragment_loader__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].FRAG_LOADING));
- this.observer = observer;
- this.config = config;
- this.remuxer = remuxer;
+ _this.loaders = {};
+ return _this;
}
- _createClass(AACDemuxer, [{
- key: 'resetInitSegment',
- value: function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {
- this._audioTrack = { container: 'audio/adts', type: 'audio', id: -1, sequenceNumber: 0, isAAC: true, samples: [], len: 0, manifestCodec: audioCodec, duration: duration, inputTimeScale: 90000 };
- }
- }, {
- key: 'resetTimeStamp',
- value: function resetTimeStamp() {}
- }, {
- key: 'append',
-
-
- // feed incoming data to the front of the parsing pipeline
- value: function append(data, timeOffset, contiguous, accurateTimeOffset) {
- var track,
- id3 = new _id2.default(data),
- pts = 90 * id3.timeStamp,
- config,
- frameLength,
- frameDuration,
- frameIndex,
- offset,
- headerLength,
- stamp,
- length,
- aacSample;
-
- track = this._audioTrack;
-
- // Look for ADTS header
- for (offset = id3.length, length = data.length; offset < length - 1; offset++) {
- if (data[offset] === 0xff && (data[offset + 1] & 0xf6) === 0xf0) {
- break;
- }
- }
-
- if (!track.samplerate) {
- config = _adts2.default.getAudioConfig(this.observer, data, offset, track.manifestCodec);
- track.config = config.config;
- track.samplerate = config.samplerate;
- track.channelCount = config.channelCount;
- track.codec = config.codec;
- _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);
- }
- frameIndex = 0;
- frameDuration = 1024 * 90000 / track.samplerate;
- while (offset + 5 < length) {
- // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header
- headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;
- // retrieve frame size
- frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;
- frameLength -= headerLength;
- //stamp = pes.pts;
-
- if (frameLength > 0 && offset + headerLength + frameLength <= length) {
- stamp = pts + frameIndex * frameDuration;
- //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);
- aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };
- track.samples.push(aacSample);
- track.len += frameLength;
- offset += frameLength + headerLength;
- frameIndex++;
- // look for ADTS header (0xFFFx)
- for (; offset < length - 1; offset++) {
- if (data[offset] === 0xff && (data[offset + 1] & 0xf6) === 0xf0) {
- break;
- }
- }
- } else {
- break;
- }
- }
- this.remuxer.remux(track, { samples: [] }, { samples: [{ pts: pts, dts: pts, data: id3.payload }], inputTimeScale: 90000 }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset);
- }
- }, {
- key: 'destroy',
- value: function destroy() {}
- }], [{
- key: 'probe',
- value: function probe(data) {
- // check if data contains ID3 timestamp and ADTS sync word
- var id3 = new _id2.default(data),
- offset,
- length;
- if (id3.hasTimeStamp) {
- // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1
- // Layer bits (position 14 and 15) in header should be always 0 for ADTS
- // More info https://wiki.multimedia.cx/index.php?title=ADTS
- for (offset = id3.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {
- if (data[offset] === 0xff && (data[offset + 1] & 0xf6) === 0xf0) {
- //logger.log('ADTS sync word found !');
- return true;
- }
- }
+ FragmentLoader.prototype.destroy = function destroy() {
+ var loaders = this.loaders;
+ for (var loaderName in loaders) {
+ var loader = loaders[loaderName];
+ if (loader) {
+ loader.destroy();
}
- return false;
}
- }]);
-
- return AACDemuxer;
-}();
-
-exports.default = AACDemuxer;
-
-},{"22":22,"27":27,"53":53}],22:[function(_dereq_,module,exports){
-'use strict';
-
-var _logger = _dereq_(53);
+ this.loaders = {};
+ event_handler.prototype.destroy.call(this);
+ };
-var _errors = _dereq_(33);
+ FragmentLoader.prototype.onFragLoading = function onFragLoading(data) {
+ var frag = data.frag,
+ type = frag.type,
+ loader = this.loaders[type],
+ config = this.hls.config;
-/**
- * ADTS parser helper
- */
-var ADTS = {
- getAudioConfig: function getAudioConfig(observer, data, offset, audioCodec) {
- var adtsObjectType,
- // :int
- adtsSampleingIndex,
- // :int
- adtsExtensionSampleingIndex,
- // :int
- adtsChanelConfig,
- // :int
- config,
- userAgent = navigator.userAgent.toLowerCase(),
- manifestCodec = audioCodec,
- adtsSampleingRates = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];
- // byte 2
- adtsObjectType = ((data[offset + 2] & 0xC0) >>> 6) + 1;
- adtsSampleingIndex = (data[offset + 2] & 0x3C) >>> 2;
- if (adtsSampleingIndex > adtsSampleingRates.length - 1) {
- observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'invalid ADTS sampling index:' + adtsSampleingIndex });
- return;
+ frag.loaded = 0;
+ if (loader) {
+ logger["b" /* logger */].warn('abort previous fragment loader for type:' + type);
+ loader.abort();
}
- adtsChanelConfig = (data[offset + 2] & 0x01) << 2;
- // byte 3
- adtsChanelConfig |= (data[offset + 3] & 0xC0) >>> 6;
- _logger.logger.log('manifest codec:' + audioCodec + ',ADTS data:type:' + adtsObjectType + ',sampleingIndex:' + adtsSampleingIndex + '[' + adtsSampleingRates[adtsSampleingIndex] + 'Hz],channelConfig:' + adtsChanelConfig);
- // firefox: freq less than 24kHz = AAC SBR (HE-AAC)
- if (/firefox/i.test(userAgent)) {
- if (adtsSampleingIndex >= 6) {
- adtsObjectType = 5;
- config = new Array(4);
- // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies
- // there is a factor 2 between frame sample rate and output sample rate
- // multiply frequency by 2 (see table below, equivalent to substract 3)
- adtsExtensionSampleingIndex = adtsSampleingIndex - 3;
- } else {
- adtsObjectType = 2;
- config = new Array(2);
- adtsExtensionSampleingIndex = adtsSampleingIndex;
- }
- // Android : always use AAC
- } else if (userAgent.indexOf('android') !== -1) {
- adtsObjectType = 2;
- config = new Array(2);
- adtsExtensionSampleingIndex = adtsSampleingIndex;
- } else {
- /* for other browsers (Chrome/Vivaldi/Opera ...)
- always force audio type to be HE-AAC SBR, as some browsers do not support audio codec switch properly (like Chrome ...)
- */
- adtsObjectType = 5;
- config = new Array(4);
- // if (manifest codec is HE-AAC or HE-AACv2) OR (manifest codec not specified AND frequency less than 24kHz)
- if (audioCodec && (audioCodec.indexOf('mp4a.40.29') !== -1 || audioCodec.indexOf('mp4a.40.5') !== -1) || !audioCodec && adtsSampleingIndex >= 6) {
- // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies
- // there is a factor 2 between frame sample rate and output sample rate
- // multiply frequency by 2 (see table below, equivalent to substract 3)
- adtsExtensionSampleingIndex = adtsSampleingIndex - 3;
- } else {
- // if (manifest codec is AAC) AND (frequency less than 24kHz AND nb channel is 1) OR (manifest codec not specified and mono audio)
- // Chrome fails to play back with low frequency AAC LC mono when initialized with HE-AAC. This is not a problem with stereo.
- if (audioCodec && audioCodec.indexOf('mp4a.40.2') !== -1 && adtsSampleingIndex >= 6 && adtsChanelConfig === 1 || !audioCodec && adtsChanelConfig === 1) {
- adtsObjectType = 2;
- config = new Array(2);
- }
- adtsExtensionSampleingIndex = adtsSampleingIndex;
- }
- }
- /* refer to http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio#Audio_Specific_Config
- ISO 14496-3 (AAC).pdf - Table 1.13 — Syntax of AudioSpecificConfig()
- Audio Profile / Audio Object Type
- 0: Null
- 1: AAC Main
- 2: AAC LC (Low Complexity)
- 3: AAC SSR (Scalable Sample Rate)
- 4: AAC LTP (Long Term Prediction)
- 5: SBR (Spectral Band Replication)
- 6: AAC Scalable
- sampling freq
- 0: 96000 Hz
- 1: 88200 Hz
- 2: 64000 Hz
- 3: 48000 Hz
- 4: 44100 Hz
- 5: 32000 Hz
- 6: 24000 Hz
- 7: 22050 Hz
- 8: 16000 Hz
- 9: 12000 Hz
- 10: 11025 Hz
- 11: 8000 Hz
- 12: 7350 Hz
- 13: Reserved
- 14: Reserved
- 15: frequency is written explictly
- Channel Configurations
- These are the channel configurations:
- 0: Defined in AOT Specifc Config
- 1: 1 channel: front-center
- 2: 2 channels: front-left, front-right
- */
- // audioObjectType = profile => profile, the MPEG-4 Audio Object Type minus 1
- config[0] = adtsObjectType << 3;
- // samplingFrequencyIndex
- config[0] |= (adtsSampleingIndex & 0x0E) >> 1;
- config[1] |= (adtsSampleingIndex & 0x01) << 7;
- // channelConfiguration
- config[1] |= adtsChanelConfig << 3;
- if (adtsObjectType === 5) {
- // adtsExtensionSampleingIndex
- config[1] |= (adtsExtensionSampleingIndex & 0x0E) >> 1;
- config[2] = (adtsExtensionSampleingIndex & 0x01) << 7;
- // adtsObjectType (force to 2, chrome is checking that object type is less than 5 ???
- // https://chromium.googlesource.com/chromium/src.git/+/master/media/formats/mp4/aac.cc
- config[2] |= 2 << 2;
- config[3] = 0;
- }
- return { config: config, samplerate: adtsSampleingRates[adtsSampleingIndex], channelCount: adtsChanelConfig, codec: 'mp4a.40.' + adtsObjectType, manifestCodec: manifestCodec };
- }
-};
+ loader = this.loaders[type] = frag.loader = typeof config.fLoader !== 'undefined' ? new config.fLoader(config) : new config.loader(config);
-module.exports = ADTS;
+ var loaderContext = void 0,
+ loaderConfig = void 0,
+ loaderCallbacks = void 0;
+ loaderContext = { url: frag.url, frag: frag, responseType: 'arraybuffer', progressData: false };
+ var start = frag.byteRangeStartOffset,
+ end = frag.byteRangeEndOffset;
+ if (!isNaN(start) && !isNaN(end)) {
+ loaderContext.rangeStart = start;
+ loaderContext.rangeEnd = end;
+ }
+ loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: 0, retryDelay: 0, maxRetryDelay: config.fragLoadingMaxRetryTimeout };
+ loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this), onProgress: this.loadprogress.bind(this) };
+ loader.load(loaderContext, loaderConfig, loaderCallbacks);
+ };
-},{"33":33,"53":53}],23:[function(_dereq_,module,exports){
-'use strict';
+ FragmentLoader.prototype.loadsuccess = function loadsuccess(response, stats, context) {
+ var networkDetails = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ var payload = response.data,
+ frag = context.frag;
+ // detach fragment loader on load success
+ frag.loader = undefined;
+ this.loaders[frag.type] = undefined;
+ this.hls.trigger(events["a" /* default */].FRAG_LOADED, { payload: payload, frag: frag, stats: stats, networkDetails: networkDetails });
+ };
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* inline demuxer.
- * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)
- */
+ FragmentLoader.prototype.loaderror = function loaderror(response, context) {
+ var networkDetails = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
-var _events = _dereq_(35);
+ var loader = context.loader;
+ if (loader) {
+ loader.abort();
+ }
+ this.loaders[context.type] = undefined;
+ this.hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].NETWORK_ERROR, details: errors["a" /* ErrorDetails */].FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response, networkDetails: networkDetails });
+ };
-var _events2 = _interopRequireDefault(_events);
+ FragmentLoader.prototype.loadtimeout = function loadtimeout(stats, context) {
+ var networkDetails = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
-var _errors = _dereq_(33);
+ var loader = context.loader;
+ if (loader) {
+ loader.abort();
+ }
+ this.loaders[context.type] = undefined;
+ this.hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].NETWORK_ERROR, details: errors["a" /* ErrorDetails */].FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag, networkDetails: networkDetails });
+ };
-var _decrypter = _dereq_(19);
+ // data will be used for progressive parsing
-var _decrypter2 = _interopRequireDefault(_decrypter);
-var _aacdemuxer = _dereq_(21);
+ FragmentLoader.prototype.loadprogress = function loadprogress(stats, context, data) {
+ var networkDetails = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
+ // jshint ignore:line
+ var frag = context.frag;
+ frag.loaded = stats.loaded;
+ this.hls.trigger(events["a" /* default */].FRAG_LOAD_PROGRESS, { frag: frag, stats: stats, networkDetails: networkDetails });
+ };
-var _aacdemuxer2 = _interopRequireDefault(_aacdemuxer);
+ return FragmentLoader;
+}(event_handler);
-var _mp4demuxer = _dereq_(29);
+/* harmony default export */ var fragment_loader = (fragment_loader_FragmentLoader);
+// CONCATENATED MODULE: ./src/loader/key-loader.js
+function key_loader__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var _mp4demuxer2 = _interopRequireDefault(_mp4demuxer);
+function key_loader__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-var _tsdemuxer = _dereq_(32);
+function key_loader__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-var _tsdemuxer2 = _interopRequireDefault(_tsdemuxer);
+/*
+ * Decrypt key Loader
+*/
-var _mp3demuxer = _dereq_(28);
-var _mp3demuxer2 = _interopRequireDefault(_mp3demuxer);
-var _mp4Remuxer = _dereq_(45);
-var _mp4Remuxer2 = _interopRequireDefault(_mp4Remuxer);
-var _passthroughRemuxer = _dereq_(46);
-var _passthroughRemuxer2 = _interopRequireDefault(_passthroughRemuxer);
+var key_loader_KeyLoader = function (_EventHandler) {
+ key_loader__inherits(KeyLoader, _EventHandler);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ function KeyLoader(hls) {
+ key_loader__classCallCheck(this, KeyLoader);
-var DemuxerInline = function () {
- function DemuxerInline(observer, typeSupported, config, vendor) {
- _classCallCheck(this, DemuxerInline);
+ var _this = key_loader__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].KEY_LOADING));
- this.observer = observer;
- this.typeSupported = typeSupported;
- this.config = config;
- this.vendor = vendor;
+ _this.loaders = {};
+ _this.decryptkey = null;
+ _this.decrypturl = null;
+ return _this;
}
- _createClass(DemuxerInline, [{
- key: 'destroy',
- value: function destroy() {
- var demuxer = this.demuxer;
- if (demuxer) {
- demuxer.destroy();
- }
- }
- }, {
- key: 'push',
- value: function push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {
- if (data.byteLength > 0 && decryptdata != null && decryptdata.key != null && decryptdata.method === 'AES-128') {
- var decrypter = this.decrypter;
- if (decrypter == null) {
- decrypter = this.decrypter = new _decrypter2.default(this.observer, this.config);
- }
- var localthis = this;
- // performance.now() not available on WebWorker, at least on Safari Desktop
- var startTime;
- try {
- startTime = performance.now();
- } catch (error) {
- startTime = Date.now();
- }
- decrypter.decrypt(data, decryptdata.key.buffer, decryptdata.iv.buffer, function (decryptedData) {
- var endTime;
- try {
- endTime = performance.now();
- } catch (error) {
- endTime = Date.now();
- }
- localthis.observer.trigger(_events2.default.FRAG_DECRYPTED, { stats: { tstart: startTime, tdecrypt: endTime } });
- localthis.pushDecrypted(new Uint8Array(decryptedData), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);
- });
- } else {
- this.pushDecrypted(new Uint8Array(data), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);
- }
- }
- }, {
- key: 'pushDecrypted',
- value: function pushDecrypted(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {
- var demuxer = this.demuxer;
- if (!demuxer ||
- // in case of continuity change, we might switch from content type (AAC container to TS container for example)
- // so let's check that current demuxer is still valid
- discontinuity && !this.probe(data)) {
- var observer = this.observer;
- var typeSupported = this.typeSupported;
- var config = this.config;
- var muxConfig = [{ demux: _tsdemuxer2.default, remux: _mp4Remuxer2.default }, { demux: _mp3demuxer2.default, remux: _mp4Remuxer2.default }, { demux: _aacdemuxer2.default, remux: _mp4Remuxer2.default }, { demux: _mp4demuxer2.default, remux: _passthroughRemuxer2.default }];
-
- // probe for content type
- for (var i in muxConfig) {
- var mux = muxConfig[i];
- var probe = mux.demux.probe;
- if (probe(data)) {
- var _remuxer = this.remuxer = new mux.remux(observer, config, typeSupported, this.vendor);
- demuxer = new mux.demux(observer, _remuxer, config, typeSupported);
- this.probe = probe;
- break;
- }
- }
- if (!demuxer) {
- observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found' });
- return;
- }
- this.demuxer = demuxer;
- }
- var remuxer = this.remuxer;
-
- if (discontinuity || trackSwitch) {
- demuxer.resetInitSegment(initSegment, audioCodec, videoCodec, duration);
- remuxer.resetInitSegment();
- }
- if (discontinuity) {
- demuxer.resetTimeStamp();
- remuxer.resetTimeStamp(defaultInitPTS);
- }
- if (typeof demuxer.setDecryptData === 'function') {
- demuxer.setDecryptData(decryptdata);
+ KeyLoader.prototype.destroy = function destroy() {
+ for (var loaderName in this.loaders) {
+ var loader = this.loaders[loaderName];
+ if (loader) {
+ loader.destroy();
}
- demuxer.append(data, timeOffset, contiguous, accurateTimeOffset);
}
- }]);
-
- return DemuxerInline;
-}();
-
-exports.default = DemuxerInline;
-
-},{"19":19,"21":21,"28":28,"29":29,"32":32,"33":33,"35":35,"45":45,"46":46}],24:[function(_dereq_,module,exports){
-'use strict';
+ this.loaders = {};
+ event_handler.prototype.destroy.call(this);
+ };
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ KeyLoader.prototype.onKeyLoading = function onKeyLoading(data) {
+ var frag = data.frag,
+ type = frag.type,
+ loader = this.loaders[type],
+ decryptdata = frag.decryptdata,
+ uri = decryptdata.uri;
+ // if uri is different from previous one or if decrypt key not retrieved yet
+ if (uri !== this.decrypturl || this.decryptkey === null) {
+ var config = this.hls.config;
-var _demuxerInline = _dereq_(23);
+ if (loader) {
+ logger["b" /* logger */].warn('abort previous key loader for type:' + type);
+ loader.abort();
+ }
+ frag.loader = this.loaders[type] = new config.loader(config);
+ this.decrypturl = uri;
+ this.decryptkey = null;
-var _demuxerInline2 = _interopRequireDefault(_demuxerInline);
+ var loaderContext = void 0,
+ loaderConfig = void 0,
+ loaderCallbacks = void 0;
+ loaderContext = { url: uri, frag: frag, responseType: 'arraybuffer' };
+ loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: config.fragLoadingMaxRetry, retryDelay: config.fragLoadingRetryDelay, maxRetryDelay: config.fragLoadingMaxRetryTimeout };
+ loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };
+ frag.loader.load(loaderContext, loaderConfig, loaderCallbacks);
+ } else if (this.decryptkey) {
+ // we already loaded this key, return it
+ decryptdata.key = this.decryptkey;
+ this.hls.trigger(events["a" /* default */].KEY_LOADED, { frag: frag });
+ }
+ };
-var _events = _dereq_(35);
+ KeyLoader.prototype.loadsuccess = function loadsuccess(response, stats, context) {
+ var frag = context.frag;
+ this.decryptkey = frag.decryptdata.key = new Uint8Array(response.data);
+ // detach fragment loader on load success
+ frag.loader = undefined;
+ this.loaders[frag.type] = undefined;
+ this.hls.trigger(events["a" /* default */].KEY_LOADED, { frag: frag });
+ };
-var _events2 = _interopRequireDefault(_events);
+ KeyLoader.prototype.loaderror = function loaderror(response, context) {
+ var frag = context.frag,
+ loader = frag.loader;
+ if (loader) {
+ loader.abort();
+ }
+ this.loaders[context.type] = undefined;
+ this.hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].NETWORK_ERROR, details: errors["a" /* ErrorDetails */].KEY_LOAD_ERROR, fatal: false, frag: frag, response: response });
+ };
-var _logger = _dereq_(53);
+ KeyLoader.prototype.loadtimeout = function loadtimeout(stats, context) {
+ var frag = context.frag,
+ loader = frag.loader;
+ if (loader) {
+ loader.abort();
+ }
+ this.loaders[context.type] = undefined;
+ this.hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].NETWORK_ERROR, details: errors["a" /* ErrorDetails */].KEY_LOAD_TIMEOUT, fatal: false, frag: frag });
+ };
-var _events3 = _dereq_(1);
+ return KeyLoader;
+}(event_handler);
-var _events4 = _interopRequireDefault(_events3);
+/* harmony default export */ var key_loader = (key_loader_KeyLoader);
+// CONCATENATED MODULE: ./src/utils/binary-search.js
+var BinarySearch = {
+ /**
+ * Searches for an item in an array which matches a certain condition.
+ * This requires the condition to only match one item in the array,
+ * and for the array to be ordered.
+ *
+ * @param {Array} list The array to search.
+ * @param {Function} comparisonFunction
+ * Called and provided a candidate item as the first argument.
+ * Should return:
+ * > -1 if the item should be located at a lower index than the provided item.
+ * > 1 if the item should be located at a higher index than the provided item.
+ * > 0 if the item is the item you're looking for.
+ *
+ * @return {*} The object if it is found or null otherwise.
+ */
+ search: function search(list, comparisonFunction) {
+ var minIndex = 0;
+ var maxIndex = list.length - 1;
+ var currentIndex = null;
+ var currentElement = null;
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ while (minIndex <= maxIndex) {
+ currentIndex = (minIndex + maxIndex) / 2 | 0;
+ currentElement = list[currentIndex];
-/* demuxer web worker.
- * - listen to worker message, and trigger DemuxerInline upon reception of Fragments.
- * - provides MP4 Boxes back to main thread using [transferable objects](https://developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast) in order to minimize message passing overhead.
- */
+ var comparisonResult = comparisonFunction(currentElement);
+ if (comparisonResult > 0) {
+ minIndex = currentIndex + 1;
+ } else if (comparisonResult < 0) {
+ maxIndex = currentIndex - 1;
+ } else {
+ return currentElement;
+ }
+ }
-var DemuxerWorker = function DemuxerWorker(self) {
- // observer setup
- var observer = new _events4.default();
- observer.trigger = function trigger(event) {
- for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- data[_key - 1] = arguments[_key];
+ return null;
}
+};
- observer.emit.apply(observer, [event, event].concat(data));
- };
+/* harmony default export */ var binary_search = (BinarySearch);
+// CONCATENATED MODULE: ./src/helper/buffer-helper.js
+/**
+ * Buffer Helper utils, providing methods dealing buffer length retrieval
+*/
- observer.off = function off(event) {
- for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- data[_key2 - 1] = arguments[_key2];
+var BufferHelper = {
+ isBuffered: function isBuffered(media, position) {
+ try {
+ if (media) {
+ var buffered = media.buffered;
+ for (var i = 0; i < buffered.length; i++) {
+ if (position >= buffered.start(i) && position <= buffered.end(i)) {
+ return true;
+ }
+ }
+ }
+ } catch (error) {
+ // this is to catch
+ // InvalidStateError: Failed to read the 'buffered' property from 'SourceBuffer':
+ // This SourceBuffer has been removed from the parent media source
}
+ return false;
+ },
- observer.removeListener.apply(observer, [event].concat(data));
- };
-
- var forwardMessage = function forwardMessage(ev, data) {
- self.postMessage({ event: ev, data: data });
- };
-
- self.addEventListener('message', function (ev) {
- var data = ev.data;
- //console.log('demuxer cmd:' + data.cmd);
- switch (data.cmd) {
- case 'init':
- var config = JSON.parse(data.config);
- self.demuxer = new _demuxerInline2.default(observer, data.typeSupported, config, data.vendor);
- try {
- (0, _logger.enableLogs)(config.debug === true);
- } catch (err) {
- console.warn('demuxerWorker: unable to enable logs');
+ bufferInfo: function bufferInfo(media, pos, maxHoleDuration) {
+ try {
+ if (media) {
+ var vbuffered = media.buffered,
+ buffered = [],
+ i;
+ for (i = 0; i < vbuffered.length; i++) {
+ buffered.push({ start: vbuffered.start(i), end: vbuffered.end(i) });
}
- // signal end of worker init
- forwardMessage('init', null);
- break;
- case 'demux':
- self.demuxer.push(data.data, data.decryptdata, data.initSegment, data.audioCodec, data.videoCodec, data.timeOffset, data.discontinuity, data.trackSwitch, data.contiguous, data.duration, data.accurateTimeOffset, data.defaultInitPTS);
- break;
- default:
- break;
+ return this.bufferedInfo(buffered, pos, maxHoleDuration);
+ }
+ } catch (error) {
+ // this is to catch
+ // InvalidStateError: Failed to read the 'buffered' property from 'SourceBuffer':
+ // This SourceBuffer has been removed from the parent media source
}
- });
+ return { len: 0, start: pos, end: pos, nextStart: undefined };
+ },
- // forward events to main thread
- observer.on(_events2.default.FRAG_DECRYPTED, forwardMessage);
- observer.on(_events2.default.FRAG_PARSING_INIT_SEGMENT, forwardMessage);
- observer.on(_events2.default.FRAG_PARSED, forwardMessage);
- observer.on(_events2.default.ERROR, forwardMessage);
- observer.on(_events2.default.FRAG_PARSING_METADATA, forwardMessage);
- observer.on(_events2.default.FRAG_PARSING_USERDATA, forwardMessage);
- observer.on(_events2.default.INIT_PTS_FOUND, forwardMessage);
+ bufferedInfo: function bufferedInfo(buffered, pos, maxHoleDuration) {
+ var buffered2 = [],
- // special case for FRAG_PARSING_DATA: pass data1/data2 as transferable object (no copy)
- observer.on(_events2.default.FRAG_PARSING_DATA, function (ev, data) {
- var transferable = [];
- var message = { event: ev, data: data };
- if (data.data1) {
- message.data1 = data.data1.buffer;
- transferable.push(data.data1.buffer);
- delete data.data1;
+ // bufferStart and bufferEnd are buffer boundaries around current video position
+ bufferLen,
+ bufferStart,
+ bufferEnd,
+ bufferStartNext,
+ i;
+ // sort on buffer.start/smaller end (IE does not always return sorted buffered range)
+ buffered.sort(function (a, b) {
+ var diff = a.start - b.start;
+ if (diff) {
+ return diff;
+ } else {
+ return b.end - a.end;
+ }
+ });
+ // there might be some small holes between buffer time range
+ // consider that holes smaller than maxHoleDuration are irrelevant and build another
+ // buffer time range representations that discards those holes
+ for (i = 0; i < buffered.length; i++) {
+ var buf2len = buffered2.length;
+ if (buf2len) {
+ var buf2end = buffered2[buf2len - 1].end;
+ // if small hole (value between 0 or maxHoleDuration ) or overlapping (negative)
+ if (buffered[i].start - buf2end < maxHoleDuration) {
+ // merge overlapping time ranges
+ // update lastRange.end only if smaller than item.end
+ // e.g. [ 1, 15] with [ 2,8] => [ 1,15] (no need to modify lastRange.end)
+ // whereas [ 1, 8] with [ 2,15] => [ 1,15] ( lastRange should switch from [1,8] to [1,15])
+ if (buffered[i].end > buf2end) {
+ buffered2[buf2len - 1].end = buffered[i].end;
+ }
+ } else {
+ // big hole
+ buffered2.push(buffered[i]);
+ }
+ } else {
+ // first value
+ buffered2.push(buffered[i]);
+ }
}
- if (data.data2) {
- message.data2 = data.data2.buffer;
- transferable.push(data.data2.buffer);
- delete data.data2;
+ for (i = 0, bufferLen = 0, bufferStart = bufferEnd = pos; i < buffered2.length; i++) {
+ var start = buffered2[i].start,
+ end = buffered2[i].end;
+ //logger.log('buf start/end:' + buffered.start(i) + '/' + buffered.end(i));
+ if (pos + maxHoleDuration >= start && pos < end) {
+ // play position is inside this buffer TimeRange, retrieve end of buffer position and buffer length
+ bufferStart = start;
+ bufferEnd = end;
+ bufferLen = bufferEnd - pos;
+ } else if (pos + maxHoleDuration < start) {
+ bufferStartNext = start;
+ break;
+ }
}
- self.postMessage(message, transferable);
- });
+ return { len: bufferLen, start: bufferStart, end: bufferEnd, nextStart: bufferStartNext };
+ }
};
-exports.default = DemuxerWorker;
+/* harmony default export */ var buffer_helper = (BufferHelper);
+// EXTERNAL MODULE: ./src/demux/demuxer-inline.js + 12 modules
+var demuxer_inline = __webpack_require__(7);
-},{"1":1,"23":23,"35":35,"53":53}],25:[function(_dereq_,module,exports){
-'use strict';
+// EXTERNAL MODULE: ./node_modules/events/events.js
+var events_events = __webpack_require__(5);
+var events_default = /*#__PURE__*/__webpack_require__.n(events_events);
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+// EXTERNAL MODULE: ./node_modules/webworkify-webpack/index.js
+var webworkify_webpack = __webpack_require__(9);
+var webworkify_webpack_default = /*#__PURE__*/__webpack_require__.n(webworkify_webpack);
-var _events = _dereq_(35);
-
-var _events2 = _interopRequireDefault(_events);
+// CONCATENATED MODULE: ./src/helper/mediasource-helper.js
+/**
+ * MediaSource helper
+ */
-var _demuxerInline = _dereq_(23);
+function getMediaSource() {
+ if (typeof window !== 'undefined') {
+ return window.MediaSource || window.WebKitMediaSource;
+ }
+}
+// CONCATENATED MODULE: ./src/demux/demuxer.js
+function demuxer__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var _demuxerInline2 = _interopRequireDefault(_demuxerInline);
-var _demuxerWorker = _dereq_(24);
-var _demuxerWorker2 = _interopRequireDefault(_demuxerWorker);
-var _logger = _dereq_(53);
-var _errors = _dereq_(33);
-var _events3 = _dereq_(1);
-var _events4 = _interopRequireDefault(_events3);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+var demuxer_MediaSource = getMediaSource();
-var Demuxer = function () {
+var demuxer_Demuxer = function () {
function Demuxer(hls, id) {
- _classCallCheck(this, Demuxer);
+ demuxer__classCallCheck(this, Demuxer);
this.hls = hls;
this.id = id;
// observer setup
- var observer = this.observer = new _events4.default();
+ var observer = this.observer = new events_default.a();
var config = hls.config;
observer.trigger = function trigger(event) {
for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -21184,7526 +21261,5122 @@ var Demuxer = function () {
}.bind(this);
// forward events to main thread
- observer.on(_events2.default.FRAG_DECRYPTED, forwardMessage);
- observer.on(_events2.default.FRAG_PARSING_INIT_SEGMENT, forwardMessage);
- observer.on(_events2.default.FRAG_PARSING_DATA, forwardMessage);
- observer.on(_events2.default.FRAG_PARSED, forwardMessage);
- observer.on(_events2.default.ERROR, forwardMessage);
- observer.on(_events2.default.FRAG_PARSING_METADATA, forwardMessage);
- observer.on(_events2.default.FRAG_PARSING_USERDATA, forwardMessage);
- observer.on(_events2.default.INIT_PTS_FOUND, forwardMessage);
+ observer.on(events["a" /* default */].FRAG_DECRYPTED, forwardMessage);
+ observer.on(events["a" /* default */].FRAG_PARSING_INIT_SEGMENT, forwardMessage);
+ observer.on(events["a" /* default */].FRAG_PARSING_DATA, forwardMessage);
+ observer.on(events["a" /* default */].FRAG_PARSED, forwardMessage);
+ observer.on(events["a" /* default */].ERROR, forwardMessage);
+ observer.on(events["a" /* default */].FRAG_PARSING_METADATA, forwardMessage);
+ observer.on(events["a" /* default */].FRAG_PARSING_USERDATA, forwardMessage);
+ observer.on(events["a" /* default */].INIT_PTS_FOUND, forwardMessage);
var typeSupported = {
- mp4: MediaSource.isTypeSupported('video/mp4'),
- mpeg: MediaSource.isTypeSupported('audio/mpeg'),
- mp3: MediaSource.isTypeSupported('audio/mp4; codecs="mp3"')
+ mp4: demuxer_MediaSource.isTypeSupported('video/mp4'),
+ mpeg: demuxer_MediaSource.isTypeSupported('audio/mpeg'),
+ mp3: demuxer_MediaSource.isTypeSupported('audio/mp4; codecs="mp3"')
};
// navigator.vendor is not always available in Web Worker
// refer to https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/navigator
var vendor = navigator.vendor;
if (config.enableWorker && typeof Worker !== 'undefined') {
- _logger.logger.log('demuxing in webworker');
+ logger["b" /* logger */].log('demuxing in webworker');
var w = void 0;
try {
- var work = _dereq_(3);
- w = this.w = work(_demuxerWorker2.default);
+ w = this.w = webworkify_webpack_default()(/*require.resolve*/(10));
this.onwmsg = this.onWorkerMessage.bind(this);
w.addEventListener('message', this.onwmsg);
w.onerror = function (event) {
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: true, event: 'demuxerWorker', err: { message: event.message + ' (' + event.filename + ':' + event.lineno + ')' } });
+ hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].OTHER_ERROR, details: errors["a" /* ErrorDetails */].INTERNAL_EXCEPTION, fatal: true, event: 'demuxerWorker', err: { message: event.message + ' (' + event.filename + ':' + event.lineno + ')' } });
};
w.postMessage({ cmd: 'init', typeSupported: typeSupported, vendor: vendor, id: id, config: JSON.stringify(config) });
} catch (err) {
- _logger.logger.error('error while initializing DemuxerWorker, fallback on DemuxerInline');
+ logger["b" /* logger */].error('error while initializing DemuxerWorker, fallback on DemuxerInline');
if (w) {
// revoke the Object URL that was used to create demuxer worker, so as not to leak it
URL.revokeObjectURL(w.objectURL);
}
- this.demuxer = new _demuxerInline2.default(observer, typeSupported, config, vendor);
+ this.demuxer = new demuxer_inline["a" /* default */](observer, typeSupported, config, vendor);
this.w = undefined;
}
} else {
- this.demuxer = new _demuxerInline2.default(observer, typeSupported, config, vendor);
+ this.demuxer = new demuxer_inline["a" /* default */](observer, typeSupported, config, vendor);
}
}
- _createClass(Demuxer, [{
- key: 'destroy',
- value: function destroy() {
- var w = this.w;
- if (w) {
- w.removeEventListener('message', this.onwmsg);
- w.terminate();
- this.w = null;
- } else {
- var demuxer = this.demuxer;
- if (demuxer) {
- demuxer.destroy();
- this.demuxer = null;
- }
- }
- var observer = this.observer;
- if (observer) {
- observer.removeAllListeners();
- this.observer = null;
+ Demuxer.prototype.destroy = function destroy() {
+ var w = this.w;
+ if (w) {
+ w.removeEventListener('message', this.onwmsg);
+ w.terminate();
+ this.w = null;
+ } else {
+ var demuxer = this.demuxer;
+ if (demuxer) {
+ demuxer.destroy();
+ this.demuxer = null;
}
}
- }, {
- key: 'push',
- value: function push(data, initSegment, audioCodec, videoCodec, frag, duration, accurateTimeOffset, defaultInitPTS) {
- var w = this.w;
- var timeOffset = !isNaN(frag.startDTS) ? frag.startDTS : frag.start;
- var decryptdata = frag.decryptdata;
- var lastFrag = this.frag;
- var discontinuity = !(lastFrag && frag.cc === lastFrag.cc);
- var trackSwitch = !(lastFrag && frag.level === lastFrag.level);
- var nextSN = lastFrag && frag.sn === lastFrag.sn + 1;
- var contiguous = !trackSwitch && nextSN;
- if (discontinuity) {
- _logger.logger.log(this.id + ':discontinuity detected');
- }
- if (trackSwitch) {
- _logger.logger.log(this.id + ':switch detected');
- }
- this.frag = frag;
- if (w) {
- // post fragment payload as transferable objects (no copy)
- w.postMessage({ cmd: 'demux', data: data, decryptdata: decryptdata, initSegment: initSegment, audioCodec: audioCodec, videoCodec: videoCodec, timeOffset: timeOffset, discontinuity: discontinuity, trackSwitch: trackSwitch, contiguous: contiguous, duration: duration, accurateTimeOffset: accurateTimeOffset, defaultInitPTS: defaultInitPTS }, [data]);
- } else {
- var demuxer = this.demuxer;
- if (demuxer) {
- demuxer.push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);
- }
- }
+ var observer = this.observer;
+ if (observer) {
+ observer.removeAllListeners();
+ this.observer = null;
}
- }, {
- key: 'onWorkerMessage',
- value: function onWorkerMessage(ev) {
- var data = ev.data,
- hls = this.hls;
- //console.log('onWorkerMessage:' + data.event);
- switch (data.event) {
- case 'init':
- // revoke the Object URL that was used to create demuxer worker, so as not to leak it
- URL.revokeObjectURL(this.w.objectURL);
- break;
- // special case for FRAG_PARSING_DATA: data1 and data2 are transferable objects
- case _events2.default.FRAG_PARSING_DATA:
- data.data.data1 = new Uint8Array(data.data1);
- if (data.data2) {
- data.data.data2 = new Uint8Array(data.data2);
- }
- /* falls through */
- default:
- data.data = data.data || {};
- data.data.frag = this.frag;
- data.data.id = this.id;
- hls.trigger(data.event, data.data);
- break;
+ };
+
+ Demuxer.prototype.push = function push(data, initSegment, audioCodec, videoCodec, frag, duration, accurateTimeOffset, defaultInitPTS) {
+ var w = this.w;
+ var timeOffset = !isNaN(frag.startDTS) ? frag.startDTS : frag.start;
+ var decryptdata = frag.decryptdata;
+ var lastFrag = this.frag;
+ var discontinuity = !(lastFrag && frag.cc === lastFrag.cc);
+ var trackSwitch = !(lastFrag && frag.level === lastFrag.level);
+ var nextSN = lastFrag && frag.sn === lastFrag.sn + 1;
+ var contiguous = !trackSwitch && nextSN;
+ if (discontinuity) {
+ logger["b" /* logger */].log(this.id + ':discontinuity detected');
+ }
+ if (trackSwitch) {
+ logger["b" /* logger */].log(this.id + ':switch detected');
+ }
+ this.frag = frag;
+ if (w) {
+ // post fragment payload as transferable objects for ArrayBuffer (no copy)
+ w.postMessage({ cmd: 'demux', data: data, decryptdata: decryptdata, initSegment: initSegment, audioCodec: audioCodec, videoCodec: videoCodec, timeOffset: timeOffset, discontinuity: discontinuity, trackSwitch: trackSwitch, contiguous: contiguous, duration: duration, accurateTimeOffset: accurateTimeOffset, defaultInitPTS: defaultInitPTS }, data instanceof ArrayBuffer ? [data] : []);
+ } else {
+ var demuxer = this.demuxer;
+ if (demuxer) {
+ demuxer.push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);
}
}
- }]);
+ };
+
+ Demuxer.prototype.onWorkerMessage = function onWorkerMessage(ev) {
+ var data = ev.data,
+ hls = this.hls;
+ //console.log('onWorkerMessage:' + data.event);
+ switch (data.event) {
+ case 'init':
+ // revoke the Object URL that was used to create demuxer worker, so as not to leak it
+ URL.revokeObjectURL(this.w.objectURL);
+ break;
+ // special case for FRAG_PARSING_DATA: data1 and data2 are transferable objects
+ case events["a" /* default */].FRAG_PARSING_DATA:
+ data.data.data1 = new Uint8Array(data.data1);
+ if (data.data2) {
+ data.data.data2 = new Uint8Array(data.data2);
+ }
+ /* falls through */
+ default:
+ data.data = data.data || {};
+ data.data.frag = this.frag;
+ data.data.id = this.id;
+ hls.trigger(data.event, data.data);
+ break;
+ }
+ };
return Demuxer;
}();
-exports.default = Demuxer;
-
-},{"1":1,"23":23,"24":24,"3":3,"33":33,"35":35,"53":53}],26:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
- * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.
- */
-
-var _logger = _dereq_(53);
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-var ExpGolomb = function () {
- function ExpGolomb(data) {
- _classCallCheck(this, ExpGolomb);
-
- this.data = data;
- // the number of bytes left to examine in this.data
- this.bytesAvailable = data.byteLength;
- // the current word being examined
- this.word = 0; // :uint
- // the number of bits left to examine in the current word
- this.bitsAvailable = 0; // :uint
- }
-
- // ():void
-
+/* harmony default export */ var demux_demuxer = (demuxer_Demuxer);
+// CONCATENATED MODULE: ./src/helper/level-helper.js
+/**
+ * Level Helper class, providing methods dealing with playlist sliding and drift
+*/
- _createClass(ExpGolomb, [{
- key: 'loadWord',
- value: function loadWord() {
- var data = this.data,
- bytesAvailable = this.bytesAvailable,
- position = data.byteLength - bytesAvailable,
- workingBytes = new Uint8Array(4),
- availableBytes = Math.min(4, bytesAvailable);
- if (availableBytes === 0) {
- throw new Error('no bytes available');
- }
- workingBytes.set(data.subarray(position, position + availableBytes));
- this.word = new DataView(workingBytes.buffer).getUint32(0);
- // track the amount of this.data that has been processed
- this.bitsAvailable = availableBytes * 8;
- this.bytesAvailable -= availableBytes;
- }
- // (count:int):void
- }, {
- key: 'skipBits',
- value: function skipBits(count) {
- var skipBytes; // :int
- if (this.bitsAvailable > count) {
- this.word <<= count;
- this.bitsAvailable -= count;
- } else {
- count -= this.bitsAvailable;
- skipBytes = count >> 3;
- count -= skipBytes >> 3;
- this.bytesAvailable -= skipBytes;
- this.loadWord();
- this.word <<= count;
- this.bitsAvailable -= count;
+function updatePTS(fragments, fromIdx, toIdx) {
+ var fragFrom = fragments[fromIdx],
+ fragTo = fragments[toIdx],
+ fragToPTS = fragTo.startPTS;
+ // if we know startPTS[toIdx]
+ if (!isNaN(fragToPTS)) {
+ // update fragment duration.
+ // it helps to fix drifts between playlist reported duration and fragment real duration
+ if (toIdx > fromIdx) {
+ fragFrom.duration = fragToPTS - fragFrom.start;
+ if (fragFrom.duration < 0) {
+ logger["b" /* logger */].warn('negative duration computed for frag ' + fragFrom.sn + ',level ' + fragFrom.level + ', there should be some duration drift between playlist and fragment!');
}
- }
-
- // (size:int):uint
-
- }, {
- key: 'readBits',
- value: function readBits(size) {
- var bits = Math.min(this.bitsAvailable, size),
- // :uint
- valu = this.word >>> 32 - bits; // :uint
- if (size > 32) {
- _logger.logger.error('Cannot read more than 32 bits at a time');
- }
- this.bitsAvailable -= bits;
- if (this.bitsAvailable > 0) {
- this.word <<= bits;
- } else if (this.bytesAvailable > 0) {
- this.loadWord();
- }
- bits = size - bits;
- if (bits > 0 && this.bitsAvailable) {
- return valu << bits | this.readBits(bits);
- } else {
- return valu;
+ } else {
+ fragTo.duration = fragFrom.start - fragToPTS;
+ if (fragTo.duration < 0) {
+ logger["b" /* logger */].warn('negative duration computed for frag ' + fragTo.sn + ',level ' + fragTo.level + ', there should be some duration drift between playlist and fragment!');
}
}
-
- // ():uint
-
- }, {
- key: 'skipLZ',
- value: function skipLZ() {
- var leadingZeroCount; // :uint
- for (leadingZeroCount = 0; leadingZeroCount < this.bitsAvailable; ++leadingZeroCount) {
- if (0 !== (this.word & 0x80000000 >>> leadingZeroCount)) {
- // the first bit of working word is 1
- this.word <<= leadingZeroCount;
- this.bitsAvailable -= leadingZeroCount;
- return leadingZeroCount;
- }
- }
- // we exhausted word and still have not found a 1
- this.loadWord();
- return leadingZeroCount + this.skipLZ();
+ } else {
+ // we dont know startPTS[toIdx]
+ if (toIdx > fromIdx) {
+ fragTo.start = fragFrom.start + fragFrom.duration;
+ } else {
+ fragTo.start = Math.max(fragFrom.start - fragTo.duration, 0);
}
+ }
+}
- // ():void
+function updateFragPTSDTS(details, frag, startPTS, endPTS, startDTS, endDTS) {
+ // update frag PTS/DTS
+ var maxStartPTS = startPTS;
+ if (!isNaN(frag.startPTS)) {
+ // delta PTS between audio and video
+ var deltaPTS = Math.abs(frag.startPTS - startPTS);
+ if (isNaN(frag.deltaPTS)) {
+ frag.deltaPTS = deltaPTS;
+ } else {
+ frag.deltaPTS = Math.max(deltaPTS, frag.deltaPTS);
+ }
+ maxStartPTS = Math.max(startPTS, frag.startPTS);
+ startPTS = Math.min(startPTS, frag.startPTS);
+ endPTS = Math.max(endPTS, frag.endPTS);
+ startDTS = Math.min(startDTS, frag.startDTS);
+ endDTS = Math.max(endDTS, frag.endDTS);
+ }
+
+ var drift = startPTS - frag.start;
+ frag.start = frag.startPTS = startPTS;
+ frag.maxStartPTS = maxStartPTS;
+ frag.endPTS = endPTS;
+ frag.startDTS = startDTS;
+ frag.endDTS = endDTS;
+ frag.duration = endPTS - startPTS;
+
+ var sn = frag.sn;
+ // exit if sn out of range
+ if (!details || sn < details.startSN || sn > details.endSN) {
+ return 0;
+ }
+ var fragIdx, fragments, i;
+ fragIdx = sn - details.startSN;
+ fragments = details.fragments;
+ // update frag reference in fragments array
+ // rationale is that fragments array might not contain this frag object.
+ // this will happpen if playlist has been refreshed between frag loading and call to updateFragPTSDTS()
+ // if we don't update frag, we won't be able to propagate PTS info on the playlist
+ // resulting in invalid sliding computation
+ fragments[fragIdx] = frag;
+ // adjust fragment PTS/duration from seqnum-1 to frag 0
+ for (i = fragIdx; i > 0; i--) {
+ updatePTS(fragments, i, i - 1);
+ }
- }, {
- key: 'skipUEG',
- value: function skipUEG() {
- this.skipBits(1 + this.skipLZ());
- }
+ // adjust fragment PTS/duration from seqnum to last frag
+ for (i = fragIdx; i < fragments.length - 1; i++) {
+ updatePTS(fragments, i, i + 1);
+ }
+ details.PTSKnown = true;
+ //logger.log(` frag start/end:${startPTS.toFixed(3)}/${endPTS.toFixed(3)}`);
- // ():void
+ return drift;
+}
- }, {
- key: 'skipEG',
- value: function skipEG() {
- this.skipBits(1 + this.skipLZ());
+function mergeDetails(oldDetails, newDetails) {
+ var start = Math.max(oldDetails.startSN, newDetails.startSN) - newDetails.startSN,
+ end = Math.min(oldDetails.endSN, newDetails.endSN) - newDetails.startSN,
+ delta = newDetails.startSN - oldDetails.startSN,
+ oldfragments = oldDetails.fragments,
+ newfragments = newDetails.fragments,
+ ccOffset = 0,
+ PTSFrag;
+
+ // check if old/new playlists have fragments in common
+ if (end < start) {
+ newDetails.PTSKnown = false;
+ return;
+ }
+ // loop through overlapping SN and update startPTS , cc, and duration if any found
+ for (var i = start; i <= end; i++) {
+ var oldFrag = oldfragments[delta + i],
+ newFrag = newfragments[i];
+ if (newFrag && oldFrag) {
+ ccOffset = oldFrag.cc - newFrag.cc;
+ if (!isNaN(oldFrag.startPTS)) {
+ newFrag.start = newFrag.startPTS = oldFrag.startPTS;
+ newFrag.endPTS = oldFrag.endPTS;
+ newFrag.duration = oldFrag.duration;
+ newFrag.backtracked = oldFrag.backtracked;
+ newFrag.dropped = oldFrag.dropped;
+ PTSFrag = newFrag;
+ }
}
+ }
- // ():uint
-
- }, {
- key: 'readUEG',
- value: function readUEG() {
- var clz = this.skipLZ(); // :uint
- return this.readBits(clz + 1) - 1;
+ if (ccOffset) {
+ logger["b" /* logger */].log('discontinuity sliding from playlist, take drift into account');
+ for (i = 0; i < newfragments.length; i++) {
+ newfragments[i].cc += ccOffset;
}
+ }
- // ():int
-
- }, {
- key: 'readEG',
- value: function readEG() {
- var valu = this.readUEG(); // :int
- if (0x01 & valu) {
- // the number is odd if the low order bit is set
- return 1 + valu >>> 1; // add 1 to make it even, and divide by 2
- } else {
- return -1 * (valu >>> 1); // divide by two then make it negative
+ // if at least one fragment contains PTS info, recompute PTS information for all fragments
+ if (PTSFrag) {
+ updateFragPTSDTS(newDetails, PTSFrag, PTSFrag.startPTS, PTSFrag.endPTS, PTSFrag.startDTS, PTSFrag.endDTS);
+ } else {
+ // ensure that delta is within oldfragments range
+ // also adjust sliding in case delta is 0 (we could have old=[50-60] and new=old=[50-61])
+ // in that case we also need to adjust start offset of all fragments
+ if (delta >= 0 && delta < oldfragments.length) {
+ // adjust start by sliding offset
+ var sliding = oldfragments[delta].start;
+ for (i = 0; i < newfragments.length; i++) {
+ newfragments[i].start += sliding;
}
}
+ }
+ // if we are here, it means we have fragments overlapping between
+ // old and new level. reliable PTS info is thus relying on old level
+ newDetails.PTSKnown = oldDetails.PTSKnown;
+}
+// CONCATENATED MODULE: ./src/utils/timeRanges.js
+/**
+ * TimeRanges to string helper
+ */
- // Some convenience functions
- // :Boolean
-
- }, {
- key: 'readBoolean',
- value: function readBoolean() {
- return 1 === this.readBits(1);
+var TimeRanges = {
+ toString: function toString(r) {
+ var log = '',
+ len = r.length;
+ for (var i = 0; i < len; i++) {
+ log += '[' + r.start(i).toFixed(3) + ',' + r.end(i).toFixed(3) + ']';
}
+ return log;
+ }
+};
- // ():int
+/* harmony default export */ var timeRanges = (TimeRanges);
+// CONCATENATED MODULE: ./src/utils/discontinuities.js
- }, {
- key: 'readUByte',
- value: function readUByte() {
- return this.readBits(8);
- }
- // ():int
- }, {
- key: 'readUShort',
- value: function readUShort() {
- return this.readBits(16);
- }
- // ():int
+function findFirstFragWithCC(fragments, cc) {
+ var firstFrag = null;
- }, {
- key: 'readUInt',
- value: function readUInt() {
- return this.readBits(32);
+ for (var i = 0; i < fragments.length; i += 1) {
+ var currentFrag = fragments[i];
+ if (currentFrag && currentFrag.cc === cc) {
+ firstFrag = currentFrag;
+ break;
}
+ }
- /**
- * Advance the ExpGolomb decoder past a scaling list. The scaling
- * list is optionally transmitted as part of a sequence parameter
- * set and is not relevant to transmuxing.
- * @param count {number} the number of entries in this scaling list
- * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1
- */
+ return firstFrag;
+}
- }, {
- key: 'skipScalingList',
- value: function skipScalingList(count) {
- var lastScale = 8,
- nextScale = 8,
- j,
- deltaScale;
- for (j = 0; j < count; j++) {
- if (nextScale !== 0) {
- deltaScale = this.readEG();
- nextScale = (lastScale + deltaScale + 256) % 256;
- }
- lastScale = nextScale === 0 ? lastScale : nextScale;
- }
+function findFragWithCC(fragments, CC) {
+ return binary_search.search(fragments, function (candidate) {
+ if (candidate.cc < CC) {
+ return 1;
+ } else if (candidate.cc > CC) {
+ return -1;
+ } else {
+ return 0;
}
+ });
+}
- /**
- * Read a sequence parameter set and return some interesting video
- * properties. A sequence parameter set is the H264 metadata that
- * describes the properties of upcoming video frames.
- * @param data {Uint8Array} the bytes of a sequence parameter set
- * @return {object} an object with configuration parsed from the
- * sequence parameter set, including the dimensions of the
- * associated video frames.
- */
-
- }, {
- key: 'readSPS',
- value: function readSPS() {
- var frameCropLeftOffset = 0,
- frameCropRightOffset = 0,
- frameCropTopOffset = 0,
- frameCropBottomOffset = 0,
- profileIdc,
- profileCompat,
- levelIdc,
- numRefFramesInPicOrderCntCycle,
- picWidthInMbsMinus1,
- picHeightInMapUnitsMinus1,
- frameMbsOnlyFlag,
- scalingListCount,
- i,
- readUByte = this.readUByte.bind(this),
- readBits = this.readBits.bind(this),
- readUEG = this.readUEG.bind(this),
- readBoolean = this.readBoolean.bind(this),
- skipBits = this.skipBits.bind(this),
- skipEG = this.skipEG.bind(this),
- skipUEG = this.skipUEG.bind(this),
- skipScalingList = this.skipScalingList.bind(this);
-
- readUByte();
- profileIdc = readUByte(); // profile_idc
- profileCompat = readBits(5); // constraint_set[0-4]_flag, u(5)
- skipBits(3); // reserved_zero_3bits u(3),
- levelIdc = readUByte(); //level_idc u(8)
- skipUEG(); // seq_parameter_set_id
- // some profiles have more optional data we don't need
- if (profileIdc === 100 || profileIdc === 110 || profileIdc === 122 || profileIdc === 244 || profileIdc === 44 || profileIdc === 83 || profileIdc === 86 || profileIdc === 118 || profileIdc === 128) {
- var chromaFormatIdc = readUEG();
- if (chromaFormatIdc === 3) {
- skipBits(1); // separate_colour_plane_flag
- }
- skipUEG(); // bit_depth_luma_minus8
- skipUEG(); // bit_depth_chroma_minus8
- skipBits(1); // qpprime_y_zero_transform_bypass_flag
- if (readBoolean()) {
- // seq_scaling_matrix_present_flag
- scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;
- for (i = 0; i < scalingListCount; i++) {
- if (readBoolean()) {
- // seq_scaling_list_present_flag[ i ]
- if (i < 6) {
- skipScalingList(16);
- } else {
- skipScalingList(64);
- }
- }
- }
- }
- }
- skipUEG(); // log2_max_frame_num_minus4
- var picOrderCntType = readUEG();
- if (picOrderCntType === 0) {
- readUEG(); //log2_max_pic_order_cnt_lsb_minus4
- } else if (picOrderCntType === 1) {
- skipBits(1); // delta_pic_order_always_zero_flag
- skipEG(); // offset_for_non_ref_pic
- skipEG(); // offset_for_top_to_bottom_field
- numRefFramesInPicOrderCntCycle = readUEG();
- for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {
- skipEG(); // offset_for_ref_frame[ i ]
- }
- }
- skipUEG(); // max_num_ref_frames
- skipBits(1); // gaps_in_frame_num_value_allowed_flag
- picWidthInMbsMinus1 = readUEG();
- picHeightInMapUnitsMinus1 = readUEG();
- frameMbsOnlyFlag = readBits(1);
- if (frameMbsOnlyFlag === 0) {
- skipBits(1); // mb_adaptive_frame_field_flag
- }
- skipBits(1); // direct_8x8_inference_flag
- if (readBoolean()) {
- // frame_cropping_flag
- frameCropLeftOffset = readUEG();
- frameCropRightOffset = readUEG();
- frameCropTopOffset = readUEG();
- frameCropBottomOffset = readUEG();
- }
- var pixelRatio = [1, 1];
- if (readBoolean()) {
- // vui_parameters_present_flag
- if (readBoolean()) {
- // aspect_ratio_info_present_flag
- var aspectRatioIdc = readUByte();
- switch (aspectRatioIdc) {
- case 1:
- pixelRatio = [1, 1];break;
- case 2:
- pixelRatio = [12, 11];break;
- case 3:
- pixelRatio = [10, 11];break;
- case 4:
- pixelRatio = [16, 11];break;
- case 5:
- pixelRatio = [40, 33];break;
- case 6:
- pixelRatio = [24, 11];break;
- case 7:
- pixelRatio = [20, 11];break;
- case 8:
- pixelRatio = [32, 11];break;
- case 9:
- pixelRatio = [80, 33];break;
- case 10:
- pixelRatio = [18, 11];break;
- case 11:
- pixelRatio = [15, 11];break;
- case 12:
- pixelRatio = [64, 33];break;
- case 13:
- pixelRatio = [160, 99];break;
- case 14:
- pixelRatio = [4, 3];break;
- case 15:
- pixelRatio = [3, 2];break;
- case 16:
- pixelRatio = [2, 1];break;
- case 255:
- {
- pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];
- break;
- }
- }
- }
- }
- return {
- width: Math.ceil((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2),
- height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - (frameMbsOnlyFlag ? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset),
- pixelRatio: pixelRatio
- };
- }
- }, {
- key: 'readSliceType',
- value: function readSliceType() {
- // skip NALu type
- this.readUByte();
- // discard first_mb_in_slice
- this.readUEG();
- // return slice_type
- return this.readUEG();
+function shouldAlignOnDiscontinuities(lastFrag, lastLevel, details) {
+ var shouldAlign = false;
+ if (lastLevel && lastLevel.details && details) {
+ if (details.endCC > details.startCC || lastFrag && lastFrag.cc < details.startCC) {
+ shouldAlign = true;
}
- }]);
-
- return ExpGolomb;
-}();
-
-exports.default = ExpGolomb;
-
-},{"53":53}],27:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
- * ID3 parser
- */
-
-
-var _logger = _dereq_(53);
+ }
+ return shouldAlign;
+}
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+// Find the first frag in the previous level which matches the CC of the first frag of the new level
+function findDiscontinuousReferenceFrag(prevDetails, curDetails) {
+ var prevFrags = prevDetails.fragments;
+ var curFrags = curDetails.fragments;
-//import Hex from '../utils/hex';
+ if (!curFrags.length || !prevFrags.length) {
+ logger["b" /* logger */].log('No fragments to align');
+ return;
+ }
-var ID3 = function () {
- function ID3(data) {
- _classCallCheck(this, ID3);
+ var prevStartFrag = findFirstFragWithCC(prevFrags, curFrags[0].cc);
- this._hasTimeStamp = false;
- this._length = 0;
- var offset = 0,
- byte1,
- byte2,
- byte3,
- byte4,
- tagSize,
- endPos,
- header,
- len;
- do {
- header = this.readUTF(data, offset, 3);
- offset += 3;
- // first check for ID3 header
- if (header === 'ID3') {
- // skip 24 bits
- offset += 3;
- // retrieve tag(s) length
- byte1 = data[offset++] & 0x7f;
- byte2 = data[offset++] & 0x7f;
- byte3 = data[offset++] & 0x7f;
- byte4 = data[offset++] & 0x7f;
- tagSize = (byte1 << 21) + (byte2 << 14) + (byte3 << 7) + byte4;
- endPos = offset + tagSize;
- //logger.log(`ID3 tag found, size/end: ${tagSize}/${endPos}`);
-
- // read ID3 tags
- this._parseID3Frames(data, offset, endPos);
- offset = endPos;
- } else if (header === '3DI') {
- // http://id3.org/id3v2.4.0-structure chapter 3.4. ID3v2 footer
- offset += 7;
- _logger.logger.log('3DI footer found, end: ' + offset);
- } else {
- offset -= 3;
- len = offset;
- if (len) {
- //logger.log(`ID3 len: ${len}`);
- if (!this.hasTimeStamp) {
- _logger.logger.warn('ID3 tag found, but no timestamp');
- }
- this._length = len;
- this._payload = data.subarray(0, len);
- }
- return;
- }
- } while (true);
+ if (!prevStartFrag || prevStartFrag && !prevStartFrag.startPTS) {
+ logger["b" /* logger */].log('No frag in previous level to align on');
+ return;
}
- _createClass(ID3, [{
- key: 'readUTF',
- value: function readUTF(data, start, len) {
+ return prevStartFrag;
+}
- var result = '',
- offset = start,
- end = start + len;
- do {
- result += String.fromCharCode(data[offset++]);
- } while (offset < end);
- return result;
+function adjustPts(sliding, details) {
+ details.fragments.forEach(function (frag) {
+ if (frag) {
+ var start = frag.start + sliding;
+ frag.start = frag.startPTS = start;
+ frag.endPTS = start + frag.duration;
}
- }, {
- key: '_parseID3Frames',
- value: function _parseID3Frames(data, offset, endPos) {
- var tagId, tagLen, tagStart, tagFlags, timestamp;
- while (offset + 8 <= endPos) {
- tagId = this.readUTF(data, offset, 4);
- offset += 4;
-
- tagLen = data[offset++] << 24 + data[offset++] << 16 + data[offset++] << 8 + data[offset++];
-
- tagFlags = data[offset++] << 8 + data[offset++];
-
- tagStart = offset;
- //logger.log("ID3 tag id:" + tagId);
- switch (tagId) {
- case 'PRIV':
- //logger.log('parse frame:' + Hex.hexDump(data.subarray(offset,endPos)));
- // owner should be "com.apple.streaming.transportStreamTimestamp"
- if (this.readUTF(data, offset, 44) === 'com.apple.streaming.transportStreamTimestamp') {
- offset += 44;
- // smelling even better ! we found the right descriptor
- // skip null character (string end) + 3 first bytes
- offset += 4;
-
- // timestamp is 33 bit expressed as a big-endian eight-octet number, with the upper 31 bits set to zero.
- var pts33Bit = data[offset++] & 0x1;
- this._hasTimeStamp = true;
-
- timestamp = ((data[offset++] << 23) + (data[offset++] << 15) + (data[offset++] << 7) + data[offset++]) / 45;
+ });
+ details.PTSKnown = true;
+}
- if (pts33Bit) {
- timestamp += 47721858.84; // 2^32 / 90
- }
- timestamp = Math.round(timestamp);
- _logger.logger.trace('ID3 timestamp found: ' + timestamp);
- this._timeStamp = timestamp;
- }
- break;
- default:
- break;
- }
- }
+// If a change in CC is detected, the PTS can no longer be relied upon
+// Attempt to align the level by using the last level - find the last frag matching the current CC and use it's PTS
+// as a reference
+function alignDiscontinuities(lastFrag, lastLevel, details) {
+ if (shouldAlignOnDiscontinuities(lastFrag, lastLevel, details)) {
+ var referenceFrag = findDiscontinuousReferenceFrag(lastLevel.details, details);
+ if (referenceFrag) {
+ logger["b" /* logger */].log('Adjusting PTS using last level due to CC increase within current level');
+ adjustPts(referenceFrag.start, details);
+ }
+ }
+ // try to align using programDateTime attribute (if available)
+ if (details.PTSKnown === false && lastLevel && lastLevel.details) {
+ // if last level sliding is 1000 and its first frag PROGRAM-DATE-TIME is 2017-08-20 1:10:00 AM
+ // and if new details first frag PROGRAM DATE-TIME is 2017-08-20 1:10:08 AM
+ // then we can deduce that playlist B sliding is 1000+8 = 1008s
+ var lastPDT = lastLevel.details.programDateTime;
+ var newPDT = details.programDateTime;
+ // date diff is in ms. frag.start is in seconds
+ var sliding = (newPDT - lastPDT) / 1000 + lastLevel.details.fragments[0].start;
+ if (!isNaN(sliding)) {
+ logger["b" /* logger */].log('adjusting PTS using programDateTime delta, sliding:' + sliding.toFixed(3));
+ adjustPts(sliding, details);
}
- }, {
- key: 'hasTimeStamp',
- get: function get() {
- return this._hasTimeStamp;
- }
- }, {
- key: 'timeStamp',
- get: function get() {
- return this._timeStamp;
- }
- }, {
- key: 'length',
- get: function get() {
- return this._length;
- }
- }, {
- key: 'payload',
- get: function get() {
- return this._payload;
- }
- }]);
-
- return ID3;
-}();
-
-exports.default = ID3;
-
-},{"53":53}],28:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
- * MP3 demuxer
- */
-
-
-var _id = _dereq_(27);
-
-var _id2 = _interopRequireDefault(_id);
-
-var _mpegaudio = _dereq_(30);
-
-var _mpegaudio2 = _interopRequireDefault(_mpegaudio);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ }
+}
+// CONCATENATED MODULE: ./src/controller/stream-controller.js
+var stream_controller__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-var MP3Demuxer = function () {
- function MP3Demuxer(observer, remuxer, config) {
- _classCallCheck(this, MP3Demuxer);
+function stream_controller__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- this.observer = observer;
- this.config = config;
- this.remuxer = remuxer;
- }
+function stream_controller__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
- _createClass(MP3Demuxer, [{
- key: 'resetInitSegment',
- value: function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {
- this._audioTrack = { container: 'audio/mpeg', type: 'audio', id: -1, sequenceNumber: 0, isAAC: false, samples: [], len: 0, manifestCodec: audioCodec, duration: duration, inputTimeScale: 90000 };
- }
- }, {
- key: 'resetTimeStamp',
- value: function resetTimeStamp() {}
- }, {
- key: 'append',
+function stream_controller__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+/*
+ * Stream Controller
+*/
- // feed incoming data to the front of the parsing pipeline
- value: function append(data, timeOffset, contiguous, accurateTimeOffset) {
- var id3 = new _id2.default(data);
- var pts = 90 * id3.timeStamp;
- var afterID3 = id3.length;
- var offset, length;
- // Look for MPEG header
- for (offset = afterID3, length = data.length; offset < length - 1; offset++) {
- if (data[offset] === 0xff && (data[offset + 1] & 0xe0) === 0xe0 && (data[offset + 1] & 0x06) !== 0x00) {
- break;
- }
- }
- _mpegaudio2.default.parse(this._audioTrack, data, id3.length, pts);
- this.remuxer.remux(this._audioTrack, { samples: [] }, { samples: [{ pts: pts, dts: pts, data: id3.payload }], inputTimeScale: 90000 }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset);
- }
- }, {
- key: 'destroy',
- value: function destroy() {}
- }], [{
- key: 'probe',
- value: function probe(data) {
- // check if data contains ID3 timestamp and MPEG sync word
- var id3 = new _id2.default(data),
- offset,
- length;
- if (id3.hasTimeStamp) {
- // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1
- // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)
- // More info http://www.mp3-tech.org/programmer/frame_header.html
- for (offset = id3.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {
- if (data[offset] === 0xff && (data[offset + 1] & 0xe0) === 0xe0 && (data[offset + 1] & 0x06) !== 0x00) {
- //logger.log('MPEG sync word found !');
- return true;
- }
- }
- }
- return false;
- }
- }]);
- return MP3Demuxer;
-}();
-exports.default = MP3Demuxer;
-},{"27":27,"30":30}],29:[function(_dereq_,module,exports){
-'use strict';
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
- * MP4 demuxer
- */
-//import {logger} from '../utils/logger';
-var _events = _dereq_(35);
-var _events2 = _interopRequireDefault(_events);
+var State = {
+ STOPPED: 'STOPPED',
+ IDLE: 'IDLE',
+ KEY_LOADING: 'KEY_LOADING',
+ FRAG_LOADING: 'FRAG_LOADING',
+ FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',
+ WAITING_LEVEL: 'WAITING_LEVEL',
+ PARSING: 'PARSING',
+ PARSED: 'PARSED',
+ BUFFER_FLUSHING: 'BUFFER_FLUSHING',
+ ENDED: 'ENDED',
+ ERROR: 'ERROR'
+};
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+var stream_controller_StreamController = function (_EventHandler) {
+ stream_controller__inherits(StreamController, _EventHandler);
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ function StreamController(hls) {
+ stream_controller__classCallCheck(this, StreamController);
-var MP4Demuxer = function () {
- function MP4Demuxer(observer, remuxer) {
- _classCallCheck(this, MP4Demuxer);
+ var _this = stream_controller__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].MEDIA_ATTACHED, events["a" /* default */].MEDIA_DETACHING, events["a" /* default */].MANIFEST_LOADING, events["a" /* default */].MANIFEST_PARSED, events["a" /* default */].LEVEL_LOADED, events["a" /* default */].KEY_LOADED, events["a" /* default */].FRAG_LOADED, events["a" /* default */].FRAG_LOAD_EMERGENCY_ABORTED, events["a" /* default */].FRAG_PARSING_INIT_SEGMENT, events["a" /* default */].FRAG_PARSING_DATA, events["a" /* default */].FRAG_PARSED, events["a" /* default */].ERROR, events["a" /* default */].AUDIO_TRACK_SWITCHING, events["a" /* default */].AUDIO_TRACK_SWITCHED, events["a" /* default */].BUFFER_CREATED, events["a" /* default */].BUFFER_APPENDED, events["a" /* default */].BUFFER_FLUSHED));
- this.observer = observer;
- this.remuxer = remuxer;
+ _this.config = hls.config;
+ _this.audioCodecSwap = false;
+ _this.ticks = 0;
+ _this._state = State.STOPPED;
+ _this.ontick = _this.tick.bind(_this);
+ return _this;
}
- _createClass(MP4Demuxer, [{
- key: 'resetTimeStamp',
- value: function resetTimeStamp() {}
- }, {
- key: 'resetInitSegment',
- value: function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {
- //jshint unused:false
- var initData = this.initData = MP4Demuxer.parseInitSegment(initSegment);
- var tracks = {};
- if (initData.audio) {
- tracks.audio = { container: 'audio/mp4', codec: audioCodec, initSegment: initSegment };
+ StreamController.prototype.destroy = function destroy() {
+ this.stopLoad();
+ if (this.timer) {
+ clearInterval(this.timer);
+ this.timer = null;
+ }
+ event_handler.prototype.destroy.call(this);
+ this.state = State.STOPPED;
+ };
+
+ StreamController.prototype.startLoad = function startLoad(startPosition) {
+ if (this.levels) {
+ var lastCurrentTime = this.lastCurrentTime,
+ hls = this.hls;
+ this.stopLoad();
+ if (!this.timer) {
+ this.timer = setInterval(this.ontick, 100);
}
- if (initData.video) {
- tracks.video = { container: 'video/mp4', codec: videoCodec, initSegment: initSegment };
+ this.level = -1;
+ this.fragLoadError = 0;
+ if (!this.startFragRequested) {
+ // determine load level
+ var startLevel = hls.startLevel;
+ if (startLevel === -1) {
+ // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level
+ startLevel = 0;
+ this.bitrateTest = true;
+ }
+ // set new level to playlist loader : this will trigger start level load
+ // hls.nextLoadLevel remains until it is set to a new value or until a new frag is successfully loaded
+ this.level = hls.nextLoadLevel = startLevel;
+ this.loadedmetadata = false;
+ }
+ // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime
+ if (lastCurrentTime > 0 && startPosition === -1) {
+ logger["b" /* logger */].log('override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));
+ startPosition = lastCurrentTime;
}
- this.observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, { tracks: tracks });
+ this.state = State.IDLE;
+ this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;
+ this.tick();
+ } else {
+ this.forceStartLoad = true;
+ this.state = State.STOPPED;
}
- }, {
- key: 'append',
-
+ };
- // feed incoming data to the front of the parsing pipeline
- value: function append(data, timeOffset, contiguous, accurateTimeOffset) {
- var initData = this.initData;
- var startDTS = MP4Demuxer.startDTS(initData, data);
- this.remuxer.remux(initData.audio, initData.video, null, null, startDTS, contiguous, accurateTimeOffset, data);
- }
- }, {
- key: 'destroy',
- value: function destroy() {}
- }], [{
- key: 'probe',
- value: function probe(data) {
- if (data.length >= 8) {
- var dataType = MP4Demuxer.bin2str(data.subarray(4, 8));
- return ['moof', 'ftyp', 'styp'].indexOf(dataType) >= 0;
+ StreamController.prototype.stopLoad = function stopLoad() {
+ var frag = this.fragCurrent;
+ if (frag) {
+ if (frag.loader) {
+ frag.loader.abort();
}
- return false;
- }
- }, {
- key: 'bin2str',
- value: function bin2str(buffer) {
- return String.fromCharCode.apply(null, buffer);
+ this.fragCurrent = null;
}
- }, {
- key: 'readUint32',
- value: function readUint32(buffer, offset) {
- var val = buffer[offset] << 24 | buffer[offset + 1] << 16 | buffer[offset + 2] << 8 | buffer[offset + 3];
- return val < 0 ? 4294967296 + val : val;
+ this.fragPrevious = null;
+ if (this.demuxer) {
+ this.demuxer.destroy();
+ this.demuxer = null;
}
+ this.state = State.STOPPED;
+ this.forceStartLoad = false;
+ };
- // Find the data for a box specified by its path
-
- }, {
- key: 'findBox',
- value: function findBox(data, path) {
- var results = [],
- i,
- size,
- type,
- end,
- subresults;
-
- if (!path.length) {
- // short-circuit the search for empty paths
- return null;
- }
-
- for (i = 0; i < data.byteLength;) {
- size = MP4Demuxer.readUint32(data, i);
- type = MP4Demuxer.bin2str(data.subarray(i + 4, i + 8));
-
- end = size > 1 ? i + size : data.byteLength;
-
- if (type === path[0]) {
- if (path.length === 1) {
- // this is the end of the path and we've found the box we were
- // looking for
- results.push(data.subarray(i + 8, end));
- } else {
- // recursively search for the next box along the path
- subresults = MP4Demuxer.findBox(data.subarray(i + 8, end), path.slice(1));
- if (subresults.length) {
- results = results.concat(subresults);
- }
- }
- }
- i = end;
+ StreamController.prototype.tick = function tick() {
+ this.ticks++;
+ if (this.ticks === 1) {
+ this.doTick();
+ if (this.ticks > 1) {
+ setTimeout(this.tick, 1);
}
-
- // we've finished searching all of data
- return results;
+ this.ticks = 0;
}
+ };
- /**
- * Parses an MP4 initialization segment and extracts stream type and
- * timescale values for any declared tracks. Timescale values indicate the
- * number of clock ticks per second to assume for time-based values
- * elsewhere in the MP4.
- *
- * To determine the start time of an MP4, you need two pieces of
- * information: the timescale unit and the earliest base media decode
- * time. Multiple timescales can be specified within an MP4 but the
- * base media decode time is always expressed in the timescale from
- * the media header box for the track:
- * ```
- * moov > trak > mdia > mdhd.timescale
- * moov > trak > mdia > hdlr
- * ```
- * @param init {Uint8Array} the bytes of the init segment
- * @return {object} a hash of track type to timescale values or null if
- * the init segment is malformed.
- */
-
- }, {
- key: 'parseInitSegment',
- value: function parseInitSegment(initSegment) {
- var result = [];
- var traks = MP4Demuxer.findBox(initSegment, ['moov', 'trak']);
-
- traks.forEach(function (trak) {
- var tkhd = MP4Demuxer.findBox(trak, ['tkhd'])[0];
- if (tkhd) {
- var version = tkhd[0];
- var index = version === 0 ? 12 : 20;
- var trackId = MP4Demuxer.readUint32(tkhd, index);
-
- var mdhd = MP4Demuxer.findBox(trak, ['mdia', 'mdhd'])[0];
- if (mdhd) {
- version = mdhd[0];
- index = version === 0 ? 12 : 20;
- var timescale = MP4Demuxer.readUint32(mdhd, index);
-
- var hdlr = MP4Demuxer.findBox(trak, ['mdia', 'hdlr'])[0];
- if (hdlr) {
- var hdlrType = MP4Demuxer.bin2str(hdlr.subarray(8, 12));
- var type = { 'soun': 'audio', 'vide': 'video' }[hdlrType];
- if (type) {
- result[trackId] = { timescale: timescale, type: type };
- result[type] = { timescale: timescale, id: trackId };
- }
- }
- }
+ StreamController.prototype.doTick = function doTick() {
+ switch (this.state) {
+ case State.ERROR:
+ //don't do anything in error state to avoid breaking further ...
+ break;
+ case State.BUFFER_FLUSHING:
+ // in buffer flushing state, reset fragLoadError counter
+ this.fragLoadError = 0;
+ break;
+ case State.IDLE:
+ this._doTickIdle();
+ break;
+ case State.WAITING_LEVEL:
+ var level = this.levels[this.level];
+ // check if playlist is already loaded
+ if (level && level.details) {
+ this.state = State.IDLE;
}
- });
- return result;
+ break;
+ case State.FRAG_LOADING_WAITING_RETRY:
+ var now = performance.now();
+ var retryDate = this.retryDate;
+ // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading
+ if (!retryDate || now >= retryDate || this.media && this.media.seeking) {
+ logger["b" /* logger */].log('mediaController: retryDate reached, switch back to IDLE state');
+ this.state = State.IDLE;
+ }
+ break;
+ case State.ERROR:
+ case State.STOPPED:
+ case State.FRAG_LOADING:
+ case State.PARSING:
+ case State.PARSED:
+ case State.ENDED:
+ break;
+ default:
+ break;
}
+ // check buffer
+ this._checkBuffer();
+ // check/update current fragment
+ this._checkFragmentChanged();
+ };
- /**
- * Determine the base media decode start time, in seconds, for an MP4
- * fragment. If multiple fragments are specified, the earliest time is
- * returned.
- *
- * The base media decode time can be parsed from track fragment
- * metadata:
- * ```
- * moof > traf > tfdt.baseMediaDecodeTime
- * ```
- * It requires the timescale value from the mdhd to interpret.
- *
- * @param timescale {object} a hash of track ids to timescale values.
- * @return {number} the earliest base media decode start time for the
- * fragment, in seconds
- */
-
- }, {
- key: 'startDTS',
- value: function startDTS(initData, fragment) {
- var trafs, baseTimes, result;
+ // Ironically the "idle" state is the on we do the most logic in it seems ....
+ // NOTE: Maybe we could rather schedule a check for buffer length after half of the currently
+ // played segment, or on pause/play/seek instead of naively checking every 100ms?
- // we need info from two childrend of each track fragment box
- trafs = MP4Demuxer.findBox(fragment, ['moof', 'traf']);
- // determine the start times for each track
- baseTimes = [].concat.apply([], trafs.map(function (traf) {
- return MP4Demuxer.findBox(traf, ['tfhd']).map(function (tfhd) {
- var id, scale, baseTime;
+ StreamController.prototype._doTickIdle = function _doTickIdle() {
+ var hls = this.hls,
+ config = hls.config,
+ media = this.media;
- // get the track id from the tfhd
- id = MP4Demuxer.readUint32(tfhd, 4);
- // assume a 90kHz clock if no timescale was specified
- scale = initData[id].timescale || 90e3;
+ // if start level not parsed yet OR
+ // if video not attached AND start fragment already requested OR start frag prefetch disable
+ // exit loop, as we either need more info (level not parsed) or we need media to be attached to load new fragment
+ if (this.levelLastLoaded === undefined || !media && (this.startFragRequested || !config.startFragPrefetch)) {
+ return;
+ }
- // get the base media decode time from the tfdt
- baseTime = MP4Demuxer.findBox(traf, ['tfdt']).map(function (tfdt) {
- var version, result;
+ // if we have not yet loaded any fragment, start loading from start position
+ var pos = void 0;
+ if (this.loadedmetadata) {
+ pos = media.currentTime;
+ } else {
+ pos = this.nextLoadPosition;
+ }
+ // determine next load level
+ var level = hls.nextLoadLevel,
+ levelInfo = this.levels[level];
- version = tfdt[0];
- result = MP4Demuxer.readUint32(tfdt, 4);
- if (version === 1) {
- result *= Math.pow(2, 32);
+ if (!levelInfo) {
+ return;
+ }
- result += MP4Demuxer.readUint32(tfdt, 8);
- }
- return result;
- })[0];
- baseTime = baseTime || Infinity;
+ var levelBitrate = levelInfo.bitrate,
+ maxBufLen = void 0;
- // convert base time to seconds
- return baseTime / scale;
- });
- }));
-
- // return the minimum
- result = Math.min.apply(null, baseTimes);
- return isFinite(result) ? result : 0;
+ // compute max Buffer Length that we could get from this load level, based on level bitrate. don't buffer more than 60 MB and more than 30s
+ if (levelBitrate) {
+ maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, config.maxBufferLength);
+ } else {
+ maxBufLen = config.maxBufferLength;
}
- }]);
-
- return MP4Demuxer;
-}();
+ maxBufLen = Math.min(maxBufLen, config.maxMaxBufferLength);
-exports.default = MP4Demuxer;
+ // determine next candidate fragment to be loaded, based on current position and end of buffer position
+ // ensure up to `config.maxMaxBufferLength` of buffer upfront
-},{"35":35}],30:[function(_dereq_,module,exports){
-'use strict';
+ var bufferInfo = buffer_helper.bufferInfo(this.mediaBuffer ? this.mediaBuffer : media, pos, config.maxBufferHole),
+ bufferLen = bufferInfo.len;
+ // Stay idle if we are still with buffer margins
+ if (bufferLen >= maxBufLen) {
+ return;
+ }
-var _logger = _dereq_(53);
+ // if buffer length is less than maxBufLen try to load a new fragment ...
+ logger["b" /* logger */].trace('buffer length of ' + bufferLen.toFixed(3) + ' is below max of ' + maxBufLen.toFixed(3) + '. checking for more payload ...');
-var MpegAudio = {
+ // set next load level : this will trigger a playlist load if needed
+ this.level = hls.nextLoadLevel = level;
- onFrame: function onFrame(track, data, bitRate, sampleRate, channelCount, frameIndex, pts) {
- var frameDuration = 1152 * 90000 / sampleRate;
- var stamp = pts + frameIndex * frameDuration;
+ var levelDetails = levelInfo.details;
+ // if level info not retrieved yet, switch state and wait for level retrieval
+ // if live playlist, ensure that new playlist has been refreshed to avoid loading/try to load
+ // a useless and outdated fragment (that might even introduce load error if it is already out of the live playlist)
+ if (levelDetails === undefined || levelDetails.live === true && this.levelLastLoaded !== level) {
+ this.state = State.WAITING_LEVEL;
+ return;
+ }
- track.config = [];
- track.channelCount = channelCount;
- track.samplerate = sampleRate;
- track.samples.push({ unit: data, pts: stamp, dts: stamp });
- track.len += data.length;
- },
+ // we just got done loading the final fragment and there is no other buffered range after ...
+ // rationale is that in case there are any buffered ranges after, it means that there are unbuffered portion in between
+ // so we should not switch to ENDED in that case, to be able to buffer them
+ // dont switch to ENDED if we need to backtrack last fragment
+ var fragPrevious = this.fragPrevious;
+ if (!levelDetails.live && fragPrevious && !fragPrevious.backtracked && fragPrevious.sn === levelDetails.endSN && !bufferInfo.nextStart) {
+ // fragPrevious is last fragment. retrieve level duration using last frag start offset + duration
+ // real duration might be lower than initial duration if there are drifts between real frag duration and playlist signaling
+ var duration = Math.min(media.duration, fragPrevious.start + fragPrevious.duration);
+ // if everything (almost) til the end is buffered, let's signal eos
+ // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference (audio/video offsets...)
+ // tolerate up to one frag duration to cope with these cases.
+ // also cope with almost zero last frag duration (max last frag duration with 200ms) refer to https://github.com/video-dev/hls.js/pull/657
+ if (duration - Math.max(bufferInfo.end, fragPrevious.start) <= Math.max(0.2, fragPrevious.duration)) {
+ // Finalize the media stream
+ var data = {};
+ if (this.altAudio) {
+ data.type = 'video';
+ }
+ this.hls.trigger(events["a" /* default */].BUFFER_EOS, data);
+ this.state = State.ENDED;
+ return;
+ }
+ }
- onNoise: function onNoise(data) {
- _logger.logger.warn('mpeg audio has noise: ' + data.length + ' bytes');
- },
+ // if we have the levelDetails for the selected variant, lets continue enrichen our stream (load keys/fragments or trigger EOS, etc..)
+ this._fetchPayloadOrEos(pos, bufferInfo, levelDetails);
+ };
- parseFrames: function parseFrames(track, data, start, end, frameIndex, pts) {
- var BitratesMap = [32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160];
- var SamplingRateMap = [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000];
+ StreamController.prototype._fetchPayloadOrEos = function _fetchPayloadOrEos(pos, bufferInfo, levelDetails) {
+ var fragPrevious = this.fragPrevious,
+ level = this.level,
+ fragments = levelDetails.fragments,
+ fragLen = fragments.length;
- if (start + 2 > end) {
- return -1; // we need at least 2 bytes to detect sync pattern
- }
- if (data[start] === 0xFF || (data[start + 1] & 0xE0) === 0xE0) {
- // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference
- if (start + 24 > end) {
- return -1;
- }
- var headerB = data[start + 1] >> 3 & 3;
- var headerC = data[start + 1] >> 1 & 3;
- var headerE = data[start + 2] >> 4 & 15;
- var headerF = data[start + 2] >> 2 & 3;
- var headerG = !!(data[start + 2] & 2);
- if (headerB !== 1 && headerE !== 0 && headerE !== 15 && headerF !== 3) {
- var columnInBitrates = headerB === 3 ? 3 - headerC : headerC === 3 ? 3 : 4;
- var bitRate = BitratesMap[columnInBitrates * 14 + headerE - 1] * 1000;
- var columnInSampleRates = headerB === 3 ? 0 : headerB === 2 ? 1 : 2;
- var sampleRate = SamplingRateMap[columnInSampleRates * 3 + headerF];
- var padding = headerG ? 1 : 0;
- var channelCount = data[start + 3] >> 6 === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)
- var frameLength = headerC === 3 ? (headerB === 3 ? 12 : 6) * bitRate / sampleRate + padding << 2 : (headerB === 3 ? 144 : 72) * bitRate / sampleRate + padding | 0;
- if (start + frameLength > end) {
- return -1;
- }
+ // empty playlist
+ if (fragLen === 0) {
+ return;
+ }
- this.onFrame(track, data.subarray(start, start + frameLength), bitRate, sampleRate, channelCount, frameIndex, pts);
+ // find fragment index, contiguous with end of buffer position
+ var start = fragments[0].start,
+ end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,
+ bufferEnd = bufferInfo.end,
+ frag = void 0;
- return frameLength;
- }
+ if (levelDetails.initSegment && !levelDetails.initSegment.data) {
+ frag = levelDetails.initSegment;
+ } else {
+ // in case of live playlist we need to ensure that requested position is not located before playlist start
+ if (levelDetails.live) {
+ var initialLiveManifestSize = this.config.initialLiveManifestSize;
+ if (fragLen < initialLiveManifestSize) {
+ logger["b" /* logger */].warn('Can not start playback of a level, reason: not enough fragments ' + fragLen + ' < ' + initialLiveManifestSize);
+ return;
}
- // noise or ID3, trying to skip
- var offset = start + 2;
- while (offset < end) {
- if (data[offset - 1] === 0xFF && (data[offset] & 0xE0) === 0xE0) {
- // sync pattern is found
- this.onNoise(data.subarray(start, offset - 1));
- return offset - start - 1;
- }
- offset++;
+ frag = this._ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen);
+ // if it explicitely returns null don't load any fragment and exit function now
+ if (frag === null) {
+ return;
}
- return -1;
- },
-
- parse: function parse(track, data, offset, pts) {
- var length = data.length;
- var frameIndex = 0;
- var parsed;
-
- while (offset < length && (parsed = this.parseFrames(track, data, offset, length, frameIndex++, pts)) > 0) {
- offset += parsed;
+ } else {
+ // VoD playlist: if bufferEnd before start of playlist, load first fragment
+ if (bufferEnd < start) {
+ frag = fragments[0];
}
+ }
}
-}; /**
- * MPEG parser helper
- */
-
-
-module.exports = MpegAudio;
-
-},{"53":53}],31:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
- * SAMPLE-AES decrypter
- */
-
-var _decrypter = _dereq_(19);
-
-var _decrypter2 = _interopRequireDefault(_decrypter);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ if (!frag) {
+ frag = this._findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails);
+ }
+ if (frag) {
+ this._loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd);
+ }
+ return;
+ };
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ StreamController.prototype._ensureFragmentAtLivePoint = function _ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen) {
+ var config = this.hls.config,
+ media = this.media;
-var SampleAesDecrypter = function () {
- function SampleAesDecrypter(observer, config, decryptdata, discardEPB) {
- _classCallCheck(this, SampleAesDecrypter);
+ var frag = void 0;
- this.decryptdata = decryptdata;
- this.discardEPB = discardEPB;
- this.decrypter = new _decrypter2.default(observer, config);
- }
+ // check if requested position is within seekable boundaries :
+ //logger.log(`start/pos/bufEnd/seeking:${start.toFixed(3)}/${pos.toFixed(3)}/${bufferEnd.toFixed(3)}/${this.media.seeking}`);
+ var maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount * levelDetails.targetduration;
- _createClass(SampleAesDecrypter, [{
- key: 'decryptBuffer',
- value: function decryptBuffer(encryptedData, callback) {
- this.decrypter.decrypt(encryptedData, this.decryptdata.key.buffer, this.decryptdata.iv.buffer, callback);
+ if (bufferEnd < Math.max(start - config.maxFragLookUpTolerance, end - maxLatency)) {
+ var liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);
+ logger["b" /* logger */].log('buffer end: ' + bufferEnd.toFixed(3) + ' is located too far from the end of live sliding playlist, reset currentTime to : ' + liveSyncPosition.toFixed(3));
+ bufferEnd = liveSyncPosition;
+ if (media && media.readyState && media.duration > liveSyncPosition) {
+ media.currentTime = liveSyncPosition;
+ }
+ this.nextLoadPosition = liveSyncPosition;
}
- // AAC - encrypt all full 16 bytes blocks starting from offset 16
-
- }, {
- key: 'decryptAacSample',
- value: function decryptAacSample(samples, sampleIndex, callback, sync) {
- var curUnit = samples[sampleIndex].unit;
- var encryptedData = curUnit.subarray(16, curUnit.length - curUnit.length % 16);
- var encryptedBuffer = encryptedData.buffer.slice(encryptedData.byteOffset, encryptedData.byteOffset + encryptedData.length);
-
- var localthis = this;
- this.decryptBuffer(encryptedBuffer, function (decryptedData) {
- decryptedData = new Uint8Array(decryptedData);
- curUnit.set(decryptedData, 16);
+ // if end of buffer greater than live edge, don't load any fragment
+ // this could happen if live playlist intermittently slides in the past.
+ // level 1 loaded [182580161,182580167]
+ // level 1 loaded [182580162,182580169]
+ // Loading 182580168 of [182580162 ,182580169],level 1 ..
+ // Loading 182580169 of [182580162 ,182580169],level 1 ..
+ // level 1 loaded [182580162,182580168] <============= here we should have bufferEnd > end. in that case break to avoid reloading 182580168
+ // level 1 loaded [182580164,182580171]
+ //
+ // don't return null in case media not loaded yet (readystate === 0)
+ if (levelDetails.PTSKnown && bufferEnd > end && media && media.readyState) {
+ return null;
+ }
- if (!sync) {
- localthis.decryptAacSamples(samples, sampleIndex + 1, callback);
+ if (this.startFragRequested && !levelDetails.PTSKnown) {
+ /* we are switching level on live playlist, but we don't have any PTS info for that quality level ...
+ try to load frag matching with next SN.
+ even if SN are not synchronized between playlists, loading this frag will help us
+ compute playlist sliding and find the right one after in case it was not the right consecutive one */
+ if (fragPrevious) {
+ var targetSN = fragPrevious.sn + 1;
+ if (targetSN >= levelDetails.startSN && targetSN <= levelDetails.endSN) {
+ var fragNext = fragments[targetSN - levelDetails.startSN];
+ if (fragPrevious.cc === fragNext.cc) {
+ frag = fragNext;
+ logger["b" /* logger */].log('live playlist, switching playlist, load frag with next SN: ' + frag.sn);
+ }
}
- });
- }
- }, {
- key: 'decryptAacSamples',
- value: function decryptAacSamples(samples, sampleIndex, callback) {
- for (;; sampleIndex++) {
- if (sampleIndex >= samples.length) {
- callback();
- return;
+ // next frag SN not available (or not with same continuity counter)
+ // look for a frag sharing the same CC
+ if (!frag) {
+ frag = binary_search.search(fragments, function (frag) {
+ return fragPrevious.cc - frag.cc;
+ });
+ if (frag) {
+ logger["b" /* logger */].log('live playlist, switching playlist, load frag with same CC: ' + frag.sn);
+ }
}
-
- if (samples[sampleIndex].unit.length < 32) {
- continue;
+ }
+ if (!frag) {
+ /* we have no idea about which fragment should be loaded.
+ so let's load mid fragment. it will help computing playlist sliding and find the right one
+ */
+ frag = fragments[Math.min(fragLen - 1, Math.round(fragLen / 2))];
+ logger["b" /* logger */].log('live playlist, switching playlist, unknown, load middle frag : ' + frag.sn);
+ }
+ }
+ return frag;
+ };
+
+ StreamController.prototype._findFragment = function _findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails) {
+ var config = this.hls.config;
+ var frag = void 0;
+ var foundFrag = void 0;
+ var maxFragLookUpTolerance = config.maxFragLookUpTolerance;
+ var fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;
+ var fragmentWithinToleranceTest = function fragmentWithinToleranceTest(candidate) {
+ // offset should be within fragment boundary - config.maxFragLookUpTolerance
+ // this is to cope with situations like
+ // bufferEnd = 9.991
+ // frag[Ø] : [0,10]
+ // frag[1] : [10,20]
+ // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here
+ // frag start frag start+duration
+ // |-----------------------------|
+ // <---> <--->
+ // ...--------><-----------------------------><---------....
+ // previous frag matching fragment next frag
+ // return -1 return 0 return 1
+ //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);
+ // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments
+ var candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration + (candidate.deltaPTS ? candidate.deltaPTS : 0));
+ if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {
+ return 1;
+ } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element
+ else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {
+ return -1;
}
+ return 0;
+ };
- var sync = this.decrypter.isSync();
+ if (bufferEnd < end) {
+ if (bufferEnd > end - maxFragLookUpTolerance) {
+ maxFragLookUpTolerance = 0;
+ }
+ // Prefer the next fragment if it's within tolerance
+ if (fragNext && !fragmentWithinToleranceTest(fragNext)) {
+ foundFrag = fragNext;
+ } else {
+ foundFrag = binary_search.search(fragments, fragmentWithinToleranceTest);
+ }
+ } else {
+ // reach end of playlist
+ foundFrag = fragments[fragLen - 1];
+ }
+ if (foundFrag) {
+ frag = foundFrag;
+ var curSNIdx = frag.sn - levelDetails.startSN;
+ var sameLevel = fragPrevious && frag.level === fragPrevious.level;
+ var prevFrag = fragments[curSNIdx - 1];
+ var nextFrag = fragments[curSNIdx + 1];
+ //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);
+ if (fragPrevious && frag.sn === fragPrevious.sn) {
+ if (sameLevel && !frag.backtracked) {
+ if (frag.sn < levelDetails.endSN) {
+ var deltaPTS = fragPrevious.deltaPTS;
+ // if there is a significant delta between audio and video, larger than max allowed hole,
+ // and if previous remuxed fragment did not start with a keyframe. (fragPrevious.dropped)
+ // let's try to load previous fragment again to get last keyframe
+ // then we will reload again current fragment (that way we should be able to fill the buffer hole ...)
+ if (deltaPTS && deltaPTS > config.maxBufferHole && fragPrevious.dropped && curSNIdx) {
+ frag = prevFrag;
+ logger["b" /* logger */].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');
+ // decrement previous frag load counter to avoid frag loop loading error when next fragment will get reloaded
+ fragPrevious.loadCounter--;
+ } else {
+ frag = nextFrag;
+ logger["b" /* logger */].log('SN just loaded, load next one: ' + frag.sn);
+ }
+ } else {
+ frag = null;
+ }
+ } else if (frag.backtracked) {
+ // Only backtrack a max of 1 consecutive fragment to prevent sliding back too far when little or no frags start with keyframes
+ if (nextFrag && nextFrag.backtracked) {
+ logger["b" /* logger */].warn('Already backtracked from fragment ' + nextFrag.sn + ', will not backtrack to fragment ' + frag.sn + '. Loading fragment ' + nextFrag.sn);
+ frag = nextFrag;
+ } else {
+ // If a fragment has dropped frames and it's in a same level/sequence, load the previous fragment to try and find the keyframe
+ // Reset the dropped count now since it won't be reset until we parse the fragment again, which prevents infinite backtracking on the same segment
+ logger["b" /* logger */].warn('Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe');
+ frag.dropped = 0;
+ if (prevFrag) {
+ if (prevFrag.loadCounter) {
+ prevFrag.loadCounter--;
+ }
+ frag = prevFrag;
+ frag.backtracked = true;
+ } else if (curSNIdx) {
+ // can't backtrack on very first fragment
+ frag = null;
+ }
+ }
+ }
+ }
+ }
+ return frag;
+ };
- this.decryptAacSample(samples, sampleIndex, callback, sync);
+ StreamController.prototype._loadFragmentOrKey = function _loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd) {
+ var hls = this.hls,
+ config = hls.config;
- if (!sync) {
+ //logger.log('loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));
+ if (frag.decryptdata && frag.decryptdata.uri != null && frag.decryptdata.key == null) {
+ logger["b" /* logger */].log('Loading key for ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level);
+ this.state = State.KEY_LOADING;
+ hls.trigger(events["a" /* default */].KEY_LOADING, { frag: frag });
+ } else {
+ logger["b" /* logger */].log('Loading ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level + ', currentTime:' + pos.toFixed(3) + ',bufferEnd:' + bufferEnd.toFixed(3));
+ // ensure that we are not reloading the same fragments in loop ...
+ if (this.fragLoadIdx !== undefined) {
+ this.fragLoadIdx++;
+ } else {
+ this.fragLoadIdx = 0;
+ }
+ if (frag.loadCounter) {
+ frag.loadCounter++;
+ var maxThreshold = config.fragLoadingLoopThreshold;
+ // if this frag has already been loaded 3 times, and if it has been reloaded recently
+ if (frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold) {
+ hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });
return;
}
+ } else {
+ frag.loadCounter = 1;
}
- }
+ frag.loadIdx = this.fragLoadIdx;
+ frag.autoLevel = hls.autoLevelEnabled;
+ frag.bitrateTest = this.bitrateTest;
- // AVC - encrypt one 16 bytes block out of ten, starting from offset 32
-
- }, {
- key: 'getAvcEncryptedData',
- value: function getAvcEncryptedData(decodedData) {
- var encryptedDataLen = Math.floor((decodedData.length - 48) / 160) * 16 + 16;
- var encryptedData = new Int8Array(encryptedDataLen);
- var outputPos = 0;
- for (var inputPos = 32; inputPos <= decodedData.length - 16; inputPos += 160, outputPos += 16) {
- encryptedData.set(decodedData.subarray(inputPos, inputPos + 16), outputPos);
+ this.fragCurrent = frag;
+ this.startFragRequested = true;
+ // Don't update nextLoadPosition for fragments which are not buffered
+ if (!isNaN(frag.sn) && !frag.bitrateTest) {
+ this.nextLoadPosition = frag.start + frag.duration;
}
- return encryptedData;
- }
- }, {
- key: 'getAvcDecryptedUnit',
- value: function getAvcDecryptedUnit(decodedData, decryptedData) {
- decryptedData = new Uint8Array(decryptedData);
- var inputPos = 0;
- for (var outputPos = 32; outputPos <= decodedData.length - 16; outputPos += 160, inputPos += 16) {
- decodedData.set(decryptedData.subarray(inputPos, inputPos + 16), outputPos);
+ hls.trigger(events["a" /* default */].FRAG_LOADING, { frag: frag });
+ // lazy demuxer init, as this could take some time ... do it during frag loading
+ if (!this.demuxer) {
+ this.demuxer = new demux_demuxer(hls, 'main');
}
- return decodedData;
+ this.state = State.FRAG_LOADING;
+ return;
}
- }, {
- key: 'decryptAvcSample',
- value: function decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync) {
- var decodedData = this.discardEPB(curUnit.data);
- var encryptedData = this.getAvcEncryptedData(decodedData);
- var localthis = this;
+ };
- this.decryptBuffer(encryptedData.buffer, function (decryptedData) {
- curUnit.data = localthis.getAvcDecryptedUnit(decodedData, decryptedData);
+ StreamController.prototype.getBufferedFrag = function getBufferedFrag(position) {
+ return binary_search.search(this._bufferedFrags, function (frag) {
+ if (position < frag.startPTS) {
+ return -1;
+ } else if (position > frag.endPTS) {
+ return 1;
+ }
+ return 0;
+ });
+ };
- if (!sync) {
- localthis.decryptAvcSamples(samples, sampleIndex, unitIndex + 1, callback);
- }
- });
+ StreamController.prototype.followingBufferedFrag = function followingBufferedFrag(frag) {
+ if (frag) {
+ // try to get range of next fragment (500ms after this range)
+ return this.getBufferedFrag(frag.endPTS + 0.5);
}
- }, {
- key: 'decryptAvcSamples',
- value: function decryptAvcSamples(samples, sampleIndex, unitIndex, callback) {
- for (;; sampleIndex++, unitIndex = 0) {
- if (sampleIndex >= samples.length) {
- callback();
- return;
- }
-
- var curUnits = samples[sampleIndex].units;
- for (;; unitIndex++) {
- if (unitIndex >= curUnits.length) {
- break;
- }
-
- var curUnit = curUnits[unitIndex];
- if (curUnit.length <= 48 || curUnit.type !== 1 && curUnit.type !== 5) {
- continue;
- }
-
- var sync = this.decrypter.isSync();
-
- this.decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync);
+ return null;
+ };
- if (!sync) {
- return;
+ StreamController.prototype._checkFragmentChanged = function _checkFragmentChanged() {
+ var fragPlayingCurrent,
+ currentTime,
+ video = this.media;
+ if (video && video.readyState && video.seeking === false) {
+ currentTime = video.currentTime;
+ /* if video element is in seeked state, currentTime can only increase.
+ (assuming that playback rate is positive ...)
+ As sometimes currentTime jumps back to zero after a
+ media decode error, check this, to avoid seeking back to
+ wrong position after a media decode error
+ */
+ if (currentTime > video.playbackRate * this.lastCurrentTime) {
+ this.lastCurrentTime = currentTime;
+ }
+ if (buffer_helper.isBuffered(video, currentTime)) {
+ fragPlayingCurrent = this.getBufferedFrag(currentTime);
+ } else if (buffer_helper.isBuffered(video, currentTime + 0.1)) {
+ /* ensure that FRAG_CHANGED event is triggered at startup,
+ when first video frame is displayed and playback is paused.
+ add a tolerance of 100ms, in case current position is not buffered,
+ check if current pos+100ms is buffered and use that buffer range
+ for FRAG_CHANGED event reporting */
+ fragPlayingCurrent = this.getBufferedFrag(currentTime + 0.1);
+ }
+ if (fragPlayingCurrent) {
+ var fragPlaying = fragPlayingCurrent;
+ if (fragPlaying !== this.fragPlaying) {
+ this.hls.trigger(events["a" /* default */].FRAG_CHANGED, { frag: fragPlaying });
+ var fragPlayingLevel = fragPlaying.level;
+ if (!this.fragPlaying || this.fragPlaying.level !== fragPlayingLevel) {
+ this.hls.trigger(events["a" /* default */].LEVEL_SWITCHED, { level: fragPlayingLevel });
}
+ this.fragPlaying = fragPlaying;
}
}
}
- }]);
-
- return SampleAesDecrypter;
-}();
-
-exports.default = SampleAesDecrypter;
-
-},{"19":19}],32:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
- * highly optimized TS demuxer:
- * parse PAT, PMT
- * extract PES packet from audio and video PIDs
- * extract AVC/H264 NAL units and AAC/ADTS samples from PES packet
- * trigger the remuxer upon parsing completion
- * it also tries to workaround as best as it can audio codec switch (HE-AAC to AAC and vice versa), without having to restart the MediaSource.
- * it also controls the remuxing process :
- * upon discontinuity or level switch detection, it will also notifies the remuxer so that it can reset its state.
- */
-
-// import Hex from '../utils/hex';
-
-
-var _adts = _dereq_(22);
-
-var _adts2 = _interopRequireDefault(_adts);
-
-var _mpegaudio = _dereq_(30);
-
-var _mpegaudio2 = _interopRequireDefault(_mpegaudio);
-
-var _events = _dereq_(35);
-
-var _events2 = _interopRequireDefault(_events);
-
-var _expGolomb = _dereq_(26);
-
-var _expGolomb2 = _interopRequireDefault(_expGolomb);
-
-var _sampleAes = _dereq_(31);
-
-var _sampleAes2 = _interopRequireDefault(_sampleAes);
-
-var _logger = _dereq_(53);
-
-var _errors = _dereq_(33);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ };
-var TSDemuxer = function () {
- function TSDemuxer(observer, remuxer, config, typeSupported) {
- _classCallCheck(this, TSDemuxer);
+ /*
+ on immediate level switch :
+ - pause playback if playing
+ - cancel any pending load request
+ - and trigger a buffer flush
+ */
- this.observer = observer;
- this.config = config;
- this.typeSupported = typeSupported;
- this.remuxer = remuxer;
- this.sampleAes = null;
- }
- _createClass(TSDemuxer, [{
- key: 'setDecryptData',
- value: function setDecryptData(decryptdata) {
- if (decryptdata != null && decryptdata.key != null && decryptdata.method === 'SAMPLE-AES') {
- this.sampleAes = new _sampleAes2.default(this.observer, this.config, decryptdata, this.discardEPB);
+ StreamController.prototype.immediateLevelSwitch = function immediateLevelSwitch() {
+ logger["b" /* logger */].log('immediateLevelSwitch');
+ if (!this.immediateSwitch) {
+ this.immediateSwitch = true;
+ var media = this.media,
+ previouslyPaused = void 0;
+ if (media) {
+ previouslyPaused = media.paused;
+ media.pause();
} else {
- this.sampleAes = null;
+ // don't restart playback after instant level switch in case media not attached
+ previouslyPaused = true;
}
+ this.previouslyPaused = previouslyPaused;
}
- }, {
- key: 'resetInitSegment',
- value: function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {
- this.pmtParsed = false;
- this._pmtId = -1;
- this._avcTrack = { container: 'video/mp2t', type: 'video', id: -1, inputTimeScale: 90000, sequenceNumber: 0, samples: [], len: 0, dropped: 0 };
- this._audioTrack = { container: 'video/mp2t', type: 'audio', id: -1, inputTimeScale: 90000, duration: duration, sequenceNumber: 0, samples: [], len: 0, isAAC: true };
- this._id3Track = { type: 'id3', id: -1, inputTimeScale: 90000, sequenceNumber: 0, samples: [], len: 0 };
- this._txtTrack = { type: 'text', id: -1, inputTimeScale: 90000, sequenceNumber: 0, samples: [], len: 0 };
- // flush any partial content
- this.aacOverFlow = null;
- this.aacLastPTS = null;
- this.avcSample = null;
- this.audioCodec = audioCodec;
- this.videoCodec = videoCodec;
- this._duration = duration;
+ var fragCurrent = this.fragCurrent;
+ if (fragCurrent && fragCurrent.loader) {
+ fragCurrent.loader.abort();
}
- }, {
- key: 'resetTimeStamp',
- value: function resetTimeStamp() {}
+ this.fragCurrent = null;
+ // increase fragment load Index to avoid frag loop loading error after buffer flush
+ if (this.fragLoadIdx !== undefined) {
+ this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;
+ }
+ // flush everything
+ this.flushMainBuffer(0, Number.POSITIVE_INFINITY);
+ };
- // feed incoming data to the front of the parsing pipeline
+ /*
+ on immediate level switch end, after new fragment has been buffered :
+ - nudge video decoder by slightly adjusting video currentTime (if currentTime buffered)
+ - resume the playback if needed
+ */
- }, {
- key: 'append',
- value: function append(data, timeOffset, contiguous, accurateTimeOffset) {
- var start,
- len = data.length,
- stt,
- pid,
- atf,
- offset,
- pes,
- unknownPIDs = false;
- this.contiguous = contiguous;
- var pmtParsed = this.pmtParsed,
- avcTrack = this._avcTrack,
- audioTrack = this._audioTrack,
- id3Track = this._id3Track,
- avcId = avcTrack.id,
- audioId = audioTrack.id,
- id3Id = id3Track.id,
- pmtId = this._pmtId,
- avcData = avcTrack.pesData,
- audioData = audioTrack.pesData,
- id3Data = id3Track.pesData,
- parsePAT = this._parsePAT,
- parsePMT = this._parsePMT,
- parsePES = this._parsePES,
- parseAVCPES = this._parseAVCPES.bind(this),
- parseAACPES = this._parseAACPES.bind(this),
- parseMPEGPES = this._parseMPEGPES.bind(this),
- parseID3PES = this._parseID3PES.bind(this);
-
- // don't parse last TS packet if incomplete
- len -= len % 188;
- // loop through TS packets
- for (start = 0; start < len; start += 188) {
- if (data[start] === 0x47) {
- stt = !!(data[start + 1] & 0x40);
- // pid is a 13-bit field starting at the last bit of TS[1]
- pid = ((data[start + 1] & 0x1f) << 8) + data[start + 2];
- atf = (data[start + 3] & 0x30) >> 4;
- // if an adaption field is present, its length is specified by the fifth byte of the TS packet header.
- if (atf > 1) {
- offset = start + 5 + data[start + 4];
- // continue if there is only adaptation field
- if (offset === start + 188) {
- continue;
- }
- } else {
- offset = start + 4;
- }
- switch (pid) {
- case avcId:
- if (stt) {
- if (avcData && (pes = parsePES(avcData))) {
- parseAVCPES(pes, false);
- }
- avcData = { data: [], size: 0 };
- }
- if (avcData) {
- avcData.data.push(data.subarray(offset, start + 188));
- avcData.size += start + 188 - offset;
- }
- break;
- case audioId:
- if (stt) {
- if (audioData && (pes = parsePES(audioData))) {
- if (audioTrack.isAAC) {
- parseAACPES(pes);
- } else {
- parseMPEGPES(pes);
- }
- }
- audioData = { data: [], size: 0 };
- }
- if (audioData) {
- audioData.data.push(data.subarray(offset, start + 188));
- audioData.size += start + 188 - offset;
- }
- break;
- case id3Id:
- if (stt) {
- if (id3Data && (pes = parsePES(id3Data))) {
- parseID3PES(pes);
- }
- id3Data = { data: [], size: 0 };
- }
- if (id3Data) {
- id3Data.data.push(data.subarray(offset, start + 188));
- id3Data.size += start + 188 - offset;
- }
- break;
- case 0:
- if (stt) {
- offset += data[offset] + 1;
- }
- pmtId = this._pmtId = parsePAT(data, offset);
- break;
- case pmtId:
- if (stt) {
- offset += data[offset] + 1;
- }
- var parsedPIDs = parsePMT(data, offset, this.typeSupported.mpeg === true || this.typeSupported.mp3 === true, this.sampleAes != null);
-
- // only update track id if track PID found while parsing PMT
- // this is to avoid resetting the PID to -1 in case
- // track PID transiently disappears from the stream
- // this could happen in case of transient missing audio samples for example
- avcId = parsedPIDs.avc;
- if (avcId > 0) {
- avcTrack.id = avcId;
- }
- audioId = parsedPIDs.audio;
- if (audioId > 0) {
- audioTrack.id = audioId;
- audioTrack.isAAC = parsedPIDs.isAAC;
- }
- id3Id = parsedPIDs.id3;
- if (id3Id > 0) {
- id3Track.id = id3Id;
- }
- if (unknownPIDs && !pmtParsed) {
- _logger.logger.log('reparse from beginning');
- unknownPIDs = false;
- // we set it to -188, the += 188 in the for loop will reset start to 0
- start = -188;
- }
- pmtParsed = this.pmtParsed = true;
- break;
- case 17:
- case 0x1fff:
- break;
- default:
- unknownPIDs = true;
- break;
- }
- } else {
- this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'TS packet did not start with 0x47' });
- }
+
+ StreamController.prototype.immediateLevelSwitchEnd = function immediateLevelSwitchEnd() {
+ var media = this.media;
+ if (media && media.buffered.length) {
+ this.immediateSwitch = false;
+ if (buffer_helper.isBuffered(media, media.currentTime)) {
+ // only nudge if currentTime is buffered
+ media.currentTime -= 0.0001;
}
- // try to parse last PES packets
- if (avcData && (pes = parsePES(avcData))) {
- parseAVCPES(pes, true);
- avcTrack.pesData = null;
- } else {
- // either avcData null or PES truncated, keep it for next frag parsing
- avcTrack.pesData = avcData;
+ if (!this.previouslyPaused) {
+ media.play();
}
+ }
+ };
- if (audioData && (pes = parsePES(audioData))) {
- if (audioTrack.isAAC) {
- parseAACPES(pes);
+ StreamController.prototype.nextLevelSwitch = function nextLevelSwitch() {
+ /* try to switch ASAP without breaking video playback :
+ in order to ensure smooth but quick level switching,
+ we need to find the next flushable buffer range
+ we should take into account new segment fetch time
+ */
+ var media = this.media;
+ // ensure that media is defined and that metadata are available (to retrieve currentTime)
+ if (media && media.readyState) {
+ var fetchdelay = void 0,
+ fragPlayingCurrent = void 0,
+ nextBufferedFrag = void 0;
+ if (this.fragLoadIdx !== undefined) {
+ // increase fragment load Index to avoid frag loop loading error after buffer flush
+ this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;
+ }
+ fragPlayingCurrent = this.getBufferedFrag(media.currentTime);
+ if (fragPlayingCurrent && fragPlayingCurrent.startPTS > 1) {
+ // flush buffer preceding current fragment (flush until current fragment start offset)
+ // minus 1s to avoid video freezing, that could happen if we flush keyframe of current video ...
+ this.flushMainBuffer(0, fragPlayingCurrent.startPTS - 1);
+ }
+ if (!media.paused) {
+ // add a safety delay of 1s
+ var nextLevelId = this.hls.nextLoadLevel,
+ nextLevel = this.levels[nextLevelId],
+ fragLastKbps = this.fragLastKbps;
+ if (fragLastKbps && this.fragCurrent) {
+ fetchdelay = this.fragCurrent.duration * nextLevel.bitrate / (1000 * fragLastKbps) + 1;
} else {
- parseMPEGPES(pes);
+ fetchdelay = 0;
}
- audioTrack.pesData = null;
} else {
- if (audioData && audioData.size) {
- _logger.logger.log('last AAC PES packet truncated,might overlap between fragments');
+ fetchdelay = 0;
+ }
+ //logger.log('fetchdelay:'+fetchdelay);
+ // find buffer range that will be reached once new fragment will be fetched
+ nextBufferedFrag = this.getBufferedFrag(media.currentTime + fetchdelay);
+ if (nextBufferedFrag) {
+ // we can flush buffer range following this one without stalling playback
+ nextBufferedFrag = this.followingBufferedFrag(nextBufferedFrag);
+ if (nextBufferedFrag) {
+ // if we are here, we can also cancel any loading/demuxing in progress, as they are useless
+ var fragCurrent = this.fragCurrent;
+ if (fragCurrent && fragCurrent.loader) {
+ fragCurrent.loader.abort();
+ }
+ this.fragCurrent = null;
+ // start flush position is the start PTS of next buffered frag.
+ // we use frag.naxStartPTS which is max(audio startPTS, video startPTS).
+ // in case there is a small PTS Delta between audio and video, using maxStartPTS avoids flushing last samples from current fragment
+ this.flushMainBuffer(nextBufferedFrag.maxStartPTS, Number.POSITIVE_INFINITY);
}
- // either audioData null or PES truncated, keep it for next frag parsing
- audioTrack.pesData = audioData;
}
+ }
+ };
- if (id3Data && (pes = parsePES(id3Data))) {
- parseID3PES(pes);
- id3Track.pesData = null;
- } else {
- // either id3Data null or PES truncated, keep it for next frag parsing
- id3Track.pesData = id3Data;
- }
+ StreamController.prototype.flushMainBuffer = function flushMainBuffer(startOffset, endOffset) {
+ this.state = State.BUFFER_FLUSHING;
+ var flushScope = { startOffset: startOffset, endOffset: endOffset };
+ // if alternate audio tracks are used, only flush video, otherwise flush everything
+ if (this.altAudio) {
+ flushScope.type = 'video';
+ }
+ this.hls.trigger(events["a" /* default */].BUFFER_FLUSHING, flushScope);
+ };
- if (this.sampleAes == null) {
- this.remuxer.remux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);
- } else {
- this.decryptAndRemux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);
- }
+ StreamController.prototype.onMediaAttached = function onMediaAttached(data) {
+ var media = this.media = this.mediaBuffer = data.media;
+ this.onvseeking = this.onMediaSeeking.bind(this);
+ this.onvseeked = this.onMediaSeeked.bind(this);
+ this.onvended = this.onMediaEnded.bind(this);
+ media.addEventListener('seeking', this.onvseeking);
+ media.addEventListener('seeked', this.onvseeked);
+ media.addEventListener('ended', this.onvended);
+ var config = this.config;
+ if (this.levels && config.autoStartLoad) {
+ this.hls.startLoad(config.startPosition);
}
- }, {
- key: 'decryptAndRemux',
- value: function decryptAndRemux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {
- if (audioTrack.samples && audioTrack.isAAC) {
- var localthis = this;
- this.sampleAes.decryptAacSamples(audioTrack.samples, 0, function () {
- localthis.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);
- });
- } else {
- this.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);
- }
+ };
+
+ StreamController.prototype.onMediaDetaching = function onMediaDetaching() {
+ var media = this.media;
+ if (media && media.ended) {
+ logger["b" /* logger */].log('MSE detaching and video ended, reset startPosition');
+ this.startPosition = this.lastCurrentTime = 0;
}
- }, {
- key: 'decryptAndRemuxAvc',
- value: function decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {
- if (videoTrack.samples) {
- var localthis = this;
- this.sampleAes.decryptAvcSamples(videoTrack.samples, 0, 0, function () {
- localthis.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);
- });
- } else {
- this.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);
+
+ // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery
+ var levels = this.levels;
+ if (levels) {
+ // reset fragment load counter
+ levels.forEach(function (level) {
+ if (level.details) {
+ level.details.fragments.forEach(function (fragment) {
+ fragment.loadCounter = undefined;
+ fragment.backtracked = undefined;
+ });
+ }
+ });
+ }
+ // remove video listeners
+ if (media) {
+ media.removeEventListener('seeking', this.onvseeking);
+ media.removeEventListener('seeked', this.onvseeked);
+ media.removeEventListener('ended', this.onvended);
+ this.onvseeking = this.onvseeked = this.onvended = null;
+ }
+ this.media = this.mediaBuffer = null;
+ this.loadedmetadata = false;
+ this.stopLoad();
+ };
+
+ StreamController.prototype.onMediaSeeking = function onMediaSeeking() {
+ var media = this.media,
+ currentTime = media ? media.currentTime : undefined,
+ config = this.config;
+ if (!isNaN(currentTime)) {
+ logger["b" /* logger */].log('media seeking to ' + currentTime.toFixed(3));
+ }
+ var mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media;
+ var bufferInfo = buffer_helper.bufferInfo(mediaBuffer, currentTime, this.config.maxBufferHole);
+ if (this.state === State.FRAG_LOADING) {
+ var fragCurrent = this.fragCurrent;
+ // check if we are seeking to a unbuffered area AND if frag loading is in progress
+ if (bufferInfo.len === 0 && fragCurrent) {
+ var tolerance = config.maxFragLookUpTolerance,
+ fragStartOffset = fragCurrent.start - tolerance,
+ fragEndOffset = fragCurrent.start + fragCurrent.duration + tolerance;
+ // check if we seek position will be out of currently loaded frag range : if out cancel frag load, if in, don't do anything
+ if (currentTime < fragStartOffset || currentTime > fragEndOffset) {
+ if (fragCurrent.loader) {
+ logger["b" /* logger */].log('seeking outside of buffer while fragment load in progress, cancel fragment load');
+ fragCurrent.loader.abort();
+ }
+ this.fragCurrent = null;
+ this.fragPrevious = null;
+ // switch to IDLE state to load new fragment
+ this.state = State.IDLE;
+ } else {
+ logger["b" /* logger */].log('seeking outside of buffer but within currently loaded fragment range');
+ }
}
+ } else if (this.state === State.ENDED) {
+ // if seeking to unbuffered area, clean up fragPrevious
+ if (bufferInfo.len === 0) {
+ this.fragPrevious = 0;
+ }
+ // switch to IDLE state to check for potential new fragment
+ this.state = State.IDLE;
}
- }, {
- key: 'destroy',
- value: function destroy() {
- this._initPTS = this._initDTS = undefined;
- this._duration = 0;
+ if (media) {
+ this.lastCurrentTime = currentTime;
}
- }, {
- key: '_parsePAT',
- value: function _parsePAT(data, offset) {
- // skip the PSI header and parse the first PMT entry
- return (data[offset + 10] & 0x1F) << 8 | data[offset + 11];
- //logger.log('PMT PID:' + this._pmtId);
+ // avoid reporting fragment loop loading error in case user is seeking several times on same position
+ if (this.state !== State.FRAG_LOADING && this.fragLoadIdx !== undefined) {
+ this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;
}
- }, {
- key: '_parsePMT',
- value: function _parsePMT(data, offset, mpegSupported, isSampleAes) {
- var sectionLength,
- tableEnd,
- programInfoLength,
- pid,
- result = { audio: -1, avc: -1, id3: -1, isAAC: true };
- sectionLength = (data[offset + 1] & 0x0f) << 8 | data[offset + 2];
- tableEnd = offset + 3 + sectionLength - 4;
- // to determine where the table is, we have to figure out how
- // long the program info descriptors are
- programInfoLength = (data[offset + 10] & 0x0f) << 8 | data[offset + 11];
- // advance the offset to the first entry in the mapping table
- offset += 12 + programInfoLength;
- while (offset < tableEnd) {
- pid = (data[offset + 1] & 0x1F) << 8 | data[offset + 2];
- switch (data[offset]) {
- case 0xcf:
- // SAMPLE-AES AAC
- if (!isSampleAes) {
- _logger.logger.log('unkown stream type:' + data[offset]);
- break;
- }
- /* falls through */
-
- // ISO/IEC 13818-7 ADTS AAC (MPEG-2 lower bit-rate audio)
- case 0x0f:
- //logger.log('AAC PID:' + pid);
- if (result.audio === -1) {
- result.audio = pid;
- }
- break;
-
- // Packetized metadata (ID3)
- case 0x15:
- //logger.log('ID3 PID:' + pid);
- if (result.id3 === -1) {
- result.id3 = pid;
- }
- break;
-
- case 0xdb:
- // SAMPLE-AES AVC
- if (!isSampleAes) {
- _logger.logger.log('unkown stream type:' + data[offset]);
- break;
- }
- /* falls through */
+ // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target
+ if (!this.loadedmetadata) {
+ this.nextLoadPosition = this.startPosition = currentTime;
+ }
+ // tick to speed up processing
+ this.tick();
+ };
- // ITU-T Rec. H.264 and ISO/IEC 14496-10 (lower bit-rate video)
- case 0x1b:
- //logger.log('AVC PID:' + pid);
- if (result.avc === -1) {
- result.avc = pid;
- }
- break;
+ StreamController.prototype.onMediaSeeked = function onMediaSeeked() {
+ var media = this.media,
+ currentTime = media ? media.currentTime : undefined;
+ if (!isNaN(currentTime)) {
+ logger["b" /* logger */].log('media seeked to ' + currentTime.toFixed(3));
+ }
+ // tick to speed up FRAGMENT_PLAYING triggering
+ this.tick();
+ };
- // ISO/IEC 11172-3 (MPEG-1 audio)
- // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)
- case 0x03:
- case 0x04:
- //logger.log('MPEG PID:' + pid);
- if (!mpegSupported) {
- _logger.logger.log('MPEG audio found, not supported in this browser for now');
- } else if (result.audio === -1) {
- result.audio = pid;
- result.isAAC = false;
- }
- break;
+ StreamController.prototype.onMediaEnded = function onMediaEnded() {
+ logger["b" /* logger */].log('media ended');
+ // reset startPosition and lastCurrentTime to restart playback @ stream beginning
+ this.startPosition = this.lastCurrentTime = 0;
+ };
- case 0x24:
- _logger.logger.warn('HEVC stream type found, not supported for now');
- break;
+ StreamController.prototype.onManifestLoading = function onManifestLoading() {
+ // reset buffer on manifest loading
+ logger["b" /* logger */].log('trigger BUFFER_RESET');
+ this.hls.trigger(events["a" /* default */].BUFFER_RESET);
+ this._bufferedFrags = [];
+ this.stalled = false;
+ this.startPosition = this.lastCurrentTime = 0;
+ };
- default:
- _logger.logger.log('unkown stream type:' + data[offset]);
- break;
+ StreamController.prototype.onManifestParsed = function onManifestParsed(data) {
+ var aac = false,
+ heaac = false,
+ codec;
+ data.levels.forEach(function (level) {
+ // detect if we have different kind of audio codecs used amongst playlists
+ codec = level.audioCodec;
+ if (codec) {
+ if (codec.indexOf('mp4a.40.2') !== -1) {
+ aac = true;
+ }
+ if (codec.indexOf('mp4a.40.5') !== -1) {
+ heaac = true;
}
- // move to the next table entry
- // skip past the elementary stream descriptors, if present
- offset += ((data[offset + 3] & 0x0F) << 8 | data[offset + 4]) + 5;
}
- return result;
- }
- }, {
- key: '_parsePES',
- value: function _parsePES(stream) {
- var i = 0,
- frag,
- pesFlags,
- pesPrefix,
- pesLen,
- pesHdrLen,
- pesData,
- pesPts,
- pesDts,
- payloadStartOffset,
- data = stream.data;
- // safety check
- if (!stream || stream.size === 0) {
- return null;
+ });
+ this.audioCodecSwitch = aac && heaac;
+ if (this.audioCodecSwitch) {
+ logger["b" /* logger */].log('both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC');
+ }
+ this.levels = data.levels;
+ this.startFragRequested = false;
+ var config = this.config;
+ if (config.autoStartLoad || this.forceStartLoad) {
+ this.hls.startLoad(config.startPosition);
+ }
+ };
+
+ StreamController.prototype.onLevelLoaded = function onLevelLoaded(data) {
+ var newDetails = data.details;
+ var newLevelId = data.level;
+ var lastLevel = this.levels[this.levelLastLoaded];
+ var curLevel = this.levels[newLevelId];
+ var duration = newDetails.totalduration;
+ var sliding = 0;
+
+ logger["b" /* logger */].log('level ' + newLevelId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);
+
+ if (newDetails.live) {
+ var curDetails = curLevel.details;
+ if (curDetails && newDetails.fragments.length > 0) {
+ // we already have details for that level, merge them
+ mergeDetails(curDetails, newDetails);
+ sliding = newDetails.fragments[0].start;
+ this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);
+ if (newDetails.PTSKnown && !isNaN(sliding)) {
+ logger["b" /* logger */].log('live playlist sliding:' + sliding.toFixed(3));
+ } else {
+ logger["b" /* logger */].log('live playlist - outdated PTS, unknown sliding');
+ alignDiscontinuities(this.fragPrevious, lastLevel, newDetails);
+ }
+ } else {
+ logger["b" /* logger */].log('live playlist - first load, unknown sliding');
+ newDetails.PTSKnown = false;
+ alignDiscontinuities(this.fragPrevious, lastLevel, newDetails);
}
-
- // we might need up to 19 bytes to read PES header
- // if first chunk of data is less than 19 bytes, let's merge it with following ones until we get 19 bytes
- // usually only one merge is needed (and this is rare ...)
- while (data[0].length < 19 && data.length > 1) {
- var newData = new Uint8Array(data[0].length + data[1].length);
- newData.set(data[0]);
- newData.set(data[1], data[0].length);
- data[0] = newData;
- data.splice(1, 1);
- }
- //retrieve PTS/DTS from first fragment
- frag = data[0];
- pesPrefix = (frag[0] << 16) + (frag[1] << 8) + frag[2];
- if (pesPrefix === 1) {
- pesLen = (frag[4] << 8) + frag[5];
- // if PES parsed length is not zero and greater than total received length, stop parsing. PES might be truncated
- // minus 6 : PES header size
- if (pesLen && pesLen > stream.size - 6) {
- return null;
- }
- pesFlags = frag[7];
- if (pesFlags & 0xC0) {
- /* PES header described here : http://dvd.sourceforge.net/dvdinfo/pes-hdr.html
- as PTS / DTS is 33 bit we cannot use bitwise operator in JS,
- as Bitwise operators treat their operands as a sequence of 32 bits */
- pesPts = (frag[9] & 0x0E) * 536870912 + // 1 << 29
- (frag[10] & 0xFF) * 4194304 + // 1 << 22
- (frag[11] & 0xFE) * 16384 + // 1 << 14
- (frag[12] & 0xFF) * 128 + // 1 << 7
- (frag[13] & 0xFE) / 2;
- // check if greater than 2^32 -1
- if (pesPts > 4294967295) {
- // decrement 2^33
- pesPts -= 8589934592;
+ } else {
+ newDetails.PTSKnown = false;
+ }
+ // override level info
+ curLevel.details = newDetails;
+ this.levelLastLoaded = newLevelId;
+ this.hls.trigger(events["a" /* default */].LEVEL_UPDATED, { details: newDetails, level: newLevelId });
+
+ if (this.startFragRequested === false) {
+ // compute start position if set to -1. use it straight away if value is defined
+ if (this.startPosition === -1 || this.lastCurrentTime === -1) {
+ // first, check if start time offset has been set in playlist, if yes, use this value
+ var startTimeOffset = newDetails.startTimeOffset;
+ if (!isNaN(startTimeOffset)) {
+ if (startTimeOffset < 0) {
+ logger["b" /* logger */].log('negative start time offset ' + startTimeOffset + ', count from end of last fragment');
+ startTimeOffset = sliding + duration + startTimeOffset;
}
- if (pesFlags & 0x40) {
- pesDts = (frag[14] & 0x0E) * 536870912 + // 1 << 29
- (frag[15] & 0xFF) * 4194304 + // 1 << 22
- (frag[16] & 0xFE) * 16384 + // 1 << 14
- (frag[17] & 0xFF) * 128 + // 1 << 7
- (frag[18] & 0xFE) / 2;
- // check if greater than 2^32 -1
- if (pesDts > 4294967295) {
- // decrement 2^33
- pesDts -= 8589934592;
- }
- if (pesPts - pesDts > 60 * 90000) {
- _logger.logger.warn(Math.round((pesPts - pesDts) / 90000) + 's delta between PTS and DTS, align them');
- pesPts = pesDts;
- }
+ logger["b" /* logger */].log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);
+ this.startPosition = startTimeOffset;
+ } else {
+ // if live playlist, set start position to be fragment N-this.config.liveSyncDurationCount (usually 3)
+ if (newDetails.live) {
+ this.startPosition = this.computeLivePosition(sliding, newDetails);
+ logger["b" /* logger */].log('configure startPosition to ' + this.startPosition);
} else {
- pesDts = pesPts;
+ this.startPosition = 0;
}
}
- pesHdrLen = frag[8];
- // 9 bytes : 6 bytes for PES header + 3 bytes for PES extension
- payloadStartOffset = pesHdrLen + 9;
-
- stream.size -= payloadStartOffset;
- //reassemble PES packet
- pesData = new Uint8Array(stream.size);
- for (var j = 0, dataLen = data.length; j < dataLen; j++) {
- frag = data[j];
- var len = frag.byteLength;
- if (payloadStartOffset) {
- if (payloadStartOffset > len) {
- // trim full frag if PES header bigger than frag
- payloadStartOffset -= len;
- continue;
+ this.lastCurrentTime = this.startPosition;
+ }
+ this.nextLoadPosition = this.startPosition;
+ }
+ // only switch batck to IDLE state if we were waiting for level to start downloading a new fragment
+ if (this.state === State.WAITING_LEVEL) {
+ this.state = State.IDLE;
+ }
+ //trigger handler right now
+ this.tick();
+ };
+
+ StreamController.prototype.onKeyLoaded = function onKeyLoaded() {
+ if (this.state === State.KEY_LOADING) {
+ this.state = State.IDLE;
+ this.tick();
+ }
+ };
+
+ StreamController.prototype.onFragLoaded = function onFragLoaded(data) {
+ var fragCurrent = this.fragCurrent,
+ fragLoaded = data.frag;
+ if (this.state === State.FRAG_LOADING && fragCurrent && fragLoaded.type === 'main' && fragLoaded.level === fragCurrent.level && fragLoaded.sn === fragCurrent.sn) {
+ var stats = data.stats,
+ currentLevel = this.levels[fragCurrent.level],
+ details = currentLevel.details;
+ logger["b" /* logger */].log('Loaded ' + fragCurrent.sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + fragCurrent.level);
+ // reset frag bitrate test in any case after frag loaded event
+ this.bitrateTest = false;
+ this.stats = stats;
+ // if this frag was loaded to perform a bitrate test AND if hls.nextLoadLevel is greater than 0
+ // then this means that we should be able to load a fragment at a higher quality level
+ if (fragLoaded.bitrateTest === true && this.hls.nextLoadLevel) {
+ // switch back to IDLE state ... we just loaded a fragment to determine adequate start bitrate and initialize autoswitch algo
+ this.state = State.IDLE;
+ this.startFragRequested = false;
+ stats.tparsed = stats.tbuffered = performance.now();
+ this.hls.trigger(events["a" /* default */].FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'main' });
+ this.tick();
+ } else if (fragLoaded.sn === 'initSegment') {
+ this.state = State.IDLE;
+ stats.tparsed = stats.tbuffered = performance.now();
+ details.initSegment.data = data.payload;
+ this.hls.trigger(events["a" /* default */].FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'main' });
+ this.tick();
+ } else {
+ this.state = State.PARSING;
+ // transmux the MPEG-TS data to ISO-BMFF segments
+ var duration = details.totalduration,
+ level = fragCurrent.level,
+ sn = fragCurrent.sn,
+ audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;
+ if (this.audioCodecSwap) {
+ logger["b" /* logger */].log('swapping playlist audio codec');
+ if (audioCodec === undefined) {
+ audioCodec = this.lastAudioCodec;
+ }
+ if (audioCodec) {
+ if (audioCodec.indexOf('mp4a.40.5') !== -1) {
+ audioCodec = 'mp4a.40.2';
} else {
- // trim partial frag if PES header smaller than frag
- frag = frag.subarray(payloadStartOffset);
- len -= payloadStartOffset;
- payloadStartOffset = 0;
+ audioCodec = 'mp4a.40.5';
}
}
- pesData.set(frag, i);
- i += len;
}
- if (pesLen) {
- // payload size : remove PES header + PES extension
- pesLen -= pesHdrLen + 3;
+ this.pendingBuffering = true;
+ this.appended = false;
+ logger["b" /* logger */].log('Parsing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + level + ', cc ' + fragCurrent.cc);
+ var demuxer = this.demuxer;
+ if (!demuxer) {
+ demuxer = this.demuxer = new demux_demuxer(this.hls, 'main');
}
- return { data: pesData, pts: pesPts, dts: pesDts, len: pesLen };
- } else {
- return null;
+ // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live) and if media is not seeking (this is to overcome potential timestamp drifts between playlists and fragments)
+ var media = this.media;
+ var mediaSeeking = media && media.seeking;
+ var accurateTimeOffset = !mediaSeeking && (details.PTSKnown || !details.live);
+ var initSegmentData = details.initSegment ? details.initSegment.data : [];
+ demuxer.push(data.payload, initSegmentData, audioCodec, currentLevel.videoCodec, fragCurrent, duration, accurateTimeOffset, undefined);
}
}
- }, {
- key: 'pushAccesUnit',
- value: function pushAccesUnit(avcSample, avcTrack) {
- if (avcSample.units.length && avcSample.frame) {
- var samples = avcTrack.samples;
- var nbSamples = samples.length;
- // only push AVC sample if starting with a keyframe is not mandatory OR
- // if keyframe already found in this fragment OR
- // keyframe found in last fragment (track.sps) AND
- // samples already appended (we already found a keyframe in this fragment) OR fragment is contiguous
- if (!this.config.forceKeyFrameOnDiscontinuity || avcSample.key === true || avcTrack.sps && (nbSamples || this.contiguous)) {
- avcSample.id = nbSamples;
- samples.push(avcSample);
- } else {
- // dropped samples, track it
- avcTrack.dropped++;
+ this.fragLoadError = 0;
+ };
+
+ StreamController.prototype.onFragParsingInitSegment = function onFragParsingInitSegment(data) {
+ var fragCurrent = this.fragCurrent;
+ var fragNew = data.frag;
+ if (fragCurrent && data.id === 'main' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === State.PARSING) {
+ var tracks = data.tracks,
+ trackName,
+ track;
+
+ // if audio track is expected to come from audio stream controller, discard any coming from main
+ if (tracks.audio && this.altAudio) {
+ delete tracks.audio;
+ }
+ // include levelCodec in audio and video tracks
+ track = tracks.audio;
+ if (track) {
+ var audioCodec = this.levels[this.level].audioCodec,
+ ua = navigator.userAgent.toLowerCase();
+ if (audioCodec && this.audioCodecSwap) {
+ logger["b" /* logger */].log('swapping playlist audio codec');
+ if (audioCodec.indexOf('mp4a.40.5') !== -1) {
+ audioCodec = 'mp4a.40.2';
+ } else {
+ audioCodec = 'mp4a.40.5';
+ }
+ }
+ // in case AAC and HE-AAC audio codecs are signalled in manifest
+ // force HE-AAC , as it seems that most browsers prefers that way,
+ // except for mono streams OR on FF
+ // these conditions might need to be reviewed ...
+ if (this.audioCodecSwitch) {
+ // don't force HE-AAC if mono stream
+ if (track.metadata.channelCount !== 1 &&
+ // don't force HE-AAC if firefox
+ ua.indexOf('firefox') === -1) {
+ audioCodec = 'mp4a.40.5';
+ }
+ }
+ // HE-AAC is broken on Android, always signal audio codec as AAC even if variant manifest states otherwise
+ if (ua.indexOf('android') !== -1 && track.container !== 'audio/mpeg') {
+ // Exclude mpeg audio
+ audioCodec = 'mp4a.40.2';
+ logger["b" /* logger */].log('Android: force audio codec to ' + audioCodec);
+ }
+ track.levelCodec = audioCodec;
+ track.id = data.id;
+ }
+ track = tracks.video;
+ if (track) {
+ track.levelCodec = this.levels[this.level].videoCodec;
+ track.id = data.id;
+ }
+ this.hls.trigger(events["a" /* default */].BUFFER_CODECS, tracks);
+ // loop through tracks that are going to be provided to bufferController
+ for (trackName in tracks) {
+ track = tracks[trackName];
+ logger["b" /* logger */].log('main track:' + trackName + ',container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');
+ var initSegment = track.initSegment;
+ if (initSegment) {
+ this.appended = true;
+ // arm pending Buffering flag before appending a segment
+ this.pendingBuffering = true;
+ this.hls.trigger(events["a" /* default */].BUFFER_APPENDING, { type: trackName, data: initSegment, parent: 'main', content: 'initSegment' });
}
}
- if (avcSample.debug.length) {
- _logger.logger.log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug);
- }
+ //trigger handler right now
+ this.tick();
}
- }, {
- key: '_parseAVCPES',
- value: function _parseAVCPES(pes, last) {
- var _this = this;
-
- //logger.log('parse new PES');
- var track = this._avcTrack,
- units = this._parseAVCNALu(pes.data),
- debug = false,
- expGolombDecoder,
- avcSample = this.avcSample,
- push,
- i;
- //free pes.data to save up some memory
- pes.data = null;
-
- units.forEach(function (unit) {
- switch (unit.type) {
- //NDR
- case 1:
- push = true;
- if (debug && avcSample) {
- avcSample.debug += 'NDR ';
- }
- avcSample.frame = true;
- // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR
- var data = unit.data;
- if (data.length > 4) {
- var sliceType = new _expGolomb2.default(data).readSliceType();
- // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice
- // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.
- // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.
- // I slice: A slice that is not an SI slice that is decoded using intra prediction only.
- //if (sliceType === 2 || sliceType === 7) {
- if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {
- avcSample.key = true;
- }
- }
- break;
- //IDR
- case 5:
- push = true;
- // handle PES not starting with AUD
- if (!avcSample) {
- avcSample = _this.avcSample = _this._createAVCSample(true, pes.pts, pes.dts, '');
- }
- if (debug) {
- avcSample.debug += 'IDR ';
- }
- avcSample.key = true;
- avcSample.frame = true;
- break;
- //SEI
- case 6:
- push = true;
- if (debug && avcSample) {
- avcSample.debug += 'SEI ';
- }
- expGolombDecoder = new _expGolomb2.default(_this.discardEPB(unit.data));
-
- // skip frameType
- expGolombDecoder.readUByte();
-
- var payloadType = 0;
- var payloadSize = 0;
- var endOfCaptions = false;
- var b = 0;
-
- while (!endOfCaptions && expGolombDecoder.bytesAvailable > 1) {
- payloadType = 0;
- do {
- b = expGolombDecoder.readUByte();
- payloadType += b;
- } while (b === 0xFF);
-
- // Parse payload size.
- payloadSize = 0;
- do {
- b = expGolombDecoder.readUByte();
- payloadSize += b;
- } while (b === 0xFF);
-
- // TODO: there can be more than one payload in an SEI packet...
- // TODO: need to read type and size in a while loop to get them all
- if (payloadType === 4 && expGolombDecoder.bytesAvailable !== 0) {
-
- endOfCaptions = true;
-
- var countryCode = expGolombDecoder.readUByte();
-
- if (countryCode === 181) {
- var providerCode = expGolombDecoder.readUShort();
-
- if (providerCode === 49) {
- var userStructure = expGolombDecoder.readUInt();
-
- if (userStructure === 0x47413934) {
- var userDataType = expGolombDecoder.readUByte();
-
- // Raw CEA-608 bytes wrapped in CEA-708 packet
- if (userDataType === 3) {
- var firstByte = expGolombDecoder.readUByte();
- var secondByte = expGolombDecoder.readUByte();
-
- var totalCCs = 31 & firstByte;
- var byteArray = [firstByte, secondByte];
+ };
- for (i = 0; i < totalCCs; i++) {
- // 3 bytes per CC
- byteArray.push(expGolombDecoder.readUByte());
- byteArray.push(expGolombDecoder.readUByte());
- byteArray.push(expGolombDecoder.readUByte());
- }
+ StreamController.prototype.onFragParsingData = function onFragParsingData(data) {
+ var _this2 = this;
- _this._insertSampleInOrder(_this._txtTrack.samples, { type: 3, pts: pes.pts, bytes: byteArray });
- }
- }
- }
- }
- } else if (payloadSize < expGolombDecoder.bytesAvailable) {
- for (i = 0; i < payloadSize; i++) {
- expGolombDecoder.readUByte();
- }
- }
- }
- break;
- //SPS
- case 7:
- push = true;
- if (debug && avcSample) {
- avcSample.debug += 'SPS ';
- }
- if (!track.sps) {
- expGolombDecoder = new _expGolomb2.default(unit.data);
- var config = expGolombDecoder.readSPS();
- track.width = config.width;
- track.height = config.height;
- track.pixelRatio = config.pixelRatio;
- track.sps = [unit.data];
- track.duration = _this._duration;
- var codecarray = unit.data.subarray(1, 4);
- var codecstring = 'avc1.';
- for (i = 0; i < 3; i++) {
- var h = codecarray[i].toString(16);
- if (h.length < 2) {
- h = '0' + h;
- }
- codecstring += h;
- }
- track.codec = codecstring;
- }
- break;
- //PPS
- case 8:
- push = true;
- if (debug && avcSample) {
- avcSample.debug += 'PPS ';
- }
- if (!track.pps) {
- track.pps = [unit.data];
- }
- break;
- // AUD
- case 9:
- push = false;
- if (avcSample) {
- _this.pushAccesUnit(avcSample, track);
- }
- avcSample = _this.avcSample = _this._createAVCSample(false, pes.pts, pes.dts, debug ? 'AUD ' : '');
- break;
- // Filler Data
- case 12:
- push = false;
- break;
- default:
- push = false;
- if (avcSample) {
- avcSample.debug += 'unknown NAL ' + unit.type + ' ';
+ var fragCurrent = this.fragCurrent;
+ var fragNew = data.frag;
+ if (fragCurrent && data.id === 'main' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && !(data.type === 'audio' && this.altAudio) && // filter out main audio if audio track is loaded through audio stream controller
+ this.state === State.PARSING) {
+ var level = this.levels[this.level],
+ frag = fragCurrent;
+ if (isNaN(data.endPTS)) {
+ data.endPTS = data.startPTS + fragCurrent.duration;
+ data.endDTS = data.startDTS + fragCurrent.duration;
+ }
+
+ logger["b" /* logger */].log('Parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb + ',dropped:' + (data.dropped || 0));
+
+ // Detect gaps in a fragment and try to fix it by finding a keyframe in the previous fragment (see _findFragments)
+ if (data.type === 'video') {
+ frag.dropped = data.dropped;
+ if (frag.dropped) {
+ if (!frag.backtracked) {
+ var levelDetails = level.details;
+ if (levelDetails && frag.sn === levelDetails.startSN) {
+ logger["b" /* logger */].warn('missing video frame(s) on first frag, appending with gap');
+ } else {
+ logger["b" /* logger */].warn('missing video frame(s), backtracking fragment');
+ // Return back to the IDLE state without appending to buffer
+ // Causes findFragments to backtrack a segment and find the keyframe
+ // Audio fragments arriving before video sets the nextLoadPosition, causing _findFragments to skip the backtracked fragment
+ frag.backtracked = true;
+ this.nextLoadPosition = data.startPTS;
+ this.state = State.IDLE;
+ this.fragPrevious = frag;
+ this.tick();
+ return;
}
- break;
+ } else {
+ logger["b" /* logger */].warn('Already backtracked on this fragment, appending with the gap');
+ }
+ } else {
+ // Only reset the backtracked flag if we've loaded the frag without any dropped frames
+ frag.backtracked = false;
}
- if (avcSample && push) {
- var _units = avcSample.units;
- _units.push(unit);
+ }
+
+ var drift = updateFragPTSDTS(level.details, frag, data.startPTS, data.endPTS, data.startDTS, data.endDTS),
+ hls = this.hls;
+ hls.trigger(events["a" /* default */].LEVEL_PTS_UPDATED, { details: level.details, level: this.level, drift: drift, type: data.type, start: data.startPTS, end: data.endPTS });
+
+ // has remuxer dropped video frames located before first keyframe ?
+ [data.data1, data.data2].forEach(function (buffer) {
+ // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)
+ // in that case it is useless to append following segments
+ if (buffer && buffer.length && _this2.state === State.PARSING) {
+ _this2.appended = true;
+ // arm pending Buffering flag before appending a segment
+ _this2.pendingBuffering = true;
+ hls.trigger(events["a" /* default */].BUFFER_APPENDING, { type: data.type, data: buffer, parent: 'main', content: 'data' });
}
});
- // if last PES packet, push samples
- if (last && avcSample) {
- this.pushAccesUnit(avcSample, track);
- this.avcSample = null;
- }
+ //trigger handler right now
+ this.tick();
}
- }, {
- key: '_createAVCSample',
- value: function _createAVCSample(key, pts, dts, debug) {
- return { key: key, pts: pts, dts: dts, units: [], debug: debug };
+ };
+
+ StreamController.prototype.onFragParsed = function onFragParsed(data) {
+ var fragCurrent = this.fragCurrent;
+ var fragNew = data.frag;
+ if (fragCurrent && data.id === 'main' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === State.PARSING) {
+ this.stats.tparsed = performance.now();
+ this.state = State.PARSED;
+ this._checkAppendedParsed();
}
- }, {
- key: '_insertSampleInOrder',
- value: function _insertSampleInOrder(arr, data) {
- var len = arr.length;
- if (len > 0) {
- if (data.pts >= arr[len - 1].pts) {
- arr.push(data);
- } else {
- for (var pos = len - 1; pos >= 0; pos--) {
- if (data.pts < arr[pos].pts) {
- arr.splice(pos, 0, data);
- break;
- }
- }
+ };
+
+ StreamController.prototype.onAudioTrackSwitching = function onAudioTrackSwitching(data) {
+ // if any URL found on new audio track, it is an alternate audio track
+ var altAudio = !!data.url,
+ trackId = data.id;
+ // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered
+ // don't do anything if we switch to alt audio: audio stream controller is handling it.
+ // we will just have to change buffer scheduling on audioTrackSwitched
+ if (!altAudio) {
+ if (this.mediaBuffer !== this.media) {
+ logger["b" /* logger */].log('switching on main audio, use media.buffered to schedule main fragment loading');
+ this.mediaBuffer = this.media;
+ var fragCurrent = this.fragCurrent;
+ // we need to refill audio buffer from main: cancel any frag loading to speed up audio switch
+ if (fragCurrent.loader) {
+ logger["b" /* logger */].log('switching to main audio track, cancel main fragment load');
+ fragCurrent.loader.abort();
+ }
+ this.fragCurrent = null;
+ this.fragPrevious = null;
+ // destroy demuxer to force init segment generation (following audio switch)
+ if (this.demuxer) {
+ this.demuxer.destroy();
+ this.demuxer = null;
+ }
+ // switch to IDLE state to load new fragment
+ this.state = State.IDLE;
+ }
+ var hls = this.hls;
+ // switching to main audio, flush all audio and trigger track switched
+ hls.trigger(events["a" /* default */].BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });
+ hls.trigger(events["a" /* default */].AUDIO_TRACK_SWITCHED, { id: trackId });
+ this.altAudio = false;
+ }
+ };
+
+ StreamController.prototype.onAudioTrackSwitched = function onAudioTrackSwitched(data) {
+ var trackId = data.id,
+ altAudio = !!this.hls.audioTracks[trackId].url;
+ if (altAudio) {
+ var videoBuffer = this.videoBuffer;
+ // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered
+ if (videoBuffer && this.mediaBuffer !== videoBuffer) {
+ logger["b" /* logger */].log('switching on alternate audio, use video.buffered to schedule main fragment loading');
+ this.mediaBuffer = videoBuffer;
+ }
+ }
+ this.altAudio = altAudio;
+ this.tick();
+ };
+
+ StreamController.prototype.onBufferCreated = function onBufferCreated(data) {
+ var tracks = data.tracks,
+ mediaTrack = void 0,
+ name = void 0,
+ alternate = false;
+ for (var type in tracks) {
+ var track = tracks[type];
+ if (track.id === 'main') {
+ name = type;
+ mediaTrack = track;
+ // keep video source buffer reference
+ if (type === 'video') {
+ this.videoBuffer = tracks[type].buffer;
}
} else {
- arr.push(data);
+ alternate = true;
}
}
- }, {
- key: '_getLastNalUnit',
- value: function _getLastNalUnit() {
- var avcSample = this.avcSample,
- lastUnit = void 0;
- // try to fallback to previous sample if current one is empty
- if (!avcSample || avcSample.units.length === 0) {
- var track = this._avcTrack,
- samples = track.samples;
- avcSample = samples[samples.length - 1];
- }
- if (avcSample) {
- var units = avcSample.units;
- lastUnit = units[units.length - 1];
- }
- return lastUnit;
+ if (alternate && mediaTrack) {
+ logger["b" /* logger */].log('alternate track found, use ' + name + '.buffered to schedule main fragment loading');
+ this.mediaBuffer = mediaTrack.buffer;
+ } else {
+ this.mediaBuffer = this.media;
}
- }, {
- key: '_parseAVCNALu',
- value: function _parseAVCNALu(array) {
- var i = 0,
- len = array.byteLength,
- value,
- overflow,
- track = this._avcTrack,
- state = track.naluState || 0,
- lastState = state;
- var units = [],
- unit,
- unitType,
- lastUnitStart = -1,
- lastUnitType;
- //logger.log('PES:' + Hex.hexDump(array));
-
- if (state === -1) {
- // special use case where we found 3 or 4-byte start codes exactly at the end of previous PES packet
- lastUnitStart = 0;
- // NALu type is value read from offset 0
- lastUnitType = array[0] & 0x1f;
- state = 0;
- i = 1;
+ };
+
+ StreamController.prototype.onBufferAppended = function onBufferAppended(data) {
+ if (data.parent === 'main') {
+ var state = this.state;
+ if (state === State.PARSING || state === State.PARSED) {
+ // check if all buffers have been appended
+ this.pendingBuffering = data.pending > 0;
+ this._checkAppendedParsed();
}
+ }
+ };
- while (i < len) {
- value = array[i++];
- // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case
- if (!state) {
- state = value ? 0 : 1;
- continue;
- }
- if (state === 1) {
- state = value ? 0 : 2;
- continue;
+ StreamController.prototype._checkAppendedParsed = function _checkAppendedParsed() {
+ //trigger handler right now
+ if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {
+ var frag = this.fragCurrent;
+ if (frag) {
+ var media = this.mediaBuffer ? this.mediaBuffer : this.media;
+ logger["b" /* logger */].log('main buffered : ' + timeRanges.toString(media.buffered));
+ // filter fragments potentially evicted from buffer. this is to avoid memleak on live streams
+ var bufferedFrags = this._bufferedFrags.filter(function (frag) {
+ return buffer_helper.isBuffered(media, (frag.startPTS + frag.endPTS) / 2);
+ });
+ // push new range
+ bufferedFrags.push(frag);
+ // sort frags, as we use BinarySearch for lookup in getBufferedFrag ...
+ this._bufferedFrags = bufferedFrags.sort(function (a, b) {
+ return a.startPTS - b.startPTS;
+ });
+ this.fragPrevious = frag;
+ var stats = this.stats;
+ stats.tbuffered = performance.now();
+ // we should get rid of this.fragLastKbps
+ this.fragLastKbps = Math.round(8 * stats.total / (stats.tbuffered - stats.tfirst));
+ this.hls.trigger(events["a" /* default */].FRAG_BUFFERED, { stats: stats, frag: frag, id: 'main' });
+ this.state = State.IDLE;
+ }
+ this.tick();
+ }
+ };
+
+ StreamController.prototype.onError = function onError(data) {
+ var frag = data.frag || this.fragCurrent;
+ // don't handle frag error not related to main fragment
+ if (frag && frag.type !== 'main') {
+ return;
+ }
+ // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end
+ var mediaBuffered = !!this.media && buffer_helper.isBuffered(this.media, this.media.currentTime) && buffer_helper.isBuffered(this.media, this.media.currentTime + 0.5);
+
+ switch (data.details) {
+ case errors["a" /* ErrorDetails */].FRAG_LOAD_ERROR:
+ case errors["a" /* ErrorDetails */].FRAG_LOAD_TIMEOUT:
+ case errors["a" /* ErrorDetails */].KEY_LOAD_ERROR:
+ case errors["a" /* ErrorDetails */].KEY_LOAD_TIMEOUT:
+ if (!data.fatal) {
+ // keep retrying until the limit will be reached
+ if (this.fragLoadError + 1 <= this.config.fragLoadingMaxRetry) {
+ // exponential backoff capped to config.fragLoadingMaxRetryTimeout
+ var delay = Math.min(Math.pow(2, this.fragLoadError) * this.config.fragLoadingRetryDelay, this.config.fragLoadingMaxRetryTimeout);
+ // reset load counter to avoid frag loop loading error
+ frag.loadCounter = 0;
+ logger["b" /* logger */].warn('mediaController: frag loading failed, retry in ' + delay + ' ms');
+ this.retryDate = performance.now() + delay;
+ // retry loading state
+ // if loadedmetadata is not set, it means that we are emergency switch down on first frag
+ // in that case, reset startFragRequested flag
+ if (!this.loadedmetadata) {
+ this.startFragRequested = false;
+ this.nextLoadPosition = this.startPosition;
+ }
+ this.fragLoadError++;
+ this.state = State.FRAG_LOADING_WAITING_RETRY;
+ } else {
+ logger["b" /* logger */].error('mediaController: ' + data.details + ' reaches max retry, redispatch as fatal ...');
+ // switch error to fatal
+ data.fatal = true;
+ this.state = State.ERROR;
+ }
}
- // here we have state either equal to 2 or 3
- if (!value) {
- state = 3;
- } else if (value === 1) {
- if (lastUnitStart >= 0) {
- unit = { data: array.subarray(lastUnitStart, i - state - 1), type: lastUnitType };
- //logger.log('pushing NALU, type/size:' + unit.type + '/' + unit.data.byteLength);
- units.push(unit);
+ break;
+ case errors["a" /* ErrorDetails */].FRAG_LOOP_LOADING_ERROR:
+ if (!data.fatal) {
+ // if buffer is not empty
+ if (mediaBuffered) {
+ // try to reduce max buffer length : rationale is that we could get
+ // frag loop loading error because of buffer eviction
+ this._reduceMaxBufferLength(frag.duration);
+ this.state = State.IDLE;
} else {
- // lastUnitStart is undefined => this is the first start code found in this PES packet
- // first check if start code delimiter is overlapping between 2 PES packets,
- // ie it started in last packet (lastState not zero)
- // and ended at the beginning of this PES packet (i <= 4 - lastState)
- var lastUnit = this._getLastNalUnit();
- if (lastUnit) {
- if (lastState && i <= 4 - lastState) {
- // start delimiter overlapping between PES packets
- // strip start delimiter bytes from the end of last NAL unit
- // check if lastUnit had a state different from zero
- if (lastUnit.state) {
- // strip last bytes
- lastUnit.data = lastUnit.data.subarray(0, lastUnit.data.byteLength - lastState);
- }
- }
- // If NAL units are not starting right at the beginning of the PES packet, push preceding data into previous NAL unit.
- overflow = i - state - 1;
- if (overflow > 0) {
- //logger.log('first NALU found with overflow:' + overflow);
- var tmp = new Uint8Array(lastUnit.data.byteLength + overflow);
- tmp.set(lastUnit.data, 0);
- tmp.set(array.subarray(0, overflow), lastUnit.data.byteLength);
- lastUnit.data = tmp;
- }
+ // buffer empty. report as fatal if in manual mode or if lowest level.
+ // level controller takes care of emergency switch down logic
+ if (!frag.autoLevel || frag.level === 0) {
+ // switch error to fatal
+ data.fatal = true;
+ this.state = State.ERROR;
}
}
- // check if we can read unit type
- if (i < len) {
- unitType = array[i] & 0x1f;
- //logger.log('find NALU @ offset:' + i + ',type:' + unitType);
- lastUnitStart = i;
- lastUnitType = unitType;
- state = 0;
+ }
+ break;
+ case errors["a" /* ErrorDetails */].LEVEL_LOAD_ERROR:
+ case errors["a" /* ErrorDetails */].LEVEL_LOAD_TIMEOUT:
+ if (this.state !== State.ERROR) {
+ if (data.fatal) {
+ // if fatal error, stop processing
+ this.state = State.ERROR;
+ logger["b" /* logger */].warn('streamController: ' + data.details + ',switch to ' + this.state + ' state ...');
} else {
- // not enough byte to read unit type. let's read it on next PES parsing
- state = -1;
+ // in case of non fatal error while loading level, if level controller is not retrying to load level , switch back to IDLE
+ if (!data.levelRetry && this.state === State.WAITING_LEVEL) {
+ this.state = State.IDLE;
+ }
}
- } else {
- state = 0;
}
- }
- if (lastUnitStart >= 0 && state >= 0) {
- unit = { data: array.subarray(lastUnitStart, len), type: lastUnitType, state: state };
- units.push(unit);
- //logger.log('pushing NALU, type/size/state:' + unit.type + '/' + unit.data.byteLength + '/' + state);
- }
- // no NALu found
- if (units.length === 0) {
- // append pes.data to previous NAL unit
- var _lastUnit = this._getLastNalUnit();
- if (_lastUnit) {
- var _tmp = new Uint8Array(_lastUnit.data.byteLength + array.byteLength);
- _tmp.set(_lastUnit.data, 0);
- _tmp.set(array, _lastUnit.data.byteLength);
- _lastUnit.data = _tmp;
+ break;
+ case errors["a" /* ErrorDetails */].BUFFER_FULL_ERROR:
+ // if in appending state
+ if (data.parent === 'main' && (this.state === State.PARSING || this.state === State.PARSED)) {
+ // reduce max buf len if current position is buffered
+ if (mediaBuffered) {
+ this._reduceMaxBufferLength(this.config.maxBufferLength);
+ this.state = State.IDLE;
+ } else {
+ // current position is not buffered, but browser is still complaining about buffer full error
+ // this happens on IE/Edge, refer to https://github.com/video-dev/hls.js/pull/708
+ // in that case flush the whole buffer to recover
+ logger["b" /* logger */].warn('buffer full error also media.currentTime is not buffered, flush everything');
+ this.fragCurrent = null;
+ // flush everything
+ this.flushMainBuffer(0, Number.POSITIVE_INFINITY);
+ }
}
- }
- track.naluState = state;
- return units;
+ break;
+ default:
+ break;
}
+ };
- /**
- * remove Emulation Prevention bytes from a RBSP
- */
+ StreamController.prototype._reduceMaxBufferLength = function _reduceMaxBufferLength(minLength) {
+ var config = this.config;
+ if (config.maxMaxBufferLength >= minLength) {
+ // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...
+ config.maxMaxBufferLength /= 2;
+ logger["b" /* logger */].warn('main:reduce max buffer length to ' + config.maxMaxBufferLength + 's');
+ if (this.fragLoadIdx !== undefined) {
+ // increase fragment load Index to avoid frag loop loading error after buffer flush
+ this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;
+ }
+ }
+ };
- }, {
- key: 'discardEPB',
- value: function discardEPB(data) {
- var length = data.byteLength,
- EPBPositions = [],
- i = 1,
- newLength,
- newData;
-
- // Find all `Emulation Prevention Bytes`
- while (i < length - 2) {
- if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {
- EPBPositions.push(i + 2);
- i += 2;
+ StreamController.prototype._checkBuffer = function _checkBuffer() {
+ var media = this.media,
+ config = this.config;
+ // if ready state different from HAVE_NOTHING (numeric value 0), we are allowed to seek
+ if (media && media.readyState) {
+ var currentTime = media.currentTime,
+ mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media,
+ buffered = mediaBuffer.buffered;
+ // adjust currentTime to start position on loaded metadata
+ if (!this.loadedmetadata && buffered.length) {
+ this.loadedmetadata = true;
+ // only adjust currentTime if different from startPosition or if startPosition not buffered
+ // at that stage, there should be only one buffered range, as we reach that code after first fragment has been buffered
+ var startPosition = media.seeking ? currentTime : this.startPosition,
+ startPositionBuffered = buffer_helper.isBuffered(mediaBuffer, startPosition),
+ firstbufferedPosition = buffered.start(0),
+ startNotBufferedButClose = !startPositionBuffered && Math.abs(startPosition - firstbufferedPosition) < config.maxSeekHole;
+ // if currentTime not matching with expected startPosition or startPosition not buffered but close to first buffered
+ if (currentTime !== startPosition || startNotBufferedButClose) {
+ logger["b" /* logger */].log('target start position:' + startPosition);
+ // if startPosition not buffered, let's seek to buffered.start(0)
+ if (startNotBufferedButClose) {
+ startPosition = firstbufferedPosition;
+ logger["b" /* logger */].log('target start position not buffered, seek to buffered.start(0) ' + startPosition);
+ }
+ logger["b" /* logger */].log('adjust currentTime from ' + currentTime + ' to ' + startPosition);
+ media.currentTime = startPosition;
+ }
+ } else if (this.immediateSwitch) {
+ this.immediateLevelSwitchEnd();
+ } else {
+ var bufferInfo = buffer_helper.bufferInfo(media, currentTime, 0),
+ expectedPlaying = !(media.paused || // not playing when media is paused
+ media.ended || // not playing when media is ended
+ media.buffered.length === 0),
+ // not playing if nothing buffered
+ jumpThreshold = 0.5,
+ // tolerance needed as some browsers stalls playback before reaching buffered range end
+ playheadMoving = currentTime !== this.lastCurrentTime;
+
+ if (playheadMoving) {
+ // played moving, but was previously stalled => now not stuck anymore
+ if (this.stallReported) {
+ logger["b" /* logger */].warn('playback not stuck anymore @' + currentTime + ', after ' + Math.round(performance.now() - this.stalled) + 'ms');
+ this.stallReported = false;
+ }
+ this.stalled = undefined;
+ this.nudgeRetry = 0;
} else {
- i++;
+ // playhead not moving
+ if (expectedPlaying) {
+ // playhead not moving BUT media expected to play
+ var tnow = performance.now();
+ var hls = this.hls;
+ if (!this.stalled) {
+ // stall just detected, store current time
+ this.stalled = tnow;
+ this.stallReported = false;
+ } else {
+ // playback already stalled, check stalling duration
+ // if stalling for more than a given threshold, let's try to recover
+ var stalledDuration = tnow - this.stalled;
+ var bufferLen = bufferInfo.len;
+ var nudgeRetry = this.nudgeRetry || 0;
+ // have we reached stall deadline ?
+ if (bufferLen <= jumpThreshold && stalledDuration > config.lowBufferWatchdogPeriod * 1000) {
+ // report stalled error once
+ if (!this.stallReported) {
+ this.stallReported = true;
+ logger["b" /* logger */].warn('playback stalling in low buffer @' + currentTime);
+ hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });
+ }
+ // if buffer len is below threshold, try to jump to start of next buffer range if close
+ // no buffer available @ currentTime, check if next buffer is close (within a config.maxSeekHole second range)
+ var nextBufferStart = bufferInfo.nextStart,
+ delta = nextBufferStart - currentTime;
+ if (nextBufferStart && delta < config.maxSeekHole && delta > 0) {
+ this.nudgeRetry = ++nudgeRetry;
+ var nudgeOffset = nudgeRetry * config.nudgeOffset;
+ // next buffer is close ! adjust currentTime to nextBufferStart
+ // this will ensure effective video decoding
+ logger["b" /* logger */].log('adjust currentTime from ' + media.currentTime + ' to next buffered @ ' + nextBufferStart + ' + nudge ' + nudgeOffset);
+ media.currentTime = nextBufferStart + nudgeOffset;
+ // reset stalled so to rearm watchdog timer
+ this.stalled = undefined;
+ hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].BUFFER_SEEK_OVER_HOLE, fatal: false, hole: nextBufferStart + nudgeOffset - currentTime });
+ }
+ } else if (bufferLen > jumpThreshold && stalledDuration > config.highBufferWatchdogPeriod * 1000) {
+ // report stalled error once
+ if (!this.stallReported) {
+ this.stallReported = true;
+ logger["b" /* logger */].warn('playback stalling in high buffer @' + currentTime);
+ hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });
+ }
+ // reset stalled so to rearm watchdog timer
+ this.stalled = undefined;
+ this.nudgeRetry = ++nudgeRetry;
+ if (nudgeRetry < config.nudgeMaxRetry) {
+ var _currentTime = media.currentTime;
+ var targetTime = _currentTime + nudgeRetry * config.nudgeOffset;
+ logger["b" /* logger */].log('adjust currentTime from ' + _currentTime + ' to ' + targetTime);
+ // playback stalled in buffered area ... let's nudge currentTime to try to overcome this
+ media.currentTime = targetTime;
+ hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].BUFFER_NUDGE_ON_STALL, fatal: false });
+ } else {
+ logger["b" /* logger */].error('still stuck in high buffer @' + currentTime + ' after ' + config.nudgeMaxRetry + ', raise fatal error');
+ hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].BUFFER_STALLED_ERROR, fatal: true });
+ }
+ }
+ }
+ }
}
}
+ }
+ };
- // If no Emulation Prevention Bytes were found just return the original
- // array
- if (EPBPositions.length === 0) {
- return data;
- }
+ StreamController.prototype.onFragLoadEmergencyAborted = function onFragLoadEmergencyAborted() {
+ this.state = State.IDLE;
+ // if loadedmetadata is not set, it means that we are emergency switch down on first frag
+ // in that case, reset startFragRequested flag
+ if (!this.loadedmetadata) {
+ this.startFragRequested = false;
+ this.nextLoadPosition = this.startPosition;
+ }
+ this.tick();
+ };
- // Create a new array to hold the NAL unit data
- newLength = length - EPBPositions.length;
- newData = new Uint8Array(newLength);
- var sourceIndex = 0;
+ StreamController.prototype.onBufferFlushed = function onBufferFlushed() {
+ /* after successful buffer flushing, filter flushed fragments from bufferedFrags
+ use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)
+ */
+ var media = this.mediaBuffer ? this.mediaBuffer : this.media;
+ this._bufferedFrags = this._bufferedFrags.filter(function (frag) {
+ return buffer_helper.isBuffered(media, (frag.startPTS + frag.endPTS) / 2);
+ });
- for (i = 0; i < newLength; sourceIndex++, i++) {
- if (sourceIndex === EPBPositions[0]) {
- // Skip this byte
- sourceIndex++;
- // Remove this position index
- EPBPositions.shift();
- }
- newData[i] = data[sourceIndex];
+ if (this.fragLoadIdx !== undefined) {
+ // increase fragment load Index to avoid frag loop loading error after buffer flush
+ this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;
+ }
+ // move to IDLE once flush complete. this should trigger new fragment loading
+ this.state = State.IDLE;
+ // reset reference to frag
+ this.fragPrevious = null;
+ };
+
+ StreamController.prototype.swapAudioCodec = function swapAudioCodec() {
+ this.audioCodecSwap = !this.audioCodecSwap;
+ };
+
+ StreamController.prototype.computeLivePosition = function computeLivePosition(sliding, levelDetails) {
+ var targetLatency = this.config.liveSyncDuration !== undefined ? this.config.liveSyncDuration : this.config.liveSyncDurationCount * levelDetails.targetduration;
+ return sliding + Math.max(0, levelDetails.totalduration - targetLatency);
+ };
+
+ stream_controller__createClass(StreamController, [{
+ key: 'state',
+ set: function set(nextState) {
+ if (this.state !== nextState) {
+ var previousState = this.state;
+ this._state = nextState;
+ logger["b" /* logger */].log('main stream:' + previousState + '->' + nextState);
+ this.hls.trigger(events["a" /* default */].STREAM_STATE_TRANSITION, { previousState: previousState, nextState: nextState });
}
- return newData;
+ },
+ get: function get() {
+ return this._state;
}
}, {
- key: '_parseAACPES',
- value: function _parseAACPES(pes) {
- var track = this._audioTrack,
- data = pes.data,
- pts = pes.pts,
- startOffset = 0,
- aacOverFlow = this.aacOverFlow,
- aacLastPTS = this.aacLastPTS,
- config,
- frameLength,
- frameDuration,
- frameIndex,
- offset,
- headerLength,
- stamp,
- len,
- aacSample;
- if (aacOverFlow) {
- var tmp = new Uint8Array(aacOverFlow.byteLength + data.byteLength);
- tmp.set(aacOverFlow, 0);
- tmp.set(data, aacOverFlow.byteLength);
- //logger.log(`AAC: append overflowing ${aacOverFlow.byteLength} bytes to beginning of new PES`);
- data = tmp;
- }
- // look for ADTS header (0xFFFx)
- for (offset = startOffset, len = data.length; offset < len - 1; offset++) {
- if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {
- break;
- }
- }
- // if ADTS header does not start straight from the beginning of the PES payload, raise an error
- if (offset) {
- var reason, fatal;
- if (offset < len - 1) {
- reason = 'AAC PES did not start with ADTS header,offset:' + offset;
- fatal = false;
- } else {
- reason = 'no ADTS header found in AAC PES';
- fatal = true;
- }
- _logger.logger.warn('parsing error:' + reason);
- this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason });
- if (fatal) {
- return;
- }
- }
- if (!track.samplerate) {
- var audioCodec = this.audioCodec;
- config = _adts2.default.getAudioConfig(this.observer, data, offset, audioCodec);
- track.config = config.config;
- track.samplerate = config.samplerate;
- track.channelCount = config.channelCount;
- track.codec = config.codec;
- track.manifestCodec = config.manifestCodec;
- _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);
- }
- frameIndex = 0;
- frameDuration = 1024 * 90000 / track.samplerate;
-
- // if last AAC frame is overflowing, we should ensure timestamps are contiguous:
- // first sample PTS should be equal to last sample PTS + frameDuration
- if (aacOverFlow && aacLastPTS) {
- var newPTS = aacLastPTS + frameDuration;
- if (Math.abs(newPTS - pts) > 1) {
- _logger.logger.log('AAC: align PTS for overlapping frames by ' + Math.round((newPTS - pts) / 90));
- pts = newPTS;
- }
- }
-
- while (offset + 5 < len) {
- // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header
- headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;
- // retrieve frame size
- frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;
- frameLength -= headerLength;
- //stamp = pes.pts;
-
- if (frameLength > 0 && offset + headerLength + frameLength <= len) {
- stamp = pts + frameIndex * frameDuration;
- //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);
- aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };
- track.samples.push(aacSample);
- track.len += frameLength;
- offset += frameLength + headerLength;
- frameIndex++;
- // look for ADTS header (0xFFFx)
- for (; offset < len - 1; offset++) {
- if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {
- break;
- }
- }
- } else {
- break;
+ key: 'currentLevel',
+ get: function get() {
+ var media = this.media;
+ if (media) {
+ var frag = this.getBufferedFrag(media.currentTime);
+ if (frag) {
+ return frag.level;
}
}
- if (offset < len) {
- aacOverFlow = data.subarray(offset, len);
- //logger.log(`AAC: overflow detected:${len-offset}`);
- } else {
- aacOverFlow = null;
- }
- this.aacOverFlow = aacOverFlow;
- this.aacLastPTS = stamp;
+ return -1;
}
}, {
- key: '_parseMPEGPES',
- value: function _parseMPEGPES(pes) {
- _mpegaudio2.default.parse(this._audioTrack, pes.data, 0, pes.pts);
+ key: 'nextBufferedFrag',
+ get: function get() {
+ var media = this.media;
+ if (media) {
+ // first get end range of current fragment
+ return this.followingBufferedFrag(this.getBufferedFrag(media.currentTime));
+ } else {
+ return null;
+ }
}
}, {
- key: '_parseID3PES',
- value: function _parseID3PES(pes) {
- this._id3Track.samples.push(pes);
- }
- }], [{
- key: 'probe',
- value: function probe(data) {
- // a TS fragment should contain at least 3 TS packets, a PAT, a PMT, and one PID, each starting with 0x47
- if (data.length >= 3 * 188 && data[0] === 0x47 && data[188] === 0x47 && data[2 * 188] === 0x47) {
- return true;
+ key: 'nextLevel',
+ get: function get() {
+ var frag = this.nextBufferedFrag;
+ if (frag) {
+ return frag.level;
} else {
- return false;
+ return -1;
}
}
+ }, {
+ key: 'liveSyncPosition',
+ get: function get() {
+ return this._liveSyncPosition;
+ },
+ set: function set(value) {
+ this._liveSyncPosition = value;
+ }
}]);
- return TSDemuxer;
-}();
+ return StreamController;
+}(event_handler);
-exports.default = TSDemuxer;
+/* harmony default export */ var stream_controller = (stream_controller_StreamController);
+// CONCATENATED MODULE: ./src/controller/level-controller.js
+var level_controller__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-},{"22":22,"26":26,"30":30,"31":31,"33":33,"35":35,"53":53}],33:[function(_dereq_,module,exports){
-'use strict';
+function level_controller__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var ErrorTypes = exports.ErrorTypes = {
- // Identifier for a network error (loading error / timeout ...)
- NETWORK_ERROR: 'networkError',
- // Identifier for a media Error (video/parsing/mediasource error)
- MEDIA_ERROR: 'mediaError',
- // Identifier for a mux Error (demuxing/remuxing)
- MUX_ERROR: 'muxError',
- // Identifier for all other errors
- OTHER_ERROR: 'otherError'
-};
+function level_controller__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-var ErrorDetails = exports.ErrorDetails = {
- // Identifier for a manifest load error - data: { url : faulty URL, response : { code: error code, text: error text }}
- MANIFEST_LOAD_ERROR: 'manifestLoadError',
- // Identifier for a manifest load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}
- MANIFEST_LOAD_TIMEOUT: 'manifestLoadTimeOut',
- // Identifier for a manifest parsing error - data: { url : faulty URL, reason : error reason}
- MANIFEST_PARSING_ERROR: 'manifestParsingError',
- // Identifier for a manifest with only incompatible codecs error - data: { url : faulty URL, reason : error reason}
- MANIFEST_INCOMPATIBLE_CODECS_ERROR: 'manifestIncompatibleCodecsError',
- // Identifier for a level load error - data: { url : faulty URL, response : { code: error code, text: error text }}
- LEVEL_LOAD_ERROR: 'levelLoadError',
- // Identifier for a level load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}
- LEVEL_LOAD_TIMEOUT: 'levelLoadTimeOut',
- // Identifier for a level switch error - data: { level : faulty level Id, event : error description}
- LEVEL_SWITCH_ERROR: 'levelSwitchError',
- // Identifier for an audio track load error - data: { url : faulty URL, response : { code: error code, text: error text }}
- AUDIO_TRACK_LOAD_ERROR: 'audioTrackLoadError',
- // Identifier for an audio track load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}
- AUDIO_TRACK_LOAD_TIMEOUT: 'audioTrackLoadTimeOut',
- // Identifier for fragment load error - data: { frag : fragment object, response : { code: error code, text: error text }}
- FRAG_LOAD_ERROR: 'fragLoadError',
- // Identifier for fragment loop loading error - data: { frag : fragment object}
- FRAG_LOOP_LOADING_ERROR: 'fragLoopLoadingError',
- // Identifier for fragment load timeout error - data: { frag : fragment object}
- FRAG_LOAD_TIMEOUT: 'fragLoadTimeOut',
- // Identifier for a fragment decryption error event - data: {id : demuxer Id,frag: fragment object, reason : parsing error description }
- FRAG_DECRYPT_ERROR: 'fragDecryptError',
- // Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description }
- // will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release
- FRAG_PARSING_ERROR: 'fragParsingError',
- // Identifier for a remux alloc error event - data: { id : demuxer Id, frag : fragment object, bytes : nb of bytes on which allocation failed , reason : error text }
- REMUX_ALLOC_ERROR: 'remuxAllocError',
- // Identifier for decrypt key load error - data: { frag : fragment object, response : { code: error code, text: error text }}
- KEY_LOAD_ERROR: 'keyLoadError',
- // Identifier for decrypt key load timeout error - data: { frag : fragment object}
- KEY_LOAD_TIMEOUT: 'keyLoadTimeOut',
- // Triggered when an exception occurs while adding a sourceBuffer to MediaSource - data : { err : exception , mimeType : mimeType }
- BUFFER_ADD_CODEC_ERROR: 'bufferAddCodecError',
- // Identifier for a buffer append error - data: append error description
- BUFFER_APPEND_ERROR: 'bufferAppendError',
- // Identifier for a buffer appending error event - data: appending error description
- BUFFER_APPENDING_ERROR: 'bufferAppendingError',
- // Identifier for a buffer stalled error event
- BUFFER_STALLED_ERROR: 'bufferStalledError',
- // Identifier for a buffer full event
- BUFFER_FULL_ERROR: 'bufferFullError',
- // Identifier for a buffer seek over hole event
- BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole',
- // Identifier for a buffer nudge on stall (playback is stuck although currentTime is in a buffered area)
- BUFFER_NUDGE_ON_STALL: 'bufferNudgeOnStall',
- // Identifier for an internal exception happening inside hls.js while handling an event
- INTERNAL_EXCEPTION: 'internalException',
- // Malformed WebVTT contents
- WEBVTT_EXCEPTION: 'webVTTException'
-};
+function level_controller__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-},{}],34:[function(_dereq_,module,exports){
-'use strict';
+/*
+ * Level Controller
+*/
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*
- *
- * All objects in the event handling chain should inherit from this class
- *
- */
-var _logger = _dereq_(53);
-var _errors = _dereq_(33);
-var _events = _dereq_(35);
-var _events2 = _interopRequireDefault(_events);
+var level_controller_LevelController = function (_EventHandler) {
+ level_controller__inherits(LevelController, _EventHandler);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ function LevelController(hls) {
+ level_controller__classCallCheck(this, LevelController);
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ var _this = level_controller__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].MANIFEST_LOADED, events["a" /* default */].LEVEL_LOADED, events["a" /* default */].FRAG_LOADED, events["a" /* default */].ERROR));
-var EventHandler = function () {
- function EventHandler(hls) {
- _classCallCheck(this, EventHandler);
+ _this.canload = false;
+ _this.currentLevelIndex = null;
+ _this.manualLevelIndex = -1;
+ _this.timer = null;
+ return _this;
+ }
- this.hls = hls;
- this.onEvent = this.onEvent.bind(this);
+ LevelController.prototype.destroy = function destroy() {
+ this.cleanTimer();
+ this.manualLevelIndex = -1;
+ };
- for (var _len = arguments.length, events = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- events[_key - 1] = arguments[_key];
+ LevelController.prototype.cleanTimer = function cleanTimer() {
+ if (this.timer !== null) {
+ clearTimeout(this.timer);
+ this.timer = null;
}
+ };
- this.handledEvents = events;
- this.useGenericHandler = true;
+ LevelController.prototype.startLoad = function startLoad() {
+ var levels = this._levels;
- this.registerListeners();
- }
+ this.canload = true;
+ this.levelRetryCount = 0;
- _createClass(EventHandler, [{
- key: 'destroy',
- value: function destroy() {
- this.unregisterListeners();
- }
- }, {
- key: 'isEventHandler',
- value: function isEventHandler() {
- return _typeof(this.handledEvents) === 'object' && this.handledEvents.length && typeof this.onEvent === 'function';
- }
- }, {
- key: 'registerListeners',
- value: function registerListeners() {
- if (this.isEventHandler()) {
- this.handledEvents.forEach(function (event) {
- if (event === 'hlsEventGeneric') {
- throw new Error('Forbidden event name: ' + event);
- }
- this.hls.on(event, this.onEvent);
- }.bind(this));
- }
- }
- }, {
- key: 'unregisterListeners',
- value: function unregisterListeners() {
- if (this.isEventHandler()) {
- this.handledEvents.forEach(function (event) {
- this.hls.off(event, this.onEvent);
- }.bind(this));
- }
+ // clean up live level details to force reload them, and reset load errors
+ if (levels) {
+ levels.forEach(function (level) {
+ level.loadError = 0;
+ var levelDetails = level.details;
+ if (levelDetails && levelDetails.live) {
+ level.details = undefined;
+ }
+ });
}
-
- /**
- * arguments: event (string), data (any)
- */
-
- }, {
- key: 'onEvent',
- value: function onEvent(event, data) {
- this.onEventGeneric(event, data);
+ // speed up live playlist refresh if timer exists
+ if (this.timer !== null) {
+ this.loadLevel();
}
- }, {
- key: 'onEventGeneric',
- value: function onEventGeneric(event, data) {
- var eventToFunction = function eventToFunction(event, data) {
- var funcName = 'on' + event.replace('hls', '');
- if (typeof this[funcName] !== 'function') {
- throw new Error('Event ' + event + ' has no generic handler in this ' + this.constructor.name + ' class (tried ' + funcName + ')');
- }
- return this[funcName].bind(this, data);
- };
- try {
- eventToFunction.call(this, event, data).call();
- } catch (err) {
- _logger.logger.error('internal error happened while processing ' + event + ':' + err.message);
- this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event: event, err: err });
- }
- }
- }]);
-
- return EventHandler;
-}();
-
-exports.default = EventHandler;
-
-},{"33":33,"35":35,"53":53}],35:[function(_dereq_,module,exports){
-'use strict';
+ };
-module.exports = {
- // fired before MediaSource is attaching to media element - data: { media }
- MEDIA_ATTACHING: 'hlsMediaAttaching',
- // fired when MediaSource has been succesfully attached to media element - data: { }
- MEDIA_ATTACHED: 'hlsMediaAttached',
- // fired before detaching MediaSource from media element - data: { }
- MEDIA_DETACHING: 'hlsMediaDetaching',
- // fired when MediaSource has been detached from media element - data: { }
- MEDIA_DETACHED: 'hlsMediaDetached',
- // fired when we buffer is going to be reset - data: { }
- BUFFER_RESET: 'hlsBufferReset',
- // fired when we know about the codecs that we need buffers for to push into - data: {tracks : { container, codec, levelCodec, initSegment, metadata }}
- BUFFER_CODECS: 'hlsBufferCodecs',
- // fired when sourcebuffers have been created - data: { tracks : tracks }
- BUFFER_CREATED: 'hlsBufferCreated',
- // fired when we append a segment to the buffer - data: { segment: segment object }
- BUFFER_APPENDING: 'hlsBufferAppending',
- // fired when we are done with appending a media segment to the buffer - data : { parent : segment parent that triggered BUFFER_APPENDING, pending : nb of segments waiting for appending for this segment parent}
- BUFFER_APPENDED: 'hlsBufferAppended',
- // fired when the stream is finished and we want to notify the media buffer that there will be no more data - data: { }
- BUFFER_EOS: 'hlsBufferEos',
- // fired when the media buffer should be flushed - data { startOffset, endOffset }
- BUFFER_FLUSHING: 'hlsBufferFlushing',
- // fired when the media buffer has been flushed - data: { }
- BUFFER_FLUSHED: 'hlsBufferFlushed',
- // fired to signal that a manifest loading starts - data: { url : manifestURL}
- MANIFEST_LOADING: 'hlsManifestLoading',
- // fired after manifest has been loaded - data: { levels : [available quality levels], audioTracks : [ available audio tracks], url : manifestURL, stats : { trequest, tfirst, tload, mtime}}
- MANIFEST_LOADED: 'hlsManifestLoaded',
- // fired after manifest has been parsed - data: { levels : [available quality levels], firstLevel : index of first quality level appearing in Manifest}
- MANIFEST_PARSED: 'hlsManifestParsed',
- // fired when a level switch is requested - data: { level : id of new level } // deprecated in favor LEVEL_SWITCHING
- LEVEL_SWITCH: 'hlsLevelSwitch',
- // fired when a level switch is requested - data: { level : id of new level }
- LEVEL_SWITCHING: 'hlsLevelSwitching',
- // fired when a level switch is effective - data: { level : id of new level }
- LEVEL_SWITCHED: 'hlsLevelSwitched',
- // fired when a level playlist loading starts - data: { url : level URL, level : id of level being loaded}
- LEVEL_LOADING: 'hlsLevelLoading',
- // fired when a level playlist loading finishes - data: { details : levelDetails object, level : id of loaded level, stats : { trequest, tfirst, tload, mtime} }
- LEVEL_LOADED: 'hlsLevelLoaded',
- // fired when a level's details have been updated based on previous details, after it has been loaded - data: { details : levelDetails object, level : id of updated level }
- LEVEL_UPDATED: 'hlsLevelUpdated',
- // fired when a level's PTS information has been updated after parsing a fragment - data: { details : levelDetails object, level : id of updated level, drift: PTS drift observed when parsing last fragment }
- LEVEL_PTS_UPDATED: 'hlsLevelPtsUpdated',
- // fired to notify that audio track lists has been updated - data: { audioTracks : audioTracks }
- AUDIO_TRACKS_UPDATED: 'hlsAudioTracksUpdated',
- // fired when an audio track switch occurs - data: { id : audio track id } // deprecated in favor AUDIO_TRACK_SWITCHING
- AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',
- // fired when an audio track switching is requested - data: { id : audio track id }
- AUDIO_TRACK_SWITCHING: 'hlsAudioTrackSwitching',
- // fired when an audio track switch actually occurs - data: { id : audio track id }
- AUDIO_TRACK_SWITCHED: 'hlsAudioTrackSwitched',
- // fired when an audio track loading starts - data: { url : audio track URL, id : audio track id }
- AUDIO_TRACK_LOADING: 'hlsAudioTrackLoading',
- // fired when an audio track loading finishes - data: { details : levelDetails object, id : audio track id, stats : { trequest, tfirst, tload, mtime } }
- AUDIO_TRACK_LOADED: 'hlsAudioTrackLoaded',
- // fired to notify that subtitle track lists has been updated - data: { subtitleTracks : subtitleTracks }
- SUBTITLE_TRACKS_UPDATED: 'hlsSubtitleTracksUpdated',
- // fired when an subtitle track switch occurs - data: { id : subtitle track id }
- SUBTITLE_TRACK_SWITCH: 'hlsSubtitleTrackSwitch',
- // fired when a subtitle track loading starts - data: { url : subtitle track URL, id : subtitle track id }
- SUBTITLE_TRACK_LOADING: 'hlsSubtitleTrackLoading',
- // fired when a subtitle track loading finishes - data: { details : levelDetails object, id : subtitle track id, stats : { trequest, tfirst, tload, mtime } }
- SUBTITLE_TRACK_LOADED: 'hlsSubtitleTrackLoaded',
- // fired when a subtitle fragment has been processed - data: { success : boolean, frag : the processed frag }
- SUBTITLE_FRAG_PROCESSED: 'hlsSubtitleFragProcessed',
- // fired when the first timestamp is found - data: { id : demuxer id, initPTS: initPTS, frag : fragment object }
- INIT_PTS_FOUND: 'hlsInitPtsFound',
- // fired when a fragment loading starts - data: { frag : fragment object }
- FRAG_LOADING: 'hlsFragLoading',
- // fired when a fragment loading is progressing - data: { frag : fragment object, { trequest, tfirst, loaded } }
- FRAG_LOAD_PROGRESS: 'hlsFragLoadProgress',
- // Identifier for fragment load aborting for emergency switch down - data: { frag : fragment object }
- FRAG_LOAD_EMERGENCY_ABORTED: 'hlsFragLoadEmergencyAborted',
- // fired when a fragment loading is completed - data: { frag : fragment object, payload : fragment payload, stats : { trequest, tfirst, tload, length } }
- FRAG_LOADED: 'hlsFragLoaded',
- // fired when a fragment has finished decrypting - data: { id : demuxer id, frag: fragment object, stats : { tstart, tdecrypt } }
- FRAG_DECRYPTED: 'hlsFragDecrypted',
- // fired when Init Segment has been extracted from fragment - data: { id : demuxer id, frag: fragment object, moov : moov MP4 box, codecs : codecs found while parsing fragment }
- FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',
- // fired when parsing sei text is completed - data: { id : demuxer id, frag: fragment object, samples : [ sei samples pes ] }
- FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',
- // fired when parsing id3 is completed - data: { id : demuxer id, frag: fragment object, samples : [ id3 samples pes ] }
- FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',
- // fired when data have been extracted from fragment - data: { id : demuxer id, frag: fragment object, data1 : moof MP4 box or TS fragments, data2 : mdat MP4 box or null}
- FRAG_PARSING_DATA: 'hlsFragParsingData',
- // fired when fragment parsing is completed - data: { id : demuxer id, frag: fragment object }
- FRAG_PARSED: 'hlsFragParsed',
- // fired when fragment remuxed MP4 boxes have all been appended into SourceBuffer - data: { id : demuxer id, frag : fragment object, stats : { trequest, tfirst, tload, tparsed, tbuffered, length, bwEstimate } }
- FRAG_BUFFERED: 'hlsFragBuffered',
- // fired when fragment matching with current media position is changing - data : { id : demuxer id, frag : fragment object }
- FRAG_CHANGED: 'hlsFragChanged',
- // Identifier for a FPS drop event - data: { curentDropped, currentDecoded, totalDroppedFrames }
- FPS_DROP: 'hlsFpsDrop',
- //triggered when FPS drop triggers auto level capping - data: { level, droppedlevel }
- FPS_DROP_LEVEL_CAPPING: 'hlsFpsDropLevelCapping',
- // Identifier for an error event - data: { type : error type, details : error details, fatal : if true, hls.js cannot/will not try to recover, if false, hls.js will try to recover,other error specific data }
- ERROR: 'hlsError',
- // fired when hls.js instance starts destroying. Different from MEDIA_DETACHED as one could want to detach and reattach a media to the instance of hls.js to handle mid-rolls for example - data: { }
- DESTROYING: 'hlsDestroying',
- // fired when a decrypt key loading starts - data: { frag : fragment object }
- KEY_LOADING: 'hlsKeyLoading',
- // fired when a decrypt key loading is completed - data: { frag : fragment object, payload : key payload, stats : { trequest, tfirst, tload, length } }
- KEY_LOADED: 'hlsKeyLoaded',
- // fired upon stream controller state transitions - data: { previousState, nextState }
- STREAM_STATE_TRANSITION: 'hlsStreamStateTransition'
-};
+ LevelController.prototype.stopLoad = function stopLoad() {
+ this.canload = false;
+ };
-},{}],36:[function(_dereq_,module,exports){
-'use strict';
+ LevelController.prototype.onManifestLoaded = function onManifestLoaded(data) {
+ var levels = [];
+ var bitrateStart = void 0;
+ var levelSet = {};
+ var levelFromSet = null;
+ var videoCodecFound = false;
+ var audioCodecFound = false;
+ var chromeOrFirefox = /chrome|firefox/.test(navigator.userAgent.toLowerCase());
+ var audioTracks = [];
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ // regroup redundant levels together
+ data.levels.forEach(function (level) {
+ level.loadError = 0;
+ level.fragmentError = false;
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+ videoCodecFound = videoCodecFound || !!level.videoCodec;
+ audioCodecFound = audioCodecFound || !!level.audioCodec || !!(level.attrs && level.attrs.AUDIO);
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ // erase audio codec info if browser does not support mp4a.40.34.
+ // demuxer will autodetect codec and fallback to mpeg/audio
+ if (chromeOrFirefox === true && level.audioCodec && level.audioCodec.indexOf('mp4a.40.34') !== -1) {
+ level.audioCodec = undefined;
+ }
-/**
- * AAC helper
- */
+ levelFromSet = levelSet[level.bitrate];
-var AAC = function () {
- function AAC() {
- _classCallCheck(this, AAC);
- }
-
- _createClass(AAC, null, [{
- key: 'getSilentFrame',
- value: function getSilentFrame(codec, channelCount) {
- switch (codec) {
- case 'mp4a.40.2':
- if (channelCount === 1) {
- return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x23, 0x80]);
- } else if (channelCount === 2) {
- return new Uint8Array([0x21, 0x00, 0x49, 0x90, 0x02, 0x19, 0x00, 0x23, 0x80]);
- } else if (channelCount === 3) {
- return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x8e]);
- } else if (channelCount === 4) {
- return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x80, 0x2c, 0x80, 0x08, 0x02, 0x38]);
- } else if (channelCount === 5) {
- return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x38]);
- } else if (channelCount === 6) {
- return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x00, 0xb2, 0x00, 0x20, 0x08, 0xe0]);
- }
- break;
- // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)
- default:
- if (channelCount === 1) {
- // ffmpeg -y -f lavfi -i "aevalsrc=0:d=0.05" -c:a libfdk_aac -profile:a aac_he -b:a 4k output.aac && hexdump -v -e '16/1 "0x%x," "\n"' -v output.aac
- return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x4e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x1c, 0x6, 0xf1, 0xc1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);
- } else if (channelCount === 2) {
- // ffmpeg -y -f lavfi -i "aevalsrc=0|0:d=0.05" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 "0x%x," "\n"' -v output.aac
- return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);
- } else if (channelCount === 3) {
- // ffmpeg -y -f lavfi -i "aevalsrc=0|0|0:d=0.05" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 "0x%x," "\n"' -v output.aac
- return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);
- }
- break;
+ if (levelFromSet === undefined) {
+ level.url = [level.url];
+ level.urlId = 0;
+ levelSet[level.bitrate] = level;
+ levels.push(level);
+ } else {
+ levelFromSet.url.push(level.url);
}
- return null;
- }
- }]);
+ });
- return AAC;
-}();
+ // remove audio-only level if we also have levels with audio+video codecs signalled
+ if (videoCodecFound === true && audioCodecFound === true) {
+ levels = levels.filter(function (_ref) {
+ var videoCodec = _ref.videoCodec;
+ return !!videoCodec;
+ });
+ }
-exports.default = AAC;
+ // only keep levels with supported audio/video codecs
+ levels = levels.filter(function (_ref2) {
+ var audioCodec = _ref2.audioCodec,
+ videoCodec = _ref2.videoCodec;
-},{}],37:[function(_dereq_,module,exports){
-"use strict";
+ return (!audioCodec || isCodecSupportedInMp4(audioCodec)) && (!videoCodec || isCodecSupportedInMp4(videoCodec));
+ });
-/**
- * Buffer Helper utils, providing methods dealing buffer length retrieval
-*/
+ if (data.audioTracks) {
+ audioTracks = data.audioTracks.filter(function (track) {
+ return !track.audioCodec || isCodecSupportedInMp4(track.audioCodec, 'audio');
+ });
+ }
-var BufferHelper = {
- isBuffered: function isBuffered(media, position) {
- if (media) {
- var buffered = media.buffered;
- for (var i = 0; i < buffered.length; i++) {
- if (position >= buffered.start(i) && position <= buffered.end(i)) {
- return true;
+ if (levels.length > 0) {
+ // start bitrate is the first bitrate of the manifest
+ bitrateStart = levels[0].bitrate;
+ // sort level on bitrate
+ levels.sort(function (a, b) {
+ return a.bitrate - b.bitrate;
+ });
+ this._levels = levels;
+ // find index of first level in sorted levels
+ for (var i = 0; i < levels.length; i++) {
+ if (levels[i].bitrate === bitrateStart) {
+ this._firstLevel = i;
+ logger["b" /* logger */].log('manifest loaded,' + levels.length + ' level(s) found, first bitrate:' + bitrateStart);
+ break;
}
}
+ this.hls.trigger(events["a" /* default */].MANIFEST_PARSED, {
+ levels: levels,
+ audioTracks: audioTracks,
+ firstLevel: this._firstLevel,
+ stats: data.stats,
+ audio: audioCodecFound,
+ video: videoCodecFound,
+ altAudio: audioTracks.length > 0
+ });
+ } else {
+ this.hls.trigger(events["a" /* default */].ERROR, {
+ type: errors["b" /* ErrorTypes */].MEDIA_ERROR,
+ details: errors["a" /* ErrorDetails */].MANIFEST_INCOMPATIBLE_CODECS_ERROR,
+ fatal: true,
+ url: this.hls.url,
+ reason: 'no level with compatible codecs found in manifest'
+ });
}
- return false;
- },
+ };
- bufferInfo: function bufferInfo(media, pos, maxHoleDuration) {
- if (media) {
- var vbuffered = media.buffered,
- buffered = [],
- i;
- for (i = 0; i < vbuffered.length; i++) {
- buffered.push({ start: vbuffered.start(i), end: vbuffered.end(i) });
+ LevelController.prototype.setLevelInternal = function setLevelInternal(newLevel) {
+ var levels = this._levels;
+ var hls = this.hls;
+ // check if level idx is valid
+ if (newLevel >= 0 && newLevel < levels.length) {
+ // stopping live reloading timer if any
+ this.cleanTimer();
+ if (this.currentLevelIndex !== newLevel) {
+ logger["b" /* logger */].log('switching to level ' + newLevel);
+ this.currentLevelIndex = newLevel;
+ var levelProperties = levels[newLevel];
+ levelProperties.level = newLevel;
+ // LEVEL_SWITCH to be deprecated in next major release
+ hls.trigger(events["a" /* default */].LEVEL_SWITCH, levelProperties);
+ hls.trigger(events["a" /* default */].LEVEL_SWITCHING, levelProperties);
+ }
+ var level = levels[newLevel],
+ levelDetails = level.details;
+ // check if we need to load playlist for this level
+ if (!levelDetails || levelDetails.live === true) {
+ // level not retrieved yet, or live playlist we need to (re)load it
+ var urlId = level.urlId;
+ hls.trigger(events["a" /* default */].LEVEL_LOADING, { url: level.url[urlId], level: newLevel, id: urlId });
}
- return this.bufferedInfo(buffered, pos, maxHoleDuration);
} else {
- return { len: 0, start: pos, end: pos, nextStart: undefined };
+ // invalid level id given, trigger error
+ hls.trigger(events["a" /* default */].ERROR, {
+ type: errors["b" /* ErrorTypes */].OTHER_ERROR,
+ details: errors["a" /* ErrorDetails */].LEVEL_SWITCH_ERROR,
+ level: newLevel,
+ fatal: false,
+ reason: 'invalid level idx'
+ });
}
- },
-
- bufferedInfo: function bufferedInfo(buffered, pos, maxHoleDuration) {
- var buffered2 = [],
+ };
- // bufferStart and bufferEnd are buffer boundaries around current video position
- bufferLen,
- bufferStart,
- bufferEnd,
- bufferStartNext,
- i;
- // sort on buffer.start/smaller end (IE does not always return sorted buffered range)
- buffered.sort(function (a, b) {
- var diff = a.start - b.start;
- if (diff) {
- return diff;
- } else {
- return b.end - a.end;
- }
- });
- // there might be some small holes between buffer time range
- // consider that holes smaller than maxHoleDuration are irrelevant and build another
- // buffer time range representations that discards those holes
- for (i = 0; i < buffered.length; i++) {
- var buf2len = buffered2.length;
- if (buf2len) {
- var buf2end = buffered2[buf2len - 1].end;
- // if small hole (value between 0 or maxHoleDuration ) or overlapping (negative)
- if (buffered[i].start - buf2end < maxHoleDuration) {
- // merge overlapping time ranges
- // update lastRange.end only if smaller than item.end
- // e.g. [ 1, 15] with [ 2,8] => [ 1,15] (no need to modify lastRange.end)
- // whereas [ 1, 8] with [ 2,15] => [ 1,15] ( lastRange should switch from [1,8] to [1,15])
- if (buffered[i].end > buf2end) {
- buffered2[buf2len - 1].end = buffered[i].end;
- }
- } else {
- // big hole
- buffered2.push(buffered[i]);
- }
- } else {
- // first value
- buffered2.push(buffered[i]);
+ LevelController.prototype.onError = function onError(data) {
+ if (data.fatal === true) {
+ if (data.type === errors["b" /* ErrorTypes */].NETWORK_ERROR) {
+ this.cleanTimer();
}
+ return;
}
- for (i = 0, bufferLen = 0, bufferStart = bufferEnd = pos; i < buffered2.length; i++) {
- var start = buffered2[i].start,
- end = buffered2[i].end;
- //logger.log('buf start/end:' + buffered.start(i) + '/' + buffered.end(i));
- if (pos + maxHoleDuration >= start && pos < end) {
- // play position is inside this buffer TimeRange, retrieve end of buffer position and buffer length
- bufferStart = start;
- bufferEnd = end;
- bufferLen = bufferEnd - pos;
- } else if (pos + maxHoleDuration < start) {
- bufferStartNext = start;
+
+ var levelError = false,
+ fragmentError = false;
+ var levelIndex = void 0;
+
+ // try to recover not fatal errors
+ switch (data.details) {
+ case errors["a" /* ErrorDetails */].FRAG_LOAD_ERROR:
+ case errors["a" /* ErrorDetails */].FRAG_LOAD_TIMEOUT:
+ case errors["a" /* ErrorDetails */].FRAG_LOOP_LOADING_ERROR:
+ case errors["a" /* ErrorDetails */].KEY_LOAD_ERROR:
+ case errors["a" /* ErrorDetails */].KEY_LOAD_TIMEOUT:
+ levelIndex = data.frag.level;
+ fragmentError = true;
+ break;
+ case errors["a" /* ErrorDetails */].LEVEL_LOAD_ERROR:
+ case errors["a" /* ErrorDetails */].LEVEL_LOAD_TIMEOUT:
+ levelIndex = data.context.level;
+ levelError = true;
+ break;
+ case errors["a" /* ErrorDetails */].REMUX_ALLOC_ERROR:
+ levelIndex = data.level;
+ levelError = true;
break;
- }
}
- return { len: bufferLen, start: bufferStart, end: bufferEnd, nextStart: bufferStartNext };
- }
-};
-module.exports = BufferHelper;
-
-},{}],38:[function(_dereq_,module,exports){
-'use strict';
+ if (levelIndex !== undefined) {
+ this.recoverLevel(data, levelIndex, levelError, fragmentError);
+ }
+ };
-var _logger = _dereq_(53);
+ /**
+ * Switch to a redundant stream if any available.
+ * If redundant stream is not available, emergency switch down if ABR mode is enabled.
+ *
+ * @param {Object} errorEvent
+ * @param {Number} levelIndex current level index
+ * @param {Boolean} levelError
+ * @param {Boolean} fragmentError
+ */
+ // FIXME Find a better abstraction where fragment/level retry management is well decoupled
-var LevelHelper = {
- mergeDetails: function mergeDetails(oldDetails, newDetails) {
- var start = Math.max(oldDetails.startSN, newDetails.startSN) - newDetails.startSN,
- end = Math.min(oldDetails.endSN, newDetails.endSN) - newDetails.startSN,
- delta = newDetails.startSN - oldDetails.startSN,
- oldfragments = oldDetails.fragments,
- newfragments = newDetails.fragments,
- ccOffset = 0,
- PTSFrag;
+ LevelController.prototype.recoverLevel = function recoverLevel(errorEvent, levelIndex, levelError, fragmentError) {
+ var _this2 = this;
- // check if old/new playlists have fragments in common
- if (end < start) {
- newDetails.PTSKnown = false;
- return;
- }
- // loop through overlapping SN and update startPTS , cc, and duration if any found
- for (var i = start; i <= end; i++) {
- var oldFrag = oldfragments[delta + i],
- newFrag = newfragments[i];
- if (newFrag && oldFrag) {
- ccOffset = oldFrag.cc - newFrag.cc;
- if (!isNaN(oldFrag.startPTS)) {
- newFrag.start = newFrag.startPTS = oldFrag.startPTS;
- newFrag.endPTS = oldFrag.endPTS;
- newFrag.duration = oldFrag.duration;
- newFrag.backtracked = oldFrag.backtracked;
- newFrag.dropped = oldFrag.dropped;
- PTSFrag = newFrag;
- }
+ var config = this.hls.config;
+ var errorDetails = errorEvent.details;
+
+ var level = this._levels[levelIndex];
+ var redundantLevels = void 0,
+ delay = void 0,
+ nextLevel = void 0;
+
+ level.loadError++;
+ level.fragmentError = fragmentError;
+
+ if (levelError === true) {
+ if (this.levelRetryCount + 1 <= config.levelLoadingMaxRetry) {
+ // exponential backoff capped to max retry timeout
+ delay = Math.min(Math.pow(2, this.levelRetryCount) * config.levelLoadingRetryDelay, config.levelLoadingMaxRetryTimeout);
+ // Schedule level reload
+ this.timer = setTimeout(function () {
+ return _this2.loadLevel();
+ }, delay);
+ // boolean used to inform stream controller not to switch back to IDLE on non fatal error
+ errorEvent.levelRetry = true;
+ this.levelRetryCount++;
+ logger["b" /* logger */].warn('level controller, ' + errorDetails + ', retry in ' + delay + ' ms, current retry count is ' + this.levelRetryCount);
+ } else {
+ logger["b" /* logger */].error('level controller, cannot recover from ' + errorDetails + ' error');
+ this.currentLevelIndex = null;
+ // stopping live reloading timer if any
+ this.cleanTimer();
+ // switch error to fatal
+ errorEvent.fatal = true;
+ return;
}
}
- if (ccOffset) {
- _logger.logger.log('discontinuity sliding from playlist, take drift into account');
- for (i = 0; i < newfragments.length; i++) {
- newfragments[i].cc += ccOffset;
- }
- }
+ // Try any redundant streams if available for both errors: level and fragment
+ // If level.loadError reaches redundantLevels it means that we tried them all, no hope => let's switch down
+ if (levelError === true || fragmentError === true) {
+ redundantLevels = level.url.length;
- // if at least one fragment contains PTS info, recompute PTS information for all fragments
- if (PTSFrag) {
- LevelHelper.updateFragPTSDTS(newDetails, PTSFrag, PTSFrag.startPTS, PTSFrag.endPTS, PTSFrag.startDTS, PTSFrag.endDTS);
- } else {
- // ensure that delta is within oldfragments range
- // also adjust sliding in case delta is 0 (we could have old=[50-60] and new=old=[50-61])
- // in that case we also need to adjust start offset of all fragments
- if (delta >= 0 && delta < oldfragments.length) {
- // adjust start by sliding offset
- var sliding = oldfragments[delta].start;
- for (i = 0; i < newfragments.length; i++) {
- newfragments[i].start += sliding;
+ if (redundantLevels > 1 && level.loadError < redundantLevels) {
+ logger["b" /* logger */].warn('level controller, ' + errorDetails + ' for level ' + levelIndex + ': switching to redundant stream id ' + level.urlId);
+ level.urlId = (level.urlId + 1) % redundantLevels;
+ level.details = undefined;
+ } else {
+ // Search for available level
+ if (this.manualLevelIndex === -1) {
+ // When lowest level has been reached, let's start hunt from the top
+ nextLevel = levelIndex === 0 ? this._levels.length - 1 : levelIndex - 1;
+ logger["b" /* logger */].warn('level controller, ' + errorDetails + ': switch to ' + nextLevel);
+ this.hls.nextAutoLevel = this.currentLevelIndex = nextLevel;
+ } else if (fragmentError === true) {
+ // Allow fragment retry as long as configuration allows.
+ // reset this._level so that another call to set level() will trigger again a frag load
+ logger["b" /* logger */].warn('level controller, ' + errorDetails + ': reload a fragment');
+ this.currentLevelIndex = null;
}
}
}
- // if we are here, it means we have fragments overlapping between
- // old and new level. reliable PTS info is thus relying on old level
- newDetails.PTSKnown = oldDetails.PTSKnown;
- return;
- },
+ };
- updateFragPTSDTS: function updateFragPTSDTS(details, frag, startPTS, endPTS, startDTS, endDTS) {
- // update frag PTS/DTS
- if (!isNaN(frag.startPTS)) {
- // delta PTS between audio and video
- var deltaPTS = Math.abs(frag.startPTS - startPTS);
- if (isNaN(frag.deltaPTS)) {
- frag.deltaPTS = deltaPTS;
- } else {
- frag.deltaPTS = Math.max(deltaPTS, frag.deltaPTS);
- }
- startPTS = Math.min(startPTS, frag.startPTS);
- endPTS = Math.max(endPTS, frag.endPTS);
- startDTS = Math.min(startDTS, frag.startDTS);
- endDTS = Math.max(endDTS, frag.endDTS);
- }
+ // reset errors on the successful load of a fragment
- var drift = startPTS - frag.start;
- frag.start = frag.startPTS = startPTS;
- frag.endPTS = endPTS;
- frag.startDTS = startDTS;
- frag.endDTS = endDTS;
- frag.duration = endPTS - startPTS;
- var sn = frag.sn;
- // exit if sn out of range
- if (!details || sn < details.startSN || sn > details.endSN) {
- return 0;
- }
- var fragIdx, fragments, i;
- fragIdx = sn - details.startSN;
- fragments = details.fragments;
- frag = fragments[fragIdx];
- // adjust fragment PTS/duration from seqnum-1 to frag 0
- for (i = fragIdx; i > 0; i--) {
- LevelHelper.updatePTS(fragments, i, i - 1);
- }
+ LevelController.prototype.onFragLoaded = function onFragLoaded(_ref3) {
+ var frag = _ref3.frag;
- // adjust fragment PTS/duration from seqnum to last frag
- for (i = fragIdx; i < fragments.length - 1; i++) {
- LevelHelper.updatePTS(fragments, i, i + 1);
+ if (frag !== undefined && frag.type === 'main') {
+ var level = this._levels[frag.level];
+ if (level !== undefined) {
+ level.fragmentError = false;
+ level.loadError = 0;
+ this.levelRetryCount = 0;
+ }
}
- details.PTSKnown = true;
- //logger.log(` frag start/end:${startPTS.toFixed(3)}/${endPTS.toFixed(3)}`);
+ };
- return drift;
- },
+ LevelController.prototype.onLevelLoaded = function onLevelLoaded(data) {
+ var _this3 = this;
- updatePTS: function updatePTS(fragments, fromIdx, toIdx) {
- var fragFrom = fragments[fromIdx],
- fragTo = fragments[toIdx],
- fragToPTS = fragTo.startPTS;
- // if we know startPTS[toIdx]
- if (!isNaN(fragToPTS)) {
- // update fragment duration.
- // it helps to fix drifts between playlist reported duration and fragment real duration
- if (toIdx > fromIdx) {
- fragFrom.duration = fragToPTS - fragFrom.start;
- if (fragFrom.duration < 0) {
- _logger.logger.warn('negative duration computed for frag ' + fragFrom.sn + ',level ' + fragFrom.level + ', there should be some duration drift between playlist and fragment!');
- }
- } else {
- fragTo.duration = fragFrom.start - fragToPTS;
- if (fragTo.duration < 0) {
- _logger.logger.warn('negative duration computed for frag ' + fragTo.sn + ',level ' + fragTo.level + ', there should be some duration drift between playlist and fragment!');
- }
+ var levelId = data.level;
+ // only process level loaded events matching with expected level
+ if (levelId === this.currentLevelIndex) {
+ var curLevel = this._levels[levelId];
+ // reset level load error counter on successful level loaded only if there is no issues with fragments
+ if (curLevel.fragmentError === false) {
+ curLevel.loadError = 0;
+ this.levelRetryCount = 0;
}
- } else {
- // we dont know startPTS[toIdx]
- if (toIdx > fromIdx) {
- fragTo.start = fragFrom.start + fragFrom.duration;
+ var newDetails = data.details;
+ // if current playlist is a live playlist, arm a timer to reload it
+ if (newDetails.live) {
+ var reloadInterval = 1000 * (newDetails.averagetargetduration ? newDetails.averagetargetduration : newDetails.targetduration),
+ curDetails = curLevel.details;
+ if (curDetails && newDetails.endSN === curDetails.endSN) {
+ // follow HLS Spec, If the client reloads a Playlist file and finds that it has not
+ // changed then it MUST wait for a period of one-half the target
+ // duration before retrying.
+ reloadInterval /= 2;
+ logger["b" /* logger */].log('same live playlist, reload twice faster');
+ }
+ // decrement reloadInterval with level loading delay
+ reloadInterval -= performance.now() - data.stats.trequest;
+ // in any case, don't reload more than every second
+ reloadInterval = Math.max(1000, Math.round(reloadInterval));
+ logger["b" /* logger */].log('live playlist, reload in ' + reloadInterval + ' ms');
+ this.timer = setTimeout(function () {
+ return _this3.loadLevel();
+ }, reloadInterval);
} else {
- fragTo.start = Math.max(fragFrom.start - fragTo.duration, 0);
+ this.cleanTimer();
}
}
- }
-}; /**
- * Level Helper class, providing methods dealing with playlist sliding and drift
- */
-
-module.exports = LevelHelper;
-
-},{"53":53}],39:[function(_dereq_,module,exports){
-/**
- * HLS interface
- */
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _urlToolkit = _dereq_(2);
-
-var _urlToolkit2 = _interopRequireDefault(_urlToolkit);
-
-var _events = _dereq_(35);
-
-var _events2 = _interopRequireDefault(_events);
-
-var _errors = _dereq_(33);
-
-var _playlistLoader = _dereq_(43);
-
-var _playlistLoader2 = _interopRequireDefault(_playlistLoader);
-
-var _fragmentLoader = _dereq_(41);
-
-var _fragmentLoader2 = _interopRequireDefault(_fragmentLoader);
-
-var _keyLoader = _dereq_(42);
-
-var _keyLoader2 = _interopRequireDefault(_keyLoader);
-
-var _streamController = _dereq_(13);
-
-var _streamController2 = _interopRequireDefault(_streamController);
-
-var _levelController = _dereq_(12);
-
-var _levelController2 = _interopRequireDefault(_levelController);
-
-var _id3TrackController = _dereq_(11);
-
-var _id3TrackController2 = _interopRequireDefault(_id3TrackController);
-
-var _logger = _dereq_(53);
-
-var _events3 = _dereq_(1);
-
-var _events4 = _interopRequireDefault(_events3);
-
-var _config = _dereq_(4);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ };
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ LevelController.prototype.loadLevel = function loadLevel() {
+ var level = void 0,
+ urlIndex = void 0;
-var Hls = function () {
- _createClass(Hls, null, [{
- key: 'isSupported',
- value: function isSupported() {
- var mediaSource = window.MediaSource = window.MediaSource || window.WebKitMediaSource;
- var sourceBuffer = window.SourceBuffer = window.SourceBuffer || window.WebKitSourceBuffer;
- var isTypeSupported = mediaSource && typeof mediaSource.isTypeSupported === 'function' && mediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"');
+ if (this.currentLevelIndex !== null && this.canload === true) {
+ level = this._levels[this.currentLevelIndex];
+ if (level !== undefined && level.url.length > 0) {
+ urlIndex = level.urlId;
+ this.hls.trigger(events["a" /* default */].LEVEL_LOADING, { url: level.url[urlIndex], level: this.currentLevelIndex, id: urlIndex });
+ }
+ }
+ };
- // if SourceBuffer is exposed ensure its API is valid
- // safari and old version of Chrome doe not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible
- var sourceBufferValidAPI = !sourceBuffer || sourceBuffer.prototype && typeof sourceBuffer.prototype.appendBuffer === 'function' && typeof sourceBuffer.prototype.remove === 'function';
- return isTypeSupported && sourceBufferValidAPI;
+ level_controller__createClass(LevelController, [{
+ key: 'levels',
+ get: function get() {
+ return this._levels;
}
}, {
- key: 'version',
+ key: 'level',
get: function get() {
- // replaced with browserify-versionify transform
- return '0.7.9';
+ return this.currentLevelIndex;
+ },
+ set: function set(newLevel) {
+ var levels = this._levels;
+ if (levels) {
+ newLevel = Math.min(newLevel, levels.length - 1);
+ if (this.currentLevelIndex !== newLevel || levels[newLevel].details === undefined) {
+ this.setLevelInternal(newLevel);
+ }
+ }
}
}, {
- key: 'Events',
+ key: 'manualLevel',
get: function get() {
- return _events2.default;
+ return this.manualLevelIndex;
+ },
+ set: function set(newLevel) {
+ this.manualLevelIndex = newLevel;
+ if (this._startLevel === undefined) {
+ this._startLevel = newLevel;
+ }
+ if (newLevel !== -1) {
+ this.level = newLevel;
+ }
}
}, {
- key: 'ErrorTypes',
+ key: 'firstLevel',
get: function get() {
- return _errors.ErrorTypes;
+ return this._firstLevel;
+ },
+ set: function set(newLevel) {
+ this._firstLevel = newLevel;
}
}, {
- key: 'ErrorDetails',
+ key: 'startLevel',
get: function get() {
- return _errors.ErrorDetails;
+ // hls.startLevel takes precedence over config.startLevel
+ // if none of these values are defined, fallback on this._firstLevel (first quality level appearing in variant manifest)
+ if (this._startLevel === undefined) {
+ var configStartLevel = this.hls.config.startLevel;
+ if (configStartLevel !== undefined) {
+ return configStartLevel;
+ } else {
+ return this._firstLevel;
+ }
+ } else {
+ return this._startLevel;
+ }
+ },
+ set: function set(newLevel) {
+ this._startLevel = newLevel;
}
}, {
- key: 'DefaultConfig',
+ key: 'nextLoadLevel',
get: function get() {
- if (!Hls.defaultConfig) {
- return _config.hlsDefaultConfig;
+ if (this.manualLevelIndex !== -1) {
+ return this.manualLevelIndex;
+ } else {
+ return this.hls.nextAutoLevel;
}
- return Hls.defaultConfig;
},
- set: function set(defaultConfig) {
- Hls.defaultConfig = defaultConfig;
+ set: function set(nextLevel) {
+ this.level = nextLevel;
+ if (this.manualLevelIndex === -1) {
+ this.hls.nextAutoLevel = nextLevel;
+ }
}
}]);
- function Hls() {
- var _this = this;
-
- var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ return LevelController;
+}(event_handler);
- _classCallCheck(this, Hls);
+/* harmony default export */ var level_controller = (level_controller_LevelController);
+// EXTERNAL MODULE: ./src/demux/id3.js
+var id3 = __webpack_require__(3);
- var defaultConfig = Hls.DefaultConfig;
+// CONCATENATED MODULE: ./src/controller/id3-track-controller.js
+function id3_track_controller__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- if ((config.liveSyncDurationCount || config.liveMaxLatencyDurationCount) && (config.liveSyncDuration || config.liveMaxLatencyDuration)) {
- throw new Error('Illegal hls.js config: don\'t mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration');
- }
+function id3_track_controller__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
- for (var prop in defaultConfig) {
- if (prop in config) {
- continue;
- }
- config[prop] = defaultConfig[prop];
- }
+function id3_track_controller__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
- if (config.liveMaxLatencyDurationCount !== undefined && config.liveMaxLatencyDurationCount <= config.liveSyncDurationCount) {
- throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');
- }
-
- if (config.liveMaxLatencyDuration !== undefined && (config.liveMaxLatencyDuration <= config.liveSyncDuration || config.liveSyncDuration === undefined)) {
- throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');
- }
-
- (0, _logger.enableLogs)(config.debug);
- this.config = config;
- this._autoLevelCapping = -1;
- // observer setup
- var observer = this.observer = new _events4.default();
- observer.trigger = function trigger(event) {
- for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- data[_key - 1] = arguments[_key];
- }
-
- observer.emit.apply(observer, [event, event].concat(data));
- };
-
- observer.off = function off(event) {
- for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- data[_key2 - 1] = arguments[_key2];
- }
+/*
+ * id3 metadata track controller
+*/
- observer.removeListener.apply(observer, [event].concat(data));
- };
- this.on = observer.on.bind(observer);
- this.off = observer.off.bind(observer);
- this.trigger = observer.trigger.bind(observer);
- // core controllers and network loaders
- var abrController = this.abrController = new config.abrController(this);
- var bufferController = new config.bufferController(this);
- var capLevelController = new config.capLevelController(this);
- var fpsController = new config.fpsController(this);
- var playListLoader = new _playlistLoader2.default(this);
- var fragmentLoader = new _fragmentLoader2.default(this);
- var keyLoader = new _keyLoader2.default(this);
- var id3TrackController = new _id3TrackController2.default(this);
- // network controllers
- var levelController = this.levelController = new _levelController2.default(this);
- var streamController = this.streamController = new _streamController2.default(this);
- var networkControllers = [levelController, streamController];
- // optional audio stream controller
- var Controller = config.audioStreamController;
- if (Controller) {
- networkControllers.push(new Controller(this));
- }
- this.networkControllers = networkControllers;
- var coreComponents = [playListLoader, fragmentLoader, keyLoader, abrController, bufferController, capLevelController, fpsController, id3TrackController];
+var id3_track_controller_ID3TrackController = function (_EventHandler) {
+ id3_track_controller__inherits(ID3TrackController, _EventHandler);
- // optional audio track and subtitle controller
- Controller = config.audioTrackController;
- if (Controller) {
- var audioTrackController = new Controller(this);
- this.audioTrackController = audioTrackController;
- coreComponents.push(audioTrackController);
- }
+ function ID3TrackController(hls) {
+ id3_track_controller__classCallCheck(this, ID3TrackController);
- Controller = config.subtitleTrackController;
- if (Controller) {
- var subtitleTrackController = new Controller(this);
- this.subtitleTrackController = subtitleTrackController;
- coreComponents.push(subtitleTrackController);
- }
+ var _this = id3_track_controller__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].MEDIA_ATTACHED, events["a" /* default */].MEDIA_DETACHING, events["a" /* default */].FRAG_PARSING_METADATA));
- // optional subtitle controller
- [config.subtitleStreamController, config.timelineController].forEach(function (Controller) {
- if (Controller) {
- coreComponents.push(new Controller(_this));
- }
- });
- this.coreComponents = coreComponents;
+ _this.id3Track = undefined;
+ _this.media = undefined;
+ return _this;
}
- _createClass(Hls, [{
- key: 'destroy',
- value: function destroy() {
- _logger.logger.log('destroy');
- this.trigger(_events2.default.DESTROYING);
- this.detachMedia();
- this.coreComponents.concat(this.networkControllers).forEach(function (component) {
- component.destroy();
- });
- this.url = null;
- this.observer.removeAllListeners();
- this._autoLevelCapping = -1;
- }
- }, {
- key: 'attachMedia',
- value: function attachMedia(media) {
- _logger.logger.log('attachMedia');
- this.media = media;
- this.trigger(_events2.default.MEDIA_ATTACHING, { media: media });
- }
- }, {
- key: 'detachMedia',
- value: function detachMedia() {
- _logger.logger.log('detachMedia');
- this.trigger(_events2.default.MEDIA_DETACHING);
- this.media = null;
- }
- }, {
- key: 'loadSource',
- value: function loadSource(url) {
- url = _urlToolkit2.default.buildAbsoluteURL(window.location.href, url, { alwaysNormalize: true });
- _logger.logger.log('loadSource:' + url);
- this.url = url;
- // when attaching to a source URL, trigger a playlist load
- this.trigger(_events2.default.MANIFEST_LOADING, { url: url });
- }
- }, {
- key: 'startLoad',
- value: function startLoad() {
- var startPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
-
- _logger.logger.log('startLoad(' + startPosition + ')');
- this.networkControllers.forEach(function (controller) {
- controller.startLoad(startPosition);
- });
- }
- }, {
- key: 'stopLoad',
- value: function stopLoad() {
- _logger.logger.log('stopLoad');
- this.networkControllers.forEach(function (controller) {
- controller.stopLoad();
- });
- }
- }, {
- key: 'swapAudioCodec',
- value: function swapAudioCodec() {
- _logger.logger.log('swapAudioCodec');
- this.streamController.swapAudioCodec();
- }
- }, {
- key: 'recoverMediaError',
- value: function recoverMediaError() {
- _logger.logger.log('recoverMediaError');
- var media = this.media;
- this.detachMedia();
- this.attachMedia(media);
- }
-
- /** Return all quality levels **/
-
- }, {
- key: 'levels',
- get: function get() {
- return this.levelController.levels;
- }
+ ID3TrackController.prototype.destroy = function destroy() {
+ event_handler.prototype.destroy.call(this);
+ };
- /** Return current playback quality level **/
+ // Add ID3 metatadata text track.
- }, {
- key: 'currentLevel',
- get: function get() {
- return this.streamController.currentLevel;
- }
- /* set quality level immediately (-1 for automatic level selection) */
- ,
- set: function set(newLevel) {
- _logger.logger.log('set currentLevel:' + newLevel);
- this.loadLevel = newLevel;
- this.streamController.immediateLevelSwitch();
+ ID3TrackController.prototype.onMediaAttached = function onMediaAttached(data) {
+ this.media = data.media;
+ if (!this.media) {
+ return;
}
+ };
- /** Return next playback quality level (quality level of next fragment) **/
+ ID3TrackController.prototype.onMediaDetaching = function onMediaDetaching() {
+ this.media = undefined;
+ };
- }, {
- key: 'nextLevel',
- get: function get() {
- return this.streamController.nextLevel;
- }
+ ID3TrackController.prototype.onFragParsingMetadata = function onFragParsingMetadata(data) {
+ var fragment = data.frag;
+ var samples = data.samples;
- /* set quality level for next fragment (-1 for automatic level selection) */
- ,
- set: function set(newLevel) {
- _logger.logger.log('set nextLevel:' + newLevel);
- this.levelController.manualLevel = newLevel;
- this.streamController.nextLevelSwitch();
+ // create track dynamically
+ if (!this.id3Track) {
+ this.id3Track = this.media.addTextTrack('metadata', 'id3');
+ this.id3Track.mode = 'hidden';
}
- /** Return the quality level of current/last loaded fragment **/
+ // Attempt to recreate Safari functionality by creating
+ // WebKitDataCue objects when available and store the decoded
+ // ID3 data in the value property of the cue
+ var Cue = window.WebKitDataCue || window.VTTCue || window.TextTrackCue;
- }, {
- key: 'loadLevel',
- get: function get() {
- return this.levelController.level;
- }
+ for (var i = 0; i < samples.length; i++) {
+ var frames = id3["a" /* default */].getID3Frames(samples[i].data);
+ if (frames) {
+ var startTime = samples[i].pts;
+ var endTime = i < samples.length - 1 ? samples[i + 1].pts : fragment.endPTS;
- /* set quality level for current/next loaded fragment (-1 for automatic level selection) */
- ,
- set: function set(newLevel) {
- _logger.logger.log('set loadLevel:' + newLevel);
- this.levelController.manualLevel = newLevel;
- }
-
- /** Return the quality level of next loaded fragment **/
+ // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE
+ if (startTime === endTime) {
+ endTime += 0.0001;
+ }
- }, {
- key: 'nextLoadLevel',
- get: function get() {
- return this.levelController.nextLoadLevel;
+ for (var j = 0; j < frames.length; j++) {
+ var frame = frames[j];
+ // Safari doesn't put the timestamp frame in the TextTrack
+ if (!id3["a" /* default */].isTimeStampFrame(frame)) {
+ var cue = new Cue(startTime, endTime, '');
+ cue.value = frame;
+ this.id3Track.addCue(cue);
+ }
+ }
+ }
}
+ };
- /** set quality level of next loaded fragment **/
- ,
- set: function set(level) {
- this.levelController.nextLoadLevel = level;
- }
+ return ID3TrackController;
+}(event_handler);
- /** Return first level (index of first level referenced in manifest)
- **/
+/* harmony default export */ var id3_track_controller = (id3_track_controller_ID3TrackController);
+// CONCATENATED MODULE: ./src/helper/is-supported.js
- }, {
- key: 'firstLevel',
- get: function get() {
- return Math.max(this.levelController.firstLevel, this.minAutoLevel);
- }
- /** set first level (index of first level referenced in manifest)
- **/
- ,
- set: function set(newLevel) {
- _logger.logger.log('set firstLevel:' + newLevel);
- this.levelController.firstLevel = newLevel;
- }
+function is_supported_isSupported() {
+ var mediaSource = getMediaSource();
+ var sourceBuffer = window.SourceBuffer || window.WebKitSourceBuffer;
+ var isTypeSupported = mediaSource && typeof mediaSource.isTypeSupported === 'function' && mediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"');
- /** Return start level (level of first fragment that will be played back)
- if not overrided by user, first level appearing in manifest will be used as start level
- if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)
- **/
+ // if SourceBuffer is exposed ensure its API is valid
+ // safari and old version of Chrome doe not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible
+ var sourceBufferValidAPI = !sourceBuffer || sourceBuffer.prototype && typeof sourceBuffer.prototype.appendBuffer === 'function' && typeof sourceBuffer.prototype.remove === 'function';
+ return !!isTypeSupported && !!sourceBufferValidAPI;
+}
+// CONCATENATED MODULE: ./src/utils/ewma.js
+function ewma__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- }, {
- key: 'startLevel',
- get: function get() {
- return this.levelController.startLevel;
- }
+/*
+ * compute an Exponential Weighted moving average
+ * - https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average
+ * - heavily inspired from shaka-player
+ */
- /** set start level (level of first fragment that will be played back)
- if not overrided by user, first level appearing in manifest will be used as start level
- if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)
- **/
- ,
- set: function set(newLevel) {
- _logger.logger.log('set startLevel:' + newLevel);
- var hls = this;
- // if not in automatic start level detection, ensure startLevel is greater than minAutoLevel
- if (newLevel !== -1) {
- newLevel = Math.max(newLevel, hls.minAutoLevel);
- }
- hls.levelController.startLevel = newLevel;
- }
+var EWMA = function () {
- /** Return the capping/max level value that could be used by automatic level selection algorithm **/
+ // About half of the estimated value will be from the last |halfLife| samples by weight.
+ function EWMA(halfLife) {
+ ewma__classCallCheck(this, EWMA);
- }, {
- key: 'autoLevelCapping',
- get: function get() {
- return this._autoLevelCapping;
- }
+ // Larger values of alpha expire historical data more slowly.
+ this.alpha_ = halfLife ? Math.exp(Math.log(0.5) / halfLife) : 0;
+ this.estimate_ = 0;
+ this.totalWeight_ = 0;
+ }
- /** set the capping/max level value that could be used by automatic level selection algorithm **/
- ,
- set: function set(newLevel) {
- _logger.logger.log('set autoLevelCapping:' + newLevel);
- this._autoLevelCapping = newLevel;
- }
+ EWMA.prototype.sample = function sample(weight, value) {
+ var adjAlpha = Math.pow(this.alpha_, weight);
+ this.estimate_ = value * (1 - adjAlpha) + adjAlpha * this.estimate_;
+ this.totalWeight_ += weight;
+ };
- /* check if we are in automatic level selection mode */
+ EWMA.prototype.getTotalWeight = function getTotalWeight() {
+ return this.totalWeight_;
+ };
- }, {
- key: 'autoLevelEnabled',
- get: function get() {
- return this.levelController.manualLevel === -1;
+ EWMA.prototype.getEstimate = function getEstimate() {
+ if (this.alpha_) {
+ var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);
+ return this.estimate_ / zeroFactor;
+ } else {
+ return this.estimate_;
}
+ };
- /* return manual level */
+ return EWMA;
+}();
- }, {
- key: 'manualLevel',
- get: function get() {
- return this.levelController.manualLevel;
- }
+/* harmony default export */ var ewma = (EWMA);
+// CONCATENATED MODULE: ./src/utils/ewma-bandwidth-estimator.js
+function ewma_bandwidth_estimator__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /* return min level selectable in auto mode according to config.minAutoBitrate */
+/*
+ * EWMA Bandwidth Estimator
+ * - heavily inspired from shaka-player
+ * Tracks bandwidth samples and estimates available bandwidth.
+ * Based on the minimum of two exponentially-weighted moving averages with
+ * different half-lives.
+ */
- }, {
- key: 'minAutoLevel',
- get: function get() {
- var hls = this,
- levels = hls.levels,
- minAutoBitrate = hls.config.minAutoBitrate,
- len = levels ? levels.length : 0;
- for (var i = 0; i < len; i++) {
- var levelNextBitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate;
- if (levelNextBitrate > minAutoBitrate) {
- return i;
- }
- }
- return 0;
- }
- /* return max level selectable in auto mode according to autoLevelCapping */
- }, {
- key: 'maxAutoLevel',
- get: function get() {
- var hls = this;
- var levels = hls.levels;
- var autoLevelCapping = hls.autoLevelCapping;
- var maxAutoLevel = void 0;
- if (autoLevelCapping === -1 && levels && levels.length) {
- maxAutoLevel = levels.length - 1;
- } else {
- maxAutoLevel = autoLevelCapping;
- }
- return maxAutoLevel;
- }
+var ewma_bandwidth_estimator_EwmaBandWidthEstimator = function () {
+ function EwmaBandWidthEstimator(hls, slow, fast, defaultEstimate) {
+ ewma_bandwidth_estimator__classCallCheck(this, EwmaBandWidthEstimator);
- // return next auto level
+ this.hls = hls;
+ this.defaultEstimate_ = defaultEstimate;
+ this.minWeight_ = 0.001;
+ this.minDelayMs_ = 50;
+ this.slow_ = new ewma(slow);
+ this.fast_ = new ewma(fast);
+ }
- }, {
- key: 'nextAutoLevel',
- get: function get() {
- var hls = this;
- // ensure next auto level is between min and max auto level
- return Math.min(Math.max(hls.abrController.nextAutoLevel, hls.minAutoLevel), hls.maxAutoLevel);
- }
+ EwmaBandWidthEstimator.prototype.sample = function sample(durationMs, numBytes) {
+ durationMs = Math.max(durationMs, this.minDelayMs_);
+ var bandwidth = 8000 * numBytes / durationMs,
- // this setter is used to force next auto level
- // this is useful to force a switch down in auto mode : in case of load error on level N, hls.js can set nextAutoLevel to N-1 for example)
- // forced value is valid for one fragment. upon succesful frag loading at forced level, this value will be resetted to -1 by ABR controller
- ,
- set: function set(nextLevel) {
- var hls = this;
- hls.abrController.nextAutoLevel = Math.max(hls.minAutoLevel, nextLevel);
- }
+ //console.log('instant bw:'+ Math.round(bandwidth));
+ // we weight sample using loading duration....
+ weight = durationMs / 1000;
+ this.fast_.sample(weight, bandwidth);
+ this.slow_.sample(weight, bandwidth);
+ };
- /** get alternate audio tracks list from playlist **/
+ EwmaBandWidthEstimator.prototype.canEstimate = function canEstimate() {
+ var fast = this.fast_;
+ return fast && fast.getTotalWeight() >= this.minWeight_;
+ };
- }, {
- key: 'audioTracks',
- get: function get() {
- var audioTrackController = this.audioTrackController;
- return audioTrackController ? audioTrackController.audioTracks : [];
+ EwmaBandWidthEstimator.prototype.getEstimate = function getEstimate() {
+ if (this.canEstimate()) {
+ //console.log('slow estimate:'+ Math.round(this.slow_.getEstimate()));
+ //console.log('fast estimate:'+ Math.round(this.fast_.getEstimate()));
+ // Take the minimum of these two estimates. This should have the effect of
+ // adapting down quickly, but up more slowly.
+ return Math.min(this.fast_.getEstimate(), this.slow_.getEstimate());
+ } else {
+ return this.defaultEstimate_;
}
+ };
- /** get index of the selected audio track (index in audio track lists) **/
-
- }, {
- key: 'audioTrack',
- get: function get() {
- var audioTrackController = this.audioTrackController;
- return audioTrackController ? audioTrackController.audioTrack : -1;
- }
+ EwmaBandWidthEstimator.prototype.destroy = function destroy() {};
- /** select an audio track, based on its index in audio track lists**/
- ,
- set: function set(audioTrackId) {
- var audioTrackController = this.audioTrackController;
- if (audioTrackController) {
- audioTrackController.audioTrack = audioTrackId;
- }
- }
- }, {
- key: 'liveSyncPosition',
- get: function get() {
- return this.streamController.liveSyncPosition;
- }
+ return EwmaBandWidthEstimator;
+}();
- /** get alternate subtitle tracks list from playlist **/
+/* harmony default export */ var ewma_bandwidth_estimator = (ewma_bandwidth_estimator_EwmaBandWidthEstimator);
+// CONCATENATED MODULE: ./src/controller/abr-controller.js
+var abr_controller__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- }, {
- key: 'subtitleTracks',
- get: function get() {
- var subtitleTrackController = this.subtitleTrackController;
- return subtitleTrackController ? subtitleTrackController.subtitleTracks : [];
- }
+function abr_controller__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /** get index of the selected subtitle track (index in subtitle track lists) **/
+function abr_controller__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
- }, {
- key: 'subtitleTrack',
- get: function get() {
- var subtitleTrackController = this.subtitleTrackController;
- return subtitleTrackController ? subtitleTrackController.subtitleTrack : -1;
- }
+function abr_controller__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
- /** select an subtitle track, based on its index in subtitle track lists**/
- ,
- set: function set(subtitleTrackId) {
- var subtitleTrackController = this.subtitleTrackController;
- if (subtitleTrackController) {
- subtitleTrackController.subtitleTrack = subtitleTrackId;
- }
- }
- }]);
+/*
+ * simple ABR Controller
+ * - compute next level based on last fragment bw heuristics
+ * - implement an abandon rules triggered if we have less than 2 frag buffered and if computed bw shows that we risk buffer stalling
+ */
- return Hls;
-}();
-exports.default = Hls;
-},{"1":1,"11":11,"12":12,"13":13,"2":2,"33":33,"35":35,"4":4,"41":41,"42":42,"43":43,"53":53}],40:[function(_dereq_,module,exports){
-'use strict';
-// This is mostly for support of the es6 module export
-// syntax with the babel compiler, it looks like it doesnt support
-// function exports like we are used to in node/commonjs
-module.exports = _dereq_(39).default;
-},{"39":39}],41:[function(_dereq_,module,exports){
-'use strict';
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-var _events = _dereq_(35);
+var abr_controller_AbrController = function (_EventHandler) {
+ abr_controller__inherits(AbrController, _EventHandler);
-var _events2 = _interopRequireDefault(_events);
+ function AbrController(hls) {
+ abr_controller__classCallCheck(this, AbrController);
-var _eventHandler = _dereq_(34);
+ var _this = abr_controller__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].FRAG_LOADING, events["a" /* default */].FRAG_LOADED, events["a" /* default */].FRAG_BUFFERED, events["a" /* default */].ERROR));
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
+ _this.lastLoadedFragLevel = 0;
+ _this._nextAutoLevel = -1;
+ _this.hls = hls;
+ _this.timer = null;
+ _this._bwEstimator = null;
+ _this.onCheck = _this._abandonRulesCheck.bind(_this);
+ return _this;
+ }
-var _errors = _dereq_(33);
+ AbrController.prototype.destroy = function destroy() {
+ this.clearTimer();
+ event_handler.prototype.destroy.call(this);
+ };
-var _logger = _dereq_(53);
+ AbrController.prototype.onFragLoading = function onFragLoading(data) {
+ var frag = data.frag;
+ if (frag.type === 'main') {
+ if (!this.timer) {
+ this.timer = setInterval(this.onCheck, 100);
+ }
+ // lazy init of bw Estimator, rationale is that we use different params for Live/VoD
+ // so we need to wait for stream manifest / playlist type to instantiate it.
+ if (!this._bwEstimator) {
+ var hls = this.hls,
+ level = data.frag.level,
+ isLive = hls.levels[level].details.live,
+ config = hls.config,
+ ewmaFast = void 0,
+ ewmaSlow = void 0;
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ if (isLive) {
+ ewmaFast = config.abrEwmaFastLive;
+ ewmaSlow = config.abrEwmaSlowLive;
+ } else {
+ ewmaFast = config.abrEwmaFastVoD;
+ ewmaSlow = config.abrEwmaSlowVoD;
+ }
+ this._bwEstimator = new ewma_bandwidth_estimator(hls, ewmaSlow, ewmaFast, config.abrEwmaDefaultEstimate);
+ }
+ this.fragCurrent = frag;
+ }
+ };
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ AbrController.prototype._abandonRulesCheck = function _abandonRulesCheck() {
+ /*
+ monitor fragment retrieval time...
+ we compute expected time of arrival of the complete fragment.
+ we compare it to expected time of buffer starvation
+ */
+ var hls = this.hls,
+ v = hls.media,
+ frag = this.fragCurrent,
+ loader = frag.loader,
+ minAutoLevel = hls.minAutoLevel;
+
+ // if loader has been destroyed or loading has been aborted, stop timer and return
+ if (!loader || loader.stats && loader.stats.aborted) {
+ logger["b" /* logger */].warn('frag loader destroy or aborted, disarm abandonRules');
+ this.clearTimer();
+ // reset forced auto level value so that next level will be selected
+ this._nextAutoLevel = -1;
+ return;
+ }
+ var stats = loader.stats;
+ /* only monitor frag retrieval time if
+ (video not paused OR first fragment being loaded(ready state === HAVE_NOTHING = 0)) AND autoswitching enabled AND not lowest level (=> means that we have several levels) */
+ if (v && stats && (!v.paused && v.playbackRate !== 0 || !v.readyState) && frag.autoLevel && frag.level) {
+ var requestDelay = performance.now() - stats.trequest,
+ playbackRate = Math.abs(v.playbackRate);
+ // monitor fragment load progress after half of expected fragment duration,to stabilize bitrate
+ if (requestDelay > 500 * frag.duration / playbackRate) {
+ var levels = hls.levels,
+ loadRate = Math.max(1, stats.bw ? stats.bw / 8 : stats.loaded * 1000 / requestDelay),
+ // byte/s; at least 1 byte/s to avoid division by zero
+ // compute expected fragment length using frag duration and level bitrate. also ensure that expected len is gte than already loaded size
+ level = levels[frag.level],
+ levelBitrate = level.realBitrate ? Math.max(level.realBitrate, level.bitrate) : level.bitrate,
+ expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levelBitrate / 8)),
+ pos = v.currentTime,
+ fragLoadedDelay = (expectedLen - stats.loaded) / loadRate,
+ bufferStarvationDelay = (buffer_helper.bufferInfo(v, pos, hls.config.maxBufferHole).end - pos) / playbackRate;
+ // consider emergency switch down only if we have less than 2 frag buffered AND
+ // time to finish loading current fragment is bigger than buffer starvation delay
+ // ie if we risk buffer starvation if bw does not increase quickly
+ if (bufferStarvationDelay < 2 * frag.duration / playbackRate && fragLoadedDelay > bufferStarvationDelay) {
+ var fragLevelNextLoadedDelay = void 0,
+ nextLoadLevel = void 0;
+ // lets iterate through lower level and try to find the biggest one that could avoid rebuffering
+ // we start from current level - 1 and we step down , until we find a matching level
+ for (nextLoadLevel = frag.level - 1; nextLoadLevel > minAutoLevel; nextLoadLevel--) {
+ // compute time to load next fragment at lower level
+ // 0.8 : consider only 80% of current bw to be conservative
+ // 8 = bits per byte (bps/Bps)
+ var levelNextBitrate = levels[nextLoadLevel].realBitrate ? Math.max(levels[nextLoadLevel].realBitrate, levels[nextLoadLevel].bitrate) : levels[nextLoadLevel].bitrate;
+ fragLevelNextLoadedDelay = frag.duration * levelNextBitrate / (8 * 0.8 * loadRate);
+ if (fragLevelNextLoadedDelay < bufferStarvationDelay) {
+ // we found a lower level that be rebuffering free with current estimated bw !
+ break;
+ }
+ }
+ // only emergency switch down if it takes less time to load new fragment at lowest level instead
+ // of finishing loading current one ...
+ if (fragLevelNextLoadedDelay < fragLoadedDelay) {
+ logger["b" /* logger */].warn('loading too slow, abort fragment loading and switch to level ' + nextLoadLevel + ':fragLoadedDelay[' + nextLoadLevel + ']<fragLoadedDelay[' + (frag.level - 1) + '];bufferStarvationDelay:' + fragLevelNextLoadedDelay.toFixed(1) + '<' + fragLoadedDelay.toFixed(1) + ':' + bufferStarvationDelay.toFixed(1));
+ // force next load level in auto mode
+ hls.nextLoadLevel = nextLoadLevel;
+ // update bw estimate for this fragment before cancelling load (this will help reducing the bw)
+ this._bwEstimator.sample(requestDelay, stats.loaded);
+ //abort fragment loading
+ loader.abort();
+ // stop abandon rules timer
+ this.clearTimer();
+ hls.trigger(events["a" /* default */].FRAG_LOAD_EMERGENCY_ABORTED, { frag: frag, stats: stats });
+ }
+ }
+ }
+ }
+ };
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+ AbrController.prototype.onFragLoaded = function onFragLoaded(data) {
+ var frag = data.frag;
+ if (frag.type === 'main' && !isNaN(frag.sn)) {
+ // stop monitoring bw once frag loaded
+ this.clearTimer();
+ // store level id after successful fragment load
+ this.lastLoadedFragLevel = frag.level;
+ // reset forced auto level value so that next level will be selected
+ this._nextAutoLevel = -1;
+
+ // compute level average bitrate
+ if (this.hls.config.abrMaxWithRealBitrate) {
+ var level = this.hls.levels[frag.level];
+ var loadedBytes = (level.loaded ? level.loaded.bytes : 0) + data.stats.loaded;
+ var loadedDuration = (level.loaded ? level.loaded.duration : 0) + data.frag.duration;
+ level.loaded = { bytes: loadedBytes, duration: loadedDuration };
+ level.realBitrate = Math.round(8 * loadedBytes / loadedDuration);
+ }
+ // if fragment has been loaded to perform a bitrate test,
+ if (data.frag.bitrateTest) {
+ var stats = data.stats;
+ stats.tparsed = stats.tbuffered = stats.tload;
+ this.onFragBuffered(data);
+ }
+ }
+ };
+
+ AbrController.prototype.onFragBuffered = function onFragBuffered(data) {
+ var stats = data.stats,
+ frag = data.frag;
+ // only update stats on first frag buffering
+ // if same frag is loaded multiple times, it might be in browser cache, and loaded quickly
+ // and leading to wrong bw estimation
+ // on bitrate test, also only update stats once (if tload = tbuffered == on FRAG_LOADED)
+ if (stats.aborted !== true && frag.loadCounter === 1 && frag.type === 'main' && !isNaN(frag.sn) && (!frag.bitrateTest || stats.tload === stats.tbuffered)) {
+ // use tparsed-trequest instead of tbuffered-trequest to compute fragLoadingProcessing; rationale is that buffer appending only happens once media is attached
+ // in case we use config.startFragPrefetch while media is not attached yet, fragment might be parsed while media not attached yet, but it will only be buffered on media attached
+ // as a consequence it could happen really late in the process. meaning that appending duration might appears huge ... leading to underestimated throughput estimation
+ var fragLoadingProcessingMs = stats.tparsed - stats.trequest;
+ logger["b" /* logger */].log('latency/loading/parsing/append/kbps:' + Math.round(stats.tfirst - stats.trequest) + '/' + Math.round(stats.tload - stats.tfirst) + '/' + Math.round(stats.tparsed - stats.tload) + '/' + Math.round(stats.tbuffered - stats.tparsed) + '/' + Math.round(8 * stats.loaded / (stats.tbuffered - stats.trequest)));
+ this._bwEstimator.sample(fragLoadingProcessingMs, stats.loaded);
+ stats.bwEstimate = this._bwEstimator.getEstimate();
+ // if fragment has been loaded to perform a bitrate test, (hls.startLevel = -1), store bitrate test delay duration
+ if (frag.bitrateTest) {
+ this.bitrateTestDelay = fragLoadingProcessingMs / 1000;
+ } else {
+ this.bitrateTestDelay = 0;
+ }
+ }
+ };
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * Fragment Loader
- */
+ AbrController.prototype.onError = function onError(data) {
+ // stop timer in case of frag loading error
+ switch (data.details) {
+ case errors["a" /* ErrorDetails */].FRAG_LOAD_ERROR:
+ case errors["a" /* ErrorDetails */].FRAG_LOAD_TIMEOUT:
+ this.clearTimer();
+ break;
+ default:
+ break;
+ }
+ };
-var FragmentLoader = function (_EventHandler) {
- _inherits(FragmentLoader, _EventHandler);
+ AbrController.prototype.clearTimer = function clearTimer() {
+ clearInterval(this.timer);
+ this.timer = null;
+ };
- function FragmentLoader(hls) {
- _classCallCheck(this, FragmentLoader);
+ // return next auto level
- var _this = _possibleConstructorReturn(this, (FragmentLoader.__proto__ || Object.getPrototypeOf(FragmentLoader)).call(this, hls, _events2.default.FRAG_LOADING));
- _this.loaders = {};
- return _this;
- }
+ AbrController.prototype._findBestLevel = function _findBestLevel(currentLevel, currentFragDuration, currentBw, minAutoLevel, maxAutoLevel, maxFetchDuration, bwFactor, bwUpFactor, levels) {
+ for (var i = maxAutoLevel; i >= minAutoLevel; i--) {
+ var levelInfo = levels[i],
+ levelDetails = levelInfo.details,
+ avgDuration = levelDetails ? levelDetails.totalduration / levelDetails.fragments.length : currentFragDuration,
+ live = levelDetails ? levelDetails.live : false,
+ adjustedbw = void 0;
+ // follow algorithm captured from stagefright :
+ // https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp
+ // Pick the highest bandwidth stream below or equal to estimated bandwidth.
+ // consider only 80% of the available bandwidth, but if we are switching up,
+ // be even more conservative (70%) to avoid overestimating and immediately
+ // switching back.
+ if (i <= currentLevel) {
+ adjustedbw = bwFactor * currentBw;
+ } else {
+ adjustedbw = bwUpFactor * currentBw;
+ }
+ var bitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate,
+ fetchDuration = bitrate * avgDuration / adjustedbw;
- _createClass(FragmentLoader, [{
- key: 'destroy',
- value: function destroy() {
- var loaders = this.loaders;
- for (var loaderName in loaders) {
- var loader = loaders[loaderName];
- if (loader) {
- loader.destroy();
- }
+ logger["b" /* logger */].trace('level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: ' + i + '/' + Math.round(adjustedbw) + '/' + bitrate + '/' + avgDuration + '/' + maxFetchDuration + '/' + fetchDuration);
+ // if adjusted bw is greater than level bitrate AND
+ if (adjustedbw > bitrate && (
+ // fragment fetchDuration unknown OR live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches
+ // we don't account for max Fetch Duration for live streams, this is to avoid switching down when near the edge of live sliding window ...
+ // special case to support startLevel = -1 (bitrateTest) on live streams : in that case we should not exit loop so that _findBestLevel will return -1
+ !fetchDuration || live && !this.bitrateTestDelay || fetchDuration < maxFetchDuration)) {
+ // as we are looping from highest to lowest, this will return the best achievable quality level
+ return i;
}
- this.loaders = {};
- _eventHandler2.default.prototype.destroy.call(this);
}
- }, {
- key: 'onFragLoading',
- value: function onFragLoading(data) {
- var frag = data.frag,
- type = frag.type,
- loader = this.loaders[type],
- config = this.hls.config;
-
- frag.loaded = 0;
- if (loader) {
- _logger.logger.warn('abort previous fragment loader for type:' + type);
- loader.abort();
- }
- loader = this.loaders[type] = frag.loader = typeof config.fLoader !== 'undefined' ? new config.fLoader(config) : new config.loader(config);
+ // not enough time budget even with quality level 0 ... rebuffering might happen
+ return -1;
+ };
- var loaderContext = void 0,
- loaderConfig = void 0,
- loaderCallbacks = void 0;
- loaderContext = { url: frag.url, frag: frag, responseType: 'arraybuffer', progressData: false };
- var start = frag.byteRangeStartOffset,
- end = frag.byteRangeEndOffset;
- if (!isNaN(start) && !isNaN(end)) {
- loaderContext.rangeStart = start;
- loaderContext.rangeEnd = end;
+ abr_controller__createClass(AbrController, [{
+ key: 'nextAutoLevel',
+ get: function get() {
+ var forcedAutoLevel = this._nextAutoLevel;
+ var bwEstimator = this._bwEstimator;
+ // in case next auto level has been forced, and bw not available or not reliable, return forced value
+ if (forcedAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {
+ return forcedAutoLevel;
}
- loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: 0, retryDelay: 0, maxRetryDelay: config.fragLoadingMaxRetryTimeout };
- loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this), onProgress: this.loadprogress.bind(this) };
- loader.load(loaderContext, loaderConfig, loaderCallbacks);
- }
- }, {
- key: 'loadsuccess',
- value: function loadsuccess(response, stats, context) {
- var payload = response.data,
- frag = context.frag;
- // detach fragment loader on load success
- frag.loader = undefined;
- this.loaders[frag.type] = undefined;
- this.hls.trigger(_events2.default.FRAG_LOADED, { payload: payload, frag: frag, stats: stats });
- }
- }, {
- key: 'loaderror',
- value: function loaderror(response, context) {
- var loader = context.loader;
- if (loader) {
- loader.abort();
+ // compute next level using ABR logic
+ var nextABRAutoLevel = this._nextABRAutoLevel;
+ // if forced auto level has been defined, use it to cap ABR computed quality level
+ if (forcedAutoLevel !== -1) {
+ nextABRAutoLevel = Math.min(forcedAutoLevel, nextABRAutoLevel);
}
- this.loaders[context.type] = undefined;
- this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response });
+ return nextABRAutoLevel;
+ },
+ set: function set(nextLevel) {
+ this._nextAutoLevel = nextLevel;
}
}, {
- key: 'loadtimeout',
- value: function loadtimeout(stats, context) {
- var loader = context.loader;
- if (loader) {
- loader.abort();
- }
- this.loaders[context.type] = undefined;
- this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag });
- }
+ key: '_nextABRAutoLevel',
+ get: function get() {
+ var hls = this.hls,
+ maxAutoLevel = hls.maxAutoLevel,
+ levels = hls.levels,
+ config = hls.config,
+ minAutoLevel = hls.minAutoLevel;
+ var v = hls.media,
+ currentLevel = this.lastLoadedFragLevel,
+ currentFragDuration = this.fragCurrent ? this.fragCurrent.duration : 0,
+ pos = v ? v.currentTime : 0,
- // data will be used for progressive parsing
+ // playbackRate is the absolute value of the playback rate; if v.playbackRate is 0, we use 1 to load as
+ // if we're playing back at the normal rate.
+ playbackRate = v && v.playbackRate !== 0 ? Math.abs(v.playbackRate) : 1.0,
+ avgbw = this._bwEstimator ? this._bwEstimator.getEstimate() : config.abrEwmaDefaultEstimate,
- }, {
- key: 'loadprogress',
- value: function loadprogress(stats, context, data) {
- // jshint ignore:line
- var frag = context.frag;
- frag.loaded = stats.loaded;
- this.hls.trigger(_events2.default.FRAG_LOAD_PROGRESS, { frag: frag, stats: stats });
+ // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.
+ bufferStarvationDelay = (buffer_helper.bufferInfo(v, pos, config.maxBufferHole).end - pos) / playbackRate;
+
+ // First, look to see if we can find a level matching with our avg bandwidth AND that could also guarantee no rebuffering at all
+ var bestLevel = this._findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay, config.abrBandWidthFactor, config.abrBandWidthUpFactor, levels);
+ if (bestLevel >= 0) {
+ return bestLevel;
+ } else {
+ logger["b" /* logger */].trace('rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering');
+ // not possible to get rid of rebuffering ... let's try to find level that will guarantee less than maxStarvationDelay of rebuffering
+ // if no matching level found, logic will return 0
+ var maxStarvationDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxStarvationDelay) : config.maxStarvationDelay,
+ bwFactor = config.abrBandWidthFactor,
+ bwUpFactor = config.abrBandWidthUpFactor;
+ if (bufferStarvationDelay === 0) {
+ // in case buffer is empty, let's check if previous fragment was loaded to perform a bitrate test
+ var bitrateTestDelay = this.bitrateTestDelay;
+ if (bitrateTestDelay) {
+ // if it is the case, then we need to adjust our max starvation delay using maxLoadingDelay config value
+ // max video loading delay used in automatic start level selection :
+ // in that mode ABR controller will ensure that video loading time (ie the time to fetch the first fragment at lowest quality level +
+ // the time to fetch the fragment at the appropriate quality level is less than ```maxLoadingDelay``` )
+ // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration
+ var maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxLoadingDelay) : config.maxLoadingDelay;
+ maxStarvationDelay = maxLoadingDelay - bitrateTestDelay;
+ logger["b" /* logger */].trace('bitrate test took ' + Math.round(1000 * bitrateTestDelay) + 'ms, set first fragment max fetchDuration to ' + Math.round(1000 * maxStarvationDelay) + ' ms');
+ // don't use conservative factor on bitrate test
+ bwFactor = bwUpFactor = 1;
+ }
+ }
+ bestLevel = this._findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay + maxStarvationDelay, bwFactor, bwUpFactor, levels);
+ return Math.max(bestLevel, 0);
+ }
}
}]);
- return FragmentLoader;
-}(_eventHandler2.default);
+ return AbrController;
+}(event_handler);
-exports.default = FragmentLoader;
+/* harmony default export */ var abr_controller = (abr_controller_AbrController);
+// CONCATENATED MODULE: ./src/controller/buffer-controller.js
+function buffer_controller__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-},{"33":33,"34":34,"35":35,"53":53}],42:[function(_dereq_,module,exports){
-'use strict';
+function buffer_controller__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+function buffer_controller__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-var _events = _dereq_(35);
-
-var _events2 = _interopRequireDefault(_events);
+/*
+ * Buffer Controller
+*/
-var _eventHandler = _dereq_(34);
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
-var _errors = _dereq_(33);
-var _logger = _dereq_(53);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+var buffer_controller_MediaSource = getMediaSource();
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
- * Decrypt key Loader
- */
+var buffer_controller_BufferController = function (_EventHandler) {
+ buffer_controller__inherits(BufferController, _EventHandler);
-var KeyLoader = function (_EventHandler) {
- _inherits(KeyLoader, _EventHandler);
+ function BufferController(hls) {
+ buffer_controller__classCallCheck(this, BufferController);
- function KeyLoader(hls) {
- _classCallCheck(this, KeyLoader);
+ // the value that we have set mediasource.duration to
+ // (the actual duration may be tweaked slighly by the browser)
+ var _this = buffer_controller__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].MEDIA_ATTACHING, events["a" /* default */].MEDIA_DETACHING, events["a" /* default */].MANIFEST_PARSED, events["a" /* default */].BUFFER_RESET, events["a" /* default */].BUFFER_APPENDING, events["a" /* default */].BUFFER_CODECS, events["a" /* default */].BUFFER_EOS, events["a" /* default */].BUFFER_FLUSHING, events["a" /* default */].LEVEL_PTS_UPDATED, events["a" /* default */].LEVEL_UPDATED));
- var _this = _possibleConstructorReturn(this, (KeyLoader.__proto__ || Object.getPrototypeOf(KeyLoader)).call(this, hls, _events2.default.KEY_LOADING));
+ _this._msDuration = null;
+ // the value that we want to set mediaSource.duration to
+ _this._levelDuration = null;
+ // current stream state: true - for live broadcast, false - for VoD content
+ _this._live = null;
+ // cache the self generated object url to detect hijack of video tag
+ _this._objectUrl = null;
- _this.loaders = {};
- _this.decryptkey = null;
- _this.decrypturl = null;
+ // Source Buffer listeners
+ _this.onsbue = _this.onSBUpdateEnd.bind(_this);
+ _this.onsbe = _this.onSBUpdateError.bind(_this);
+ _this.pendingTracks = {};
+ _this.tracks = {};
return _this;
}
- _createClass(KeyLoader, [{
- key: 'destroy',
- value: function destroy() {
- for (var loaderName in this.loaders) {
- var loader = this.loaders[loaderName];
- if (loader) {
- loader.destroy();
- }
- }
- this.loaders = {};
- _eventHandler2.default.prototype.destroy.call(this);
- }
- }, {
- key: 'onKeyLoading',
- value: function onKeyLoading(data) {
- var frag = data.frag,
- type = frag.type,
- loader = this.loaders[type],
- decryptdata = frag.decryptdata,
- uri = decryptdata.uri;
- // if uri is different from previous one or if decrypt key not retrieved yet
- if (uri !== this.decrypturl || this.decryptkey === null) {
- var config = this.hls.config;
-
- if (loader) {
- _logger.logger.warn('abort previous key loader for type:' + type);
- loader.abort();
- }
- frag.loader = this.loaders[type] = new config.loader(config);
- this.decrypturl = uri;
- this.decryptkey = null;
-
- var loaderContext = void 0,
- loaderConfig = void 0,
- loaderCallbacks = void 0;
- loaderContext = { url: uri, frag: frag, responseType: 'arraybuffer' };
- loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: config.fragLoadingMaxRetry, retryDelay: config.fragLoadingRetryDelay, maxRetryDelay: config.fragLoadingMaxRetryTimeout };
- loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };
- frag.loader.load(loaderContext, loaderConfig, loaderCallbacks);
- } else if (this.decryptkey) {
- // we already loaded this key, return it
- decryptdata.key = this.decryptkey;
- this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });
- }
- }
- }, {
- key: 'loadsuccess',
- value: function loadsuccess(response, stats, context) {
- var frag = context.frag;
- this.decryptkey = frag.decryptdata.key = new Uint8Array(response.data);
- // detach fragment loader on load success
- frag.loader = undefined;
- this.loaders[frag.type] = undefined;
- this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });
- }
- }, {
- key: 'loaderror',
- value: function loaderror(response, context) {
- var frag = context.frag,
- loader = frag.loader;
- if (loader) {
- loader.abort();
- }
- this.loaders[context.type] = undefined;
- this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_ERROR, fatal: false, frag: frag, response: response });
- }
- }, {
- key: 'loadtimeout',
- value: function loadtimeout(stats, context) {
- var frag = context.frag,
- loader = frag.loader;
- if (loader) {
- loader.abort();
- }
- this.loaders[context.type] = undefined;
- this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_TIMEOUT, fatal: false, frag: frag });
- }
- }]);
+ BufferController.prototype.destroy = function destroy() {
+ event_handler.prototype.destroy.call(this);
+ };
- return KeyLoader;
-}(_eventHandler2.default);
+ BufferController.prototype.onLevelPtsUpdated = function onLevelPtsUpdated(data) {
+ var type = data.type;
+ var audioTrack = this.tracks.audio;
-exports.default = KeyLoader;
+ // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)
+ // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`
+ // is greater than 100ms (this is enough to handle seek for VOD or level change for LIVE videos). At the time of change we issue
+ // `SourceBuffer.abort()` and adjusting `SourceBuffer.timestampOffset` if `SourceBuffer.updating` is false or awaiting `updateend`
+ // event if SB is in updating state.
+ // More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486
-},{"33":33,"34":34,"35":35,"53":53}],43:[function(_dereq_,module,exports){
-'use strict';
+ if (type === 'audio' && audioTrack && audioTrack.container === 'audio/mpeg') {
+ // Chrome audio mp3 track
+ var audioBuffer = this.sourceBuffer.audio;
+ var delta = Math.abs(audioBuffer.timestampOffset - data.start);
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ // adjust timestamp offset if time delta is greater than 100ms
+ if (delta > 0.1) {
+ var updating = audioBuffer.updating;
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
- * Playlist Loader
- */
+ try {
+ audioBuffer.abort();
+ } catch (err) {
+ updating = true;
+ logger["b" /* logger */].warn('can not abort audio buffer: ' + err);
+ }
-var _urlToolkit = _dereq_(2);
+ if (!updating) {
+ logger["b" /* logger */].warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + data.start);
+ audioBuffer.timestampOffset = data.start;
+ } else {
+ this.audioTimestampOffset = data.start;
+ }
+ }
+ }
+ };
-var _urlToolkit2 = _interopRequireDefault(_urlToolkit);
+ BufferController.prototype.onManifestParsed = function onManifestParsed(data) {
+ var audioExpected = data.audio,
+ videoExpected = data.video || data.levels.length && data.audio,
+ sourceBufferNb = 0;
+ // in case of alt audio 2 BUFFER_CODECS events will be triggered, one per stream controller
+ // sourcebuffers will be created all at once when the expected nb of tracks will be reached
+ // in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller
+ // it will contain the expected nb of source buffers, no need to compute it
+ if (data.altAudio && (audioExpected || videoExpected)) {
+ sourceBufferNb = (audioExpected ? 1 : 0) + (videoExpected ? 1 : 0);
+ logger["b" /* logger */].log(sourceBufferNb + ' sourceBuffer(s) expected');
+ }
+ this.sourceBufferNb = sourceBufferNb;
+ };
-var _events = _dereq_(35);
+ BufferController.prototype.onMediaAttaching = function onMediaAttaching(data) {
+ var media = this.media = data.media;
+ if (media) {
+ // setup the media source
+ var ms = this.mediaSource = new buffer_controller_MediaSource();
+ //Media Source listeners
+ this.onmso = this.onMediaSourceOpen.bind(this);
+ this.onmse = this.onMediaSourceEnded.bind(this);
+ this.onmsc = this.onMediaSourceClose.bind(this);
+ ms.addEventListener('sourceopen', this.onmso);
+ ms.addEventListener('sourceended', this.onmse);
+ ms.addEventListener('sourceclose', this.onmsc);
+ // link video and media Source
+ media.src = URL.createObjectURL(ms);
+ // cache the locally generated object url
+ this._objectUrl = media.src;
+ }
+ };
+
+ BufferController.prototype.onMediaDetaching = function onMediaDetaching() {
+ logger["b" /* logger */].log('media source detaching');
+ var ms = this.mediaSource;
+ if (ms) {
+ if (ms.readyState === 'open') {
+ try {
+ // endOfStream could trigger exception if any sourcebuffer is in updating state
+ // we don't really care about checking sourcebuffer state here,
+ // as we are anyway detaching the MediaSource
+ // let's just avoid this exception to propagate
+ ms.endOfStream();
+ } catch (err) {
+ logger["b" /* logger */].warn('onMediaDetaching:' + err.message + ' while calling endOfStream');
+ }
+ }
+ ms.removeEventListener('sourceopen', this.onmso);
+ ms.removeEventListener('sourceended', this.onmse);
+ ms.removeEventListener('sourceclose', this.onmsc);
-var _events2 = _interopRequireDefault(_events);
+ // Detach properly the MediaSource from the HTMLMediaElement as
+ // suggested in https://github.com/w3c/media-source/issues/53.
+ if (this.media) {
+ URL.revokeObjectURL(this._objectUrl);
-var _eventHandler = _dereq_(34);
+ // clean up video tag src only if it's our own url. some external libraries might
+ // hijack the video tag and change its 'src' without destroying the Hls instance first
+ if (this.media.src === this._objectUrl) {
+ this.media.removeAttribute('src');
+ this.media.load();
+ } else {
+ logger["b" /* logger */].warn('media.src was changed by a third party - skip cleanup');
+ }
+ }
-var _eventHandler2 = _interopRequireDefault(_eventHandler);
+ 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(events["a" /* default */].MEDIA_DETACHED);
+ };
-var _errors = _dereq_(33);
+ BufferController.prototype.onMediaSourceOpen = function onMediaSourceOpen() {
+ logger["b" /* logger */].log('media source opened');
+ this.hls.trigger(events["a" /* default */].MEDIA_ATTACHED, { media: this.media });
+ var mediaSource = this.mediaSource;
+ if (mediaSource) {
+ // once received, don't listen anymore to sourceopen event
+ mediaSource.removeEventListener('sourceopen', this.onmso);
+ }
+ this.checkPendingTracks();
+ };
-var _attrList = _dereq_(47);
+ BufferController.prototype.checkPendingTracks = function checkPendingTracks() {
+ // if any buffer codecs pending, check if we have enough to create sourceBuffers
+ var pendingTracks = this.pendingTracks,
+ pendingTracksNb = Object.keys(pendingTracks).length;
+ // if any pending tracks and (if nb of pending tracks gt or equal than expected nb or if unknown expected nb)
+ if (pendingTracksNb && (this.sourceBufferNb <= pendingTracksNb || this.sourceBufferNb === 0)) {
+ // ok, let's create them now !
+ this.createSourceBuffers(pendingTracks);
+ this.pendingTracks = {};
+ // append any pending segments now !
+ this.doAppending();
+ }
+ };
-var _attrList2 = _interopRequireDefault(_attrList);
+ BufferController.prototype.onMediaSourceClose = function onMediaSourceClose() {
+ logger["b" /* logger */].log('media source closed');
+ };
-var _logger = _dereq_(53);
+ BufferController.prototype.onMediaSourceEnded = function onMediaSourceEnded() {
+ logger["b" /* logger */].log('media source ended');
+ };
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ BufferController.prototype.onSBUpdateEnd = function onSBUpdateEnd() {
+ // update timestampOffset
+ if (this.audioTimestampOffset) {
+ var audioBuffer = this.sourceBuffer.audio;
+ logger["b" /* logger */].warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + this.audioTimestampOffset);
+ audioBuffer.timestampOffset = this.audioTimestampOffset;
+ delete this.audioTimestampOffset;
+ }
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+ if (this._needsFlush) {
+ this.doFlush();
+ }
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+ if (this._needsEos) {
+ this.checkEos();
+ }
+ this.appending = false;
+ var parent = this.parent;
+ // count nb of pending segments waiting for appending on this sourcebuffer
+ var pending = this.segments.reduce(function (counter, segment) {
+ return segment.parent === parent ? counter + 1 : counter;
+ }, 0);
+ this.hls.trigger(events["a" /* default */].BUFFER_APPENDED, { parent: parent, pending: pending });
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ // don't append in flushing mode
+ if (!this._needsFlush) {
+ this.doAppending();
+ }
-// https://regex101.com is your friend
-var MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g;
-var MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;
-var LEVEL_PLAYLIST_REGEX_FAST = /#EXTINF:(\d*(?:\.\d+)?)(?:,(.*))?|(?!#)(\S.+)|#EXT-X-BYTERANGE: *(.+)|#EXT-X-PROGRAM-DATE-TIME:(.+)|#.*/g;
-var LEVEL_PLAYLIST_REGEX_SLOW = /(?:(?:#(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?/;
+ this.updateMediaElementDuration();
+ };
-var LevelKey = function () {
- function LevelKey() {
- _classCallCheck(this, LevelKey);
+ BufferController.prototype.onSBUpdateError = function onSBUpdateError(event) {
+ logger["b" /* logger */].error('sourceBuffer error:', event);
+ // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error
+ // this error might not always be fatal (it is fatal if decode error is set, in that case
+ // it will be followed by a mediaElement error ...)
+ this.hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].BUFFER_APPENDING_ERROR, fatal: false });
+ // we don't need to do more than that, as accordin to the spec, updateend will be fired just after
+ };
- this.method = null;
- this.key = null;
- this.iv = null;
- this._uri = null;
- }
+ BufferController.prototype.onBufferReset = function onBufferReset() {
+ var sourceBuffer = this.sourceBuffer;
+ for (var type in sourceBuffer) {
+ var sb = sourceBuffer[type];
+ try {
+ this.mediaSource.removeSourceBuffer(sb);
+ sb.removeEventListener('updateend', this.onsbue);
+ sb.removeEventListener('error', this.onsbe);
+ } catch (err) {}
+ }
+ this.sourceBuffer = {};
+ this.flushRange = [];
+ this.segments = [];
+ this.appended = 0;
+ };
- _createClass(LevelKey, [{
- key: 'uri',
- get: function get() {
- if (!this._uri && this.reluri) {
- this._uri = _urlToolkit2.default.buildAbsoluteURL(this.baseuri, this.reluri, { alwaysNormalize: true });
+ BufferController.prototype.onBufferCodecs = function onBufferCodecs(tracks) {
+ // if source buffer(s) not created yet, appended buffer tracks in this.pendingTracks
+ // if sourcebuffers already created, do nothing ...
+ if (Object.keys(this.sourceBuffer).length === 0) {
+ for (var trackName in tracks) {
+ this.pendingTracks[trackName] = tracks[trackName];
+ }
+ var mediaSource = this.mediaSource;
+ if (mediaSource && mediaSource.readyState === 'open') {
+ // try to create sourcebuffers if mediasource opened
+ this.checkPendingTracks();
}
- return this._uri;
}
- }]);
+ };
- return LevelKey;
-}();
+ BufferController.prototype.createSourceBuffers = function createSourceBuffers(tracks) {
+ var sourceBuffer = this.sourceBuffer,
+ mediaSource = this.mediaSource;
-var Fragment = function () {
- function Fragment() {
- _classCallCheck(this, Fragment);
+ for (var trackName in tracks) {
+ if (!sourceBuffer[trackName]) {
+ var track = tracks[trackName];
+ // use levelCodec as first priority
+ var codec = track.levelCodec || track.codec;
+ var mimeType = track.container + ';codecs=' + codec;
+ logger["b" /* logger */].log('creating sourceBuffer(' + mimeType + ')');
+ try {
+ var sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);
+ sb.addEventListener('updateend', this.onsbue);
+ sb.addEventListener('error', this.onsbe);
+ this.tracks[trackName] = { codec: codec, container: track.container };
+ track.buffer = sb;
+ } catch (err) {
+ logger["b" /* logger */].error('error while trying to add sourceBuffer:' + err.message);
+ this.hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].BUFFER_ADD_CODEC_ERROR, fatal: false, err: err, mimeType: mimeType });
+ }
+ }
+ }
+ this.hls.trigger(events["a" /* default */].BUFFER_CREATED, { tracks: tracks });
+ };
- this._url = null;
- this._byteRange = null;
- this._decryptdata = null;
- this.tagList = [];
- }
+ BufferController.prototype.onBufferAppending = function onBufferAppending(data) {
+ if (!this._needsFlush) {
+ if (!this.segments) {
+ this.segments = [data];
+ } else {
+ this.segments.push(data);
+ }
+ this.doAppending();
+ }
+ };
- _createClass(Fragment, [{
- key: 'createInitializationVector',
+ BufferController.prototype.onBufferAppendFail = function onBufferAppendFail(data) {
+ logger["b" /* logger */].error('sourceBuffer error:', data.event);
+ // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error
+ // this error might not always be fatal (it is fatal if decode error is set, in that case
+ // it will be followed by a mediaElement error ...)
+ this.hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].BUFFER_APPENDING_ERROR, fatal: false });
+ };
+ // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()
- /**
- * Utility method for parseLevelPlaylist to create an initialization vector for a given segment
- * @returns {Uint8Array}
- */
- value: function createInitializationVector(segmentNumber) {
- var uint8View = new Uint8Array(16);
- for (var i = 12; i < 16; i++) {
- uint8View[i] = segmentNumber >> 8 * (15 - i) & 0xff;
+ BufferController.prototype.onBufferEos = function onBufferEos(data) {
+ var sb = this.sourceBuffer;
+ var dataType = data.type;
+ for (var type in sb) {
+ if (!dataType || type === dataType) {
+ if (!sb[type].ended) {
+ sb[type].ended = true;
+ logger["b" /* logger */].log(type + ' sourceBuffer now EOS');
+ }
}
-
- return uint8View;
}
+ this.checkEos();
+ };
- /**
- * Utility method for parseLevelPlaylist to get a fragment's decryption data from the currently parsed encryption key data
- * @param levelkey - a playlist's encryption info
- * @param segmentNumber - the fragment's segment number
- * @returns {*} - an object to be applied as a fragment's decryptdata
- */
-
- }, {
- key: 'fragmentDecryptdataFromLevelkey',
- value: function fragmentDecryptdataFromLevelkey(levelkey, segmentNumber) {
- var decryptdata = levelkey;
+ // if all source buffers are marked as ended, signal endOfStream() to MediaSource.
- if (levelkey && levelkey.method && levelkey.uri && !levelkey.iv) {
- decryptdata = new LevelKey();
- decryptdata.method = levelkey.method;
- decryptdata.baseuri = levelkey.baseuri;
- decryptdata.reluri = levelkey.reluri;
- decryptdata.iv = this.createInitializationVector(segmentNumber);
- }
- return decryptdata;
- }
- }, {
- key: 'cloneObj',
- value: function cloneObj(obj) {
- return JSON.parse(JSON.stringify(obj));
- }
- }, {
- key: 'url',
- get: function get() {
- if (!this._url && this.relurl) {
- this._url = _urlToolkit2.default.buildAbsoluteURL(this.baseurl, this.relurl, { alwaysNormalize: true });
- }
- return this._url;
- },
- set: function set(value) {
- this._url = value;
+ BufferController.prototype.checkEos = function checkEos() {
+ var sb = this.sourceBuffer,
+ mediaSource = this.mediaSource;
+ if (!mediaSource || mediaSource.readyState !== 'open') {
+ this._needsEos = false;
+ return;
}
- }, {
- key: 'programDateTime',
- get: function get() {
- if (!this._programDateTime && this.rawProgramDateTime) {
- this._programDateTime = new Date(Date.parse(this.rawProgramDateTime));
+ for (var type in sb) {
+ var sbobj = sb[type];
+ if (!sbobj.ended) {
+ return;
}
- return this._programDateTime;
- }
- }, {
- key: 'byteRange',
- get: function get() {
- if (!this._byteRange) {
- var byteRange = this._byteRange = [];
- if (this.rawByteRange) {
- var params = this.rawByteRange.split('@', 2);
- if (params.length === 1) {
- var lastByteRangeEndOffset = this.lastByteRangeEndOffset;
- byteRange[0] = lastByteRangeEndOffset ? lastByteRangeEndOffset : 0;
- } else {
- byteRange[0] = parseInt(params[1]);
- }
- byteRange[1] = parseInt(params[0]) + byteRange[0];
- }
+ if (sbobj.updating) {
+ this._needsEos = true;
+ return;
}
- return this._byteRange;
}
- }, {
- key: 'byteRangeStartOffset',
- get: function get() {
- return this.byteRange[0];
- }
- }, {
- key: 'byteRangeEndOffset',
- get: function get() {
- return this.byteRange[1];
+ logger["b" /* logger */].log('all media data available, signal endOfStream() to MediaSource and stop loading fragment');
+ //Notify the media element that it now has all of the media data
+ try {
+ mediaSource.endOfStream();
+ } catch (e) {
+ logger["b" /* logger */].warn('exception while calling mediaSource.endOfStream()');
}
- }, {
- key: 'decryptdata',
- get: function get() {
- if (!this._decryptdata) {
- this._decryptdata = this.fragmentDecryptdataFromLevelkey(this.levelkey, this.sn);
- }
- return this._decryptdata;
+ this._needsEos = false;
+ };
+
+ BufferController.prototype.onBufferFlushing = function onBufferFlushing(data) {
+ this.flushRange.push({ start: data.startOffset, end: data.endOffset, type: data.type });
+ // attempt flush immediately
+ this.flushBufferCounter = 0;
+ this.doFlush();
+ };
+
+ BufferController.prototype.onLevelUpdated = function onLevelUpdated(_ref) {
+ var details = _ref.details;
+
+ if (details.fragments.length > 0) {
+ this._levelDuration = details.totalduration + details.fragments[0].start;
+ this._live = details.live;
+ this.updateMediaElementDuration();
}
- }]);
+ };
- return Fragment;
-}();
+ /**
+ * Update Media Source duration to current level duration or override to Infinity if configuration parameter
+ * 'liveDurationInfinity` is set to `true`
+ * More details: https://github.com/video-dev/hls.js/issues/355
+ */
-var PlaylistLoader = function (_EventHandler) {
- _inherits(PlaylistLoader, _EventHandler);
- function PlaylistLoader(hls) {
- _classCallCheck(this, PlaylistLoader);
+ BufferController.prototype.updateMediaElementDuration = function updateMediaElementDuration() {
+ var config = this.hls.config;
- var _this = _possibleConstructorReturn(this, (PlaylistLoader.__proto__ || Object.getPrototypeOf(PlaylistLoader)).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.LEVEL_LOADING, _events2.default.AUDIO_TRACK_LOADING, _events2.default.SUBTITLE_TRACK_LOADING));
+ var duration = void 0;
- _this.loaders = {};
- return _this;
- }
+ if (this._levelDuration === null || !this.media || !this.mediaSource || !this.sourceBuffer || this.media.readyState === 0 || this.mediaSource.readyState !== 'open') {
+ return;
+ }
- _createClass(PlaylistLoader, [{
- key: 'destroy',
- value: function destroy() {
- for (var loaderName in this.loaders) {
- var loader = this.loaders[loaderName];
- if (loader) {
- loader.destroy();
- }
+ for (var type in this.sourceBuffer) {
+ if (this.sourceBuffer[type].updating === true) {
+ // can't set duration whilst a buffer is updating
+ return;
}
- this.loaders = {};
- _eventHandler2.default.prototype.destroy.call(this);
- }
- }, {
- key: 'onManifestLoading',
- value: function onManifestLoading(data) {
- this.load(data.url, { type: 'manifest' });
- }
- }, {
- key: 'onLevelLoading',
- value: function onLevelLoading(data) {
- this.load(data.url, { type: 'level', level: data.level, id: data.id });
- }
- }, {
- key: 'onAudioTrackLoading',
- value: function onAudioTrackLoading(data) {
- this.load(data.url, { type: 'audioTrack', id: data.id });
}
- }, {
- key: 'onSubtitleTrackLoading',
- value: function onSubtitleTrackLoading(data) {
- this.load(data.url, { type: 'subtitleTrack', id: data.id });
- }
- }, {
- key: 'load',
- value: function load(url, context) {
- var loader = this.loaders[context.type];
- if (loader) {
- var loaderContext = loader.context;
- if (loaderContext && loaderContext.url === url) {
- _logger.logger.trace('playlist request ongoing');
- return;
- } else {
- _logger.logger.warn('abort previous loader for type:' + context.type);
- loader.abort();
- }
- }
- var config = this.hls.config,
- retry = void 0,
- timeout = void 0,
- retryDelay = void 0,
- maxRetryDelay = void 0;
- if (context.type === 'manifest') {
- retry = config.manifestLoadingMaxRetry;
- timeout = config.manifestLoadingTimeOut;
- retryDelay = config.manifestLoadingRetryDelay;
- maxRetryDelay = config.manifestLoadingMaxRetryTimeout;
- } else {
- retry = config.levelLoadingMaxRetry;
- timeout = config.levelLoadingTimeOut;
- retryDelay = config.levelLoadingRetryDelay;
- maxRetryDelay = config.levelLoadingMaxRetryTimeout;
- _logger.logger.log('loading playlist for ' + context.type + ' ' + (context.level || context.id));
- }
- loader = this.loaders[context.type] = context.loader = typeof config.pLoader !== 'undefined' ? new config.pLoader(config) : new config.loader(config);
- context.url = url;
- context.responseType = '';
- var loaderConfig = void 0,
- loaderCallbacks = void 0;
- loaderConfig = { timeout: timeout, maxRetry: retry, retryDelay: retryDelay, maxRetryDelay: maxRetryDelay };
- loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };
- loader.load(context, loaderConfig, loaderCallbacks);
+ duration = this.media.duration;
+ // initialise to the value that the media source is reporting
+ if (this._msDuration === null) {
+ this._msDuration = this.mediaSource.duration;
}
- }, {
- key: 'resolve',
- value: function resolve(url, baseUrl) {
- return _urlToolkit2.default.buildAbsoluteURL(baseUrl, url, { alwaysNormalize: true });
+
+ if (this._live === true && config.liveDurationInfinity === true) {
+ // Override duration to Infinity
+ logger["b" /* logger */].log('Media Source duration is set to Infinity');
+ this._msDuration = this.mediaSource.duration = Infinity;
+ } else if (this._levelDuration > this._msDuration && this._levelDuration > duration || duration === Infinity || isNaN(duration)) {
+ // levelDuration was the last value we set.
+ // not using mediaSource.duration as the browser may tweak this value
+ // only update Media Source duration if its value increase, this is to avoid
+ // flushing already buffered portion when switching between quality level
+ logger["b" /* logger */].log('Updating Media Source duration to ' + this._levelDuration.toFixed(3));
+ this._msDuration = this.mediaSource.duration = this._levelDuration;
}
- }, {
- key: 'parseMasterPlaylist',
- value: function parseMasterPlaylist(string, baseurl) {
- var levels = [],
- result = void 0;
- MASTER_PLAYLIST_REGEX.lastIndex = 0;
- while ((result = MASTER_PLAYLIST_REGEX.exec(string)) != null) {
- var level = {};
-
- var attrs = level.attrs = new _attrList2.default(result[1]);
- level.url = this.resolve(result[2], baseurl);
-
- var resolution = attrs.decimalResolution('RESOLUTION');
- if (resolution) {
- level.width = resolution.width;
- level.height = resolution.height;
- }
- level.bitrate = attrs.decimalInteger('AVERAGE-BANDWIDTH') || attrs.decimalInteger('BANDWIDTH');
- level.name = attrs.NAME;
-
- var codecs = attrs.CODECS;
- if (codecs) {
- codecs = codecs.split(/[ ,]+/);
- for (var i = 0; i < codecs.length; i++) {
- var codec = codecs[i];
- if (codec.indexOf('avc1') !== -1) {
- level.videoCodec = this.avc1toavcoti(codec);
- } else {
- level.audioCodec = codec;
- }
- }
- }
+ };
- levels.push(level);
+ BufferController.prototype.doFlush = function doFlush() {
+ // loop through all buffer ranges to flush
+ while (this.flushRange.length) {
+ var range = this.flushRange[0];
+ // flushBuffer will abort any buffer append in progress and flush Audio/Video Buffer
+ if (this.flushBuffer(range.start, range.end, range.type)) {
+ // range flushed, remove from flush array
+ this.flushRange.shift();
+ this.flushBufferCounter = 0;
+ } else {
+ this._needsFlush = true;
+ // avoid looping, wait for SB update end to retrigger a flush
+ return;
}
- return levels;
}
- }, {
- key: 'parseMasterPlaylistMedia',
- value: function parseMasterPlaylistMedia(string, baseurl, type) {
- var result = void 0,
- medias = [],
- id = 0;
- MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;
- while ((result = MASTER_PLAYLIST_MEDIA_REGEX.exec(string)) != null) {
- var media = {};
- var attrs = new _attrList2.default(result[1]);
- if (attrs.TYPE === type) {
- media.groupId = attrs['GROUP-ID'];
- media.name = attrs.NAME;
- media.type = type;
- media.default = attrs.DEFAULT === 'YES';
- media.autoselect = attrs.AUTOSELECT === 'YES';
- media.forced = attrs.FORCED === 'YES';
- if (attrs.URI) {
- media.url = this.resolve(attrs.URI, baseurl);
- }
- media.lang = attrs.LANGUAGE;
- if (!media.name) {
- media.name = media.lang;
- }
- media.id = id++;
- medias.push(media);
+ if (this.flushRange.length === 0) {
+ // everything flushed
+ this._needsFlush = false;
+
+ // let's recompute this.appended, which is used to avoid flush looping
+ var appended = 0;
+ var sourceBuffer = this.sourceBuffer;
+ try {
+ for (var type in sourceBuffer) {
+ appended += sourceBuffer[type].buffered.length;
}
+ } catch (error) {
+ // error could be thrown while accessing buffered, in case sourcebuffer has already been removed from MediaSource
+ // this is harmess at this stage, catch this to avoid reporting an internal exception
+ logger["b" /* logger */].error('error while accessing sourceBuffer.buffered');
}
- return medias;
- }
- }, {
- key: 'avc1toavcoti',
- value: function avc1toavcoti(codec) {
- var result,
- avcdata = codec.split('.');
- if (avcdata.length > 2) {
- result = avcdata.shift() + '.';
- result += parseInt(avcdata.shift()).toString(16);
- result += ('000' + parseInt(avcdata.shift()).toString(16)).substr(-4);
- } else {
- result = codec;
- }
- return result;
+ this.appended = appended;
+ this.hls.trigger(events["a" /* default */].BUFFER_FLUSHED);
}
- }, {
- key: 'parseLevelPlaylist',
- value: function parseLevelPlaylist(string, baseurl, id, type) {
- var currentSN = 0,
- totalduration = 0,
- level = { type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0 },
- levelkey = new LevelKey(),
- cc = 0,
- prevFrag = null,
- frag = new Fragment(),
- result,
- i;
-
- LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;
-
- while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {
- var duration = result[1];
- if (duration) {
- // INF
- frag.duration = parseFloat(duration);
- // avoid sliced strings https://github.com/video-dev/hls.js/issues/939
- var title = (' ' + result[2]).slice(1);
- frag.title = title ? title : null;
- frag.tagList.push(title ? ['INF', duration, title] : ['INF', duration]);
- } else if (result[3]) {
- // url
- if (!isNaN(frag.duration)) {
- var sn = currentSN++;
- frag.type = type;
- frag.start = totalduration;
- frag.levelkey = levelkey;
- frag.sn = sn;
- frag.level = id;
- frag.cc = cc;
- frag.baseurl = baseurl;
- // avoid sliced strings https://github.com/video-dev/hls.js/issues/939
- frag.relurl = (' ' + result[3]).slice(1);
-
- level.fragments.push(frag);
- prevFrag = frag;
- totalduration += frag.duration;
+ };
- frag = new Fragment();
- }
- } else if (result[4]) {
- // X-BYTERANGE
- frag.rawByteRange = (' ' + result[4]).slice(1);
- if (prevFrag) {
- var lastByteRangeEndOffset = prevFrag.byteRangeEndOffset;
- if (lastByteRangeEndOffset) {
- frag.lastByteRangeEndOffset = lastByteRangeEndOffset;
+ BufferController.prototype.doAppending = function doAppending() {
+ var hls = this.hls,
+ sourceBuffer = this.sourceBuffer,
+ segments = this.segments;
+ if (Object.keys(sourceBuffer).length) {
+ if (this.media.error) {
+ this.segments = [];
+ logger["b" /* logger */].error('trying to append although a media error occured, flush segment and abort');
+ return;
+ }
+ if (this.appending) {
+ //logger.log(`sb appending in progress`);
+ return;
+ }
+ if (segments && segments.length) {
+ var segment = segments.shift();
+ try {
+ var type = segment.type,
+ sb = sourceBuffer[type];
+ if (sb) {
+ if (!sb.updating) {
+ // reset sourceBuffer ended flag before appending segment
+ sb.ended = false;
+ //logger.log(`appending ${segment.content} ${type} SB, size:${segment.data.length}, ${segment.parent}`);
+ this.parent = segment.parent;
+ sb.appendBuffer(segment.data);
+ this.appendError = 0;
+ this.appended++;
+ this.appending = true;
+ } else {
+ segments.unshift(segment);
}
+ } else {
+ // in case we don't have any source buffer matching with this segment type,
+ // it means that Mediasource fails to create sourcebuffer
+ // discard this segment, and trigger update end
+ this.onSBUpdateEnd();
}
- } else if (result[5]) {
- // PROGRAM-DATE-TIME
- // avoid sliced strings https://github.com/video-dev/hls.js/issues/939
- frag.rawProgramDateTime = (' ' + result[5]).slice(1);
- frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);
- } else {
- result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);
- for (i = 1; i < result.length; i++) {
- if (result[i] !== undefined) {
- break;
+ } catch (err) {
+ // in case any error occured while appending, put back segment in segments table
+ logger["b" /* logger */].error('error while trying to append buffer:' + err.message);
+ segments.unshift(segment);
+ var event = { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, parent: segment.parent };
+ if (err.code !== 22) {
+ if (this.appendError) {
+ this.appendError++;
+ } else {
+ this.appendError = 1;
}
- }
-
- // avoid sliced strings https://github.com/video-dev/hls.js/issues/939
- var value1 = (' ' + result[i + 1]).slice(1);
- var value2 = (' ' + result[i + 2]).slice(1);
-
- switch (result[i]) {
- case '#':
- frag.tagList.push(value2 ? [value1, value2] : [value1]);
- break;
- case 'PLAYLIST-TYPE':
- level.type = value1.toUpperCase();
- break;
- case 'MEDIA-SEQUENCE':
- currentSN = level.startSN = parseInt(value1);
- break;
- case 'TARGETDURATION':
- level.targetduration = parseFloat(value1);
- break;
- case 'VERSION':
- level.version = parseInt(value1);
- break;
- case 'EXTM3U':
- break;
- case 'ENDLIST':
- level.live = false;
- break;
- case 'DIS':
- cc++;
- frag.tagList.push(['DIS']);
- break;
- case 'DISCONTINUITY-SEQ':
- cc = parseInt(value1);
- break;
- case 'KEY':
- // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4
- var decryptparams = value1;
- var keyAttrs = new _attrList2.default(decryptparams);
- var decryptmethod = keyAttrs.enumeratedString('METHOD'),
- decrypturi = keyAttrs.URI,
- decryptiv = keyAttrs.hexadecimalInteger('IV');
- if (decryptmethod) {
- levelkey = new LevelKey();
- if (decrypturi && ['AES-128', 'SAMPLE-AES'].indexOf(decryptmethod) >= 0) {
- levelkey.method = decryptmethod;
- // URI to get the key
- levelkey.baseuri = baseurl;
- levelkey.reluri = decrypturi;
- levelkey.key = null;
- // Initialization Vector (IV)
- levelkey.iv = decryptiv;
- }
- }
- break;
- case 'START':
- var startParams = value1;
- var startAttrs = new _attrList2.default(startParams);
- var startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');
- //TIME-OFFSET can be 0
- if (!isNaN(startTimeOffset)) {
- level.startTimeOffset = startTimeOffset;
- }
- break;
- case 'MAP':
- var mapAttrs = new _attrList2.default(value1);
- frag.relurl = mapAttrs.URI;
- frag.rawByteRange = mapAttrs.BYTERANGE;
- frag.baseurl = baseurl;
- frag.level = id;
- frag.type = type;
- frag.sn = 'initSegment';
- level.initSegment = frag;
- frag = new Fragment();
- break;
- default:
- _logger.logger.warn('line parsed but not handled: ' + result);
- break;
+ event.details = errors["a" /* ErrorDetails */].BUFFER_APPEND_ERROR;
+ /* with UHD content, we could get loop of quota exceeded error until
+ browser is able to evict some data from sourcebuffer. retrying help recovering this
+ */
+ if (this.appendError > hls.config.appendErrorMaxRetry) {
+ logger["b" /* logger */].log('fail ' + hls.config.appendErrorMaxRetry + ' times to append segment in sourceBuffer');
+ segments = [];
+ event.fatal = true;
+ hls.trigger(events["a" /* default */].ERROR, event);
+ return;
+ } else {
+ event.fatal = false;
+ hls.trigger(events["a" /* default */].ERROR, event);
+ }
+ } else {
+ // QuotaExceededError: http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror
+ // let's stop appending any segments, and report BUFFER_FULL_ERROR error
+ this.segments = [];
+ event.details = errors["a" /* ErrorDetails */].BUFFER_FULL_ERROR;
+ event.fatal = false;
+ hls.trigger(events["a" /* default */].ERROR, event);
+ return;
}
}
}
- frag = prevFrag;
- //logger.log('found ' + level.fragments.length + ' fragments');
- if (frag && !frag.relurl) {
- level.fragments.pop();
- totalduration -= frag.duration;
- }
- level.totalduration = totalduration;
- level.averagetargetduration = totalduration / level.fragments.length;
- level.endSN = currentSN - 1;
- return level;
}
- }, {
- key: 'loadsuccess',
- value: function loadsuccess(response, stats, context) {
- var string = response.data,
- url = response.url,
- type = context.type,
- id = context.id,
- level = context.level,
- hls = this.hls;
+ };
- this.loaders[type] = undefined;
- // responseURL not supported on some browsers (it is used to detect URL redirection)
- // data-uri mode also not supported (but no need to detect redirection)
- if (url === undefined || url.indexOf('data:') === 0) {
- // fallback to initial URL
- url = context.url;
- }
- stats.tload = performance.now();
- //stats.mtime = new Date(target.getResponseHeader('Last-Modified'));
- if (string.indexOf('#EXTM3U') === 0) {
- if (string.indexOf('#EXTINF:') > 0) {
- var isLevel = type !== 'audioTrack' && type !== 'subtitleTrack',
- levelId = !isNaN(level) ? level : !isNaN(id) ? id : 0,
- levelDetails = this.parseLevelPlaylist(string, url, levelId, type === 'audioTrack' ? 'audio' : type === 'subtitleTrack' ? 'subtitle' : 'main');
- levelDetails.tload = stats.tload;
- if (type === 'manifest') {
- // first request, stream manifest (no master playlist), fire manifest loaded event with level details
- hls.trigger(_events2.default.MANIFEST_LOADED, { levels: [{ url: url, details: levelDetails }], audioTracks: [], url: url, stats: stats });
- }
- stats.tparsed = performance.now();
- if (levelDetails.targetduration) {
- if (isLevel) {
- hls.trigger(_events2.default.LEVEL_LOADED, { details: levelDetails, level: level || 0, id: id || 0, stats: stats });
- } else {
- if (type === 'audioTrack') {
- hls.trigger(_events2.default.AUDIO_TRACK_LOADED, { details: levelDetails, id: id, stats: stats });
- } else if (type === 'subtitleTrack') {
- hls.trigger(_events2.default.SUBTITLE_TRACK_LOADED, { details: levelDetails, id: id, stats: stats });
- }
- }
- } else {
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'invalid targetduration' });
+ /*
+ flush specified buffered range,
+ return true once range has been flushed.
+ as sourceBuffer.remove() is asynchronous, flushBuffer will be retriggered on sourceBuffer update end
+ */
+
+
+ BufferController.prototype.flushBuffer = function flushBuffer(startOffset, endOffset, typeIn) {
+ var sb,
+ i,
+ bufStart,
+ bufEnd,
+ flushStart,
+ flushEnd,
+ sourceBuffer = this.sourceBuffer;
+ if (Object.keys(sourceBuffer).length) {
+ logger["b" /* logger */].log('flushBuffer,pos/start/end: ' + this.media.currentTime.toFixed(3) + '/' + startOffset + '/' + endOffset);
+ // safeguard to avoid infinite looping : don't try to flush more than the nb of appended segments
+ if (this.flushBufferCounter < this.appended) {
+ for (var type in sourceBuffer) {
+ // check if sourcebuffer type is defined (typeIn): if yes, let's only flush this one
+ // if no, let's flush all sourcebuffers
+ if (typeIn && type !== typeIn) {
+ continue;
}
- } else {
- var levels = this.parseMasterPlaylist(string, url);
- // multi level playlist, parse level info
- if (levels.length) {
- var audioTracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO');
- var subtitles = this.parseMasterPlaylistMedia(string, url, 'SUBTITLES');
- if (audioTracks.length) {
- // check if we have found an audio track embedded in main playlist (audio track without URI attribute)
- var embeddedAudioFound = false;
- audioTracks.forEach(function (audioTrack) {
- if (!audioTrack.url) {
- embeddedAudioFound = true;
+ sb = sourceBuffer[type];
+ // we are going to flush buffer, mark source buffer as 'not ended'
+ sb.ended = false;
+ if (!sb.updating) {
+ try {
+ for (i = 0; i < sb.buffered.length; i++) {
+ bufStart = sb.buffered.start(i);
+ bufEnd = sb.buffered.end(i);
+ // workaround firefox not able to properly flush multiple buffered range.
+ if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1 && endOffset === Number.POSITIVE_INFINITY) {
+ flushStart = startOffset;
+ flushEnd = endOffset;
+ } else {
+ flushStart = Math.max(bufStart, startOffset);
+ flushEnd = Math.min(bufEnd, endOffset);
+ }
+ /* sometimes sourcebuffer.remove() does not flush
+ the exact expected time range.
+ to avoid rounding issues/infinite loop,
+ only flush buffer range of length greater than 500ms.
+ */
+ if (Math.min(flushEnd, bufEnd) - flushStart > 0.5) {
+ this.flushBufferCounter++;
+ logger["b" /* logger */].log('flush ' + type + ' [' + flushStart + ',' + flushEnd + '], of [' + bufStart + ',' + bufEnd + '], pos:' + this.media.currentTime);
+ sb.remove(flushStart, flushEnd);
+ return false;
}
- });
- // if no embedded audio track defined, but audio codec signaled in quality level, we need to signal this main audio track
- // this could happen with playlists with alt audio rendition in which quality levels (main) contains both audio+video. but with mixed audio track not signaled
- if (embeddedAudioFound === false && levels[0].audioCodec && !levels[0].attrs.AUDIO) {
- _logger.logger.log('audio codec signaled in quality level, but no embedded audio track signaled, create one');
- audioTracks.unshift({ type: 'main', name: 'main' });
}
+ } catch (e) {
+ logger["b" /* logger */].warn('exception while accessing sourcebuffer, it might have been removed from MediaSource');
}
- hls.trigger(_events2.default.MANIFEST_LOADED, { levels: levels, audioTracks: audioTracks, subtitles: subtitles, url: url, stats: stats });
} else {
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest' });
+ //logger.log('abort ' + type + ' append in progress');
+ // this will abort any appending in progress
+ //sb.abort();
+ logger["b" /* logger */].warn('cannot flush, sb updating in progress');
+ return false;
}
}
} else {
- hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter' });
+ logger["b" /* logger */].warn('abort flushing too many retries');
}
+ logger["b" /* logger */].log('buffer flushed');
}
- }, {
- key: 'loaderror',
- value: function loaderror(response, context) {
- var details,
- fatal,
- loader = context.loader;
- switch (context.type) {
- case 'manifest':
- details = _errors.ErrorDetails.MANIFEST_LOAD_ERROR;
- fatal = true;
- break;
- case 'level':
- details = _errors.ErrorDetails.LEVEL_LOAD_ERROR;
- fatal = false;
- break;
- case 'audioTrack':
- details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR;
- fatal = false;
- break;
- }
- if (loader) {
- loader.abort();
- this.loaders[context.type] = undefined;
- }
- this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context: context });
- }
- }, {
- key: 'loadtimeout',
- value: function loadtimeout(stats, context) {
- var details,
- fatal,
- loader = context.loader;
- switch (context.type) {
- case 'manifest':
- details = _errors.ErrorDetails.MANIFEST_LOAD_TIMEOUT;
- fatal = true;
- break;
- case 'level':
- details = _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT;
- fatal = false;
- break;
- case 'audioTrack':
- details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT;
- fatal = false;
- break;
- }
- if (loader) {
- loader.abort();
- this.loaders[context.type] = undefined;
- }
- this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context: context });
- }
- }]);
-
- return PlaylistLoader;
-}(_eventHandler2.default);
+ // everything flushed !
+ return true;
+ };
-exports.default = PlaylistLoader;
+ return BufferController;
+}(event_handler);
-},{"2":2,"33":33,"34":34,"35":35,"47":47,"53":53}],44:[function(_dereq_,module,exports){
-'use strict';
+/* harmony default export */ var buffer_controller = (buffer_controller_BufferController);
+// CONCATENATED MODULE: ./src/controller/cap-level-controller.js
+var cap_level_controller__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+function cap_level_controller__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+function cap_level_controller__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+function cap_level_controller__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-/**
- * Generate MP4 Box
+/*
+ * cap stream level to media size dimension controller
*/
-//import Hex from '../utils/hex';
-var UINT32_MAX = Math.pow(2, 32) - 1;
-var MP4 = function () {
- function MP4() {
- _classCallCheck(this, MP4);
- }
-
- _createClass(MP4, null, [{
- key: 'init',
- value: function init() {
- MP4.types = {
- avc1: [], // codingname
- avcC: [],
- btrt: [],
- dinf: [],
- dref: [],
- esds: [],
- ftyp: [],
- hdlr: [],
- mdat: [],
- mdhd: [],
- mdia: [],
- mfhd: [],
- minf: [],
- moof: [],
- moov: [],
- mp4a: [],
- '.mp3': [],
- mvex: [],
- mvhd: [],
- pasp: [],
- sdtp: [],
- stbl: [],
- stco: [],
- stsc: [],
- stsd: [],
- stsz: [],
- stts: [],
- tfdt: [],
- tfhd: [],
- traf: [],
- trak: [],
- trun: [],
- trex: [],
- tkhd: [],
- vmhd: [],
- smhd: []
- };
- var i;
- for (i in MP4.types) {
- if (MP4.types.hasOwnProperty(i)) {
- MP4.types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];
- }
- }
-
- var videoHdlr = new Uint8Array([0x00, // version 0
- 0x00, 0x00, 0x00, // flags
- 0x00, 0x00, 0x00, 0x00, // pre_defined
- 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'
- 0x00, 0x00, 0x00, 0x00, // reserved
- 0x00, 0x00, 0x00, 0x00, // reserved
- 0x00, 0x00, 0x00, 0x00, // reserved
- 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'
- ]);
-
- var audioHdlr = new Uint8Array([0x00, // version 0
- 0x00, 0x00, 0x00, // flags
- 0x00, 0x00, 0x00, 0x00, // pre_defined
- 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'
- 0x00, 0x00, 0x00, 0x00, // reserved
- 0x00, 0x00, 0x00, 0x00, // reserved
- 0x00, 0x00, 0x00, 0x00, // reserved
- 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'
- ]);
-
- MP4.HDLR_TYPES = {
- 'video': videoHdlr,
- 'audio': audioHdlr
- };
+var cap_level_controller_CapLevelController = function (_EventHandler) {
+ cap_level_controller__inherits(CapLevelController, _EventHandler);
- var dref = new Uint8Array([0x00, // version 0
- 0x00, 0x00, 0x00, // flags
- 0x00, 0x00, 0x00, 0x01, // entry_count
- 0x00, 0x00, 0x00, 0x0c, // entry_size
- 0x75, 0x72, 0x6c, 0x20, // 'url' type
- 0x00, // version 0
- 0x00, 0x00, 0x01 // entry_flags
- ]);
-
- var stco = new Uint8Array([0x00, // version
- 0x00, 0x00, 0x00, // flags
- 0x00, 0x00, 0x00, 0x00 // entry_count
- ]);
-
- MP4.STTS = MP4.STSC = MP4.STCO = stco;
-
- MP4.STSZ = new Uint8Array([0x00, // version
- 0x00, 0x00, 0x00, // flags
- 0x00, 0x00, 0x00, 0x00, // sample_size
- 0x00, 0x00, 0x00, 0x00]);
- MP4.VMHD = new Uint8Array([0x00, // version
- 0x00, 0x00, 0x01, // flags
- 0x00, 0x00, // graphicsmode
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor
- ]);
- MP4.SMHD = new Uint8Array([0x00, // version
- 0x00, 0x00, 0x00, // flags
- 0x00, 0x00, // balance
- 0x00, 0x00 // reserved
- ]);
-
- MP4.STSD = new Uint8Array([0x00, // version 0
- 0x00, 0x00, 0x00, // flags
- 0x00, 0x00, 0x00, 0x01]); // entry_count
-
- var majorBrand = new Uint8Array([105, 115, 111, 109]); // isom
- var avc1Brand = new Uint8Array([97, 118, 99, 49]); // avc1
- var minorVersion = new Uint8Array([0, 0, 0, 1]);
-
- MP4.FTYP = MP4.box(MP4.types.ftyp, majorBrand, minorVersion, majorBrand, avc1Brand);
- MP4.DINF = MP4.box(MP4.types.dinf, MP4.box(MP4.types.dref, dref));
- }
- }, {
- key: 'box',
- value: function box(type) {
- var payload = Array.prototype.slice.call(arguments, 1),
- size = 8,
- i = payload.length,
- len = i,
- result;
- // calculate the total size we need to allocate
- while (i--) {
- size += payload[i].byteLength;
- }
- result = new Uint8Array(size);
- result[0] = size >> 24 & 0xff;
- result[1] = size >> 16 & 0xff;
- result[2] = size >> 8 & 0xff;
- result[3] = size & 0xff;
- result.set(type, 4);
- // copy the payload into the result
- for (i = 0, size = 8; i < len; i++) {
- // copy payload[i] array @ offset size
- result.set(payload[i], size);
- size += payload[i].byteLength;
- }
- return result;
- }
- }, {
- key: 'hdlr',
- value: function hdlr(type) {
- return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);
- }
- }, {
- key: 'mdat',
- value: function mdat(data) {
- return MP4.box(MP4.types.mdat, data);
- }
- }, {
- key: 'mdhd',
- value: function mdhd(timescale, duration) {
- duration *= timescale;
- var upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));
- var lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));
- return MP4.box(MP4.types.mdhd, new Uint8Array([0x01, // version 1
- 0x00, 0x00, 0x00, // flags
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time
- timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale
- upperWordDuration >> 24, upperWordDuration >> 16 & 0xFF, upperWordDuration >> 8 & 0xFF, upperWordDuration & 0xFF, lowerWordDuration >> 24, lowerWordDuration >> 16 & 0xFF, lowerWordDuration >> 8 & 0xFF, lowerWordDuration & 0xFF, 0x55, 0xc4, // 'und' language (undetermined)
- 0x00, 0x00]));
+ function CapLevelController(hls) {
+ cap_level_controller__classCallCheck(this, CapLevelController);
+
+ return cap_level_controller__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].FPS_DROP_LEVEL_CAPPING, events["a" /* default */].MEDIA_ATTACHING, events["a" /* default */].MANIFEST_PARSED));
+ }
+
+ CapLevelController.prototype.destroy = function destroy() {
+ if (this.hls.config.capLevelToPlayerSize) {
+ this.media = this.restrictedLevels = null;
+ this.autoLevelCapping = Number.POSITIVE_INFINITY;
+ if (this.timer) {
+ this.timer = clearInterval(this.timer);
+ }
}
- }, {
- key: 'mdia',
- value: function mdia(track) {
- return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale, track.duration), MP4.hdlr(track.type), MP4.minf(track));
+ };
+
+ CapLevelController.prototype.onFpsDropLevelCapping = function onFpsDropLevelCapping(data) {
+ // Don't add a restricted level more than once
+ if (CapLevelController.isLevelAllowed(data.droppedLevel, this.restrictedLevels)) {
+ this.restrictedLevels.push(data.droppedLevel);
}
- }, {
- key: 'mfhd',
- value: function mfhd(sequenceNumber) {
- return MP4.box(MP4.types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags
- sequenceNumber >> 24, sequenceNumber >> 16 & 0xFF, sequenceNumber >> 8 & 0xFF, sequenceNumber & 0xFF]));
+ };
+
+ CapLevelController.prototype.onMediaAttaching = function onMediaAttaching(data) {
+ this.media = data.media instanceof HTMLVideoElement ? data.media : null;
+ };
+
+ CapLevelController.prototype.onManifestParsed = function onManifestParsed(data) {
+ var hls = this.hls;
+ this.restrictedLevels = [];
+ if (hls.config.capLevelToPlayerSize) {
+ this.autoLevelCapping = Number.POSITIVE_INFINITY;
+ this.levels = data.levels;
+ hls.firstLevel = this.getMaxLevel(data.firstLevel);
+ clearInterval(this.timer);
+ this.timer = setInterval(this.detectPlayerSize.bind(this), 1000);
+ this.detectPlayerSize();
}
- }, {
- key: 'minf',
- value: function minf(track) {
- if (track.type === 'audio') {
- return MP4.box(MP4.types.minf, MP4.box(MP4.types.smhd, MP4.SMHD), MP4.DINF, MP4.stbl(track));
- } else {
- return MP4.box(MP4.types.minf, MP4.box(MP4.types.vmhd, MP4.VMHD), MP4.DINF, MP4.stbl(track));
+ };
+
+ CapLevelController.prototype.detectPlayerSize = function detectPlayerSize() {
+ if (this.media) {
+ var levelsLength = this.levels ? this.levels.length : 0;
+ if (levelsLength) {
+ var hls = this.hls;
+ hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);
+ if (hls.autoLevelCapping > this.autoLevelCapping) {
+ // if auto level capping has a higher value for the previous one, flush the buffer using nextLevelSwitch
+ // usually happen when the user go to the fullscreen mode.
+ hls.streamController.nextLevelSwitch();
+ }
+ this.autoLevelCapping = hls.autoLevelCapping;
}
}
- }, {
- key: 'moof',
- value: function moof(sn, baseMediaDecodeTime, track) {
- return MP4.box(MP4.types.moof, MP4.mfhd(sn), MP4.traf(track, baseMediaDecodeTime));
- }
- /**
- * @param tracks... (optional) {array} the tracks associated with this movie
- */
+ };
- }, {
- key: 'moov',
- value: function moov(tracks) {
- var i = tracks.length,
- boxes = [];
+ /*
+ * returns level should be the one with the dimensions equal or greater than the media (player) dimensions (so the video will be downscaled)
+ */
- while (i--) {
- boxes[i] = MP4.trak(tracks[i]);
- }
- return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale, tracks[0].duration)].concat(boxes).concat(MP4.mvex(tracks)));
- }
- }, {
- key: 'mvex',
- value: function mvex(tracks) {
- var i = tracks.length,
- boxes = [];
+ CapLevelController.prototype.getMaxLevel = function getMaxLevel(capLevelIndex) {
+ var _this2 = this;
- while (i--) {
- boxes[i] = MP4.trex(tracks[i]);
- }
- return MP4.box.apply(null, [MP4.types.mvex].concat(boxes));
+ if (!this.levels) {
+ return -1;
}
- }, {
- key: 'mvhd',
- value: function mvhd(timescale, duration) {
- duration *= timescale;
- var upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));
- var lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));
- var bytes = new Uint8Array([0x01, // version 1
- 0x00, 0x00, 0x00, // flags
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time
- timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale
- upperWordDuration >> 24, upperWordDuration >> 16 & 0xFF, upperWordDuration >> 8 & 0xFF, upperWordDuration & 0xFF, lowerWordDuration >> 24, lowerWordDuration >> 16 & 0xFF, lowerWordDuration >> 8 & 0xFF, lowerWordDuration & 0xFF, 0x00, 0x01, 0x00, 0x00, // 1.0 rate
- 0x01, 0x00, // 1.0 volume
- 0x00, 0x00, // reserved
- 0x00, 0x00, 0x00, 0x00, // reserved
- 0x00, 0x00, 0x00, 0x00, // reserved
- 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined
- 0xff, 0xff, 0xff, 0xff // next_track_ID
- ]);
- return MP4.box(MP4.types.mvhd, bytes);
+
+ var validLevels = this.levels.filter(function (level, index) {
+ return CapLevelController.isLevelAllowed(index, _this2.restrictedLevels) && index <= capLevelIndex;
+ });
+
+ return CapLevelController.getMaxLevelByMediaSize(validLevels, this.mediaWidth, this.mediaHeight);
+ };
+
+ CapLevelController.isLevelAllowed = function isLevelAllowed(level) {
+ var restrictedLevels = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
+
+ return restrictedLevels.indexOf(level) === -1;
+ };
+
+ CapLevelController.getMaxLevelByMediaSize = function getMaxLevelByMediaSize(levels, width, height) {
+ if (!levels || levels && !levels.length) {
+ return -1;
}
- }, {
- key: 'sdtp',
- value: function sdtp(track) {
- var samples = track.samples || [],
- bytes = new Uint8Array(4 + samples.length),
- flags,
- i;
- // leave the full box header (4 bytes) all zero
- // write the sample table
- for (i = 0; i < samples.length; i++) {
- flags = samples[i].flags;
- bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;
+
+ // Levels can have the same dimensions but differing bandwidths - since levels are ordered, we can look to the next
+ // to determine whether we've chosen the greatest bandwidth for the media's dimensions
+ var atGreatestBandiwdth = function atGreatestBandiwdth(curLevel, nextLevel) {
+ if (!nextLevel) {
+ return true;
}
+ return curLevel.width !== nextLevel.width || curLevel.height !== nextLevel.height;
+ };
- return MP4.box(MP4.types.sdtp, bytes);
- }
- }, {
- key: 'stbl',
- value: function stbl(track) {
- return MP4.box(MP4.types.stbl, MP4.stsd(track), MP4.box(MP4.types.stts, MP4.STTS), MP4.box(MP4.types.stsc, MP4.STSC), MP4.box(MP4.types.stsz, MP4.STSZ), MP4.box(MP4.types.stco, MP4.STCO));
- }
- }, {
- key: 'avc1',
- value: function avc1(track) {
- var sps = [],
- pps = [],
- i,
- data,
- len;
- // assemble the SPSs
-
- for (i = 0; i < track.sps.length; i++) {
- data = track.sps[i];
- len = data.byteLength;
- sps.push(len >>> 8 & 0xFF);
- sps.push(len & 0xFF);
- sps = sps.concat(Array.prototype.slice.call(data)); // SPS
- }
-
- // assemble the PPSs
- for (i = 0; i < track.pps.length; i++) {
- data = track.pps[i];
- len = data.byteLength;
- pps.push(len >>> 8 & 0xFF);
- pps.push(len & 0xFF);
- pps = pps.concat(Array.prototype.slice.call(data));
- }
-
- var avcc = MP4.box(MP4.types.avcC, new Uint8Array([0x01, // version
- sps[3], // profile
- sps[4], // profile compat
- sps[5], // level
- 0xfc | 3, // lengthSizeMinusOne, hard-coded to 4 bytes
- 0xE0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets
- ].concat(sps).concat([track.pps.length // numOfPictureParameterSets
- ]).concat(pps))),
- // "PPS"
- width = track.width,
- height = track.height,
- hSpacing = track.pixelRatio[0],
- vSpacing = track.pixelRatio[1];
- //console.log('avcc:' + Hex.hexDump(avcc));
- return MP4.box(MP4.types.avc1, new Uint8Array([0x00, 0x00, 0x00, // reserved
- 0x00, 0x00, 0x00, // reserved
- 0x00, 0x01, // data_reference_index
- 0x00, 0x00, // pre_defined
- 0x00, 0x00, // reserved
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined
- width >> 8 & 0xFF, width & 0xff, // width
- height >> 8 & 0xFF, height & 0xff, // height
- 0x00, 0x48, 0x00, 0x00, // horizresolution
- 0x00, 0x48, 0x00, 0x00, // vertresolution
- 0x00, 0x00, 0x00, 0x00, // reserved
- 0x00, 0x01, // frame_count
- 0x12, 0x64, 0x61, 0x69, 0x6C, //dailymotion/hls.js
- 0x79, 0x6D, 0x6F, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x68, 0x6C, 0x73, 0x2E, 0x6A, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname
- 0x00, 0x18, // depth = 24
- 0x11, 0x11]), // pre_defined = -1
- avcc, MP4.box(MP4.types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB
- 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate
- 0x00, 0x2d, 0xc6, 0xc0])), // avgBitrate
- MP4.box(MP4.types.pasp, new Uint8Array([hSpacing >> 24, // hSpacing
- hSpacing >> 16 & 0xFF, hSpacing >> 8 & 0xFF, hSpacing & 0xFF, vSpacing >> 24, // vSpacing
- vSpacing >> 16 & 0xFF, vSpacing >> 8 & 0xFF, vSpacing & 0xFF])));
- }
- }, {
- key: 'esds',
- value: function esds(track) {
- var configlen = track.config.length;
- return new Uint8Array([0x00, // version 0
- 0x00, 0x00, 0x00, // flags
-
- 0x03, // descriptor_type
- 0x17 + configlen, // length
- 0x00, 0x01, //es_id
- 0x00, // stream_priority
-
- 0x04, // descriptor_type
- 0x0f + configlen, // length
- 0x40, //codec : mpeg4_audio
- 0x15, // stream_type
- 0x00, 0x00, 0x00, // buffer_size
- 0x00, 0x00, 0x00, 0x00, // maxBitrate
- 0x00, 0x00, 0x00, 0x00, // avgBitrate
-
- 0x05 // descriptor_type
- ].concat([configlen]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor
- }
- }, {
- key: 'mp4a',
- value: function mp4a(track) {
- var samplerate = track.samplerate;
- return MP4.box(MP4.types.mp4a, new Uint8Array([0x00, 0x00, 0x00, // reserved
- 0x00, 0x00, 0x00, // reserved
- 0x00, 0x01, // data_reference_index
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved
- 0x00, track.channelCount, // channelcount
- 0x00, 0x10, // sampleSize:16bits
- 0x00, 0x00, 0x00, 0x00, // reserved2
- samplerate >> 8 & 0xFF, samplerate & 0xff, //
- 0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));
- }
- }, {
- key: 'mp3',
- value: function mp3(track) {
- var samplerate = track.samplerate;
- return MP4.box(MP4.types['.mp3'], new Uint8Array([0x00, 0x00, 0x00, // reserved
- 0x00, 0x00, 0x00, // reserved
- 0x00, 0x01, // data_reference_index
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved
- 0x00, track.channelCount, // channelcount
- 0x00, 0x10, // sampleSize:16bits
- 0x00, 0x00, 0x00, 0x00, // reserved2
- samplerate >> 8 & 0xFF, samplerate & 0xff, //
- 0x00, 0x00]));
- }
- }, {
- key: 'stsd',
- value: function stsd(track) {
- if (track.type === 'audio') {
- if (!track.isAAC && track.codec === 'mp3') {
- return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));
- }
- return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp4a(track));
- } else {
- return MP4.box(MP4.types.stsd, MP4.STSD, MP4.avc1(track));
+ // If we run through the loop without breaking, the media's dimensions are greater than every level, so default to
+ // the max level
+ var maxLevelIndex = levels.length - 1;
+
+ for (var i = 0; i < levels.length; i += 1) {
+ var level = levels[i];
+ if ((level.width >= width || level.height >= height) && atGreatestBandiwdth(level, levels[i + 1])) {
+ maxLevelIndex = i;
+ break;
}
}
- }, {
- key: 'tkhd',
- value: function tkhd(track) {
- var id = track.id,
- duration = track.duration * track.timescale,
- width = track.width,
- height = track.height,
- upperWordDuration = Math.floor(duration / (UINT32_MAX + 1)),
- lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));
- return MP4.box(MP4.types.tkhd, new Uint8Array([0x01, // version 1
- 0x00, 0x00, 0x07, // flags
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time
- id >> 24 & 0xFF, id >> 16 & 0xFF, id >> 8 & 0xFF, id & 0xFF, // track_ID
- 0x00, 0x00, 0x00, 0x00, // reserved
- upperWordDuration >> 24, upperWordDuration >> 16 & 0xFF, upperWordDuration >> 8 & 0xFF, upperWordDuration & 0xFF, lowerWordDuration >> 24, lowerWordDuration >> 16 & 0xFF, lowerWordDuration >> 8 & 0xFF, lowerWordDuration & 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved
- 0x00, 0x00, // layer
- 0x00, 0x00, // alternate_group
- 0x00, 0x00, // non-audio track volume
- 0x00, 0x00, // reserved
- 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix
- width >> 8 & 0xFF, width & 0xFF, 0x00, 0x00, // width
- height >> 8 & 0xFF, height & 0xFF, 0x00, 0x00 // height
- ]));
- }
- }, {
- key: 'traf',
- value: function traf(track, baseMediaDecodeTime) {
- var sampleDependencyTable = MP4.sdtp(track),
- id = track.id,
- upperWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1)),
- lowerWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));
- return MP4.box(MP4.types.traf, MP4.box(MP4.types.tfhd, new Uint8Array([0x00, // version 0
- 0x00, 0x00, 0x00, // flags
- id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF])), MP4.box(MP4.types.tfdt, new Uint8Array([0x01, // version 1
- 0x00, 0x00, 0x00, // flags
- upperWordBaseMediaDecodeTime >> 24, upperWordBaseMediaDecodeTime >> 16 & 0XFF, upperWordBaseMediaDecodeTime >> 8 & 0XFF, upperWordBaseMediaDecodeTime & 0xFF, lowerWordBaseMediaDecodeTime >> 24, lowerWordBaseMediaDecodeTime >> 16 & 0XFF, lowerWordBaseMediaDecodeTime >> 8 & 0XFF, lowerWordBaseMediaDecodeTime & 0xFF])), MP4.trun(track, sampleDependencyTable.length + 16 + // tfhd
- 20 + // tfdt
- 8 + // traf header
- 16 + // mfhd
- 8 + // moof header
- 8), // mdat header
- sampleDependencyTable);
- }
- /**
- * Generate a track box.
- * @param track {object} a track definition
- * @return {Uint8Array} the track box
- */
+ return maxLevelIndex;
+ };
- }, {
- key: 'trak',
- value: function trak(track) {
- track.duration = track.duration || 0xffffffff;
- return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));
- }
- }, {
- key: 'trex',
- value: function trex(track) {
- var id = track.id;
- return MP4.box(MP4.types.trex, new Uint8Array([0x00, // version 0
- 0x00, 0x00, 0x00, // flags
- id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF, // track_ID
- 0x00, 0x00, 0x00, 0x01, // default_sample_description_index
- 0x00, 0x00, 0x00, 0x00, // default_sample_duration
- 0x00, 0x00, 0x00, 0x00, // default_sample_size
- 0x00, 0x01, 0x00, 0x01 // default_sample_flags
- ]));
+ cap_level_controller__createClass(CapLevelController, [{
+ key: 'mediaWidth',
+ get: function get() {
+ var width = void 0;
+ var media = this.media;
+ if (media) {
+ width = media.width || media.clientWidth || media.offsetWidth;
+ width *= CapLevelController.contentScaleFactor;
+ }
+ return width;
}
}, {
- key: 'trun',
- value: function trun(track, offset) {
- var samples = track.samples || [],
- len = samples.length,
- arraylen = 12 + 16 * len,
- array = new Uint8Array(arraylen),
- i,
- sample,
- duration,
- size,
- flags,
- cts;
- offset += 8 + arraylen;
- array.set([0x00, // version 0
- 0x00, 0x0f, 0x01, // flags
- len >>> 24 & 0xFF, len >>> 16 & 0xFF, len >>> 8 & 0xFF, len & 0xFF, // sample_count
- offset >>> 24 & 0xFF, offset >>> 16 & 0xFF, offset >>> 8 & 0xFF, offset & 0xFF // data_offset
- ], 0);
- for (i = 0; i < len; i++) {
- sample = samples[i];
- duration = sample.duration;
- size = sample.size;
- flags = sample.flags;
- cts = sample.cts;
- array.set([duration >>> 24 & 0xFF, duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, // sample_duration
- size >>> 24 & 0xFF, size >>> 16 & 0xFF, size >>> 8 & 0xFF, size & 0xFF, // sample_size
- flags.isLeading << 2 | flags.dependsOn, flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.paddingValue << 1 | flags.isNonSync, flags.degradPrio & 0xF0 << 8, flags.degradPrio & 0x0F, // sample_flags
- cts >>> 24 & 0xFF, cts >>> 16 & 0xFF, cts >>> 8 & 0xFF, cts & 0xFF // sample_composition_time_offset
- ], 12 + 16 * i);
- }
- return MP4.box(MP4.types.trun, array);
+ key: 'mediaHeight',
+ get: function get() {
+ var height = void 0;
+ var media = this.media;
+ if (media) {
+ height = media.height || media.clientHeight || media.offsetHeight;
+ height *= CapLevelController.contentScaleFactor;
+ }
+ return height;
}
- }, {
- key: 'initSegment',
- value: function initSegment(tracks) {
- if (!MP4.types) {
- MP4.init();
- }
- var movie = MP4.moov(tracks),
- result;
- result = new Uint8Array(MP4.FTYP.byteLength + movie.byteLength);
- result.set(MP4.FTYP);
- result.set(movie, MP4.FTYP.byteLength);
- return result;
+ }], [{
+ key: 'contentScaleFactor',
+ get: function get() {
+ var pixelRatio = 1;
+ try {
+ pixelRatio = window.devicePixelRatio;
+ } catch (e) {}
+ return pixelRatio;
}
}]);
- return MP4;
-}();
-
-exports.default = MP4;
-
-},{}],45:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
- * fMP4 remuxer
- */
-
-var _aac = _dereq_(36);
+ return CapLevelController;
+}(event_handler);
-var _aac2 = _interopRequireDefault(_aac);
+/* harmony default export */ var cap_level_controller = (cap_level_controller_CapLevelController);
+// CONCATENATED MODULE: ./src/controller/fps-controller.js
+function fps_controller__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var _events = _dereq_(35);
+function fps_controller__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-var _events2 = _interopRequireDefault(_events);
+function fps_controller__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-var _logger = _dereq_(53);
+/*
+ * FPS Controller
+*/
-var _mp4Generator = _dereq_(44);
-var _mp4Generator2 = _interopRequireDefault(_mp4Generator);
-var _errors = _dereq_(33);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+var fps_controller_FPSController = function (_EventHandler) {
+ fps_controller__inherits(FPSController, _EventHandler);
-// 10 seconds
-var MAX_SILENT_FRAME_DURATION = 10 * 1000;
-
-var MP4Remuxer = function () {
- function MP4Remuxer(observer, config, typeSupported, vendor) {
- _classCallCheck(this, MP4Remuxer);
+ function FPSController(hls) {
+ fps_controller__classCallCheck(this, FPSController);
- this.observer = observer;
- this.config = config;
- this.typeSupported = typeSupported;
- var userAgent = navigator.userAgent;
- this.isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');
- this.ISGenerated = false;
+ return fps_controller__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].MEDIA_ATTACHING));
}
- _createClass(MP4Remuxer, [{
- key: 'destroy',
- value: function destroy() {}
- }, {
- key: 'resetTimeStamp',
- value: function resetTimeStamp(defaultTimeStamp) {
- this._initPTS = this._initDTS = defaultTimeStamp;
- }
- }, {
- key: 'resetInitSegment',
- value: function resetInitSegment() {
- this.ISGenerated = false;
+ FPSController.prototype.destroy = function destroy() {
+ if (this.timer) {
+ clearInterval(this.timer);
}
- }, {
- key: 'remux',
- value: function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {
- // generate Init Segment if needed
- if (!this.ISGenerated) {
- this.generateIS(audioTrack, videoTrack, timeOffset);
- }
-
- if (this.ISGenerated) {
- // Purposefully remuxing audio before video, so that remuxVideo can use nextAudioPts, which is
- // calculated in remuxAudio.
- //logger.log('nb AAC samples:' + audioTrack.samples.length);
- if (audioTrack.samples.length) {
- // if initSegment was generated without video samples, regenerate it again
- if (!audioTrack.timescale) {
- _logger.logger.warn('regenerate InitSegment as audio detected');
- this.generateIS(audioTrack, videoTrack, timeOffset);
- }
- var audioData = this.remuxAudio(audioTrack, timeOffset, contiguous, accurateTimeOffset);
- //logger.log('nb AVC samples:' + videoTrack.samples.length);
- if (videoTrack.samples.length) {
- var audioTrackLength = void 0;
- if (audioData) {
- audioTrackLength = audioData.endPTS - audioData.startPTS;
- }
- // if initSegment was generated without video samples, regenerate it again
- if (!videoTrack.timescale) {
- _logger.logger.warn('regenerate InitSegment as video detected');
- this.generateIS(audioTrack, videoTrack, timeOffset);
- }
- this.remuxVideo(videoTrack, timeOffset, contiguous, audioTrackLength, accurateTimeOffset);
- }
- } else {
- var videoData = void 0;
- //logger.log('nb AVC samples:' + videoTrack.samples.length);
- if (videoTrack.samples.length) {
- videoData = this.remuxVideo(videoTrack, timeOffset, contiguous, accurateTimeOffset);
- }
- if (videoData && audioTrack.codec) {
- this.remuxEmptyAudio(audioTrack, timeOffset, contiguous, videoData);
- }
- }
- }
- //logger.log('nb ID3 samples:' + audioTrack.samples.length);
- if (id3Track.samples.length) {
- this.remuxID3(id3Track, timeOffset);
- }
- //logger.log('nb ID3 samples:' + audioTrack.samples.length);
- if (textTrack.samples.length) {
- this.remuxText(textTrack, timeOffset);
+ this.isVideoPlaybackQualityAvailable = false;
+ };
+
+ FPSController.prototype.onMediaAttaching = function onMediaAttaching(data) {
+ var config = this.hls.config;
+ if (config.capLevelOnFPSDrop) {
+ var video = this.video = data.media instanceof HTMLVideoElement ? data.media : null;
+ if (typeof video.getVideoPlaybackQuality === 'function') {
+ this.isVideoPlaybackQualityAvailable = true;
}
- //notify end of parsing
- this.observer.trigger(_events2.default.FRAG_PARSED);
+ clearInterval(this.timer);
+ this.timer = setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);
}
- }, {
- key: 'generateIS',
- value: function generateIS(audioTrack, videoTrack, timeOffset) {
- var observer = this.observer,
- audioSamples = audioTrack.samples,
- videoSamples = videoTrack.samples,
- typeSupported = this.typeSupported,
- container = 'audio/mp4',
- tracks = {},
- data = { tracks: tracks },
- computePTSDTS = this._initPTS === undefined,
- initPTS,
- initDTS;
+ };
- if (computePTSDTS) {
- initPTS = initDTS = Infinity;
- }
- if (audioTrack.config && audioSamples.length) {
- // let's use audio sampling rate as MP4 time scale.
- // rationale is that there is a integer nb of audio frames per audio sample (1024 for AAC)
- // using audio sampling rate here helps having an integer MP4 frame duration
- // this avoids potential rounding issue and AV sync issue
- audioTrack.timescale = audioTrack.samplerate;
- _logger.logger.log('audio sampling rate : ' + audioTrack.samplerate);
- if (!audioTrack.isAAC) {
- if (typeSupported.mpeg) {
- // Chrome and Safari
- container = 'audio/mpeg';
- audioTrack.codec = '';
- } else if (typeSupported.mp3) {
- // Firefox
- audioTrack.codec = 'mp3';
- }
- }
- tracks.audio = {
- container: container,
- codec: audioTrack.codec,
- initSegment: !audioTrack.isAAC && typeSupported.mpeg ? new Uint8Array() : _mp4Generator2.default.initSegment([audioTrack]),
- metadata: {
- channelCount: audioTrack.channelCount
- }
- };
- if (computePTSDTS) {
- // remember first PTS of this demuxing context. for audio, PTS = DTS
- initPTS = initDTS = audioSamples[0].pts - audioTrack.inputTimeScale * timeOffset;
- }
- }
-
- if (videoTrack.sps && videoTrack.pps && videoSamples.length) {
- // let's use input time scale as MP4 video timescale
- // we use input time scale straight away to avoid rounding issues on frame duration / cts computation
- var inputTimeScale = videoTrack.inputTimeScale;
- videoTrack.timescale = inputTimeScale;
- tracks.video = {
- container: 'video/mp4',
- codec: videoTrack.codec,
- initSegment: _mp4Generator2.default.initSegment([videoTrack]),
- metadata: {
- width: videoTrack.width,
- height: videoTrack.height
+ FPSController.prototype.checkFPS = function checkFPS(video, decodedFrames, droppedFrames) {
+ var currentTime = performance.now();
+ if (decodedFrames) {
+ if (this.lastTime) {
+ var currentPeriod = currentTime - this.lastTime,
+ currentDropped = droppedFrames - this.lastDroppedFrames,
+ currentDecoded = decodedFrames - this.lastDecodedFrames,
+ droppedFPS = 1000 * currentDropped / currentPeriod,
+ hls = this.hls;
+ hls.trigger(events["a" /* default */].FPS_DROP, { currentDropped: currentDropped, currentDecoded: currentDecoded, totalDroppedFrames: droppedFrames });
+ if (droppedFPS > 0) {
+ //logger.log('checkFPS : droppedFPS/decodedFPS:' + droppedFPS/(1000 * currentDecoded / currentPeriod));
+ if (currentDropped > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {
+ var currentLevel = hls.currentLevel;
+ logger["b" /* logger */].warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);
+ if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {
+ currentLevel = currentLevel - 1;
+ hls.trigger(events["a" /* default */].FPS_DROP_LEVEL_CAPPING, { level: currentLevel, droppedLevel: hls.currentLevel });
+ hls.autoLevelCapping = currentLevel;
+ hls.streamController.nextLevelSwitch();
+ }
}
- };
- if (computePTSDTS) {
- initPTS = Math.min(initPTS, videoSamples[0].pts - inputTimeScale * timeOffset);
- initDTS = Math.min(initDTS, videoSamples[0].dts - inputTimeScale * timeOffset);
- this.observer.trigger(_events2.default.INIT_PTS_FOUND, { initPTS: initPTS });
}
}
+ this.lastTime = currentTime;
+ this.lastDroppedFrames = droppedFrames;
+ this.lastDecodedFrames = decodedFrames;
+ }
+ };
- if (Object.keys(tracks).length) {
- observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);
- this.ISGenerated = true;
- if (computePTSDTS) {
- this._initPTS = initPTS;
- this._initDTS = initDTS;
- }
+ FPSController.prototype.checkFPSInterval = function checkFPSInterval() {
+ var video = this.video;
+ if (video) {
+ if (this.isVideoPlaybackQualityAvailable) {
+ var videoPlaybackQuality = video.getVideoPlaybackQuality();
+ this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);
} else {
- observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'no audio/video samples found' });
+ this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);
}
}
- }, {
- key: 'remuxVideo',
- value: function remuxVideo(track, timeOffset, contiguous, audioTrackLength, accurateTimeOffset) {
- var offset = 8,
- timeScale = track.timescale,
- mp4SampleDuration,
- mdat,
- moof,
- firstPTS,
- firstDTS,
- nextDTS,
- lastPTS,
- lastDTS,
- inputSamples = track.samples,
- outputSamples = [],
- nbSamples = inputSamples.length,
- ptsNormalize = this._PTSNormalize,
- initDTS = this._initDTS;
-
- // for (let i = 0; i < track.samples.length; i++) {
- // let avcSample = track.samples[i];
- // let units = avcSample.units;
- // let unitsString = '';
- // for (let j = 0; j < units.length ; j++) {
- // unitsString += units[j].type + ',';
- // if (units[j].data.length < 500) {
- // unitsString += Hex.hexDump(units[j].data);
- // }
- // }
- // logger.log(avcSample.pts + '/' + avcSample.dts + ',' + unitsString + avcSample.units.length);
- // }
-
- // if parsed fragment is contiguous with last one, let's use last DTS value as reference
- var nextAvcDts = this.nextAvcDts;
-
- var isSafari = this.isSafari;
-
- // Safari does not like overlapping DTS on consecutive fragments. let's use nextAvcDts to overcome this if fragments are consecutive
- if (isSafari) {
- // also consider consecutive fragments as being contiguous (even if a level switch occurs),
- // for sake of clarity:
- // consecutive fragments are frags with
- // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR
- // - less than 200 ms PTS gaps (timeScale/5)
- contiguous |= inputSamples.length && nextAvcDts && (accurateTimeOffset && Math.abs(timeOffset - nextAvcDts / timeScale) < 0.1 || Math.abs(inputSamples[0].pts - nextAvcDts - initDTS) < timeScale / 5);
- }
+ };
- if (!contiguous) {
- // if not contiguous, let's use target timeOffset
- nextAvcDts = timeOffset * timeScale;
- }
+ return FPSController;
+}(event_handler);
- // PTS is coded on 33bits, and can loop from -2^32 to 2^32
- // ptsNormalize will make PTS/DTS value monotonic, we use last known DTS value as reference value
- inputSamples.forEach(function (sample) {
- sample.pts = ptsNormalize(sample.pts - initDTS, nextAvcDts);
- sample.dts = ptsNormalize(sample.dts - initDTS, nextAvcDts);
- });
+/* harmony default export */ var fps_controller = (fps_controller_FPSController);
+// CONCATENATED MODULE: ./src/utils/xhr-loader.js
+function xhr_loader__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- // sort video samples by DTS then PTS then demux id order
- inputSamples.sort(function (a, b) {
- var deltadts = a.dts - b.dts;
- var deltapts = a.pts - b.pts;
- return deltadts ? deltadts : deltapts ? deltapts : a.id - b.id;
- });
+/**
+ * XHR based logger
+*/
- // handle broken streams with PTS < DTS, tolerance up 200ms (18000 in 90kHz timescale)
- var PTSDTSshift = inputSamples.reduce(function (prev, curr) {
- return Math.max(Math.min(prev, curr.pts - curr.dts), -18000);
- }, 0);
- if (PTSDTSshift < 0) {
- _logger.logger.warn('PTS < DTS detected in video samples, shifting DTS by ' + Math.round(PTSDTSshift / 90) + ' ms to overcome this issue');
- for (var i = 0; i < inputSamples.length; i++) {
- inputSamples[i].dts += PTSDTSshift;
- }
- }
-
- // compute first DTS and last DTS, normalize them against reference value
- var sample = inputSamples[0];
- firstDTS = Math.max(sample.dts, 0);
- firstPTS = Math.max(sample.pts, 0);
-
- // check timestamp continuity accross consecutive fragments (this is to remove inter-fragment gap/hole)
- var delta = Math.round((firstDTS - nextAvcDts) / 90);
- // if fragment are contiguous, detect hole/overlapping between fragments
- if (contiguous) {
- if (delta) {
- if (delta > 1) {
- _logger.logger.log('AVC:' + delta + ' ms hole between fragments detected,filling it');
- } else if (delta < -1) {
- _logger.logger.log('AVC:' + -delta + ' ms overlapping between fragments detected');
- }
- // remove hole/gap : set DTS to next expected DTS
- firstDTS = nextAvcDts;
- inputSamples[0].dts = firstDTS;
- // offset PTS as well, ensure that PTS is smaller or equal than new DTS
- firstPTS = Math.max(firstPTS - delta, nextAvcDts);
- inputSamples[0].pts = firstPTS;
- _logger.logger.log('Video/PTS/DTS adjusted: ' + Math.round(firstPTS / 90) + '/' + Math.round(firstDTS / 90) + ',delta:' + delta + ' ms');
- }
- }
- nextDTS = firstDTS;
- // compute lastPTS/lastDTS
- sample = inputSamples[inputSamples.length - 1];
- lastDTS = Math.max(sample.dts, 0);
- lastPTS = Math.max(sample.pts, 0, lastDTS);
- // on Safari let's signal the same sample duration for all samples
- // sample duration (as expected by trun MP4 boxes), should be the delta between sample DTS
- // set this constant duration as being the avg delta between consecutive DTS.
- if (isSafari) {
- mp4SampleDuration = Math.round((lastDTS - firstDTS) / (inputSamples.length - 1));
- }
-
- var nbNalu = 0,
- naluLen = 0;
- for (var _i = 0; _i < nbSamples; _i++) {
- // compute total/avc sample length and nb of NAL units
- var _sample = inputSamples[_i],
- units = _sample.units,
- nbUnits = units.length,
- sampleLen = 0;
- for (var j = 0; j < nbUnits; j++) {
- sampleLen += units[j].data.length;
- }
- naluLen += sampleLen;
- nbNalu += nbUnits;
- _sample.length = sampleLen;
-
- // normalize PTS/DTS
- if (isSafari) {
- // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples
- _sample.dts = firstDTS + _i * mp4SampleDuration;
- } else {
- // ensure sample monotonic DTS
- _sample.dts = Math.max(_sample.dts, firstDTS);
- }
- // ensure that computed value is greater or equal than sample DTS
- _sample.pts = Math.max(_sample.pts, _sample.dts);
- }
+var xhr_loader_XhrLoader = function () {
+ function XhrLoader(config) {
+ xhr_loader__classCallCheck(this, XhrLoader);
- /* concatenate the video data and construct the mdat in place
- (need 8 more bytes to fill length and mpdat type) */
- var mdatSize = naluLen + 4 * nbNalu + 8;
- try {
- mdat = new Uint8Array(mdatSize);
- } catch (err) {
- this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MUX_ERROR, details: _errors.ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes: mdatSize, reason: 'fail allocating video mdat ' + mdatSize });
- return;
- }
- var view = new DataView(mdat.buffer);
- view.setUint32(0, mdatSize);
- mdat.set(_mp4Generator2.default.types.mdat, 4);
-
- for (var _i2 = 0; _i2 < nbSamples; _i2++) {
- var avcSample = inputSamples[_i2],
- avcSampleUnits = avcSample.units,
- mp4SampleLength = 0,
- compositionTimeOffset = void 0;
- // convert NALU bitstream to MP4 format (prepend NALU with size field)
- for (var _j = 0, _nbUnits = avcSampleUnits.length; _j < _nbUnits; _j++) {
- var unit = avcSampleUnits[_j],
- unitData = unit.data,
- unitDataLen = unit.data.byteLength;
- view.setUint32(offset, unitDataLen);
- offset += 4;
- mdat.set(unitData, offset);
- offset += unitDataLen;
- mp4SampleLength += 4 + unitDataLen;
- }
-
- if (!isSafari) {
- // expected sample duration is the Decoding Timestamp diff of consecutive samples
- if (_i2 < nbSamples - 1) {
- mp4SampleDuration = inputSamples[_i2 + 1].dts - avcSample.dts;
- } else {
- var config = this.config,
- lastFrameDuration = avcSample.dts - inputSamples[_i2 > 0 ? _i2 - 1 : _i2].dts;
- if (config.stretchShortVideoTrack) {
- // In some cases, a segment's audio track duration may exceed the video track duration.
- // Since we've already remuxed audio, and we know how long the audio track is, we look to
- // see if the delta to the next segment is longer than the minimum of maxBufferHole and
- // maxSeekHole. If so, playback would potentially get stuck, so we artificially inflate
- // the duration of the last frame to minimize any potential gap between segments.
- var maxBufferHole = config.maxBufferHole,
- maxSeekHole = config.maxSeekHole,
- gapTolerance = Math.floor(Math.min(maxBufferHole, maxSeekHole) * timeScale),
- deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * timeScale : this.nextAudioPts) - avcSample.pts;
- if (deltaToFrameEnd > gapTolerance) {
- // We subtract lastFrameDuration from deltaToFrameEnd to try to prevent any video
- // frame overlap. maxBufferHole/maxSeekHole should be >> lastFrameDuration anyway.
- mp4SampleDuration = deltaToFrameEnd - lastFrameDuration;
- if (mp4SampleDuration < 0) {
- mp4SampleDuration = lastFrameDuration;
- }
- _logger.logger.log('It is approximately ' + deltaToFrameEnd / 90 + ' ms to the next segment; using duration ' + mp4SampleDuration / 90 + ' ms for the last video frame.');
- } else {
- mp4SampleDuration = lastFrameDuration;
- }
- } else {
- mp4SampleDuration = lastFrameDuration;
- }
- }
- compositionTimeOffset = Math.round(avcSample.pts - avcSample.dts);
- } else {
- compositionTimeOffset = Math.max(0, mp4SampleDuration * Math.round((avcSample.pts - avcSample.dts) / mp4SampleDuration));
- }
-
- //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(avcSample.pts/4294967296).toFixed(3)}');
- outputSamples.push({
- size: mp4SampleLength,
- // constant duration
- duration: mp4SampleDuration,
- cts: compositionTimeOffset,
- flags: {
- isLeading: 0,
- isDependedOn: 0,
- hasRedundancy: 0,
- degradPrio: 0,
- dependsOn: avcSample.key ? 2 : 1,
- isNonSync: avcSample.key ? 0 : 1
- }
- });
- }
- // next AVC sample DTS should be equal to last sample DTS + last sample duration (in PES timescale)
- this.nextAvcDts = lastDTS + mp4SampleDuration;
- var dropped = track.dropped;
- track.len = 0;
- track.nbNalu = 0;
- track.dropped = 0;
- if (outputSamples.length && navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
- var flags = outputSamples[0].flags;
- // chrome workaround, mark first sample as being a Random Access Point to avoid sourcebuffer append issue
- // https://code.google.com/p/chromium/issues/detail?id=229412
- flags.dependsOn = 2;
- flags.isNonSync = 0;
- }
- track.samples = outputSamples;
- moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS, track);
- track.samples = [];
+ if (config && config.xhrSetup) {
+ this.xhrSetup = config.xhrSetup;
+ }
+ }
- var data = {
- data1: moof,
- data2: mdat,
- startPTS: firstPTS / timeScale,
- endPTS: (lastPTS + mp4SampleDuration) / timeScale,
- startDTS: firstDTS / timeScale,
- endDTS: this.nextAvcDts / timeScale,
- type: 'video',
- nb: outputSamples.length,
- dropped: dropped
- };
- this.observer.trigger(_events2.default.FRAG_PARSING_DATA, data);
- return data;
+ XhrLoader.prototype.destroy = function destroy() {
+ this.abort();
+ this.loader = null;
+ };
+
+ XhrLoader.prototype.abort = function abort() {
+ var loader = this.loader;
+ if (loader && loader.readyState !== 4) {
+ this.stats.aborted = true;
+ loader.abort();
}
- }, {
- key: 'remuxAudio',
- value: function remuxAudio(track, timeOffset, contiguous, accurateTimeOffset) {
- var inputTimeScale = track.inputTimeScale,
- mp4timeScale = track.timescale,
- scaleFactor = inputTimeScale / mp4timeScale,
- mp4SampleDuration = track.isAAC ? 1024 : 1152,
- inputSampleDuration = mp4SampleDuration * scaleFactor,
- ptsNormalize = this._PTSNormalize,
- initDTS = this._initDTS,
- rawMPEG = !track.isAAC && this.typeSupported.mpeg;
-
- var offset,
- mp4Sample,
- fillFrame,
- mdat,
- moof,
- firstPTS,
- lastPTS,
- inputSamples = track.samples,
- outputSamples = [],
- nextAudioPts = this.nextAudioPts;
-
- // for audio samples, also consider consecutive fragments as being contiguous (even if a level switch occurs),
- // for sake of clarity:
- // consecutive fragments are frags with
- // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR
- // - less than 20 audio frames distance
- // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)
- // this helps ensuring audio continuity
- // and this also avoids audio glitches/cut when switching quality, or reporting wrong duration on first audio frame
- contiguous |= inputSamples.length && nextAudioPts && (accurateTimeOffset && Math.abs(timeOffset - nextAudioPts / inputTimeScale) < 0.1 || Math.abs(inputSamples[0].pts - nextAudioPts - initDTS) < 20 * inputSampleDuration);
-
- if (!contiguous) {
- // if fragments are not contiguous, let's use timeOffset to compute next Audio PTS
- nextAudioPts = timeOffset * inputTimeScale;
- }
- // compute normalized PTS
- inputSamples.forEach(function (sample) {
- sample.pts = sample.dts = ptsNormalize(sample.pts - initDTS, nextAudioPts);
- });
+ window.clearTimeout(this.requestTimeout);
+ this.requestTimeout = null;
+ window.clearTimeout(this.retryTimeout);
+ this.retryTimeout = null;
+ };
- // sort based on normalized PTS (this is to avoid sorting issues in case timestamp
- // reloop in the middle of our samples array)
- inputSamples.sort(function (a, b) {
- return a.pts - b.pts;
- });
+ XhrLoader.prototype.load = function load(context, config, callbacks) {
+ this.context = context;
+ this.config = config;
+ this.callbacks = callbacks;
+ this.stats = { trequest: performance.now(), retry: 0 };
+ this.retryDelay = config.retryDelay;
+ this.loadInternal();
+ };
- // If the audio track is missing samples, the frames seem to get "left-shifted" within the
- // resulting mp4 segment, causing sync issues and leaving gaps at the end of the audio segment.
- // In an effort to prevent this from happening, we inject frames here where there are gaps.
- // When possible, we inject a silent frame; when that's not possible, we duplicate the last
- // frame.
-
- // only inject/drop audio frames in case time offset is accurate
- if (accurateTimeOffset && track.isAAC) {
- for (var i = 0, nextPts = nextAudioPts; i < inputSamples.length;) {
- // First, let's see how far off this frame is from where we expect it to be
- var sample = inputSamples[i],
- delta;
- var pts = sample.pts;
- delta = pts - nextPts;
-
- var duration = Math.abs(1000 * delta / inputTimeScale);
-
- // If we're overlapping by more than a duration, drop this sample
- if (delta <= -inputSampleDuration) {
- _logger.logger.warn('Dropping 1 audio frame @ ' + (nextPts / inputTimeScale).toFixed(3) + 's due to ' + duration + ' ms overlap.');
- inputSamples.splice(i, 1);
- track.len -= sample.unit.length;
- // Don't touch nextPtsNorm or i
- }
+ XhrLoader.prototype.loadInternal = function loadInternal() {
+ var xhr,
+ context = this.context;
+ xhr = this.loader = new XMLHttpRequest();
- // Insert missing frames if:
- // 1: We're more than one frame away
- // 2: Not more than MAX_SILENT_FRAME_DURATION away
- // 3: currentTime (aka nextPtsNorm) is not 0
- else if (delta >= inputSampleDuration && duration < MAX_SILENT_FRAME_DURATION && nextPts) {
- var missing = Math.round(delta / inputSampleDuration);
- _logger.logger.warn('Injecting ' + missing + ' audio frame @ ' + (nextPts / inputTimeScale).toFixed(3) + 's due to ' + Math.round(1000 * delta / inputTimeScale) + ' ms gap.');
- for (var j = 0; j < missing; j++) {
- var newStamp = Math.max(nextPts, 0);
- fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);
- if (!fillFrame) {
- _logger.logger.log('Unable to get silent frame for given audio codec; duplicating last frame instead.');
- fillFrame = sample.unit.subarray();
- }
- inputSamples.splice(i, 0, { unit: fillFrame, pts: newStamp, dts: newStamp });
- track.len += fillFrame.length;
- nextPts += inputSampleDuration;
- i++;
- }
+ var stats = this.stats;
+ stats.tfirst = 0;
+ stats.loaded = 0;
+ var xhrSetup = this.xhrSetup;
- // Adjust sample to next expected pts
- sample.pts = sample.dts = nextPts;
- nextPts += inputSampleDuration;
- i++;
- } else {
- // Otherwise, just adjust pts
- if (Math.abs(delta) > 0.1 * inputSampleDuration) {
- //logger.log(`Invalid frame delta ${Math.round(delta + inputSampleDuration)} at PTS ${Math.round(pts / 90)} (should be ${Math.round(inputSampleDuration)}).`);
- }
- sample.pts = sample.dts = nextPts;
- nextPts += inputSampleDuration;
- i++;
- }
+ try {
+ if (xhrSetup) {
+ try {
+ xhrSetup(xhr, context.url);
+ } catch (e) {
+ // fix xhrSetup: (xhr, url) => {xhr.setRequestHeader("Content-Language", "test");}
+ // not working, as xhr.setRequestHeader expects xhr.readyState === OPEN
+ xhr.open('GET', context.url, true);
+ xhrSetup(xhr, context.url);
}
}
-
- for (var _j2 = 0, _nbSamples = inputSamples.length; _j2 < _nbSamples; _j2++) {
- var audioSample = inputSamples[_j2];
- var unit = audioSample.unit;
- var _pts = audioSample.pts;
- //logger.log(`Audio/PTS:${Math.round(pts/90)}`);
- // if not first sample
- if (lastPTS !== undefined) {
- mp4Sample.duration = Math.round((_pts - lastPTS) / scaleFactor);
- } else {
- var _delta = Math.round(1000 * (_pts - nextAudioPts) / inputTimeScale),
- numMissingFrames = 0;
- // if fragment are contiguous, detect hole/overlapping between fragments
- // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)
- if (contiguous && track.isAAC) {
- // log delta
- if (_delta) {
- if (_delta > 0 && _delta < MAX_SILENT_FRAME_DURATION) {
- numMissingFrames = Math.round((_pts - nextAudioPts) / inputSampleDuration);
- _logger.logger.log(_delta + ' ms hole between AAC samples detected,filling it');
- if (numMissingFrames > 0) {
- fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);
- if (!fillFrame) {
- fillFrame = unit.subarray();
- }
- track.len += numMissingFrames * fillFrame.length;
- }
- // if we have frame overlap, overlapping for more than half a frame duraion
- } else if (_delta < -12) {
- // drop overlapping audio frames... browser will deal with it
- _logger.logger.log('drop overlapping AAC sample, expected/parsed/delta:' + (nextAudioPts / inputTimeScale).toFixed(3) + 's/' + (_pts / inputTimeScale).toFixed(3) + 's/' + -_delta + 'ms');
- track.len -= unit.byteLength;
- continue;
- }
- // set PTS/DTS to expected PTS/DTS
- _pts = nextAudioPts;
- }
- }
- // remember first PTS of our audioSamples, ensure value is positive
- firstPTS = Math.max(0, _pts);
- if (track.len > 0) {
- /* concatenate the audio data and construct the mdat in place
- (need 8 more bytes to fill length and mdat type) */
- var mdatSize = rawMPEG ? track.len : track.len + 8;
- offset = rawMPEG ? 0 : 8;
- try {
- mdat = new Uint8Array(mdatSize);
- } catch (err) {
- this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MUX_ERROR, details: _errors.ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes: mdatSize, reason: 'fail allocating audio mdat ' + mdatSize });
- return;
- }
- if (!rawMPEG) {
- var view = new DataView(mdat.buffer);
- view.setUint32(0, mdatSize);
- mdat.set(_mp4Generator2.default.types.mdat, 4);
- }
- } else {
- // no audio samples
- return;
- }
- for (var _i3 = 0; _i3 < numMissingFrames; _i3++) {
- fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);
- if (!fillFrame) {
- _logger.logger.log('Unable to get silent frame for given audio codec; duplicating this frame instead.');
- fillFrame = unit.subarray();
- }
- mdat.set(fillFrame, offset);
- offset += fillFrame.byteLength;
- mp4Sample = {
- size: fillFrame.byteLength,
- cts: 0,
- duration: 1024,
- flags: {
- isLeading: 0,
- isDependedOn: 0,
- hasRedundancy: 0,
- degradPrio: 0,
- dependsOn: 1
- }
- };
- outputSamples.push(mp4Sample);
- }
- }
- mdat.set(unit, offset);
- var unitLen = unit.byteLength;
- offset += unitLen;
- //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${audioSample.pts}/${audioSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(audioSample.pts/4294967296).toFixed(3)}');
- mp4Sample = {
- size: unitLen,
- cts: 0,
- duration: 0,
- flags: {
- isLeading: 0,
- isDependedOn: 0,
- hasRedundancy: 0,
- degradPrio: 0,
- dependsOn: 1
- }
- };
- outputSamples.push(mp4Sample);
- lastPTS = _pts;
- }
- var lastSampleDuration = 0;
- var nbSamples = outputSamples.length;
- //set last sample duration as being identical to previous sample
- if (nbSamples >= 2) {
- lastSampleDuration = outputSamples[nbSamples - 2].duration;
- mp4Sample.duration = lastSampleDuration;
- }
- if (nbSamples) {
- // next audio sample PTS should be equal to last sample PTS + duration
- this.nextAudioPts = nextAudioPts = lastPTS + scaleFactor * lastSampleDuration;
- //logger.log('Audio/PTS/PTSend:' + audioSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));
- track.len = 0;
- track.samples = outputSamples;
- if (rawMPEG) {
- moof = new Uint8Array();
- } else {
- moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstPTS / scaleFactor, track);
- }
- track.samples = [];
- var start = firstPTS / inputTimeScale;
- var end = nextAudioPts / inputTimeScale;
- var audioData = {
- data1: moof,
- data2: mdat,
- startPTS: start,
- endPTS: end,
- startDTS: start,
- endDTS: end,
- type: 'audio',
- nb: nbSamples
- };
- this.observer.trigger(_events2.default.FRAG_PARSING_DATA, audioData);
- return audioData;
+ if (!xhr.readyState) {
+ xhr.open('GET', context.url, true);
}
- return null;
+ } catch (e) {
+ // IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS
+ this.callbacks.onError({ code: xhr.status, text: e.message }, context, xhr);
+ return;
}
- }, {
- key: 'remuxEmptyAudio',
- value: function remuxEmptyAudio(track, timeOffset, contiguous, videoData) {
- var inputTimeScale = track.inputTimeScale,
- mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale,
- scaleFactor = inputTimeScale / mp4timeScale,
- nextAudioPts = this.nextAudioPts,
+ if (context.rangeEnd) {
+ xhr.setRequestHeader('Range', 'bytes=' + context.rangeStart + '-' + (context.rangeEnd - 1));
+ }
+ xhr.onreadystatechange = this.readystatechange.bind(this);
+ xhr.onprogress = this.loadprogress.bind(this);
+ xhr.responseType = context.responseType;
- // sync with video's timestamp
- startDTS = (nextAudioPts !== undefined ? nextAudioPts : videoData.startDTS * inputTimeScale) + this._initDTS,
- endDTS = videoData.endDTS * inputTimeScale + this._initDTS,
-
- // one sample's duration value
- sampleDuration = 1024,
- frameDuration = scaleFactor * sampleDuration,
-
-
- // samples count of this segment's duration
- nbSamples = Math.ceil((endDTS - startDTS) / frameDuration),
-
+ // setup timeout before we perform request
+ this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), this.config.timeout);
+ xhr.send();
+ };
- // silent frame
- silentFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);
+ XhrLoader.prototype.readystatechange = function readystatechange(event) {
+ var xhr = event.currentTarget,
+ readyState = xhr.readyState,
+ stats = this.stats,
+ context = this.context,
+ config = this.config;
- _logger.logger.warn('remux empty Audio');
- // Can't remux if we can't generate a silent frame...
- if (!silentFrame) {
- _logger.logger.trace('Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!');
- return;
- }
+ // don't proceed if xhr has been aborted
+ if (stats.aborted) {
+ return;
+ }
- var samples = [];
- for (var i = 0; i < nbSamples; i++) {
- var stamp = startDTS + i * frameDuration;
- samples.push({ unit: silentFrame, pts: stamp, dts: stamp });
- track.len += silentFrame.length;
+ // >= HEADERS_RECEIVED
+ if (readyState >= 2) {
+ // clear xhr timeout and rearm it if readyState less than 4
+ window.clearTimeout(this.requestTimeout);
+ if (stats.tfirst === 0) {
+ stats.tfirst = Math.max(performance.now(), stats.trequest);
+ }
+ if (readyState === 4) {
+ var status = xhr.status;
+ // http status between 200 to 299 are all successful
+ if (status >= 200 && status < 300) {
+ stats.tload = Math.max(stats.tfirst, performance.now());
+ var data = void 0,
+ len = void 0;
+ if (context.responseType === 'arraybuffer') {
+ data = xhr.response;
+ len = data.byteLength;
+ } else {
+ data = xhr.responseText;
+ len = data.length;
+ }
+ stats.loaded = stats.total = len;
+ var response = { url: xhr.responseURL, data: data };
+ this.callbacks.onSuccess(response, stats, context, xhr);
+ } else {
+ // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error
+ if (stats.retry >= config.maxRetry || status >= 400 && status < 499) {
+ logger["b" /* logger */].error(status + ' while loading ' + context.url);
+ this.callbacks.onError({ code: status, text: xhr.statusText }, context, xhr);
+ } else {
+ // retry
+ logger["b" /* logger */].warn(status + ' while loading ' + context.url + ', retrying in ' + this.retryDelay + '...');
+ // aborts and resets internal state
+ this.destroy();
+ // schedule retry
+ this.retryTimeout = window.setTimeout(this.loadInternal.bind(this), this.retryDelay);
+ // set exponential backoff
+ this.retryDelay = Math.min(2 * this.retryDelay, config.maxRetryDelay);
+ stats.retry++;
+ }
+ }
+ } else {
+ // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet
+ this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout);
}
- track.samples = samples;
-
- this.remuxAudio(track, timeOffset, contiguous);
}
- }, {
- key: 'remuxID3',
- value: function remuxID3(track, timeOffset) {
- var length = track.samples.length,
- sample;
- var inputTimeScale = track.inputTimeScale;
- var initPTS = this._initPTS;
- var initDTS = this._initDTS;
- // consume samples
- if (length) {
- for (var index = 0; index < length; index++) {
- sample = track.samples[index];
- // setting id3 pts, dts to relative time
- // using this._initPTS and this._initDTS to calculate relative time
- sample.pts = (sample.pts - initPTS) / inputTimeScale;
- sample.dts = (sample.dts - initDTS) / inputTimeScale;
- }
- this.observer.trigger(_events2.default.FRAG_PARSING_METADATA, {
- samples: track.samples
- });
- }
+ };
- track.samples = [];
- timeOffset = timeOffset;
- }
- }, {
- key: 'remuxText',
- value: function remuxText(track, timeOffset) {
- track.samples.sort(function (a, b) {
- return a.pts - b.pts;
- });
+ XhrLoader.prototype.loadtimeout = function loadtimeout() {
+ logger["b" /* logger */].warn('timeout while loading ' + this.context.url);
+ this.callbacks.onTimeout(this.stats, this.context, null);
+ };
- var length = track.samples.length,
- sample;
- var inputTimeScale = track.inputTimeScale;
- var initPTS = this._initPTS;
- // consume samples
- if (length) {
- for (var index = 0; index < length; index++) {
- sample = track.samples[index];
- // setting text pts, dts to relative time
- // using this._initPTS and this._initDTS to calculate relative time
- sample.pts = (sample.pts - initPTS) / inputTimeScale;
- }
- this.observer.trigger(_events2.default.FRAG_PARSING_USERDATA, {
- samples: track.samples
- });
- }
+ XhrLoader.prototype.loadprogress = function loadprogress(event) {
+ var xhr = event.currentTarget,
+ stats = this.stats;
- track.samples = [];
- timeOffset = timeOffset;
+ stats.loaded = event.loaded;
+ if (event.lengthComputable) {
+ stats.total = event.total;
}
- }, {
- key: '_PTSNormalize',
- value: function _PTSNormalize(value, reference) {
- var offset;
- if (reference === undefined) {
- return value;
- }
- if (reference < value) {
- // - 2^33
- offset = -8589934592;
- } else {
- // + 2^33
- offset = 8589934592;
- }
- /* PTS is 33bit (from 0 to 2^33 -1)
- if diff between value and reference is bigger than half of the amplitude (2^32) then it means that
- PTS looping occured. fill the gap */
- while (Math.abs(value - reference) > 4294967296) {
- value += offset;
- }
- return value;
+ var onProgress = this.callbacks.onProgress;
+ if (onProgress) {
+ // third arg is to provide on progress data
+ onProgress(stats, this.context, null, xhr);
}
- }]);
+ };
- return MP4Remuxer;
+ return XhrLoader;
}();
-exports.default = MP4Remuxer;
+/* harmony default export */ var xhr_loader = (xhr_loader_XhrLoader);
+// CONCATENATED MODULE: ./src/controller/audio-track-controller.js
+var audio_track_controller__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-},{"33":33,"35":35,"36":36,"44":44,"53":53}],46:[function(_dereq_,module,exports){
-'use strict';
+function audio_track_controller__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+function audio_track_controller__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
- * passthrough remuxer
- */
+function audio_track_controller__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+/*
+ * audio track controller
+*/
-var _events = _dereq_(35);
-var _events2 = _interopRequireDefault(_events);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var PassThroughRemuxer = function () {
- function PassThroughRemuxer(observer) {
- _classCallCheck(this, PassThroughRemuxer);
- this.observer = observer;
- }
+var audio_track_controller_AudioTrackController = function (_EventHandler) {
+ audio_track_controller__inherits(AudioTrackController, _EventHandler);
- _createClass(PassThroughRemuxer, [{
- key: 'destroy',
- value: function destroy() {}
- }, {
- key: 'resetTimeStamp',
- value: function resetTimeStamp() {}
- }, {
- key: 'resetInitSegment',
- value: function resetInitSegment() {}
- }, {
- key: 'remux',
- value: function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset, rawData) {
- var observer = this.observer;
- var streamType = '';
- if (audioTrack) {
- streamType += 'audio';
- }
- if (videoTrack) {
- streamType += 'video';
- }
- observer.trigger(_events2.default.FRAG_PARSING_DATA, {
- data1: rawData,
- startPTS: timeOffset,
- startDTS: timeOffset,
- type: streamType,
- nb: 1,
- dropped: 0
- });
- //notify end of parsing
- observer.trigger(_events2.default.FRAG_PARSED);
- }
- }]);
+ function AudioTrackController(hls) {
+ audio_track_controller__classCallCheck(this, AudioTrackController);
- return PassThroughRemuxer;
-}();
+ var _this = audio_track_controller__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].MANIFEST_LOADING, events["a" /* default */].MANIFEST_PARSED, events["a" /* default */].AUDIO_TRACK_LOADED, events["a" /* default */].ERROR));
-exports.default = PassThroughRemuxer;
+ _this.ticks = 0;
+ _this.ontick = _this.tick.bind(_this);
+ return _this;
+ }
-},{"35":35}],47:[function(_dereq_,module,exports){
-'use strict';
+ AudioTrackController.prototype.destroy = function destroy() {
+ this.cleanTimer();
+ event_handler.prototype.destroy.call(this);
+ };
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ AudioTrackController.prototype.cleanTimer = function cleanTimer() {
+ if (this.timer) {
+ clearTimeout(this.timer);
+ this.timer = null;
+ }
+ };
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+ AudioTrackController.prototype.tick = function tick() {
+ this.ticks++;
+ if (this.ticks === 1) {
+ this.doTick();
+ if (this.ticks > 1) {
+ setTimeout(this.tick, 1);
+ }
+ this.ticks = 0;
+ }
+ };
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ AudioTrackController.prototype.doTick = function doTick() {
+ this.updateTrack(this.trackId);
+ };
-var DECIMAL_RESOLUTION_REGEX = /^(\d+)x(\d+)$/;
-var ATTR_LIST_REGEX = /\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g;
+ AudioTrackController.prototype.onError = function onError(data) {
+ if (data.fatal && data.type === errors["b" /* ErrorTypes */].NETWORK_ERROR) {
+ this.cleanTimer();
+ }
+ };
-// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js
+ AudioTrackController.prototype.onManifestLoading = function onManifestLoading() {
+ // reset audio tracks on manifest loading
+ this.tracks = [];
+ this.trackId = -1;
+ };
-var AttrList = function () {
- function AttrList(attrs) {
- _classCallCheck(this, AttrList);
+ AudioTrackController.prototype.onManifestParsed = function onManifestParsed(data) {
+ var _this2 = this;
- if (typeof attrs === 'string') {
- attrs = AttrList.parseAttrList(attrs);
- }
- for (var attr in attrs) {
- if (attrs.hasOwnProperty(attr)) {
- this[attr] = attrs[attr];
+ var tracks = data.audioTracks || [];
+ var defaultFound = false;
+ this.tracks = tracks;
+ this.hls.trigger(events["a" /* default */].AUDIO_TRACKS_UPDATED, { audioTracks: tracks });
+ // loop through available audio tracks and autoselect default if needed
+ var id = 0;
+ tracks.forEach(function (track) {
+ if (track.default && !defaultFound) {
+ _this2.audioTrack = id;
+ defaultFound = true;
+ return;
}
+ id++;
+ });
+ if (defaultFound === false && tracks.length) {
+ logger["b" /* logger */].log('no default audio track defined, use first audio track as default');
+ this.audioTrack = 0;
}
- }
+ };
- _createClass(AttrList, [{
- key: 'decimalInteger',
- value: function decimalInteger(attrName) {
- var intValue = parseInt(this[attrName], 10);
- if (intValue > Number.MAX_SAFE_INTEGER) {
- return Infinity;
+ AudioTrackController.prototype.onAudioTrackLoaded = function onAudioTrackLoaded(data) {
+ if (data.id < this.tracks.length) {
+ logger["b" /* logger */].log('audioTrack ' + data.id + ' loaded');
+ this.tracks[data.id].details = data.details;
+ // check if current playlist is a live playlist
+ if (data.details.live && !this.timer) {
+ // if live playlist we will have to reload it periodically
+ // set reload period to playlist target duration
+ this.timer = setInterval(this.ontick, 1000 * data.details.targetduration);
+ }
+ if (!data.details.live && this.timer) {
+ // playlist is not live and timer is armed : stopping it
+ this.cleanTimer();
}
- return intValue;
}
- }, {
- key: 'hexadecimalInteger',
- value: function hexadecimalInteger(attrName) {
- if (this[attrName]) {
- var stringValue = (this[attrName] || '0x').slice(2);
- stringValue = (stringValue.length & 1 ? '0' : '') + stringValue;
+ };
- var value = new Uint8Array(stringValue.length / 2);
- for (var i = 0; i < stringValue.length / 2; i++) {
- value[i] = parseInt(stringValue.slice(i * 2, i * 2 + 2), 16);
- }
- return value;
- } else {
- return null;
+ /** get alternate audio tracks list from playlist **/
+
+
+ AudioTrackController.prototype.setAudioTrackInternal = function setAudioTrackInternal(newId) {
+ // check if level idx is valid
+ if (newId >= 0 && newId < this.tracks.length) {
+ // stopping live reloading timer if any
+ this.cleanTimer();
+ this.trackId = newId;
+ logger["b" /* logger */].log('switching to audioTrack ' + newId);
+ var audioTrack = this.tracks[newId],
+ hls = this.hls,
+ type = audioTrack.type,
+ url = audioTrack.url,
+ eventObj = { id: newId, type: type, url: url };
+ // keep AUDIO_TRACK_SWITCH for legacy reason
+ hls.trigger(events["a" /* default */].AUDIO_TRACK_SWITCH, eventObj);
+ hls.trigger(events["a" /* default */].AUDIO_TRACK_SWITCHING, eventObj);
+ // check if we need to load playlist for this audio Track
+ var details = audioTrack.details;
+ if (url && (details === undefined || details.live === true)) {
+ // track not retrieved yet, or live playlist we need to (re)load it
+ logger["b" /* logger */].log('(re)loading playlist for audioTrack ' + newId);
+ hls.trigger(events["a" /* default */].AUDIO_TRACK_LOADING, { url: url, id: newId });
}
}
- }, {
- key: 'hexadecimalIntegerAsNumber',
- value: function hexadecimalIntegerAsNumber(attrName) {
- var intValue = parseInt(this[attrName], 16);
- if (intValue > Number.MAX_SAFE_INTEGER) {
- return Infinity;
+ };
+
+ AudioTrackController.prototype.updateTrack = function updateTrack(newId) {
+ // check if level idx is valid
+ if (newId >= 0 && newId < this.tracks.length) {
+ // stopping live reloading timer if any
+ this.cleanTimer();
+ this.trackId = newId;
+ logger["b" /* logger */].log('updating audioTrack ' + newId);
+ var audioTrack = this.tracks[newId],
+ url = audioTrack.url;
+ // check if we need to load playlist for this audio Track
+ var details = audioTrack.details;
+ if (url && (details === undefined || details.live === true)) {
+ // track not retrieved yet, or live playlist we need to (re)load it
+ logger["b" /* logger */].log('(re)loading playlist for audioTrack ' + newId);
+ this.hls.trigger(events["a" /* default */].AUDIO_TRACK_LOADING, { url: url, id: newId });
}
- return intValue;
}
- }, {
- key: 'decimalFloatingPoint',
- value: function decimalFloatingPoint(attrName) {
- return parseFloat(this[attrName]);
- }
- }, {
- key: 'enumeratedString',
- value: function enumeratedString(attrName) {
- return this[attrName];
+ };
+
+ audio_track_controller__createClass(AudioTrackController, [{
+ key: 'audioTracks',
+ get: function get() {
+ return this.tracks;
}
+
+ /** get index of the selected audio track (index in audio track lists) **/
+
}, {
- key: 'decimalResolution',
- value: function decimalResolution(attrName) {
- var res = DECIMAL_RESOLUTION_REGEX.exec(this[attrName]);
- if (res === null) {
- return undefined;
- }
- return {
- width: parseInt(res[1], 10),
- height: parseInt(res[2], 10)
- };
+ key: 'audioTrack',
+ get: function get() {
+ return this.trackId;
}
- }], [{
- key: 'parseAttrList',
- value: function parseAttrList(input) {
- var match,
- attrs = {};
- ATTR_LIST_REGEX.lastIndex = 0;
- while ((match = ATTR_LIST_REGEX.exec(input)) !== null) {
- var value = match[2],
- quote = '"';
- if (value.indexOf(quote) === 0 && value.lastIndexOf(quote) === value.length - 1) {
- value = value.slice(1, -1);
- }
- attrs[match[1]] = value;
+ /** select an audio track, based on its index in audio track lists**/
+ ,
+ set: function set(audioTrackId) {
+ if (this.trackId !== audioTrackId || this.tracks[audioTrackId].details === undefined) {
+ this.setAudioTrackInternal(audioTrackId);
}
- return attrs;
}
}]);
- return AttrList;
-}();
+ return AudioTrackController;
+}(event_handler);
-exports.default = AttrList;
+/* harmony default export */ var audio_track_controller = (audio_track_controller_AudioTrackController);
+// CONCATENATED MODULE: ./src/controller/audio-stream-controller.js
+var audio_stream_controller__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-},{}],48:[function(_dereq_,module,exports){
-"use strict";
+function audio_stream_controller__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var BinarySearch = {
- /**
- * Searches for an item in an array which matches a certain condition.
- * This requires the condition to only match one item in the array,
- * and for the array to be ordered.
- *
- * @param {Array} list The array to search.
- * @param {Function} comparisonFunction
- * Called and provided a candidate item as the first argument.
- * Should return:
- * > -1 if the item should be located at a lower index than the provided item.
- * > 1 if the item should be located at a higher index than the provided item.
- * > 0 if the item is the item you're looking for.
- *
- * @return {*} The object if it is found or null otherwise.
- */
- search: function search(list, comparisonFunction) {
- var minIndex = 0;
- var maxIndex = list.length - 1;
- var currentIndex = null;
- var currentElement = null;
-
- while (minIndex <= maxIndex) {
- currentIndex = (minIndex + maxIndex) / 2 | 0;
- currentElement = list[currentIndex];
+function audio_stream_controller__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
- var comparisonResult = comparisonFunction(currentElement);
- if (comparisonResult > 0) {
- minIndex = currentIndex + 1;
- } else if (comparisonResult < 0) {
- maxIndex = currentIndex - 1;
- } else {
- return currentElement;
- }
- }
+function audio_stream_controller__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
- return null;
- }
-};
+/*
+ * Audio Stream Controller
+*/
-module.exports = BinarySearch;
-},{}],49:[function(_dereq_,module,exports){
-'use strict';
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-/**
- *
- * This code was ported from the dash.js project at:
- * https://github.com/Dash-Industry-Forum/dash.js/blob/development/externals/cea608-parser.js
- * https://github.com/Dash-Industry-Forum/dash.js/commit/8269b26a761e0853bb21d78780ed945144ecdd4d#diff-71bc295a2d6b6b7093a1d3290d53a4b2
- *
- * The original copyright appears below:
- *
- * The copyright in this software is being made available under the BSD License,
- * included below. This software may be subject to other third party and contributor
- * rights, including patent rights, and no such rights are granted under this license.
- *
- * Copyright (c) 2015-2016, DASH Industry Forum.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation and/or
- * other materials provided with the distribution.
- * 2. Neither the name of Dash Industry Forum nor the names of its
- * contributors may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * Exceptions from regular ASCII. CodePoints are mapped to UTF-16 codes
- */
-var specialCea608CharsCodes = {
- 0x2a: 0xe1, // lowercase a, acute accent
- 0x5c: 0xe9, // lowercase e, acute accent
- 0x5e: 0xed, // lowercase i, acute accent
- 0x5f: 0xf3, // lowercase o, acute accent
- 0x60: 0xfa, // lowercase u, acute accent
- 0x7b: 0xe7, // lowercase c with cedilla
- 0x7c: 0xf7, // division symbol
- 0x7d: 0xd1, // uppercase N tilde
- 0x7e: 0xf1, // lowercase n tilde
- 0x7f: 0x2588, // Full block
- // THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
- // THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F
- // THIS MEANS THAT \x50 MUST BE ADDED TO THE VALUES
- 0x80: 0xae, // Registered symbol (R)
- 0x81: 0xb0, // degree sign
- 0x82: 0xbd, // 1/2 symbol
- 0x83: 0xbf, // Inverted (open) question mark
- 0x84: 0x2122, // Trademark symbol (TM)
- 0x85: 0xa2, // Cents symbol
- 0x86: 0xa3, // Pounds sterling
- 0x87: 0x266a, // Music 8'th note
- 0x88: 0xe0, // lowercase a, grave accent
- 0x89: 0x20, // transparent space (regular)
- 0x8a: 0xe8, // lowercase e, grave accent
- 0x8b: 0xe2, // lowercase a, circumflex accent
- 0x8c: 0xea, // lowercase e, circumflex accent
- 0x8d: 0xee, // lowercase i, circumflex accent
- 0x8e: 0xf4, // lowercase o, circumflex accent
- 0x8f: 0xfb, // lowercase u, circumflex accent
- // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
- // THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F
- 0x90: 0xc1, // capital letter A with acute
- 0x91: 0xc9, // capital letter E with acute
- 0x92: 0xd3, // capital letter O with acute
- 0x93: 0xda, // capital letter U with acute
- 0x94: 0xdc, // capital letter U with diaresis
- 0x95: 0xfc, // lowercase letter U with diaeresis
- 0x96: 0x2018, // opening single quote
- 0x97: 0xa1, // inverted exclamation mark
- 0x98: 0x2a, // asterisk
- 0x99: 0x2019, // closing single quote
- 0x9a: 0x2501, // box drawings heavy horizontal
- 0x9b: 0xa9, // copyright sign
- 0x9c: 0x2120, // Service mark
- 0x9d: 0x2022, // (round) bullet
- 0x9e: 0x201c, // Left double quotation mark
- 0x9f: 0x201d, // Right double quotation mark
- 0xa0: 0xc0, // uppercase A, grave accent
- 0xa1: 0xc2, // uppercase A, circumflex
- 0xa2: 0xc7, // uppercase C with cedilla
- 0xa3: 0xc8, // uppercase E, grave accent
- 0xa4: 0xca, // uppercase E, circumflex
- 0xa5: 0xcb, // capital letter E with diaresis
- 0xa6: 0xeb, // lowercase letter e with diaresis
- 0xa7: 0xce, // uppercase I, circumflex
- 0xa8: 0xcf, // uppercase I, with diaresis
- 0xa9: 0xef, // lowercase i, with diaresis
- 0xaa: 0xd4, // uppercase O, circumflex
- 0xab: 0xd9, // uppercase U, grave accent
- 0xac: 0xf9, // lowercase u, grave accent
- 0xad: 0xdb, // uppercase U, circumflex
- 0xae: 0xab, // left-pointing double angle quotation mark
- 0xaf: 0xbb, // right-pointing double angle quotation mark
- // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
- // THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F
- 0xb0: 0xc3, // Uppercase A, tilde
- 0xb1: 0xe3, // Lowercase a, tilde
- 0xb2: 0xcd, // Uppercase I, acute accent
- 0xb3: 0xcc, // Uppercase I, grave accent
- 0xb4: 0xec, // Lowercase i, grave accent
- 0xb5: 0xd2, // Uppercase O, grave accent
- 0xb6: 0xf2, // Lowercase o, grave accent
- 0xb7: 0xd5, // Uppercase O, tilde
- 0xb8: 0xf5, // Lowercase o, tilde
- 0xb9: 0x7b, // Open curly brace
- 0xba: 0x7d, // Closing curly brace
- 0xbb: 0x5c, // Backslash
- 0xbc: 0x5e, // Caret
- 0xbd: 0x5f, // Underscore
- 0xbe: 0x7c, // Pipe (vertical line)
- 0xbf: 0x223c, // Tilde operator
- 0xc0: 0xc4, // Uppercase A, umlaut
- 0xc1: 0xe4, // Lowercase A, umlaut
- 0xc2: 0xd6, // Uppercase O, umlaut
- 0xc3: 0xf6, // Lowercase o, umlaut
- 0xc4: 0xdf, // Esszett (sharp S)
- 0xc5: 0xa5, // Yen symbol
- 0xc6: 0xa4, // Generic currency sign
- 0xc7: 0x2503, // Box drawings heavy vertical
- 0xc8: 0xc5, // Uppercase A, ring
- 0xc9: 0xe5, // Lowercase A, ring
- 0xca: 0xd8, // Uppercase O, stroke
- 0xcb: 0xf8, // Lowercase o, strok
- 0xcc: 0x250f, // Box drawings heavy down and right
- 0xcd: 0x2513, // Box drawings heavy down and left
- 0xce: 0x2517, // Box drawings heavy up and right
- 0xcf: 0x251b // Box drawings heavy up and left
-};
-/**
- * Utils
- */
-var getCharForByte = function getCharForByte(byte) {
- var charCode = byte;
- if (specialCea608CharsCodes.hasOwnProperty(byte)) {
- charCode = specialCea608CharsCodes[byte];
- }
- return String.fromCharCode(charCode);
-};
-var NR_ROWS = 15,
- NR_COLS = 100;
-// Tables to look up row from PAC data
-var rowsLowCh1 = { 0x11: 1, 0x12: 3, 0x15: 5, 0x16: 7, 0x17: 9, 0x10: 11, 0x13: 12, 0x14: 14 };
-var rowsHighCh1 = { 0x11: 2, 0x12: 4, 0x15: 6, 0x16: 8, 0x17: 10, 0x13: 13, 0x14: 15 };
-var rowsLowCh2 = { 0x19: 1, 0x1A: 3, 0x1D: 5, 0x1E: 7, 0x1F: 9, 0x18: 11, 0x1B: 12, 0x1C: 14 };
-var rowsHighCh2 = { 0x19: 2, 0x1A: 4, 0x1D: 6, 0x1E: 8, 0x1F: 10, 0x1B: 13, 0x1C: 15 };
-var backgroundColors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'black', 'transparent'];
-/**
- * Simple logger class to be able to write with time-stamps and filter on level.
- */
-var logger = {
- verboseFilter: { 'DATA': 3, 'DEBUG': 3, 'INFO': 2, 'WARNING': 2, 'TEXT': 1, 'ERROR': 0 },
- time: null,
- verboseLevel: 0, // Only write errors
- setTime: function setTime(newTime) {
- this.time = newTime;
- },
- log: function log(severity, msg) {
- var minLevel = this.verboseFilter[severity];
- if (this.verboseLevel >= minLevel) {
- console.log(this.time + ' [' + severity + '] ' + msg);
- }
- }
+var audio_stream_controller_State = {
+ STOPPED: 'STOPPED',
+ STARTING: 'STARTING',
+ IDLE: 'IDLE',
+ PAUSED: 'PAUSED',
+ KEY_LOADING: 'KEY_LOADING',
+ FRAG_LOADING: 'FRAG_LOADING',
+ FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',
+ WAITING_TRACK: 'WAITING_TRACK',
+ PARSING: 'PARSING',
+ PARSED: 'PARSED',
+ BUFFER_FLUSHING: 'BUFFER_FLUSHING',
+ ENDED: 'ENDED',
+ ERROR: 'ERROR',
+ WAITING_INIT_PTS: 'WAITING_INIT_PTS'
};
-var numArrayToHexArray = function numArrayToHexArray(numArray) {
- var hexArray = [];
- for (var j = 0; j < numArray.length; j++) {
- hexArray.push(numArray[j].toString(16));
- }
- return hexArray;
-};
+var audio_stream_controller_AudioStreamController = function (_EventHandler) {
+ audio_stream_controller__inherits(AudioStreamController, _EventHandler);
-var PenState = function () {
- function PenState(foreground, underline, italics, background, flash) {
- _classCallCheck(this, PenState);
+ function AudioStreamController(hls) {
+ audio_stream_controller__classCallCheck(this, AudioStreamController);
- this.foreground = foreground || 'white';
- this.underline = underline || false;
- this.italics = italics || false;
- this.background = background || 'black';
- this.flash = flash || false;
- }
+ var _this = audio_stream_controller__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].MEDIA_ATTACHED, events["a" /* default */].MEDIA_DETACHING, events["a" /* default */].AUDIO_TRACKS_UPDATED, events["a" /* default */].AUDIO_TRACK_SWITCHING, events["a" /* default */].AUDIO_TRACK_LOADED, events["a" /* default */].KEY_LOADED, events["a" /* default */].FRAG_LOADED, events["a" /* default */].FRAG_PARSING_INIT_SEGMENT, events["a" /* default */].FRAG_PARSING_DATA, events["a" /* default */].FRAG_PARSED, events["a" /* default */].ERROR, events["a" /* default */].BUFFER_RESET, events["a" /* default */].BUFFER_CREATED, events["a" /* default */].BUFFER_APPENDED, events["a" /* default */].BUFFER_FLUSHED, events["a" /* default */].INIT_PTS_FOUND));
- _createClass(PenState, [{
- key: 'reset',
- value: function reset() {
- this.foreground = 'white';
- this.underline = false;
- this.italics = false;
- this.background = 'black';
- this.flash = false;
- }
- }, {
- key: 'setStyles',
- value: function setStyles(styles) {
- var attribs = ['foreground', 'underline', 'italics', 'background', 'flash'];
- for (var i = 0; i < attribs.length; i++) {
- var style = attribs[i];
- if (styles.hasOwnProperty(style)) {
- this[style] = styles[style];
- }
- }
- }
- }, {
- key: 'isDefault',
- value: function isDefault() {
- return this.foreground === 'white' && !this.underline && !this.italics && this.background === 'black' && !this.flash;
- }
- }, {
- key: 'equals',
- value: function equals(other) {
- return this.foreground === other.foreground && this.underline === other.underline && this.italics === other.italics && this.background === other.background && this.flash === other.flash;
- }
- }, {
- key: 'copy',
- value: function copy(newPenState) {
- this.foreground = newPenState.foreground;
- this.underline = newPenState.underline;
- this.italics = newPenState.italics;
- this.background = newPenState.background;
- this.flash = newPenState.flash;
- }
- }, {
- key: 'toString',
- value: function toString() {
- return 'color=' + this.foreground + ', underline=' + this.underline + ', italics=' + this.italics + ', background=' + this.background + ', flash=' + this.flash;
- }
- }]);
+ _this.config = hls.config;
+ _this.audioCodecSwap = false;
+ _this.ticks = 0;
+ _this._state = audio_stream_controller_State.STOPPED;
+ _this.ontick = _this.tick.bind(_this);
+ _this.initPTS = [];
+ _this.waitingFragment = null;
+ _this.videoTrackCC = null;
+ return _this;
+ }
- return PenState;
-}();
+ AudioStreamController.prototype.destroy = function destroy() {
+ this.stopLoad();
+ if (this.timer) {
+ clearInterval(this.timer);
+ this.timer = null;
+ }
+ event_handler.prototype.destroy.call(this);
+ this.state = audio_stream_controller_State.STOPPED;
+ };
-/**
- * Unicode character with styling and background.
- * @constructor
- */
+ //Signal that video PTS was found
-var StyledUnicodeChar = function () {
- function StyledUnicodeChar(uchar, foreground, underline, italics, background, flash) {
- _classCallCheck(this, StyledUnicodeChar);
+ AudioStreamController.prototype.onInitPtsFound = function onInitPtsFound(data) {
+ var demuxerId = data.id,
+ cc = data.frag.cc,
+ initPTS = data.initPTS;
+ if (demuxerId === 'main') {
+ //Always update the new INIT PTS
+ //Can change due level switch
+ this.initPTS[cc] = initPTS;
+ this.videoTrackCC = cc;
+ logger["b" /* logger */].log('InitPTS for cc:' + cc + ' found from video track:' + initPTS);
- this.uchar = uchar || ' '; // unicode character
- this.penState = new PenState(foreground, underline, italics, background, flash);
+ //If we are waiting we need to demux/remux the waiting frag
+ //With the new initPTS
+ if (this.state === audio_stream_controller_State.WAITING_INIT_PTS) {
+ this.tick();
+ }
}
+ };
- _createClass(StyledUnicodeChar, [{
- key: 'reset',
- value: function reset() {
- this.uchar = ' ';
- this.penState.reset();
- }
- }, {
- key: 'setChar',
- value: function setChar(uchar, newPenState) {
- this.uchar = uchar;
- this.penState.copy(newPenState);
- }
- }, {
- key: 'setPenState',
- value: function setPenState(newPenState) {
- this.penState.copy(newPenState);
- }
- }, {
- key: 'equals',
- value: function equals(other) {
- return this.uchar === other.uchar && this.penState.equals(other.penState);
- }
- }, {
- key: 'copy',
- value: function copy(newChar) {
- this.uchar = newChar.uchar;
- this.penState.copy(newChar.penState);
- }
- }, {
- key: 'isEmpty',
- value: function isEmpty() {
- return this.uchar === ' ' && this.penState.isDefault();
- }
- }]);
-
- return StyledUnicodeChar;
-}();
-
-/**
- * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.
- * @constructor
- */
-
+ AudioStreamController.prototype.startLoad = function startLoad(startPosition) {
+ if (this.tracks) {
+ var lastCurrentTime = this.lastCurrentTime;
+ this.stopLoad();
+ if (!this.timer) {
+ this.timer = setInterval(this.ontick, 100);
+ }
+ this.fragLoadError = 0;
+ if (lastCurrentTime > 0 && startPosition === -1) {
+ logger["b" /* logger */].log('audio:override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));
+ this.state = audio_stream_controller_State.IDLE;
+ } else {
+ this.lastCurrentTime = this.startPosition ? this.startPosition : startPosition;
+ this.state = audio_stream_controller_State.STARTING;
+ }
+ this.nextLoadPosition = this.startPosition = this.lastCurrentTime;
+ this.tick();
+ } else {
+ this.startPosition = startPosition;
+ this.state = audio_stream_controller_State.STOPPED;
+ }
+ };
-var Row = function () {
- function Row() {
- _classCallCheck(this, Row);
+ AudioStreamController.prototype.stopLoad = function stopLoad() {
+ var frag = this.fragCurrent;
+ if (frag) {
+ if (frag.loader) {
+ frag.loader.abort();
+ }
+ this.fragCurrent = null;
+ }
+ this.fragPrevious = null;
+ if (this.demuxer) {
+ this.demuxer.destroy();
+ this.demuxer = null;
+ }
+ this.state = audio_stream_controller_State.STOPPED;
+ };
- this.chars = [];
- for (var i = 0; i < NR_COLS; i++) {
- this.chars.push(new StyledUnicodeChar());
- }
- this.pos = 0;
- this.currPenState = new PenState();
+ AudioStreamController.prototype.tick = function tick() {
+ this.ticks++;
+ if (this.ticks === 1) {
+ this.doTick();
+ if (this.ticks > 1) {
+ setTimeout(this.tick, 1);
+ }
+ this.ticks = 0;
}
+ };
- _createClass(Row, [{
- key: 'equals',
- value: function equals(other) {
- var equal = true;
- for (var i = 0; i < NR_COLS; i++) {
- if (!this.chars[i].equals(other.chars[i])) {
- equal = false;
- break;
- }
- }
- return equal;
+ AudioStreamController.prototype.doTick = function doTick() {
+ var pos,
+ track,
+ trackDetails,
+ hls = this.hls,
+ config = hls.config;
+ //logger.log('audioStream:' + this.state);
+ switch (this.state) {
+ case audio_stream_controller_State.ERROR:
+ //don't do anything in error state to avoid breaking further ...
+ case audio_stream_controller_State.PAUSED:
+ //don't do anything in paused state either ...
+ case audio_stream_controller_State.BUFFER_FLUSHING:
+ break;
+ case audio_stream_controller_State.STARTING:
+ this.state = audio_stream_controller_State.WAITING_TRACK;
+ this.loadedmetadata = false;
+ break;
+ case audio_stream_controller_State.IDLE:
+ var tracks = this.tracks;
+ // audio tracks not received => exit loop
+ if (!tracks) {
+ break;
}
- }, {
- key: 'copy',
- value: function copy(other) {
- for (var i = 0; i < NR_COLS; i++) {
- this.chars[i].copy(other.chars[i]);
- }
+ // if video not attached AND
+ // start fragment already requested OR start frag prefetch disable
+ // exit loop
+ // => if media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop
+ if (!this.media && (this.startFragRequested || !config.startFragPrefetch)) {
+ break;
}
- }, {
- key: 'isEmpty',
- value: function isEmpty() {
- var empty = true;
- for (var i = 0; i < NR_COLS; i++) {
- if (!this.chars[i].isEmpty()) {
- empty = false;
- break;
- }
- }
- return empty;
+ // determine next candidate fragment to be loaded, based on current position and
+ // end of buffer position
+ // if we have not yet loaded any fragment, start loading from start position
+ if (this.loadedmetadata) {
+ pos = this.media.currentTime;
+ } else {
+ pos = this.nextLoadPosition;
+ if (pos === undefined) {
+ break;
+ }
}
+ var media = this.mediaBuffer ? this.mediaBuffer : this.media,
+ videoBuffer = this.videoBuffer ? this.videoBuffer : this.media,
+ bufferInfo = buffer_helper.bufferInfo(media, pos, config.maxBufferHole),
+ mainBufferInfo = buffer_helper.bufferInfo(videoBuffer, pos, config.maxBufferHole),
+ bufferLen = bufferInfo.len,
+ bufferEnd = bufferInfo.end,
+ fragPrevious = this.fragPrevious,
+
+ // ensure we buffer at least config.maxBufferLength (default 30s)
+ // once we reach that threshold, don't buffer more than video (mainBufferInfo.len)
+ maxBufLen = Math.max(config.maxBufferLength, mainBufferInfo.len),
+ audioSwitch = this.audioSwitch,
+ trackId = this.trackId;
+
+ // if buffer length is less than maxBufLen try to load a new fragment
+ if ((bufferLen < maxBufLen || audioSwitch) && trackId < tracks.length) {
+ trackDetails = tracks[trackId].details;
+ // if track info not retrieved yet, switch state and wait for track retrieval
+ if (typeof trackDetails === 'undefined') {
+ this.state = audio_stream_controller_State.WAITING_TRACK;
+ break;
+ }
- /**
- * Set the cursor to a valid column.
- */
-
- }, {
- key: 'setCursor',
- value: function setCursor(absPos) {
- if (this.pos !== absPos) {
- this.pos = absPos;
- }
- if (this.pos < 0) {
- logger.log('ERROR', 'Negative cursor position ' + this.pos);
- this.pos = 0;
- } else if (this.pos > NR_COLS) {
- logger.log('ERROR', 'Too large cursor position ' + this.pos);
- this.pos = NR_COLS;
+ // check if we need to finalize media stream
+ // we just got done loading the final fragment and there is no other buffered range after ...
+ // rationale is that in case there are any buffered ranges after, it means that there are unbuffered portion in between
+ // so we should not switch to ENDED in that case, to be able to buffer them
+ if (!audioSwitch && !trackDetails.live && fragPrevious && fragPrevious.sn === trackDetails.endSN && !bufferInfo.nextStart) {
+ // if we are not seeking or if we are seeking but everything (almost) til the end is buffered, let's signal eos
+ // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference when switching
+ // between different renditions. using half frag duration should help cope with these cases.
+ if (!this.media.seeking || this.media.duration - bufferEnd < fragPrevious.duration / 2) {
+ // Finalize the media stream
+ this.hls.trigger(events["a" /* default */].BUFFER_EOS, { type: 'audio' });
+ this.state = audio_stream_controller_State.ENDED;
+ break;
}
- }
-
- /**
- * Move the cursor relative to current position.
- */
+ }
- }, {
- key: 'moveCursor',
- value: function moveCursor(relPos) {
- var newPos = this.pos + relPos;
- if (relPos > 1) {
- for (var i = this.pos + 1; i < newPos + 1; i++) {
- this.chars[i].setPenState(this.currPenState);
+ // find fragment index, contiguous with end of buffer position
+ var fragments = trackDetails.fragments,
+ fragLen = fragments.length,
+ start = fragments[0].start,
+ end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,
+ frag = void 0;
+
+ // When switching audio track, reload audio as close as possible to currentTime
+ if (audioSwitch) {
+ if (trackDetails.live && !trackDetails.PTSKnown) {
+ logger["b" /* logger */].log('switching audiotrack, live stream, unknown PTS,load first fragment');
+ bufferEnd = 0;
+ } else {
+ bufferEnd = pos;
+ // if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime
+ if (trackDetails.PTSKnown && pos < start) {
+ // if everything is buffered from pos to start or if audio buffer upfront, let's seek to start
+ if (bufferInfo.end > start || bufferInfo.nextStart) {
+ logger["b" /* logger */].log('alt audio track ahead of main track, seek to start of alt audio track');
+ this.media.currentTime = start + 0.05;
+ } else {
+ return;
}
+ }
}
- this.setCursor(newPos);
- }
-
- /**
- * Backspace, move one step back and clear character.
- */
-
- }, {
- key: 'backSpace',
- value: function backSpace() {
- this.moveCursor(-1);
- this.chars[this.pos].setChar(' ', this.currPenState);
- }
- }, {
- key: 'insertChar',
- value: function insertChar(byte) {
- if (byte >= 0x90) {
- //Extended char
- this.backSpace();
- }
- var char = getCharForByte(byte);
- if (this.pos >= NR_COLS) {
- logger.log('ERROR', 'Cannot insert ' + byte.toString(16) + ' (' + char + ') at position ' + this.pos + '. Skipping it!');
+ }
+ if (trackDetails.initSegment && !trackDetails.initSegment.data) {
+ frag = trackDetails.initSegment;
+ }
+ // if bufferEnd before start of playlist, load first fragment
+ else if (bufferEnd <= start) {
+ frag = fragments[0];
+ if (this.videoTrackCC !== null && frag.cc !== this.videoTrackCC) {
+ // Ensure we find a fragment which matches the continuity of the video track
+ frag = findFragWithCC(fragments, this.videoTrackCC);
+ }
+ if (trackDetails.live && frag.loadIdx && frag.loadIdx === this.fragLoadIdx) {
+ // we just loaded this first fragment, and we are still lagging behind the start of the live playlist
+ // let's force seek to start
+ var nextBuffered = bufferInfo.nextStart ? bufferInfo.nextStart : start;
+ logger["b" /* logger */].log('no alt audio available @currentTime:' + this.media.currentTime + ', seeking @' + (nextBuffered + 0.05));
+ this.media.currentTime = nextBuffered + 0.05;
return;
- }
- this.chars[this.pos].setChar(char, this.currPenState);
- this.moveCursor(1);
- }
- }, {
- key: 'clearFromPos',
- value: function clearFromPos(startPos) {
- var i;
- for (i = startPos; i < NR_COLS; i++) {
- this.chars[i].reset();
- }
- }
- }, {
- key: 'clear',
- value: function clear() {
- this.clearFromPos(0);
- this.pos = 0;
- this.currPenState.reset();
- }
- }, {
- key: 'clearToEndOfRow',
- value: function clearToEndOfRow() {
- this.clearFromPos(this.pos);
- }
- }, {
- key: 'getTextString',
- value: function getTextString() {
- var chars = [];
- var empty = true;
- for (var i = 0; i < NR_COLS; i++) {
- var char = this.chars[i].uchar;
- if (char !== ' ') {
- empty = false;
- }
- chars.push(char);
- }
- if (empty) {
- return '';
+ }
} else {
- return chars.join('');
- }
- }
- }, {
- key: 'setPenStyles',
- value: function setPenStyles(styles) {
- this.currPenState.setStyles(styles);
- var currChar = this.chars[this.pos];
- currChar.setPenState(this.currPenState);
- }
- }]);
-
- return Row;
-}();
-
-/**
- * Keep a CEA-608 screen of 32x15 styled characters
- * @constructor
-*/
-
-
-var CaptionScreen = function () {
- function CaptionScreen() {
- _classCallCheck(this, CaptionScreen);
-
- this.rows = [];
- for (var i = 0; i < NR_ROWS; i++) {
- this.rows.push(new Row()); // Note that we use zero-based numbering (0-14)
- }
- this.currRow = NR_ROWS - 1;
- this.nrRollUpRows = null;
- this.reset();
- }
-
- _createClass(CaptionScreen, [{
- key: 'reset',
- value: function reset() {
- for (var i = 0; i < NR_ROWS; i++) {
- this.rows[i].clear();
- }
- this.currRow = NR_ROWS - 1;
- }
- }, {
- key: 'equals',
- value: function equals(other) {
- var equal = true;
- for (var i = 0; i < NR_ROWS; i++) {
- if (!this.rows[i].equals(other.rows[i])) {
- equal = false;
- break;
- }
- }
- return equal;
- }
- }, {
- key: 'copy',
- value: function copy(other) {
- for (var i = 0; i < NR_ROWS; i++) {
- this.rows[i].copy(other.rows[i]);
- }
- }
- }, {
- key: 'isEmpty',
- value: function isEmpty() {
- var empty = true;
- for (var i = 0; i < NR_ROWS; i++) {
- if (!this.rows[i].isEmpty()) {
- empty = false;
- break;
- }
- }
- return empty;
- }
- }, {
- key: 'backSpace',
- value: function backSpace() {
- var row = this.rows[this.currRow];
- row.backSpace();
- }
- }, {
- key: 'clearToEndOfRow',
- value: function clearToEndOfRow() {
- var row = this.rows[this.currRow];
- row.clearToEndOfRow();
- }
-
- /**
- * Insert a character (without styling) in the current row.
- */
-
- }, {
- key: 'insertChar',
- value: function insertChar(char) {
- var row = this.rows[this.currRow];
- row.insertChar(char);
- }
- }, {
- key: 'setPen',
- value: function setPen(styles) {
- var row = this.rows[this.currRow];
- row.setPenStyles(styles);
- }
- }, {
- key: 'moveCursor',
- value: function moveCursor(relPos) {
- var row = this.rows[this.currRow];
- row.moveCursor(relPos);
- }
- }, {
- key: 'setCursor',
- value: function setCursor(absPos) {
- logger.log('INFO', 'setCursor: ' + absPos);
- var row = this.rows[this.currRow];
- row.setCursor(absPos);
- }
- }, {
- key: 'setPAC',
- value: function setPAC(pacData) {
- logger.log('INFO', 'pacData = ' + JSON.stringify(pacData));
- var newRow = pacData.row - 1;
- if (this.nrRollUpRows && newRow < this.nrRollUpRows - 1) {
- newRow = this.nrRollUpRows - 1;
- }
-
- //Make sure this only affects Roll-up Captions by checking this.nrRollUpRows
- if (this.nrRollUpRows && this.currRow !== newRow) {
- //clear all rows first
- for (var i = 0; i < NR_ROWS; i++) {
- this.rows[i].clear();
- }
-
- //Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location
- //topRowIndex - the start of rows to copy (inclusive index)
- var topRowIndex = this.currRow + 1 - this.nrRollUpRows;
- //We only copy if the last position was already shown.
- //We use the cueStartTime value to check this.
- var lastOutputScreen = this.lastOutputScreen;
- if (lastOutputScreen) {
- var prevLineTime = lastOutputScreen.rows[topRowIndex].cueStartTime;
- if (prevLineTime && prevLineTime < logger.time) {
- for (var _i = 0; _i < this.nrRollUpRows; _i++) {
- this.rows[newRow - this.nrRollUpRows + _i + 1].copy(lastOutputScreen.rows[topRowIndex + _i]);
- }
- }
- }
- }
-
- this.currRow = newRow;
- var row = this.rows[this.currRow];
- if (pacData.indent !== null) {
- var indent = pacData.indent;
- var prevPos = Math.max(indent - 1, 0);
- row.setCursor(pacData.indent);
- pacData.color = row.chars[prevPos].penState.foreground;
- }
- var styles = { foreground: pacData.color, underline: pacData.underline, italics: pacData.italics, background: 'black', flash: false };
- this.setPen(styles);
- }
-
- /**
- * Set background/extra foreground, but first do back_space, and then insert space (backwards compatibility).
- */
-
- }, {
- key: 'setBkgData',
- value: function setBkgData(bkgData) {
+ var foundFrag = void 0;
+ var maxFragLookUpTolerance = config.maxFragLookUpTolerance;
+ var fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;
+ var fragmentWithinToleranceTest = function fragmentWithinToleranceTest(candidate) {
+ // offset should be within fragment boundary - config.maxFragLookUpTolerance
+ // this is to cope with situations like
+ // bufferEnd = 9.991
+ // frag[Ø] : [0,10]
+ // frag[1] : [10,20]
+ // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here
+ // frag start frag start+duration
+ // |-----------------------------|
+ // <---> <--->
+ // ...--------><-----------------------------><---------....
+ // previous frag matching fragment next frag
+ // return -1 return 0 return 1
+ //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);
+ // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments
+ var candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);
+ if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {
+ return 1;
+ } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element
+ else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {
+ return -1;
+ }
+ return 0;
+ };
- logger.log('INFO', 'bkgData = ' + JSON.stringify(bkgData));
- this.backSpace();
- this.setPen(bkgData);
- this.insertChar(0x20); //Space
- }
- }, {
- key: 'setRollUpRows',
- value: function setRollUpRows(nrRows) {
- this.nrRollUpRows = nrRows;
- }
- }, {
- key: 'rollUp',
- value: function rollUp() {
- if (this.nrRollUpRows === null) {
- logger.log('DEBUG', 'roll_up but nrRollUpRows not set yet');
- return; //Not properly setup
- }
- logger.log('TEXT', this.getDisplayText());
- var topRowIndex = this.currRow + 1 - this.nrRollUpRows;
- var topRow = this.rows.splice(topRowIndex, 1)[0];
- topRow.clear();
- this.rows.splice(this.currRow, 0, topRow);
- logger.log('INFO', 'Rolling up');
- //logger.log('TEXT', this.get_display_text())
- }
-
- /**
- * Get all non-empty rows with as unicode text.
- */
-
- }, {
- key: 'getDisplayText',
- value: function getDisplayText(asOneRow) {
- asOneRow = asOneRow || false;
- var displayText = [];
- var text = '';
- var rowNr = -1;
- for (var i = 0; i < NR_ROWS; i++) {
- var rowText = this.rows[i].getTextString();
- if (rowText) {
- rowNr = i + 1;
- if (asOneRow) {
- displayText.push('Row ' + rowNr + ': \'' + rowText + '\'');
- } else {
- displayText.push(rowText.trim());
- }
+ if (bufferEnd < end) {
+ if (bufferEnd > end - maxFragLookUpTolerance) {
+ maxFragLookUpTolerance = 0;
}
- }
- if (displayText.length > 0) {
- if (asOneRow) {
- text = '[' + displayText.join(' | ') + ']';
+ // Prefer the next fragment if it's within tolerance
+ if (fragNext && !fragmentWithinToleranceTest(fragNext)) {
+ foundFrag = fragNext;
} else {
- text = displayText.join('\n');
+ foundFrag = binary_search.search(fragments, fragmentWithinToleranceTest);
}
+ } else {
+ // reach end of playlist
+ foundFrag = fragments[fragLen - 1];
+ }
+ if (foundFrag) {
+ frag = foundFrag;
+ start = foundFrag.start;
+ //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);
+ if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {
+ if (frag.sn < trackDetails.endSN) {
+ frag = fragments[frag.sn + 1 - trackDetails.startSN];
+ logger["b" /* logger */].log('SN just loaded, load next one: ' + frag.sn);
+ } else {
+ frag = null;
+ }
+ }
+ }
}
- return text;
- }
- }, {
- key: 'getTextAndFormat',
- value: function getTextAndFormat() {
- return this.rows;
- }
- }]);
-
- return CaptionScreen;
-}();
-
-//var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];
-
-var Cea608Channel = function () {
- function Cea608Channel(channelNumber, outputFilter) {
- _classCallCheck(this, Cea608Channel);
-
- this.chNr = channelNumber;
- this.outputFilter = outputFilter;
- this.mode = null;
- this.verbose = 0;
- this.displayedMemory = new CaptionScreen();
- this.nonDisplayedMemory = new CaptionScreen();
- this.lastOutputScreen = new CaptionScreen();
- this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];
- this.writeScreen = this.displayedMemory;
- this.mode = null;
- this.cueStartTime = null; // Keeps track of where a cue started.
- }
-
- _createClass(Cea608Channel, [{
- key: 'reset',
- value: function reset() {
- this.mode = null;
- this.displayedMemory.reset();
- this.nonDisplayedMemory.reset();
- this.lastOutputScreen.reset();
- this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];
- this.writeScreen = this.displayedMemory;
- this.mode = null;
- this.cueStartTime = null;
- this.lastCueEndTime = null;
- }
- }, {
- key: 'getHandler',
- value: function getHandler() {
- return this.outputFilter;
- }
- }, {
- key: 'setHandler',
- value: function setHandler(newHandler) {
- this.outputFilter = newHandler;
- }
- }, {
- key: 'setPAC',
- value: function setPAC(pacData) {
- this.writeScreen.setPAC(pacData);
- }
- }, {
- key: 'setBkgData',
- value: function setBkgData(bkgData) {
- this.writeScreen.setBkgData(bkgData);
- }
- }, {
- key: 'setMode',
- value: function setMode(newMode) {
- if (newMode === this.mode) {
- return;
- }
- this.mode = newMode;
- logger.log('INFO', 'MODE=' + newMode);
- if (this.mode === 'MODE_POP-ON') {
- this.writeScreen = this.nonDisplayedMemory;
- } else {
- this.writeScreen = this.displayedMemory;
- this.writeScreen.reset();
- }
- if (this.mode !== 'MODE_ROLL-UP') {
- this.displayedMemory.nrRollUpRows = null;
- this.nonDisplayedMemory.nrRollUpRows = null;
- }
- this.mode = newMode;
- }
- }, {
- key: 'insertChars',
- value: function insertChars(chars) {
- for (var i = 0; i < chars.length; i++) {
- this.writeScreen.insertChar(chars[i]);
- }
- var screen = this.writeScreen === this.displayedMemory ? 'DISP' : 'NON_DISP';
- logger.log('INFO', screen + ': ' + this.writeScreen.getDisplayText(true));
- if (this.mode === 'MODE_PAINT-ON' || this.mode === 'MODE_ROLL-UP') {
- logger.log('TEXT', 'DISPLAYED: ' + this.displayedMemory.getDisplayText(true));
- this.outputDataUpdate();
- }
- }
- }, {
- key: 'ccRCL',
- value: function ccRCL() {
- // Resume Caption Loading (switch mode to Pop On)
- logger.log('INFO', 'RCL - Resume Caption Loading');
- this.setMode('MODE_POP-ON');
- }
- }, {
- key: 'ccBS',
- value: function ccBS() {
- // BackSpace
- logger.log('INFO', 'BS - BackSpace');
- if (this.mode === 'MODE_TEXT') {
- return;
- }
- this.writeScreen.backSpace();
- if (this.writeScreen === this.displayedMemory) {
- this.outputDataUpdate();
- }
- }
- }, {
- key: 'ccAOF',
- value: function ccAOF() {
- // Reserved (formerly Alarm Off)
- return;
- }
- }, {
- key: 'ccAON',
- value: function ccAON() {
- // Reserved (formerly Alarm On)
- return;
- }
- }, {
- key: 'ccDER',
- value: function ccDER() {
- // Delete to End of Row
- logger.log('INFO', 'DER- Delete to End of Row');
- this.writeScreen.clearToEndOfRow();
- this.outputDataUpdate();
- }
- }, {
- key: 'ccRU',
- value: function ccRU(nrRows) {
- //Roll-Up Captions-2,3,or 4 Rows
- logger.log('INFO', 'RU(' + nrRows + ') - Roll Up');
- this.writeScreen = this.displayedMemory;
- this.setMode('MODE_ROLL-UP');
- this.writeScreen.setRollUpRows(nrRows);
- }
- }, {
- key: 'ccFON',
- value: function ccFON() {
- //Flash On
- logger.log('INFO', 'FON - Flash On');
- this.writeScreen.setPen({ flash: true });
- }
- }, {
- key: 'ccRDC',
- value: function ccRDC() {
- // Resume Direct Captioning (switch mode to PaintOn)
- logger.log('INFO', 'RDC - Resume Direct Captioning');
- this.setMode('MODE_PAINT-ON');
- }
- }, {
- key: 'ccTR',
- value: function ccTR() {
- // Text Restart in text mode (not supported, however)
- logger.log('INFO', 'TR');
- this.setMode('MODE_TEXT');
- }
- }, {
- key: 'ccRTD',
- value: function ccRTD() {
- // Resume Text Display in Text mode (not supported, however)
- logger.log('INFO', 'RTD');
- this.setMode('MODE_TEXT');
- }
- }, {
- key: 'ccEDM',
- value: function ccEDM() {
- // Erase Displayed Memory
- logger.log('INFO', 'EDM - Erase Displayed Memory');
- this.displayedMemory.reset();
- this.outputDataUpdate();
- }
- }, {
- key: 'ccCR',
- value: function ccCR() {
- // Carriage Return
- logger.log('CR - Carriage Return');
- this.writeScreen.rollUp();
- this.outputDataUpdate();
- }
- }, {
- key: 'ccENM',
- value: function ccENM() {
- //Erase Non-Displayed Memory
- logger.log('INFO', 'ENM - Erase Non-displayed Memory');
- this.nonDisplayedMemory.reset();
- }
- }, {
- key: 'ccEOC',
- value: function ccEOC() {
- //End of Caption (Flip Memories)
- logger.log('INFO', 'EOC - End Of Caption');
- if (this.mode === 'MODE_POP-ON') {
- var tmp = this.displayedMemory;
- this.displayedMemory = this.nonDisplayedMemory;
- this.nonDisplayedMemory = tmp;
- this.writeScreen = this.nonDisplayedMemory;
- logger.log('TEXT', 'DISP: ' + this.displayedMemory.getDisplayText());
- }
- this.outputDataUpdate();
- }
- }, {
- key: 'ccTO',
- value: function ccTO(nrCols) {
- // Tab Offset 1,2, or 3 columns
- logger.log('INFO', 'TO(' + nrCols + ') - Tab Offset');
- this.writeScreen.moveCursor(nrCols);
- }
- }, {
- key: 'ccMIDROW',
- value: function ccMIDROW(secondByte) {
- // Parse MIDROW command
- var styles = { flash: false };
- styles.underline = secondByte % 2 === 1;
- styles.italics = secondByte >= 0x2e;
- if (!styles.italics) {
- var colorIndex = Math.floor(secondByte / 2) - 0x10;
- var colors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta'];
- styles.foreground = colors[colorIndex];
+ if (frag) {
+ //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));
+ if (frag.decryptdata && frag.decryptdata.uri != null && frag.decryptdata.key == null) {
+ logger["b" /* logger */].log('Loading key for ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + trackId);
+ this.state = audio_stream_controller_State.KEY_LOADING;
+ hls.trigger(events["a" /* default */].KEY_LOADING, { frag: frag });
} else {
- styles.foreground = 'white';
- }
- logger.log('INFO', 'MIDROW: ' + JSON.stringify(styles));
- this.writeScreen.setPen(styles);
- }
- }, {
- key: 'outputDataUpdate',
- value: function outputDataUpdate() {
- var t = logger.time;
- if (t === null) {
- return;
- }
- if (this.outputFilter) {
- if (this.outputFilter.updateData) {
- this.outputFilter.updateData(t, this.displayedMemory);
- }
- if (this.cueStartTime === null && !this.displayedMemory.isEmpty()) {
- // Start of a new cue
- this.cueStartTime = t;
- } else {
- if (!this.displayedMemory.equals(this.lastOutputScreen)) {
- if (this.outputFilter.newCue) {
- this.outputFilter.newCue(this.cueStartTime, t, this.lastOutputScreen);
- }
- this.cueStartTime = this.displayedMemory.isEmpty() ? null : t;
- }
+ logger["b" /* logger */].log('Loading ' + frag.sn + ', cc: ' + frag.cc + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + trackId + ', currentTime:' + pos + ',bufferEnd:' + bufferEnd.toFixed(3));
+ // ensure that we are not reloading the same fragments in loop ...
+ if (this.fragLoadIdx !== undefined) {
+ this.fragLoadIdx++;
+ } else {
+ this.fragLoadIdx = 0;
+ }
+ if (frag.loadCounter) {
+ frag.loadCounter++;
+ var maxThreshold = config.fragLoadingLoopThreshold;
+ // if this frag has already been loaded 3 times, and if it has been reloaded recently
+ if (frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold) {
+ hls.trigger(events["a" /* default */].ERROR, { type: errors["b" /* ErrorTypes */].MEDIA_ERROR, details: errors["a" /* ErrorDetails */].FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });
+ return;
}
- this.lastOutputScreen.copy(this.displayedMemory);
+ } else {
+ frag.loadCounter = 1;
+ }
+ frag.loadIdx = this.fragLoadIdx;
+ this.fragCurrent = frag;
+ this.startFragRequested = true;
+ if (!isNaN(frag.sn)) {
+ this.nextLoadPosition = frag.start + frag.duration;
+ }
+ hls.trigger(events["a" /* default */].FRAG_LOADING, { frag: frag });
+ this.state = audio_stream_controller_State.FRAG_LOADING;
}
+ }
}
- }, {
- key: 'cueSplitAtTime',
- value: function cueSplitAtTime(t) {
- if (this.outputFilter) {
- if (!this.displayedMemory.isEmpty()) {
- if (this.outputFilter.newCue) {
- this.outputFilter.newCue(this.cueStartTime, t, this.displayedMemory);
- }
- this.cueStartTime = t;
- }
- }
+ break;
+ case audio_stream_controller_State.WAITING_TRACK:
+ track = this.tracks[this.trackId];
+ // check if playlist is already loaded
+ if (track && track.details) {
+ this.state = audio_stream_controller_State.IDLE;
}
- }]);
-
- return Cea608Channel;
-}();
-
-var Cea608Parser = function () {
- function Cea608Parser(field, out1, out2) {
- _classCallCheck(this, Cea608Parser);
-
- this.field = field || 1;
- this.outputs = [out1, out2];
- this.channels = [new Cea608Channel(1, out1), new Cea608Channel(2, out2)];
- this.currChNr = -1; // Will be 1 or 2
- this.lastCmdA = null; // First byte of last command
- this.lastCmdB = null; // Second byte of last command
- this.bufferedData = [];
- this.startTime = null;
- this.lastTime = null;
- this.dataCounters = { 'padding': 0, 'char': 0, 'cmd': 0, 'other': 0 };
- }
-
- _createClass(Cea608Parser, [{
- key: 'getHandler',
- value: function getHandler(index) {
- return this.channels[index].getHandler();
+ break;
+ case audio_stream_controller_State.FRAG_LOADING_WAITING_RETRY:
+ var now = performance.now();
+ var retryDate = this.retryDate;
+ media = this.media;
+ var isSeeking = media && media.seeking;
+ // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading
+ if (!retryDate || now >= retryDate || isSeeking) {
+ logger["b" /* logger */].log('audioStreamController: retryDate reached, switch back to IDLE state');
+ this.state = audio_stream_controller_State.IDLE;
}
- }, {
- key: 'setHandler',
- value: function setHandler(index, newHandler) {
- this.channels[index].setHandler(newHandler);
+ break;
+ case audio_stream_controller_State.WAITING_INIT_PTS:
+ var videoTrackCC = this.videoTrackCC;
+ if (this.initPTS[videoTrackCC] === undefined) {
+ break;
}
- /**
- * Add data for time t in forms of list of bytes (unsigned ints). The bytes are treated as pairs.
- */
-
- }, {
- key: 'addData',
- value: function addData(t, byteList) {
- var cmdFound,
- a,
- b,
- charsFound = false;
-
- this.lastTime = t;
- logger.setTime(t);
-
- for (var i = 0; i < byteList.length; i += 2) {
- a = byteList[i] & 0x7f;
- b = byteList[i + 1] & 0x7f;
- if (a === 0 && b === 0) {
- this.dataCounters.padding += 2;
- continue;
- } else {
- logger.log('DATA', '[' + numArrayToHexArray([byteList[i], byteList[i + 1]]) + '] -> (' + numArrayToHexArray([a, b]) + ')');
- }
- cmdFound = this.parseCmd(a, b);
- if (!cmdFound) {
- cmdFound = this.parseMidrow(a, b);
- }
- if (!cmdFound) {
- cmdFound = this.parsePAC(a, b);
- }
- if (!cmdFound) {
- cmdFound = this.parseBackgroundAttributes(a, b);
- }
- if (!cmdFound) {
- charsFound = this.parseChars(a, b);
- if (charsFound) {
- if (this.currChNr && this.currChNr >= 0) {
- var channel = this.channels[this.currChNr - 1];
- channel.insertChars(charsFound);
- } else {
- logger.log('WARNING', 'No channel found yet. TEXT-MODE?');
- }
- }
- }
- if (cmdFound) {
- this.dataCounters.cmd += 2;
- } else if (charsFound) {
- this.dataCounters.char += 2;
- } else {
- this.dataCounters.other += 2;
- logger.log('WARNING', 'Couldn\'t parse cleaned data ' + numArrayToHexArray([a, b]) + ' orig: ' + numArrayToHexArray([byteList[i], byteList[i + 1]]));
- }
+ // Ensure we don't get stuck in the WAITING_INIT_PTS state if the waiting frag CC doesn't match any initPTS
+ var waitingFrag = this.waitingFragment;
+ if (waitingFrag) {
+ var waitingFragCC = waitingFrag.frag.cc;
+ if (videoTrackCC !== waitingFragCC) {
+ track = this.tracks[this.trackId];
+ if (track.details && track.details.live) {
+ logger["b" /* logger */].warn('Waiting fragment CC (' + waitingFragCC + ') does not match video track CC (' + videoTrackCC + ')');
+ this.waitingFragment = null;
+ this.state = audio_stream_controller_State.IDLE;
}
+ } else {
+ this.state = audio_stream_controller_State.FRAG_LOADING;
+ this.onFragLoaded(this.waitingFragment);
+ this.waitingFragment = null;
+ }
+ } else {
+ this.state = audio_stream_controller_State.IDLE;
}
- /**
- * Parse Command.
- * @returns {Boolean} Tells if a command was found
- */
-
- }, {
- key: 'parseCmd',
- value: function parseCmd(a, b) {
- var chNr = null;
-
- var cond1 = (a === 0x14 || a === 0x1C) && 0x20 <= b && b <= 0x2F;
- var cond2 = (a === 0x17 || a === 0x1F) && 0x21 <= b && b <= 0x23;
- if (!(cond1 || cond2)) {
- return false;
- }
-
- if (a === this.lastCmdA && b === this.lastCmdB) {
- this.lastCmdA = null;
- this.lastCmdB = null; // Repeated commands are dropped (once)
- logger.log('DEBUG', 'Repeated command (' + numArrayToHexArray([a, b]) + ') is dropped');
- return true;
- }
-
- if (a === 0x14 || a === 0x17) {
- chNr = 1;
- } else {
- chNr = 2; // (a === 0x1C || a=== 0x1f)
- }
-
- var channel = this.channels[chNr - 1];
-
- if (a === 0x14 || a === 0x1C) {
- if (b === 0x20) {
- channel.ccRCL();
- } else if (b === 0x21) {
- channel.ccBS();
- } else if (b === 0x22) {
- channel.ccAOF();
- } else if (b === 0x23) {
- channel.ccAON();
- } else if (b === 0x24) {
- channel.ccDER();
- } else if (b === 0x25) {
- channel.ccRU(2);
- } else if (b === 0x26) {
- channel.ccRU(3);
- } else if (b === 0x27) {
- channel.ccRU(4);
- } else if (b === 0x28) {
- channel.ccFON();
- } else if (b === 0x29) {
- channel.ccRDC();
- } else if (b === 0x2A) {
- channel.ccTR();
- } else if (b === 0x2B) {
- channel.ccRTD();
- } else if (b === 0x2C) {
- channel.ccEDM();
- } else if (b === 0x2D) {
- channel.ccCR();
- } else if (b === 0x2E) {
- channel.ccENM();
- } else if (b === 0x2F) {
- channel.ccEOC();
- }
- } else {
- //a == 0x17 || a == 0x1F
- channel.ccTO(b - 0x20);
- }
- this.lastCmdA = a;
- this.lastCmdB = b;
- this.currChNr = chNr;
- return true;
- }
+ break;
+ case audio_stream_controller_State.STOPPED:
+ case audio_stream_controller_State.FRAG_LOADING:
+ case audio_stream_controller_State.PARSING:
+ case audio_stream_controller_State.PARSED:
+ case audio_stream_controller_State.ENDED:
+ break;
+ default:
+ break;
+ }
+ };
- /**
- * Parse midrow styling command
- * @returns {Boolean}
- */
+ AudioStreamController.prototype.onMediaAttached = function onMediaAttached(data) {
+ var media = this.media = this.mediaBuffer = data.media;
+ this.onvseeking = this.onMediaSeeking.bind(this);
+ this.onvended = this.onMediaEnded.bind(this);
+ media.addEventListener('seeking', this.onvseeking);
+ media.addEventListener('ended', this.onvended);
+ var config = this.config;
+ if (this.tracks && config.autoStartLoad) {
+ this.startLoad(config.startPosition);
+ }
+ };
- }, {
- key: 'parseMidrow',
- value: function parseMidrow(a, b) {
- var chNr = null;
+ AudioStreamController.prototype.onMediaDetaching = function onMediaDetaching() {
+ var media = this.media;
+ if (media && media.ended) {
+ logger["b" /* logger */].log('MSE detaching and video ended, reset startPosition');
+ this.startPosition = this.lastCurrentTime = 0;
+ }
- if ((a === 0x11 || a === 0x19) && 0x20 <= b && b <= 0x2f) {
- if (a === 0x11) {
- chNr = 1;
- } else {
- chNr = 2;
- }
- if (chNr !== this.currChNr) {
- logger.log('ERROR', 'Mismatch channel in midrow parsing');
- return false;
- }
- var channel = this.channels[chNr - 1];
- channel.ccMIDROW(b);
- logger.log('DEBUG', 'MIDROW (' + numArrayToHexArray([a, b]) + ')');
- return true;
- }
- return false;
+ // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery
+ var tracks = this.tracks;
+ if (tracks) {
+ // reset fragment load counter
+ tracks.forEach(function (track) {
+ if (track.details) {
+ track.details.fragments.forEach(function (fragment) {
+ fragment.loadCounter = undefined;
+ });
}
- /**
- * Parse Preable Access Codes (Table 53).
- * @returns {Boolean} Tells if PAC found
- */
-
- }, {
- key: 'parsePAC',
- value: function parsePAC(a, b) {
-
- var chNr = null;
- var row = null;
-
- var case1 = (0x11 <= a && a <= 0x17 || 0x19 <= a && a <= 0x1F) && 0x40 <= b && b <= 0x7F;
- var case2 = (a === 0x10 || a === 0x18) && 0x40 <= b && b <= 0x5F;
- if (!(case1 || case2)) {
- return false;
- }
-
- if (a === this.lastCmdA && b === this.lastCmdB) {
- this.lastCmdA = null;
- this.lastCmdB = null;
- return true; // Repeated commands are dropped (once)
- }
+ });
+ }
+ // remove video listeners
+ if (media) {
+ media.removeEventListener('seeking', this.onvseeking);
+ media.removeEventListener('ended', this.onvended);
+ this.onvseeking = this.onvseeked = this.onvended = null;
+ }
+ this.media = this.mediaBuffer = this.videoBuffer = null;
+ this.loadedmetadata = false;
+ this.stopLoad();
+ };
- chNr = a <= 0x17 ? 1 : 2;
+ AudioStreamController.prototype.onMediaSeeking = function onMediaSeeking() {
+ if (this.state === audio_stream_controller_State.ENDED) {
+ // switch to IDLE state to check for potential new fragment
+ this.state = audio_stream_controller_State.IDLE;
+ }
+ if (this.media) {
+ this.lastCurrentTime = this.media.currentTime;
+ }
+ // avoid reporting fragment loop loading error in case user is seeking several times on same position
+ if (this.fragLoadIdx !== undefined) {
+ this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;
+ }
+ // tick to speed up processing
+ this.tick();
+ };
- if (0x40 <= b && b <= 0x5F) {
- row = chNr === 1 ? rowsLowCh1[a] : rowsLowCh2[a];
- } else {
- // 0x60 <= b <= 0x7F
- row = chNr === 1 ? rowsHighCh1[a] : rowsHighCh2[a];
- }
- var pacData = this.interpretPAC(row, b);
- var channel = this.channels[chNr - 1];
- channel.setPAC(pacData);
- this.lastCmdA = a;
- this.lastCmdB = b;
- this.currChNr = chNr;
- return true;
- }
+ AudioStreamController.prototype.onMediaEnded = function onMediaEnded() {
+ // reset startPosition and lastCurrentTime to restart playback @ stream beginning
+ this.startPosition = this.lastCurrentTime = 0;
+ };
- /**
- * Interpret the second byte of the pac, and return the information.
- * @returns {Object} pacData with style parameters.
- */
+ AudioStreamController.prototype.onAudioTracksUpdated = function onAudioTracksUpdated(data) {
+ logger["b" /* logger */].log('audio tracks updated');
+ this.tracks = data.audioTracks;
+ };
- }, {
- key: 'interpretPAC',
- value: function interpretPAC(row, byte) {
- var pacIndex = byte;
- var pacData = { color: null, italics: false, indent: null, underline: false, row: row };
+ AudioStreamController.prototype.onAudioTrackSwitching = function onAudioTrackSwitching(data) {
+ // if any URL found on new audio track, it is an alternate audio track
+ var altAudio = !!data.url;
+ this.trackId = data.id;
- if (byte > 0x5F) {
- pacIndex = byte - 0x60;
- } else {
- pacIndex = byte - 0x40;
- }
- pacData.underline = (pacIndex & 1) === 1;
- if (pacIndex <= 0xd) {
- pacData.color = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'white'][Math.floor(pacIndex / 2)];
- } else if (pacIndex <= 0xf) {
- pacData.italics = true;
- pacData.color = 'white';
- } else {
- pacData.indent = Math.floor((pacIndex - 0x10) / 2) * 4;
- }
- return pacData; // Note that row has zero offset. The spec uses 1.
- }
+ this.fragCurrent = null;
+ this.state = audio_stream_controller_State.PAUSED;
+ this.waitingFragment = null;
+ // destroy useless demuxer when switching audio to main
+ if (!altAudio) {
+ if (this.demuxer) {
+ this.demuxer.destroy();
+ this.demuxer = null;
+ }
+ } else {
+ // switching to audio track, start timer if not already started
+ if (!this.timer) {
+ this.timer = setInterval(this.ontick, 100);
+ }
+ }
- /**
- * Parse characters.
- * @returns An array with 1 to 2 codes corresponding to chars, if found. null otherwise.
- */
+ //should we switch tracks ?
+ if (altAudio) {
+ this.audioSwitch = true;
+ //main audio track are handled by stream-controller, just do something if switching to alt audio track
+ this.state = audio_stream_controller_State.IDLE;
+ // increase fragment load Index to avoid frag loop loading error after buffer flush
+ if (this.fragLoadIdx !== undefined) {
+ this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;
+ }
+ }
+ this.tick();
+ };
- }, {
- key: 'parseChars',
- value: function parseChars(a, b) {
+ AudioStreamController.prototype.onAudioTrackLoaded = function onAudioTrackLoaded(data) {
+ var newDetails = data.details,
+ trackId = data.id,
+ track = this.tracks[trackId],
+ duration = newDetails.totalduration,
+ sliding = 0;
- var channelNr = null,
- charCodes = null,
- charCode1 = null;
+ logger["b" /* logger */].log('track ' + trackId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);
- if (a >= 0x19) {
- channelNr = 2;
- charCode1 = a - 8;
- } else {
- channelNr = 1;
- charCode1 = a;
- }
- if (0x11 <= charCode1 && charCode1 <= 0x13) {
- // Special character
- var oneCode = b;
- if (charCode1 === 0x11) {
- oneCode = b + 0x50;
- } else if (charCode1 === 0x12) {
- oneCode = b + 0x70;
- } else {
- oneCode = b + 0x90;
- }
- logger.log('INFO', 'Special char \'' + getCharForByte(oneCode) + '\' in channel ' + channelNr);
- charCodes = [oneCode];
- } else if (0x20 <= a && a <= 0x7f) {
- charCodes = b === 0 ? [a] : [a, b];
- }
- if (charCodes) {
- var hexCodes = numArrayToHexArray(charCodes);
- logger.log('DEBUG', 'Char codes = ' + hexCodes.join(','));
- this.lastCmdA = null;
- this.lastCmdB = null;
- }
- return charCodes;
+ if (newDetails.live) {
+ var curDetails = track.details;
+ if (curDetails && newDetails.fragments.length > 0) {
+ // we already have details for that level, merge them
+ mergeDetails(curDetails, newDetails);
+ sliding = newDetails.fragments[0].start;
+ // TODO
+ //this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);
+ if (newDetails.PTSKnown) {
+ logger["b" /* logger */].log('live audio playlist sliding:' + sliding.toFixed(3));
+ } else {
+ logger["b" /* logger */].log('live audio playlist - outdated PTS, unknown sliding');
}
-
- /**
- * Parse extended background attributes as well as new foreground color black.
- * @returns{Boolean} Tells if background attributes are found
- */
-
- }, {
- key: 'parseBackgroundAttributes',
- value: function parseBackgroundAttributes(a, b) {
- var bkgData, index, chNr, channel;
-
- var case1 = (a === 0x10 || a === 0x18) && 0x20 <= b && b <= 0x2f;
- var case2 = (a === 0x17 || a === 0x1f) && 0x2d <= b && b <= 0x2f;
- if (!(case1 || case2)) {
- return false;
- }
- bkgData = {};
- if (a === 0x10 || a === 0x18) {
- index = Math.floor((b - 0x20) / 2);
- bkgData.background = backgroundColors[index];
- if (b % 2 === 1) {
- bkgData.background = bkgData.background + '_semi';
- }
- } else if (b === 0x2d) {
- bkgData.background = 'transparent';
- } else {
- bkgData.foreground = 'black';
- if (b === 0x2f) {
- bkgData.underline = true;
- }
- }
- chNr = a < 0x18 ? 1 : 2;
- channel = this.channels[chNr - 1];
- channel.setBkgData(bkgData);
- this.lastCmdA = null;
- this.lastCmdB = null;
- return true;
+ } else {
+ newDetails.PTSKnown = false;
+ logger["b" /* logger */].log('live audio playlist - first load, unknown sliding');
+ }
+ } else {
+ newDetails.PTSKnown = false;
+ }
+ track.details = newDetails;
+
+ // compute start position
+ if (!this.startFragRequested) {
+ // compute start position if set to -1. use it straight away if value is defined
+ if (this.startPosition === -1) {
+ // first, check if start time offset has been set in playlist, if yes, use this value
+ var startTimeOffset = newDetails.startTimeOffset;
+ if (!isNaN(startTimeOffset)) {
+ logger["b" /* logger */].log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);
+ this.startPosition = startTimeOffset;
+ } else {
+ this.startPosition = 0;
}
+ }
+ this.nextLoadPosition = this.startPosition;
+ }
+ // only switch batck to IDLE state if we were waiting for track to start downloading a new fragment
+ if (this.state === audio_stream_controller_State.WAITING_TRACK) {
+ this.state = audio_stream_controller_State.IDLE;
+ }
+ //trigger handler right now
+ this.tick();
+ };
- /**
- * Reset state of parser and its channels.
- */
+ AudioStreamController.prototype.onKeyLoaded = function onKeyLoaded() {
+ if (this.state === audio_stream_controller_State.KEY_LOADING) {
+ this.state = audio_stream_controller_State.IDLE;
+ this.tick();
+ }
+ };
- }, {
- key: 'reset',
- value: function reset() {
- for (var i = 0; i < this.channels.length; i++) {
- if (this.channels[i]) {
- this.channels[i].reset();
- }
- }
- this.lastCmdA = null;
- this.lastCmdB = null;
+ AudioStreamController.prototype.onFragLoaded = function onFragLoaded(data) {
+ var fragCurrent = this.fragCurrent,
+ fragLoaded = data.frag;
+ if (this.state === audio_stream_controller_State.FRAG_LOADING && fragCurrent && fragLoaded.type === 'audio' && fragLoaded.level === fragCurrent.level && fragLoaded.sn === fragCurrent.sn) {
+ var track = this.tracks[this.trackId],
+ details = track.details,
+ duration = details.totalduration,
+ trackId = fragCurrent.level,
+ sn = fragCurrent.sn,
+ cc = fragCurrent.cc,
+ audioCodec = this.config.defaultAudioCodec || track.audioCodec || 'mp4a.40.2',
+ stats = this.stats = data.stats;
+ if (sn === 'initSegment') {
+ this.state = audio_stream_controller_State.IDLE;
+
+ stats.tparsed = stats.tbuffered = performance.now();
+ details.initSegment.data = data.payload;
+ this.hls.trigger(events["a" /* default */].FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'audio' });
+ this.tick();
+ } else {
+ this.state = audio_stream_controller_State.PARSING;
+ // transmux the MPEG-TS data to ISO-BMFF segments
+ this.appended = false;
+ if (!this.demuxer) {
+ this.demuxer = new demux_demuxer(this.hls, 'audio');
}
-
- /**
- * Trigger the generation of a cue, and the start of a new one if displayScreens are not empty.
- */
-
- }, {
- key: 'cueSplitAtTime',
- value: function cueSplitAtTime(t) {
- for (var i = 0; i < this.channels.length; i++) {
- if (this.channels[i]) {
- this.channels[i].cueSplitAtTime(t);
- }
- }
+ //Check if we have video initPTS
+ // If not we need to wait for it
+ var initPTS = this.initPTS[cc];
+ var initSegmentData = details.initSegment ? details.initSegment.data : [];
+ if (details.initSegment || initPTS !== undefined) {
+ this.pendingBuffering = true;
+ logger["b" /* logger */].log('Demuxing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);
+ // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)
+ var accurateTimeOffset = false; //details.PTSKnown || !details.live;
+ this.demuxer.push(data.payload, initSegmentData, audioCodec, null, fragCurrent, duration, accurateTimeOffset, initPTS);
+ } else {
+ logger["b" /* logger */].log('unknown video PTS for continuity counter ' + cc + ', waiting for video PTS before demuxing audio frag ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);
+ this.waitingFragment = data;
+ this.state = audio_stream_controller_State.WAITING_INIT_PTS;
}
- }]);
-
- return Cea608Parser;
-}();
-
-exports.default = Cea608Parser;
-
-},{}],50:[function(_dereq_,module,exports){
-'use strict';
-
-var _vttparser = _dereq_(56);
-
-var Cues = {
-
- newCue: function newCue(track, startTime, endTime, captionScreen) {
- var row;
- var cue;
- var indenting;
- var indent;
- var text;
- var VTTCue = window.VTTCue || window.TextTrackCue;
-
- for (var r = 0; r < captionScreen.rows.length; r++) {
- row = captionScreen.rows[r];
- indenting = true;
- indent = 0;
- text = '';
+ }
+ }
+ this.fragLoadError = 0;
+ };
- if (!row.isEmpty()) {
- for (var c = 0; c < row.chars.length; c++) {
- if (row.chars[c].uchar.match(/\s/) && indenting) {
- indent++;
+ AudioStreamController.prototype.onFragParsingInitSegment = function onFragParsingInitSegment(data) {
+ var fragCurrent = this.fragCurrent;
+ var fragNew = data.frag;
+ if (fragCurrent && data.id === 'audio' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === audio_stream_controller_State.PARSING) {
+ var tracks = data.tracks,
+ track = void 0;
+
+ // delete any video track found on audio demuxer
+ if (tracks.video) {
+ delete tracks.video;
+ }
+
+ // include levelCodec in audio and video tracks
+ track = tracks.audio;
+ if (track) {
+ track.levelCodec = track.codec;
+ track.id = data.id;
+ this.hls.trigger(events["a" /* default */].BUFFER_CODECS, tracks);
+ logger["b" /* logger */].log('audio track:audio,container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');
+ var initSegment = track.initSegment;
+ if (initSegment) {
+ var appendObj = { type: 'audio', data: initSegment, parent: 'audio', content: 'initSegment' };
+ if (this.audioSwitch) {
+ this.pendingData = [appendObj];
} else {
- text += row.chars[c].uchar;
- indenting = false;
+ this.appended = true;
+ // arm pending Buffering flag before appending a segment
+ this.pendingBuffering = true;
+ this.hls.trigger(events["a" /* default */].BUFFER_APPENDING, appendObj);
}
}
- //To be used for cleaning-up orphaned roll-up captions
- row.cueStartTime = startTime;
+ //trigger handler right now
+ this.tick();
+ }
+ }
+ };
- // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE
- if (startTime === endTime) {
- endTime += 0.0001;
- }
+ AudioStreamController.prototype.onFragParsingData = function onFragParsingData(data) {
+ var _this2 = this;
- cue = new VTTCue(startTime, endTime, (0, _vttparser.fixLineBreaks)(text.trim()));
+ var fragCurrent = this.fragCurrent;
+ var fragNew = data.frag;
+ if (fragCurrent && data.id === 'audio' && data.type === 'audio' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === audio_stream_controller_State.PARSING) {
+ var trackId = this.trackId,
+ track = this.tracks[trackId],
+ hls = this.hls;
- if (indent >= 16) {
- indent--;
+ if (isNaN(data.endPTS)) {
+ data.endPTS = data.startPTS + fragCurrent.duration;
+ data.endDTS = data.startDTS + fragCurrent.duration;
+ }
+
+ logger["b" /* logger */].log('parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb);
+ updateFragPTSDTS(track.details, fragCurrent, data.startPTS, data.endPTS);
+
+ var audioSwitch = this.audioSwitch,
+ media = this.media,
+ appendOnBufferFlush = false;
+ //Only flush audio from old audio tracks when PTS is known on new audio track
+ if (audioSwitch && media) {
+ if (media.readyState) {
+ var currentTime = media.currentTime;
+ logger["b" /* logger */].log('switching audio track : currentTime:' + currentTime);
+ if (currentTime >= data.startPTS) {
+ logger["b" /* logger */].log('switching audio track : flushing all audio');
+ this.state = audio_stream_controller_State.BUFFER_FLUSHING;
+ hls.trigger(events["a" /* default */].BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });
+ appendOnBufferFlush = true;
+ //Lets announce that the initial audio track switch flush occur
+ this.audioSwitch = false;
+ hls.trigger(events["a" /* default */].AUDIO_TRACK_SWITCHED, { id: trackId });
+ }
} else {
- indent++;
+ //Lets announce that the initial audio track switch flush occur
+ this.audioSwitch = false;
+ hls.trigger(events["a" /* default */].AUDIO_TRACK_SWITCHED, { id: trackId });
}
+ }
- // VTTCue.line get's flakey when using controls, so let's now include line 13&14
- // also, drop line 1 since it's to close to the top
- if (navigator.userAgent.match(/Firefox\//)) {
- cue.line = r + 1;
- } else {
- cue.line = r > 7 ? r - 2 : r + 1;
+ var pendingData = this.pendingData;
+ if (!this.audioSwitch) {
+ [data.data1, data.data2].forEach(function (buffer) {
+ if (buffer && buffer.length) {
+ pendingData.push({ type: data.type, data: buffer, parent: 'audio', content: 'data' });
+ }
+ });
+ if (!appendOnBufferFlush && pendingData.length) {
+ pendingData.forEach(function (appendObj) {
+ // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)
+ // in that case it is useless to append following segments
+ if (_this2.state === audio_stream_controller_State.PARSING) {
+ // arm pending Buffering flag before appending a segment
+ _this2.pendingBuffering = true;
+ _this2.hls.trigger(events["a" /* default */].BUFFER_APPENDING, appendObj);
+ }
+ });
+ this.pendingData = [];
+ this.appended = true;
}
- cue.align = 'left';
- // Clamp the position between 0 and 100 - if out of these bounds, Firefox throws an exception and captions break
- cue.position = Math.max(0, Math.min(100, 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\//) ? 50 : 0)));
- track.addCue(cue);
}
+ //trigger handler right now
+ this.tick();
}
- }
-
-};
-
-module.exports = Cues;
-
-},{"56":56}],51:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*
- * EWMA Bandwidth Estimator
- * - heavily inspired from shaka-player
- * Tracks bandwidth samples and estimates available bandwidth.
- * Based on the minimum of two exponentially-weighted moving averages with
- * different half-lives.
- */
-
-var _ewma = _dereq_(52);
-
-var _ewma2 = _interopRequireDefault(_ewma);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-var EwmaBandWidthEstimator = function () {
- function EwmaBandWidthEstimator(hls, slow, fast, defaultEstimate) {
- _classCallCheck(this, EwmaBandWidthEstimator);
-
- this.hls = hls;
- this.defaultEstimate_ = defaultEstimate;
- this.minWeight_ = 0.001;
- this.minDelayMs_ = 50;
- this.slow_ = new _ewma2.default(slow);
- this.fast_ = new _ewma2.default(fast);
- }
-
- _createClass(EwmaBandWidthEstimator, [{
- key: 'sample',
- value: function sample(durationMs, numBytes) {
- durationMs = Math.max(durationMs, this.minDelayMs_);
- var bandwidth = 8000 * numBytes / durationMs,
+ };
- //console.log('instant bw:'+ Math.round(bandwidth));
- // we weight sample using loading duration....
- weight = durationMs / 1000;
- this.fast_.sample(weight, bandwidth);
- this.slow_.sample(weight, bandwidth);
- }
- }, {
- key: 'canEstimate',
- value: function canEstimate() {
- var fast = this.fast_;
- return fast && fast.getTotalWeight() >= this.minWeight_;
- }
- }, {
- key: 'getEstimate',
- value: function getEstimate() {
- if (this.canEstimate()) {
- //console.log('slow estimate:'+ Math.round(this.slow_.getEstimate()));
- //console.log('fast estimate:'+ Math.round(this.fast_.getEstimate()));
- // Take the minimum of these two estimates. This should have the effect of
- // adapting down quickly, but up more slowly.
- return Math.min(this.fast_.getEstimate(), this.slow_.getEstimate());
- } else {
- return this.defaultEstimate_;
- }
+ AudioStreamController.prototype.onFragParsed = function onFragParsed(data) {
+ var fragCurrent = this.fragCurrent;
+ var fragNew = data.frag;
+ if (fragCurrent && data.id === 'audio' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === audio_stream_controller_State.PARSING) {
+ this.stats.tparsed = performance.now();
+ this.state = audio_stream_controller_State.PARSED;
+ this._checkAppendedParsed();
}
- }, {
- key: 'destroy',
- value: function destroy() {}
- }]);
-
- return EwmaBandWidthEstimator;
-}();
-
-exports.default = EwmaBandWidthEstimator;
-
-},{"52":52}],52:[function(_dereq_,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-/*
- * compute an Exponential Weighted moving average
- * - https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average
- * - heavily inspired from shaka-player
- */
-
-var EWMA = function () {
-
- // About half of the estimated value will be from the last |halfLife| samples by weight.
- function EWMA(halfLife) {
- _classCallCheck(this, EWMA);
+ };
- // Larger values of alpha expire historical data more slowly.
- this.alpha_ = halfLife ? Math.exp(Math.log(0.5) / halfLife) : 0;
- this.estimate_ = 0;
- this.totalWeight_ = 0;
- }
+ AudioStreamController.prototype.onBufferReset = function onBufferReset() {
+ // reset reference to sourcebuffers
+ this.mediaBuffer = this.videoBuffer = null;
+ this.loadedmetadata = false;
+ };
- _createClass(EWMA, [{
- key: "sample",
- value: function sample(weight, value) {
- var adjAlpha = Math.pow(this.alpha_, weight);
- this.estimate_ = value * (1 - adjAlpha) + adjAlpha * this.estimate_;
- this.totalWeight_ += weight;
+ AudioStreamController.prototype.onBufferCreated = function onBufferCreated(data) {
+ var audioTrack = data.tracks.audio;
+ if (audioTrack) {
+ this.mediaBuffer = audioTrack.buffer;
+ this.loadedmetadata = true;
}
- }, {
- key: "getTotalWeight",
- value: function getTotalWeight() {
- return this.totalWeight_;
- }
- }, {
- key: "getEstimate",
- value: function getEstimate() {
- if (this.alpha_) {
- var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);
- return this.estimate_ / zeroFactor;
- } else {
- return this.estimate_;
- }
+ if (data.tracks.video) {
+ this.videoBuffer = data.tracks.video.buffer;
}
- }]);
-
- return EWMA;
-}();
-
-exports.default = EWMA;
-
-},{}],53:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
-function noop() {}
-
-var fakeLogger = {
- trace: noop,
- debug: noop,
- log: noop,
- warn: noop,
- info: noop,
- error: noop
-};
-
-var exportedLogger = fakeLogger;
-
-/*globals self: false */
-
-//let lastCallTime;
-// function formatMsgWithTimeInfo(type, msg) {
-// const now = Date.now();
-// const diff = lastCallTime ? '+' + (now - lastCallTime) : '0';
-// lastCallTime = now;
-// msg = (new Date(now)).toISOString() + ' | [' + type + '] > ' + msg + ' ( ' + diff + ' ms )';
-// return msg;
-// }
-
-function formatMsg(type, msg) {
- msg = '[' + type + '] > ' + msg;
- return msg;
-}
+ };
-function consolePrintFn(type) {
- var func = self.console[type];
- if (func) {
- return function () {
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
+ AudioStreamController.prototype.onBufferAppended = function onBufferAppended(data) {
+ if (data.parent === 'audio') {
+ var state = this.state;
+ if (state === audio_stream_controller_State.PARSING || state === audio_stream_controller_State.PARSED) {
+ // check if all buffers have been appended
+ this.pendingBuffering = data.pending > 0;
+ this._checkAppendedParsed();
}
+ }
+ };
- if (args[0]) {
- args[0] = formatMsg(type, args[0]);
+ AudioStreamController.prototype._checkAppendedParsed = function _checkAppendedParsed() {
+ //trigger handler right now
+ if (this.state === audio_stream_controller_State.PARSED && (!this.appended || !this.pendingBuffering)) {
+ var frag = this.fragCurrent,
+ stats = this.stats,
+ hls = this.hls;
+ if (frag) {
+ this.fragPrevious = frag;
+ stats.tbuffered = performance.now();
+ hls.trigger(events["a" /* default */].FRAG_BUFFERED, { stats: stats, frag: frag, id: 'audio' });
+ var media = this.mediaBuffer ? this.mediaBuffer : this.media;
+ logger["b" /* logger */].log('audio buffered : ' + timeRanges.toString(media.buffered));
+ if (this.audioSwitch && this.appended) {
+ this.audioSwitch = false;
+ hls.trigger(events["a" /* default */].AUDIO_TRACK_SWITCHED, { id: this.trackId });
+ }
+ this.state = audio_stream_controller_State.IDLE;
}
- func.apply(self.console, args);
- };
- }
- return noop;
-}
-
-function exportLoggerFunctions(debugConfig) {
- for (var _len2 = arguments.length, functions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- functions[_key2 - 1] = arguments[_key2];
- }
-
- functions.forEach(function (type) {
- exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);
- });
-}
-
-var enableLogs = exports.enableLogs = function enableLogs(debugConfig) {
- if (debugConfig === true || (typeof debugConfig === 'undefined' ? 'undefined' : _typeof(debugConfig)) === 'object') {
- exportLoggerFunctions(debugConfig,
- // Remove out from list here to hard-disable a log-level
- //'trace',
- 'debug', 'log', 'info', 'warn', 'error');
- // Some browsers don't allow to use bind on console object anyway
- // fallback to default if needed
- try {
- exportedLogger.log();
- } catch (e) {
- exportedLogger = fakeLogger;
+ this.tick();
}
- } else {
- exportedLogger = fakeLogger;
- }
-};
-
-var logger = exports.logger = exportedLogger;
+ };
-},{}],54:[function(_dereq_,module,exports){
-'use strict';
+ AudioStreamController.prototype.onError = function onError(data) {
+ var frag = data.frag;
+ // don't handle frag error not related to audio fragment
+ if (frag && frag.type !== 'audio') {
+ return;
+ }
+ switch (data.details) {
+ case errors["a" /* ErrorDetails */].FRAG_LOAD_ERROR:
+ case errors["a" /* ErrorDetails */].FRAG_LOAD_TIMEOUT:
+ if (!data.fatal) {
+ var loadError = this.fragLoadError;
+ if (loadError) {
+ loadError++;
+ } else {
+ loadError = 1;
+ }
+ var config = this.config;
+ if (loadError <= config.fragLoadingMaxRetry) {
+ this.fragLoadError = loadError;
+ // reset load counter to avoid frag loop loading error
+ frag.loadCounter = 0;
+ // exponential backoff capped to config.fragLoadingMaxRetryTimeout
+ var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);
+ logger["b" /* logger */].warn('audioStreamController: frag loading failed, retry in ' + delay + ' ms');
+ this.retryDate = performance.now() + delay;
+ // retry loading state
+ this.state = audio_stream_controller_State.FRAG_LOADING_WAITING_RETRY;
+ } else {
+ logger["b" /* logger */].error('audioStreamController: ' + data.details + ' reaches max retry, redispatch as fatal ...');
+ // switch error to fatal
+ data.fatal = true;
+ this.state = audio_stream_controller_State.ERROR;
+ }
+ }
+ break;
+ case errors["a" /* ErrorDetails */].FRAG_LOOP_LOADING_ERROR:
+ case errors["a" /* ErrorDetails */].AUDIO_TRACK_LOAD_ERROR:
+ case errors["a" /* ErrorDetails */].AUDIO_TRACK_LOAD_TIMEOUT:
+ case errors["a" /* ErrorDetails */].KEY_LOAD_ERROR:
+ case errors["a" /* ErrorDetails */].KEY_LOAD_TIMEOUT:
+ // when in ERROR state, don't switch back to IDLE state in case a non-fatal error is received
+ if (this.state !== audio_stream_controller_State.ERROR) {
+ // if fatal error, stop processing, otherwise move to IDLE to retry loading
+ this.state = data.fatal ? audio_stream_controller_State.ERROR : audio_stream_controller_State.IDLE;
+ logger["b" /* logger */].warn('audioStreamController: ' + data.details + ' while loading frag,switch to ' + this.state + ' state ...');
+ }
+ break;
+ case errors["a" /* ErrorDetails */].BUFFER_FULL_ERROR:
+ // if in appending state
+ if (data.parent === 'audio' && (this.state === audio_stream_controller_State.PARSING || this.state === audio_stream_controller_State.PARSED)) {
+ var media = this.mediaBuffer,
+ currentTime = this.media.currentTime,
+ mediaBuffered = media && buffer_helper.isBuffered(media, currentTime) && buffer_helper.isBuffered(media, currentTime + 0.5);
+ // reduce max buf len if current position is buffered
+ if (mediaBuffered) {
+ var _config = this.config;
+ if (_config.maxMaxBufferLength >= _config.maxBufferLength) {
+ // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...
+ _config.maxMaxBufferLength /= 2;
+ logger["b" /* logger */].warn('audio:reduce max buffer length to ' + _config.maxMaxBufferLength + 's');
+ // increase fragment load Index to avoid frag loop loading error after buffer flush
+ this.fragLoadIdx += 2 * _config.fragLoadingLoopThreshold;
+ }
+ this.state = audio_stream_controller_State.IDLE;
+ } else {
+ // current position is not buffered, but browser is still complaining about buffer full error
+ // this happens on IE/Edge, refer to https://github.com/video-dev/hls.js/pull/708
+ // in that case flush the whole audio buffer to recover
+ logger["b" /* logger */].warn('buffer full error also media.currentTime is not buffered, flush audio buffer');
+ this.fragCurrent = null;
+ // flush everything
+ this.state = audio_stream_controller_State.BUFFER_FLUSHING;
+ this.hls.trigger(events["a" /* default */].BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ };
-/**
- * TimeRanges to string helper
- */
+ AudioStreamController.prototype.onBufferFlushed = function onBufferFlushed() {
+ var _this3 = this;
-var TimeRanges = {
- toString: function toString(r) {
- var log = '',
- len = r.length;
- for (var i = 0; i < len; i++) {
- log += '[' + r.start(i).toFixed(3) + ',' + r.end(i).toFixed(3) + ']';
+ var pendingData = this.pendingData;
+ if (pendingData && pendingData.length) {
+ logger["b" /* logger */].log('appending pending audio data on Buffer Flushed');
+ pendingData.forEach(function (appendObj) {
+ _this3.hls.trigger(events["a" /* default */].BUFFER_APPENDING, appendObj);
+ });
+ this.appended = true;
+ this.pendingData = [];
+ this.state = audio_stream_controller_State.PARSED;
+ } else {
+ // move to IDLE once flush complete. this should trigger new fragment loading
+ this.state = audio_stream_controller_State.IDLE;
+ // reset reference to frag
+ this.fragPrevious = null;
+ this.tick();
}
- return log;
- }
-};
-
-module.exports = TimeRanges;
+ };
-},{}],55:[function(_dereq_,module,exports){
-'use strict';
+ audio_stream_controller__createClass(AudioStreamController, [{
+ key: 'state',
+ set: function set(nextState) {
+ if (this.state !== nextState) {
+ var previousState = this.state;
+ this._state = nextState;
+ logger["b" /* logger */].log('audio stream:' + previousState + '->' + nextState);
+ }
+ },
+ get: function get() {
+ return this._state;
+ }
+ }]);
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ return AudioStreamController;
+}(event_handler);
+/* harmony default export */ var audio_stream_controller = (audio_stream_controller_AudioStreamController);
+// CONCATENATED MODULE: ./src/utils/vttcue.js
/**
* Copyright 2013 vtt.js Contributors
*
@@ -28720,7 +26393,7 @@ Object.defineProperty(exports, "__esModule", {
* limitations under the License.
*/
-exports.default = function () {
+/* harmony default export */ var vttcue = ((function () {
if (typeof window !== 'undefined' && window.VTTCue) {
return window.VTTCue;
}
@@ -29007,21 +26680,13 @@ exports.default = function () {
};
return VTTCue;
-}();
-
-},{}],56:[function(_dereq_,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.fixLineBreaks = undefined;
+})());
+// CONCATENATED MODULE: ./src/utils/vttparser.js
+/*
+ * Source: https://github.com/mozilla/vtt.js/blob/master/dist/vtt.js#L1716
+ */
-var _vttcue = _dereq_(55);
-var _vttcue2 = _interopRequireDefault(_vttcue);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var StringDecoder = function StringDecoder() {
return {
@@ -29035,9 +26700,7 @@ var StringDecoder = function StringDecoder() {
return decodeURIComponent(encodeURIComponent(data));
}
};
-}; /*
- * Source: https://github.com/mozilla/vtt.js/blob/master/dist/vtt.js#L1716
- */
+};
function VTTParser() {
this.window = window;
@@ -29148,9 +26811,9 @@ function parseOptions(input, callback, keyValueDelim, groupDelim) {
}
}
-var defaults = new _vttcue2.default(0, 0, 0);
+var defaults = new vttcue(0, 0, 0);
// 'middle' was changed to 'center' in the spec: https://github.com/w3c/webvtt/pull/244
-// Chrome and Safari don't yet support this change, but FF does
+// Safari doesn't yet support this change, but FF and Chrome do.
var center = defaults.align === 'middle' ? 'middle' : 'center';
function parseCue(input, cue, regionList) {
@@ -29315,8 +26978,9 @@ VTTParser.prototype = {
}
line = collectNextLine();
-
- var m = line.match(/^WEBVTT([ \t].*)?$/);
+ // strip of UTF-8 BOM if any
+ // https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8
+ var m = line.match(/^()?WEBVTT([ \t].*)?$/);
if (!m || !m[0]) {
throw new Error('Malformed WebVTT signature.');
}
@@ -29363,7 +27027,7 @@ VTTParser.prototype = {
if (!line) {
continue;
}
- self.cue = new _vttcue2.default(0, 0, '');
+ self.cue = new vttcue(0, 0, '');
self.state = 'CUE';
// 30-39 - Check if self line contains an optional identifier or timing data.
if (line.indexOf('-->') === -1) {
@@ -29452,17 +27116,1335 @@ VTTParser.prototype = {
}
};
-exports.fixLineBreaks = fixLineBreaks;
-exports.default = VTTParser;
-},{"55":55}],57:[function(_dereq_,module,exports){
-'use strict';
-var _vttparser = _dereq_(56);
+/* harmony default export */ var vttparser = (VTTParser);
+// CONCATENATED MODULE: ./src/utils/cues.js
+
+
+function newCue(track, startTime, endTime, captionScreen) {
+ var row;
+ var cue;
+ var indenting;
+ var indent;
+ var text;
+ var VTTCue = window.VTTCue || window.TextTrackCue;
+
+ for (var r = 0; r < captionScreen.rows.length; r++) {
+ row = captionScreen.rows[r];
+ indenting = true;
+ indent = 0;
+ text = '';
+
+ if (!row.isEmpty()) {
+ for (var c = 0; c < row.chars.length; c++) {
+ if (row.chars[c].uchar.match(/\s/) && indenting) {
+ indent++;
+ } else {
+ text += row.chars[c].uchar;
+ indenting = false;
+ }
+ }
+ //To be used for cleaning-up orphaned roll-up captions
+ row.cueStartTime = startTime;
+
+ // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE
+ if (startTime === endTime) {
+ endTime += 0.0001;
+ }
+
+ cue = new VTTCue(startTime, endTime, fixLineBreaks(text.trim()));
+
+ if (indent >= 16) {
+ indent--;
+ } else {
+ indent++;
+ }
+
+ // VTTCue.line get's flakey when using controls, so let's now include line 13&14
+ // also, drop line 1 since it's to close to the top
+ if (navigator.userAgent.match(/Firefox\//)) {
+ cue.line = r + 1;
+ } else {
+ cue.line = r > 7 ? r - 2 : r + 1;
+ }
+ cue.align = 'left';
+ // Clamp the position between 0 and 100 - if out of these bounds, Firefox throws an exception and captions break
+ cue.position = Math.max(0, Math.min(100, 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\//) ? 50 : 0)));
+ track.addCue(cue);
+ }
+ }
+}
+// CONCATENATED MODULE: ./src/utils/cea-608-parser.js
+function cea_608_parser__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+/**
+ *
+ * This code was ported from the dash.js project at:
+ * https://github.com/Dash-Industry-Forum/dash.js/blob/development/externals/cea608-parser.js
+ * https://github.com/Dash-Industry-Forum/dash.js/commit/8269b26a761e0853bb21d78780ed945144ecdd4d#diff-71bc295a2d6b6b7093a1d3290d53a4b2
+ *
+ * The original copyright appears below:
+ *
+ * The copyright in this software is being made available under the BSD License,
+ * included below. This software may be subject to other third party and contributor
+ * rights, including patent rights, and no such rights are granted under this license.
+ *
+ * Copyright (c) 2015-2016, DASH Industry Forum.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation and/or
+ * other materials provided with the distribution.
+ * 2. Neither the name of Dash Industry Forum nor the names of its
+ * contributors may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * Exceptions from regular ASCII. CodePoints are mapped to UTF-16 codes
+ */
+
+var specialCea608CharsCodes = {
+ 0x2a: 0xe1, // lowercase a, acute accent
+ 0x5c: 0xe9, // lowercase e, acute accent
+ 0x5e: 0xed, // lowercase i, acute accent
+ 0x5f: 0xf3, // lowercase o, acute accent
+ 0x60: 0xfa, // lowercase u, acute accent
+ 0x7b: 0xe7, // lowercase c with cedilla
+ 0x7c: 0xf7, // division symbol
+ 0x7d: 0xd1, // uppercase N tilde
+ 0x7e: 0xf1, // lowercase n tilde
+ 0x7f: 0x2588, // Full block
+ // THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
+ // THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F
+ // THIS MEANS THAT \x50 MUST BE ADDED TO THE VALUES
+ 0x80: 0xae, // Registered symbol (R)
+ 0x81: 0xb0, // degree sign
+ 0x82: 0xbd, // 1/2 symbol
+ 0x83: 0xbf, // Inverted (open) question mark
+ 0x84: 0x2122, // Trademark symbol (TM)
+ 0x85: 0xa2, // Cents symbol
+ 0x86: 0xa3, // Pounds sterling
+ 0x87: 0x266a, // Music 8'th note
+ 0x88: 0xe0, // lowercase a, grave accent
+ 0x89: 0x20, // transparent space (regular)
+ 0x8a: 0xe8, // lowercase e, grave accent
+ 0x8b: 0xe2, // lowercase a, circumflex accent
+ 0x8c: 0xea, // lowercase e, circumflex accent
+ 0x8d: 0xee, // lowercase i, circumflex accent
+ 0x8e: 0xf4, // lowercase o, circumflex accent
+ 0x8f: 0xfb, // lowercase u, circumflex accent
+ // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
+ // THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F
+ 0x90: 0xc1, // capital letter A with acute
+ 0x91: 0xc9, // capital letter E with acute
+ 0x92: 0xd3, // capital letter O with acute
+ 0x93: 0xda, // capital letter U with acute
+ 0x94: 0xdc, // capital letter U with diaresis
+ 0x95: 0xfc, // lowercase letter U with diaeresis
+ 0x96: 0x2018, // opening single quote
+ 0x97: 0xa1, // inverted exclamation mark
+ 0x98: 0x2a, // asterisk
+ 0x99: 0x2019, // closing single quote
+ 0x9a: 0x2501, // box drawings heavy horizontal
+ 0x9b: 0xa9, // copyright sign
+ 0x9c: 0x2120, // Service mark
+ 0x9d: 0x2022, // (round) bullet
+ 0x9e: 0x201c, // Left double quotation mark
+ 0x9f: 0x201d, // Right double quotation mark
+ 0xa0: 0xc0, // uppercase A, grave accent
+ 0xa1: 0xc2, // uppercase A, circumflex
+ 0xa2: 0xc7, // uppercase C with cedilla
+ 0xa3: 0xc8, // uppercase E, grave accent
+ 0xa4: 0xca, // uppercase E, circumflex
+ 0xa5: 0xcb, // capital letter E with diaresis
+ 0xa6: 0xeb, // lowercase letter e with diaresis
+ 0xa7: 0xce, // uppercase I, circumflex
+ 0xa8: 0xcf, // uppercase I, with diaresis
+ 0xa9: 0xef, // lowercase i, with diaresis
+ 0xaa: 0xd4, // uppercase O, circumflex
+ 0xab: 0xd9, // uppercase U, grave accent
+ 0xac: 0xf9, // lowercase u, grave accent
+ 0xad: 0xdb, // uppercase U, circumflex
+ 0xae: 0xab, // left-pointing double angle quotation mark
+ 0xaf: 0xbb, // right-pointing double angle quotation mark
+ // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
+ // THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F
+ 0xb0: 0xc3, // Uppercase A, tilde
+ 0xb1: 0xe3, // Lowercase a, tilde
+ 0xb2: 0xcd, // Uppercase I, acute accent
+ 0xb3: 0xcc, // Uppercase I, grave accent
+ 0xb4: 0xec, // Lowercase i, grave accent
+ 0xb5: 0xd2, // Uppercase O, grave accent
+ 0xb6: 0xf2, // Lowercase o, grave accent
+ 0xb7: 0xd5, // Uppercase O, tilde
+ 0xb8: 0xf5, // Lowercase o, tilde
+ 0xb9: 0x7b, // Open curly brace
+ 0xba: 0x7d, // Closing curly brace
+ 0xbb: 0x5c, // Backslash
+ 0xbc: 0x5e, // Caret
+ 0xbd: 0x5f, // Underscore
+ 0xbe: 0x7c, // Pipe (vertical line)
+ 0xbf: 0x223c, // Tilde operator
+ 0xc0: 0xc4, // Uppercase A, umlaut
+ 0xc1: 0xe4, // Lowercase A, umlaut
+ 0xc2: 0xd6, // Uppercase O, umlaut
+ 0xc3: 0xf6, // Lowercase o, umlaut
+ 0xc4: 0xdf, // Esszett (sharp S)
+ 0xc5: 0xa5, // Yen symbol
+ 0xc6: 0xa4, // Generic currency sign
+ 0xc7: 0x2503, // Box drawings heavy vertical
+ 0xc8: 0xc5, // Uppercase A, ring
+ 0xc9: 0xe5, // Lowercase A, ring
+ 0xca: 0xd8, // Uppercase O, stroke
+ 0xcb: 0xf8, // Lowercase o, strok
+ 0xcc: 0x250f, // Box drawings heavy down and right
+ 0xcd: 0x2513, // Box drawings heavy down and left
+ 0xce: 0x2517, // Box drawings heavy up and right
+ 0xcf: 0x251b // Box drawings heavy up and left
+};
+
+/**
+ * Utils
+ */
+var getCharForByte = function getCharForByte(byte) {
+ var charCode = byte;
+ if (specialCea608CharsCodes.hasOwnProperty(byte)) {
+ charCode = specialCea608CharsCodes[byte];
+ }
+ return String.fromCharCode(charCode);
+};
+
+var NR_ROWS = 15,
+ NR_COLS = 100;
+// Tables to look up row from PAC data
+var rowsLowCh1 = { 0x11: 1, 0x12: 3, 0x15: 5, 0x16: 7, 0x17: 9, 0x10: 11, 0x13: 12, 0x14: 14 };
+var rowsHighCh1 = { 0x11: 2, 0x12: 4, 0x15: 6, 0x16: 8, 0x17: 10, 0x13: 13, 0x14: 15 };
+var rowsLowCh2 = { 0x19: 1, 0x1A: 3, 0x1D: 5, 0x1E: 7, 0x1F: 9, 0x18: 11, 0x1B: 12, 0x1C: 14 };
+var rowsHighCh2 = { 0x19: 2, 0x1A: 4, 0x1D: 6, 0x1E: 8, 0x1F: 10, 0x1B: 13, 0x1C: 15 };
+
+var backgroundColors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'black', 'transparent'];
+
+/**
+ * Simple logger class to be able to write with time-stamps and filter on level.
+ */
+var cea_608_parser_logger = {
+ verboseFilter: { 'DATA': 3, 'DEBUG': 3, 'INFO': 2, 'WARNING': 2, 'TEXT': 1, 'ERROR': 0 },
+ time: null,
+ verboseLevel: 0, // Only write errors
+ setTime: function setTime(newTime) {
+ this.time = newTime;
+ },
+ log: function log(severity, msg) {
+ var minLevel = this.verboseFilter[severity];
+ if (this.verboseLevel >= minLevel) {
+ console.log(this.time + ' [' + severity + '] ' + msg);
+ }
+ }
+};
+
+var numArrayToHexArray = function numArrayToHexArray(numArray) {
+ var hexArray = [];
+ for (var j = 0; j < numArray.length; j++) {
+ hexArray.push(numArray[j].toString(16));
+ }
+ return hexArray;
+};
+
+var PenState = function () {
+ function PenState(foreground, underline, italics, background, flash) {
+ cea_608_parser__classCallCheck(this, PenState);
+
+ this.foreground = foreground || 'white';
+ this.underline = underline || false;
+ this.italics = italics || false;
+ this.background = background || 'black';
+ this.flash = flash || false;
+ }
+
+ PenState.prototype.reset = function reset() {
+ this.foreground = 'white';
+ this.underline = false;
+ this.italics = false;
+ this.background = 'black';
+ this.flash = false;
+ };
+
+ PenState.prototype.setStyles = function setStyles(styles) {
+ var attribs = ['foreground', 'underline', 'italics', 'background', 'flash'];
+ for (var i = 0; i < attribs.length; i++) {
+ var style = attribs[i];
+ if (styles.hasOwnProperty(style)) {
+ this[style] = styles[style];
+ }
+ }
+ };
+
+ PenState.prototype.isDefault = function isDefault() {
+ return this.foreground === 'white' && !this.underline && !this.italics && this.background === 'black' && !this.flash;
+ };
+
+ PenState.prototype.equals = function equals(other) {
+ return this.foreground === other.foreground && this.underline === other.underline && this.italics === other.italics && this.background === other.background && this.flash === other.flash;
+ };
+
+ PenState.prototype.copy = function copy(newPenState) {
+ this.foreground = newPenState.foreground;
+ this.underline = newPenState.underline;
+ this.italics = newPenState.italics;
+ this.background = newPenState.background;
+ this.flash = newPenState.flash;
+ };
+
+ PenState.prototype.toString = function toString() {
+ return 'color=' + this.foreground + ', underline=' + this.underline + ', italics=' + this.italics + ', background=' + this.background + ', flash=' + this.flash;
+ };
+
+ return PenState;
+}();
+
+/**
+ * Unicode character with styling and background.
+ * @constructor
+ */
+
+
+var StyledUnicodeChar = function () {
+ function StyledUnicodeChar(uchar, foreground, underline, italics, background, flash) {
+ cea_608_parser__classCallCheck(this, StyledUnicodeChar);
+
+ this.uchar = uchar || ' '; // unicode character
+ this.penState = new PenState(foreground, underline, italics, background, flash);
+ }
+
+ StyledUnicodeChar.prototype.reset = function reset() {
+ this.uchar = ' ';
+ this.penState.reset();
+ };
+
+ StyledUnicodeChar.prototype.setChar = function setChar(uchar, newPenState) {
+ this.uchar = uchar;
+ this.penState.copy(newPenState);
+ };
+
+ StyledUnicodeChar.prototype.setPenState = function setPenState(newPenState) {
+ this.penState.copy(newPenState);
+ };
+
+ StyledUnicodeChar.prototype.equals = function equals(other) {
+ return this.uchar === other.uchar && this.penState.equals(other.penState);
+ };
+
+ StyledUnicodeChar.prototype.copy = function copy(newChar) {
+ this.uchar = newChar.uchar;
+ this.penState.copy(newChar.penState);
+ };
+
+ StyledUnicodeChar.prototype.isEmpty = function isEmpty() {
+ return this.uchar === ' ' && this.penState.isDefault();
+ };
+
+ return StyledUnicodeChar;
+}();
+
+/**
+ * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.
+ * @constructor
+ */
+
+
+var Row = function () {
+ function Row() {
+ cea_608_parser__classCallCheck(this, Row);
+
+ this.chars = [];
+ for (var i = 0; i < NR_COLS; i++) {
+ this.chars.push(new StyledUnicodeChar());
+ }
+ this.pos = 0;
+ this.currPenState = new PenState();
+ }
+
+ Row.prototype.equals = function equals(other) {
+ var equal = true;
+ for (var i = 0; i < NR_COLS; i++) {
+ if (!this.chars[i].equals(other.chars[i])) {
+ equal = false;
+ break;
+ }
+ }
+ return equal;
+ };
+
+ Row.prototype.copy = function copy(other) {
+ for (var i = 0; i < NR_COLS; i++) {
+ this.chars[i].copy(other.chars[i]);
+ }
+ };
+
+ Row.prototype.isEmpty = function isEmpty() {
+ var empty = true;
+ for (var i = 0; i < NR_COLS; i++) {
+ if (!this.chars[i].isEmpty()) {
+ empty = false;
+ break;
+ }
+ }
+ return empty;
+ };
+
+ /**
+ * Set the cursor to a valid column.
+ */
+
+
+ Row.prototype.setCursor = function setCursor(absPos) {
+ if (this.pos !== absPos) {
+ this.pos = absPos;
+ }
+ if (this.pos < 0) {
+ cea_608_parser_logger.log('ERROR', 'Negative cursor position ' + this.pos);
+ this.pos = 0;
+ } else if (this.pos > NR_COLS) {
+ cea_608_parser_logger.log('ERROR', 'Too large cursor position ' + this.pos);
+ this.pos = NR_COLS;
+ }
+ };
+
+ /**
+ * Move the cursor relative to current position.
+ */
+
+
+ Row.prototype.moveCursor = function moveCursor(relPos) {
+ var newPos = this.pos + relPos;
+ if (relPos > 1) {
+ for (var i = this.pos + 1; i < newPos + 1; i++) {
+ this.chars[i].setPenState(this.currPenState);
+ }
+ }
+ this.setCursor(newPos);
+ };
+
+ /**
+ * Backspace, move one step back and clear character.
+ */
+
+
+ Row.prototype.backSpace = function backSpace() {
+ this.moveCursor(-1);
+ this.chars[this.pos].setChar(' ', this.currPenState);
+ };
+
+ Row.prototype.insertChar = function insertChar(byte) {
+ if (byte >= 0x90) {
+ //Extended char
+ this.backSpace();
+ }
+ var char = getCharForByte(byte);
+ if (this.pos >= NR_COLS) {
+ cea_608_parser_logger.log('ERROR', 'Cannot insert ' + byte.toString(16) + ' (' + char + ') at position ' + this.pos + '. Skipping it!');
+ return;
+ }
+ this.chars[this.pos].setChar(char, this.currPenState);
+ this.moveCursor(1);
+ };
+
+ Row.prototype.clearFromPos = function clearFromPos(startPos) {
+ var i;
+ for (i = startPos; i < NR_COLS; i++) {
+ this.chars[i].reset();
+ }
+ };
+
+ Row.prototype.clear = function clear() {
+ this.clearFromPos(0);
+ this.pos = 0;
+ this.currPenState.reset();
+ };
+
+ Row.prototype.clearToEndOfRow = function clearToEndOfRow() {
+ this.clearFromPos(this.pos);
+ };
+
+ Row.prototype.getTextString = function getTextString() {
+ var chars = [];
+ var empty = true;
+ for (var i = 0; i < NR_COLS; i++) {
+ var char = this.chars[i].uchar;
+ if (char !== ' ') {
+ empty = false;
+ }
+ chars.push(char);
+ }
+ if (empty) {
+ return '';
+ } else {
+ return chars.join('');
+ }
+ };
+
+ Row.prototype.setPenStyles = function setPenStyles(styles) {
+ this.currPenState.setStyles(styles);
+ var currChar = this.chars[this.pos];
+ currChar.setPenState(this.currPenState);
+ };
+
+ return Row;
+}();
+
+/**
+ * Keep a CEA-608 screen of 32x15 styled characters
+ * @constructor
+*/
+
+
+var CaptionScreen = function () {
+ function CaptionScreen() {
+ cea_608_parser__classCallCheck(this, CaptionScreen);
+
+ this.rows = [];
+ for (var i = 0; i < NR_ROWS; i++) {
+ this.rows.push(new Row()); // Note that we use zero-based numbering (0-14)
+ }
+ this.currRow = NR_ROWS - 1;
+ this.nrRollUpRows = null;
+ this.reset();
+ }
+
+ CaptionScreen.prototype.reset = function reset() {
+ for (var i = 0; i < NR_ROWS; i++) {
+ this.rows[i].clear();
+ }
+ this.currRow = NR_ROWS - 1;
+ };
+
+ CaptionScreen.prototype.equals = function equals(other) {
+ var equal = true;
+ for (var i = 0; i < NR_ROWS; i++) {
+ if (!this.rows[i].equals(other.rows[i])) {
+ equal = false;
+ break;
+ }
+ }
+ return equal;
+ };
+
+ CaptionScreen.prototype.copy = function copy(other) {
+ for (var i = 0; i < NR_ROWS; i++) {
+ this.rows[i].copy(other.rows[i]);
+ }
+ };
+
+ CaptionScreen.prototype.isEmpty = function isEmpty() {
+ var empty = true;
+ for (var i = 0; i < NR_ROWS; i++) {
+ if (!this.rows[i].isEmpty()) {
+ empty = false;
+ break;
+ }
+ }
+ return empty;
+ };
+
+ CaptionScreen.prototype.backSpace = function backSpace() {
+ var row = this.rows[this.currRow];
+ row.backSpace();
+ };
+
+ CaptionScreen.prototype.clearToEndOfRow = function clearToEndOfRow() {
+ var row = this.rows[this.currRow];
+ row.clearToEndOfRow();
+ };
+
+ /**
+ * Insert a character (without styling) in the current row.
+ */
+
+
+ CaptionScreen.prototype.insertChar = function insertChar(char) {
+ var row = this.rows[this.currRow];
+ row.insertChar(char);
+ };
+
+ CaptionScreen.prototype.setPen = function setPen(styles) {
+ var row = this.rows[this.currRow];
+ row.setPenStyles(styles);
+ };
+
+ CaptionScreen.prototype.moveCursor = function moveCursor(relPos) {
+ var row = this.rows[this.currRow];
+ row.moveCursor(relPos);
+ };
+
+ CaptionScreen.prototype.setCursor = function setCursor(absPos) {
+ cea_608_parser_logger.log('INFO', 'setCursor: ' + absPos);
+ var row = this.rows[this.currRow];
+ row.setCursor(absPos);
+ };
+
+ CaptionScreen.prototype.setPAC = function setPAC(pacData) {
+ cea_608_parser_logger.log('INFO', 'pacData = ' + JSON.stringify(pacData));
+ var newRow = pacData.row - 1;
+ if (this.nrRollUpRows && newRow < this.nrRollUpRows - 1) {
+ newRow = this.nrRollUpRows - 1;
+ }
+
+ //Make sure this only affects Roll-up Captions by checking this.nrRollUpRows
+ if (this.nrRollUpRows && this.currRow !== newRow) {
+ //clear all rows first
+ for (var i = 0; i < NR_ROWS; i++) {
+ this.rows[i].clear();
+ }
+
+ //Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location
+ //topRowIndex - the start of rows to copy (inclusive index)
+ var topRowIndex = this.currRow + 1 - this.nrRollUpRows;
+ //We only copy if the last position was already shown.
+ //We use the cueStartTime value to check this.
+ var lastOutputScreen = this.lastOutputScreen;
+ if (lastOutputScreen) {
+ var prevLineTime = lastOutputScreen.rows[topRowIndex].cueStartTime;
+ if (prevLineTime && prevLineTime < cea_608_parser_logger.time) {
+ for (var _i = 0; _i < this.nrRollUpRows; _i++) {
+ this.rows[newRow - this.nrRollUpRows + _i + 1].copy(lastOutputScreen.rows[topRowIndex + _i]);
+ }
+ }
+ }
+ }
+
+ this.currRow = newRow;
+ var row = this.rows[this.currRow];
+ if (pacData.indent !== null) {
+ var indent = pacData.indent;
+ var prevPos = Math.max(indent - 1, 0);
+ row.setCursor(pacData.indent);
+ pacData.color = row.chars[prevPos].penState.foreground;
+ }
+ var styles = { foreground: pacData.color, underline: pacData.underline, italics: pacData.italics, background: 'black', flash: false };
+ this.setPen(styles);
+ };
+
+ /**
+ * Set background/extra foreground, but first do back_space, and then insert space (backwards compatibility).
+ */
+
+
+ CaptionScreen.prototype.setBkgData = function setBkgData(bkgData) {
+
+ cea_608_parser_logger.log('INFO', 'bkgData = ' + JSON.stringify(bkgData));
+ this.backSpace();
+ this.setPen(bkgData);
+ this.insertChar(0x20); //Space
+ };
+
+ CaptionScreen.prototype.setRollUpRows = function setRollUpRows(nrRows) {
+ this.nrRollUpRows = nrRows;
+ };
+
+ CaptionScreen.prototype.rollUp = function rollUp() {
+ if (this.nrRollUpRows === null) {
+ cea_608_parser_logger.log('DEBUG', 'roll_up but nrRollUpRows not set yet');
+ return; //Not properly setup
+ }
+ cea_608_parser_logger.log('TEXT', this.getDisplayText());
+ var topRowIndex = this.currRow + 1 - this.nrRollUpRows;
+ var topRow = this.rows.splice(topRowIndex, 1)[0];
+ topRow.clear();
+ this.rows.splice(this.currRow, 0, topRow);
+ cea_608_parser_logger.log('INFO', 'Rolling up');
+ //logger.log('TEXT', this.get_display_text())
+ };
+
+ /**
+ * Get all non-empty rows with as unicode text.
+ */
+
+
+ CaptionScreen.prototype.getDisplayText = function getDisplayText(asOneRow) {
+ asOneRow = asOneRow || false;
+ var displayText = [];
+ var text = '';
+ var rowNr = -1;
+ for (var i = 0; i < NR_ROWS; i++) {
+ var rowText = this.rows[i].getTextString();
+ if (rowText) {
+ rowNr = i + 1;
+ if (asOneRow) {
+ displayText.push('Row ' + rowNr + ': \'' + rowText + '\'');
+ } else {
+ displayText.push(rowText.trim());
+ }
+ }
+ }
+ if (displayText.length > 0) {
+ if (asOneRow) {
+ text = '[' + displayText.join(' | ') + ']';
+ } else {
+ text = displayText.join('\n');
+ }
+ }
+ return text;
+ };
+
+ CaptionScreen.prototype.getTextAndFormat = function getTextAndFormat() {
+ return this.rows;
+ };
+
+ return CaptionScreen;
+}();
+
+//var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];
+
+var Cea608Channel = function () {
+ function Cea608Channel(channelNumber, outputFilter) {
+ cea_608_parser__classCallCheck(this, Cea608Channel);
+
+ this.chNr = channelNumber;
+ this.outputFilter = outputFilter;
+ this.mode = null;
+ this.verbose = 0;
+ this.displayedMemory = new CaptionScreen();
+ this.nonDisplayedMemory = new CaptionScreen();
+ this.lastOutputScreen = new CaptionScreen();
+ this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];
+ this.writeScreen = this.displayedMemory;
+ this.mode = null;
+ this.cueStartTime = null; // Keeps track of where a cue started.
+ }
+
+ Cea608Channel.prototype.reset = function reset() {
+ this.mode = null;
+ this.displayedMemory.reset();
+ this.nonDisplayedMemory.reset();
+ this.lastOutputScreen.reset();
+ this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];
+ this.writeScreen = this.displayedMemory;
+ this.mode = null;
+ this.cueStartTime = null;
+ this.lastCueEndTime = null;
+ };
+
+ Cea608Channel.prototype.getHandler = function getHandler() {
+ return this.outputFilter;
+ };
+
+ Cea608Channel.prototype.setHandler = function setHandler(newHandler) {
+ this.outputFilter = newHandler;
+ };
+
+ Cea608Channel.prototype.setPAC = function setPAC(pacData) {
+ this.writeScreen.setPAC(pacData);
+ };
+
+ Cea608Channel.prototype.setBkgData = function setBkgData(bkgData) {
+ this.writeScreen.setBkgData(bkgData);
+ };
+
+ Cea608Channel.prototype.setMode = function setMode(newMode) {
+ if (newMode === this.mode) {
+ return;
+ }
+ this.mode = newMode;
+ cea_608_parser_logger.log('INFO', 'MODE=' + newMode);
+ if (this.mode === 'MODE_POP-ON') {
+ this.writeScreen = this.nonDisplayedMemory;
+ } else {
+ this.writeScreen = this.displayedMemory;
+ this.writeScreen.reset();
+ }
+ if (this.mode !== 'MODE_ROLL-UP') {
+ this.displayedMemory.nrRollUpRows = null;
+ this.nonDisplayedMemory.nrRollUpRows = null;
+ }
+ this.mode = newMode;
+ };
+
+ Cea608Channel.prototype.insertChars = function insertChars(chars) {
+ for (var i = 0; i < chars.length; i++) {
+ this.writeScreen.insertChar(chars[i]);
+ }
+ var screen = this.writeScreen === this.displayedMemory ? 'DISP' : 'NON_DISP';
+ cea_608_parser_logger.log('INFO', screen + ': ' + this.writeScreen.getDisplayText(true));
+ if (this.mode === 'MODE_PAINT-ON' || this.mode === 'MODE_ROLL-UP') {
+ cea_608_parser_logger.log('TEXT', 'DISPLAYED: ' + this.displayedMemory.getDisplayText(true));
+ this.outputDataUpdate();
+ }
+ };
+
+ Cea608Channel.prototype.ccRCL = function ccRCL() {
+ // Resume Caption Loading (switch mode to Pop On)
+ cea_608_parser_logger.log('INFO', 'RCL - Resume Caption Loading');
+ this.setMode('MODE_POP-ON');
+ };
+
+ Cea608Channel.prototype.ccBS = function ccBS() {
+ // BackSpace
+ cea_608_parser_logger.log('INFO', 'BS - BackSpace');
+ if (this.mode === 'MODE_TEXT') {
+ return;
+ }
+ this.writeScreen.backSpace();
+ if (this.writeScreen === this.displayedMemory) {
+ this.outputDataUpdate();
+ }
+ };
+
+ Cea608Channel.prototype.ccAOF = function ccAOF() {
+ // Reserved (formerly Alarm Off)
+ return;
+ };
+
+ Cea608Channel.prototype.ccAON = function ccAON() {
+ // Reserved (formerly Alarm On)
+ return;
+ };
+
+ Cea608Channel.prototype.ccDER = function ccDER() {
+ // Delete to End of Row
+ cea_608_parser_logger.log('INFO', 'DER- Delete to End of Row');
+ this.writeScreen.clearToEndOfRow();
+ this.outputDataUpdate();
+ };
+
+ Cea608Channel.prototype.ccRU = function ccRU(nrRows) {
+ //Roll-Up Captions-2,3,or 4 Rows
+ cea_608_parser_logger.log('INFO', 'RU(' + nrRows + ') - Roll Up');
+ this.writeScreen = this.displayedMemory;
+ this.setMode('MODE_ROLL-UP');
+ this.writeScreen.setRollUpRows(nrRows);
+ };
+
+ Cea608Channel.prototype.ccFON = function ccFON() {
+ //Flash On
+ cea_608_parser_logger.log('INFO', 'FON - Flash On');
+ this.writeScreen.setPen({ flash: true });
+ };
+
+ Cea608Channel.prototype.ccRDC = function ccRDC() {
+ // Resume Direct Captioning (switch mode to PaintOn)
+ cea_608_parser_logger.log('INFO', 'RDC - Resume Direct Captioning');
+ this.setMode('MODE_PAINT-ON');
+ };
+
+ Cea608Channel.prototype.ccTR = function ccTR() {
+ // Text Restart in text mode (not supported, however)
+ cea_608_parser_logger.log('INFO', 'TR');
+ this.setMode('MODE_TEXT');
+ };
+
+ Cea608Channel.prototype.ccRTD = function ccRTD() {
+ // Resume Text Display in Text mode (not supported, however)
+ cea_608_parser_logger.log('INFO', 'RTD');
+ this.setMode('MODE_TEXT');
+ };
+
+ Cea608Channel.prototype.ccEDM = function ccEDM() {
+ // Erase Displayed Memory
+ cea_608_parser_logger.log('INFO', 'EDM - Erase Displayed Memory');
+ this.displayedMemory.reset();
+ this.outputDataUpdate(true);
+ };
+
+ Cea608Channel.prototype.ccCR = function ccCR() {
+ // Carriage Return
+ cea_608_parser_logger.log('CR - Carriage Return');
+ this.writeScreen.rollUp();
+ this.outputDataUpdate(true);
+ };
+
+ Cea608Channel.prototype.ccENM = function ccENM() {
+ //Erase Non-Displayed Memory
+ cea_608_parser_logger.log('INFO', 'ENM - Erase Non-displayed Memory');
+ this.nonDisplayedMemory.reset();
+ };
+
+ Cea608Channel.prototype.ccEOC = function ccEOC() {
+ //End of Caption (Flip Memories)
+ cea_608_parser_logger.log('INFO', 'EOC - End Of Caption');
+ if (this.mode === 'MODE_POP-ON') {
+ var tmp = this.displayedMemory;
+ this.displayedMemory = this.nonDisplayedMemory;
+ this.nonDisplayedMemory = tmp;
+ this.writeScreen = this.nonDisplayedMemory;
+ cea_608_parser_logger.log('TEXT', 'DISP: ' + this.displayedMemory.getDisplayText());
+ }
+ this.outputDataUpdate(true);
+ };
+
+ Cea608Channel.prototype.ccTO = function ccTO(nrCols) {
+ // Tab Offset 1,2, or 3 columns
+ cea_608_parser_logger.log('INFO', 'TO(' + nrCols + ') - Tab Offset');
+ this.writeScreen.moveCursor(nrCols);
+ };
+
+ Cea608Channel.prototype.ccMIDROW = function ccMIDROW(secondByte) {
+ // Parse MIDROW command
+ var styles = { flash: false };
+ styles.underline = secondByte % 2 === 1;
+ styles.italics = secondByte >= 0x2e;
+ if (!styles.italics) {
+ var colorIndex = Math.floor(secondByte / 2) - 0x10;
+ var colors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta'];
+ styles.foreground = colors[colorIndex];
+ } else {
+ styles.foreground = 'white';
+ }
+ cea_608_parser_logger.log('INFO', 'MIDROW: ' + JSON.stringify(styles));
+ this.writeScreen.setPen(styles);
+ };
+
+ Cea608Channel.prototype.outputDataUpdate = function outputDataUpdate() {
+ var dispatch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
+
+ var t = cea_608_parser_logger.time;
+ if (t === null) {
+ return;
+ }
+ if (this.outputFilter) {
+ if (this.cueStartTime === null && !this.displayedMemory.isEmpty()) {
+ // Start of a new cue
+ this.cueStartTime = t;
+ } else {
+ if (!this.displayedMemory.equals(this.lastOutputScreen)) {
+ if (this.outputFilter.newCue) {
+ this.outputFilter.newCue(this.cueStartTime, t, this.lastOutputScreen);
+ if (dispatch === true && this.outputFilter.dispatchCue) {
+ this.outputFilter.dispatchCue();
+ }
+ }
+ this.cueStartTime = this.displayedMemory.isEmpty() ? null : t;
+ }
+ }
+ this.lastOutputScreen.copy(this.displayedMemory);
+ }
+ };
+
+ Cea608Channel.prototype.cueSplitAtTime = function cueSplitAtTime(t) {
+ if (this.outputFilter) {
+ if (!this.displayedMemory.isEmpty()) {
+ if (this.outputFilter.newCue) {
+ this.outputFilter.newCue(this.cueStartTime, t, this.displayedMemory);
+ }
+ this.cueStartTime = t;
+ }
+ }
+ };
+
+ return Cea608Channel;
+}();
+
+var Cea608Parser = function () {
+ function Cea608Parser(field, out1, out2) {
+ cea_608_parser__classCallCheck(this, Cea608Parser);
+
+ this.field = field || 1;
+ this.outputs = [out1, out2];
+ this.channels = [new Cea608Channel(1, out1), new Cea608Channel(2, out2)];
+ this.currChNr = -1; // Will be 1 or 2
+ this.lastCmdA = null; // First byte of last command
+ this.lastCmdB = null; // Second byte of last command
+ this.bufferedData = [];
+ this.startTime = null;
+ this.lastTime = null;
+ this.dataCounters = { 'padding': 0, 'char': 0, 'cmd': 0, 'other': 0 };
+ }
+
+ Cea608Parser.prototype.getHandler = function getHandler(index) {
+ return this.channels[index].getHandler();
+ };
+
+ Cea608Parser.prototype.setHandler = function setHandler(index, newHandler) {
+ this.channels[index].setHandler(newHandler);
+ };
+
+ /**
+ * Add data for time t in forms of list of bytes (unsigned ints). The bytes are treated as pairs.
+ */
+
+
+ Cea608Parser.prototype.addData = function addData(t, byteList) {
+ var cmdFound,
+ a,
+ b,
+ charsFound = false;
+
+ this.lastTime = t;
+ cea_608_parser_logger.setTime(t);
+
+ for (var i = 0; i < byteList.length; i += 2) {
+ a = byteList[i] & 0x7f;
+ b = byteList[i + 1] & 0x7f;
+ if (a === 0 && b === 0) {
+ this.dataCounters.padding += 2;
+ continue;
+ } else {
+ cea_608_parser_logger.log('DATA', '[' + numArrayToHexArray([byteList[i], byteList[i + 1]]) + '] -> (' + numArrayToHexArray([a, b]) + ')');
+ }
+ cmdFound = this.parseCmd(a, b);
+ if (!cmdFound) {
+ cmdFound = this.parseMidrow(a, b);
+ }
+ if (!cmdFound) {
+ cmdFound = this.parsePAC(a, b);
+ }
+ if (!cmdFound) {
+ cmdFound = this.parseBackgroundAttributes(a, b);
+ }
+ if (!cmdFound) {
+ charsFound = this.parseChars(a, b);
+ if (charsFound) {
+ if (this.currChNr && this.currChNr >= 0) {
+ var channel = this.channels[this.currChNr - 1];
+ channel.insertChars(charsFound);
+ } else {
+ cea_608_parser_logger.log('WARNING', 'No channel found yet. TEXT-MODE?');
+ }
+ }
+ }
+ if (cmdFound) {
+ this.dataCounters.cmd += 2;
+ } else if (charsFound) {
+ this.dataCounters.char += 2;
+ } else {
+ this.dataCounters.other += 2;
+ cea_608_parser_logger.log('WARNING', 'Couldn\'t parse cleaned data ' + numArrayToHexArray([a, b]) + ' orig: ' + numArrayToHexArray([byteList[i], byteList[i + 1]]));
+ }
+ }
+ };
+
+ /**
+ * Parse Command.
+ * @returns {Boolean} Tells if a command was found
+ */
+
+
+ Cea608Parser.prototype.parseCmd = function parseCmd(a, b) {
+ var chNr = null;
+
+ var cond1 = (a === 0x14 || a === 0x1C) && 0x20 <= b && b <= 0x2F;
+ var cond2 = (a === 0x17 || a === 0x1F) && 0x21 <= b && b <= 0x23;
+ if (!(cond1 || cond2)) {
+ return false;
+ }
+
+ if (a === this.lastCmdA && b === this.lastCmdB) {
+ this.lastCmdA = null;
+ this.lastCmdB = null; // Repeated commands are dropped (once)
+ cea_608_parser_logger.log('DEBUG', 'Repeated command (' + numArrayToHexArray([a, b]) + ') is dropped');
+ return true;
+ }
+
+ if (a === 0x14 || a === 0x17) {
+ chNr = 1;
+ } else {
+ chNr = 2; // (a === 0x1C || a=== 0x1f)
+ }
+
+ var channel = this.channels[chNr - 1];
+
+ if (a === 0x14 || a === 0x1C) {
+ if (b === 0x20) {
+ channel.ccRCL();
+ } else if (b === 0x21) {
+ channel.ccBS();
+ } else if (b === 0x22) {
+ channel.ccAOF();
+ } else if (b === 0x23) {
+ channel.ccAON();
+ } else if (b === 0x24) {
+ channel.ccDER();
+ } else if (b === 0x25) {
+ channel.ccRU(2);
+ } else if (b === 0x26) {
+ channel.ccRU(3);
+ } else if (b === 0x27) {
+ channel.ccRU(4);
+ } else if (b === 0x28) {
+ channel.ccFON();
+ } else if (b === 0x29) {
+ channel.ccRDC();
+ } else if (b === 0x2A) {
+ channel.ccTR();
+ } else if (b === 0x2B) {
+ channel.ccRTD();
+ } else if (b === 0x2C) {
+ channel.ccEDM();
+ } else if (b === 0x2D) {
+ channel.ccCR();
+ } else if (b === 0x2E) {
+ channel.ccENM();
+ } else if (b === 0x2F) {
+ channel.ccEOC();
+ }
+ } else {
+ //a == 0x17 || a == 0x1F
+ channel.ccTO(b - 0x20);
+ }
+ this.lastCmdA = a;
+ this.lastCmdB = b;
+ this.currChNr = chNr;
+ return true;
+ };
+
+ /**
+ * Parse midrow styling command
+ * @returns {Boolean}
+ */
+
+
+ Cea608Parser.prototype.parseMidrow = function parseMidrow(a, b) {
+ var chNr = null;
+
+ if ((a === 0x11 || a === 0x19) && 0x20 <= b && b <= 0x2f) {
+ if (a === 0x11) {
+ chNr = 1;
+ } else {
+ chNr = 2;
+ }
+ if (chNr !== this.currChNr) {
+ cea_608_parser_logger.log('ERROR', 'Mismatch channel in midrow parsing');
+ return false;
+ }
+ var channel = this.channels[chNr - 1];
+ channel.ccMIDROW(b);
+ cea_608_parser_logger.log('DEBUG', 'MIDROW (' + numArrayToHexArray([a, b]) + ')');
+ return true;
+ }
+ return false;
+ };
+ /**
+ * Parse Preable Access Codes (Table 53).
+ * @returns {Boolean} Tells if PAC found
+ */
+
+
+ Cea608Parser.prototype.parsePAC = function parsePAC(a, b) {
+
+ var chNr = null;
+ var row = null;
+
+ var case1 = (0x11 <= a && a <= 0x17 || 0x19 <= a && a <= 0x1F) && 0x40 <= b && b <= 0x7F;
+ var case2 = (a === 0x10 || a === 0x18) && 0x40 <= b && b <= 0x5F;
+ if (!(case1 || case2)) {
+ return false;
+ }
+
+ if (a === this.lastCmdA && b === this.lastCmdB) {
+ this.lastCmdA = null;
+ this.lastCmdB = null;
+ return true; // Repeated commands are dropped (once)
+ }
+
+ chNr = a <= 0x17 ? 1 : 2;
+
+ if (0x40 <= b && b <= 0x5F) {
+ row = chNr === 1 ? rowsLowCh1[a] : rowsLowCh2[a];
+ } else {
+ // 0x60 <= b <= 0x7F
+ row = chNr === 1 ? rowsHighCh1[a] : rowsHighCh2[a];
+ }
+ var pacData = this.interpretPAC(row, b);
+ var channel = this.channels[chNr - 1];
+ channel.setPAC(pacData);
+ this.lastCmdA = a;
+ this.lastCmdB = b;
+ this.currChNr = chNr;
+ return true;
+ };
+
+ /**
+ * Interpret the second byte of the pac, and return the information.
+ * @returns {Object} pacData with style parameters.
+ */
+
+
+ Cea608Parser.prototype.interpretPAC = function interpretPAC(row, byte) {
+ var pacIndex = byte;
+ var pacData = { color: null, italics: false, indent: null, underline: false, row: row };
+
+ if (byte > 0x5F) {
+ pacIndex = byte - 0x60;
+ } else {
+ pacIndex = byte - 0x40;
+ }
+ pacData.underline = (pacIndex & 1) === 1;
+ if (pacIndex <= 0xd) {
+ pacData.color = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'white'][Math.floor(pacIndex / 2)];
+ } else if (pacIndex <= 0xf) {
+ pacData.italics = true;
+ pacData.color = 'white';
+ } else {
+ pacData.indent = Math.floor((pacIndex - 0x10) / 2) * 4;
+ }
+ return pacData; // Note that row has zero offset. The spec uses 1.
+ };
+
+ /**
+ * Parse characters.
+ * @returns An array with 1 to 2 codes corresponding to chars, if found. null otherwise.
+ */
+
+
+ Cea608Parser.prototype.parseChars = function parseChars(a, b) {
+
+ var channelNr = null,
+ charCodes = null,
+ charCode1 = null;
+
+ if (a >= 0x19) {
+ channelNr = 2;
+ charCode1 = a - 8;
+ } else {
+ channelNr = 1;
+ charCode1 = a;
+ }
+ if (0x11 <= charCode1 && charCode1 <= 0x13) {
+ // Special character
+ var oneCode = b;
+ if (charCode1 === 0x11) {
+ oneCode = b + 0x50;
+ } else if (charCode1 === 0x12) {
+ oneCode = b + 0x70;
+ } else {
+ oneCode = b + 0x90;
+ }
+ cea_608_parser_logger.log('INFO', 'Special char \'' + getCharForByte(oneCode) + '\' in channel ' + channelNr);
+ charCodes = [oneCode];
+ } else if (0x20 <= a && a <= 0x7f) {
+ charCodes = b === 0 ? [a] : [a, b];
+ }
+ if (charCodes) {
+ var hexCodes = numArrayToHexArray(charCodes);
+ cea_608_parser_logger.log('DEBUG', 'Char codes = ' + hexCodes.join(','));
+ this.lastCmdA = null;
+ this.lastCmdB = null;
+ }
+ return charCodes;
+ };
+
+ /**
+ * Parse extended background attributes as well as new foreground color black.
+ * @returns{Boolean} Tells if background attributes are found
+ */
+
+
+ Cea608Parser.prototype.parseBackgroundAttributes = function parseBackgroundAttributes(a, b) {
+ var bkgData, index, chNr, channel;
+
+ var case1 = (a === 0x10 || a === 0x18) && 0x20 <= b && b <= 0x2f;
+ var case2 = (a === 0x17 || a === 0x1f) && 0x2d <= b && b <= 0x2f;
+ if (!(case1 || case2)) {
+ return false;
+ }
+ bkgData = {};
+ if (a === 0x10 || a === 0x18) {
+ index = Math.floor((b - 0x20) / 2);
+ bkgData.background = backgroundColors[index];
+ if (b % 2 === 1) {
+ bkgData.background = bkgData.background + '_semi';
+ }
+ } else if (b === 0x2d) {
+ bkgData.background = 'transparent';
+ } else {
+ bkgData.foreground = 'black';
+ if (b === 0x2f) {
+ bkgData.underline = true;
+ }
+ }
+ chNr = a < 0x18 ? 1 : 2;
+ channel = this.channels[chNr - 1];
+ channel.setBkgData(bkgData);
+ this.lastCmdA = null;
+ this.lastCmdB = null;
+ return true;
+ };
+
+ /**
+ * Reset state of parser and its channels.
+ */
+
+
+ Cea608Parser.prototype.reset = function reset() {
+ for (var i = 0; i < this.channels.length; i++) {
+ if (this.channels[i]) {
+ this.channels[i].reset();
+ }
+ }
+ this.lastCmdA = null;
+ this.lastCmdB = null;
+ };
+
+ /**
+ * Trigger the generation of a cue, and the start of a new one if displayScreens are not empty.
+ */
+
+
+ Cea608Parser.prototype.cueSplitAtTime = function cueSplitAtTime(t) {
+ for (var i = 0; i < this.channels.length; i++) {
+ if (this.channels[i]) {
+ this.channels[i].cueSplitAtTime(t);
+ }
+ }
+ };
+
+ return Cea608Parser;
+}();
+
+/* harmony default export */ var cea_608_parser = (Cea608Parser);
+// CONCATENATED MODULE: ./src/utils/output-filter.js
+function output_filter__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var OutputFilter = function () {
+ function OutputFilter(timelineController, track) {
+ output_filter__classCallCheck(this, OutputFilter);
+
+ this.timelineController = timelineController;
+ this.track = track;
+ this.startTime = null;
+ this.endTime = null;
+ this.screen = null;
+ }
+
+ OutputFilter.prototype.dispatchCue = function dispatchCue() {
+ if (this.startTime === null) {
+ return;
+ }
+ this.timelineController.addCues('textTrack' + this.track, this.startTime, this.endTime, this.screen);
+ this.startTime = null;
+ };
+
+ OutputFilter.prototype.newCue = function newCue(startTime, endTime, screen) {
+ if (this.startTime === null || this.startTime > startTime) {
+ this.startTime = startTime;
+ }
+ this.endTime = endTime;
+ this.screen = screen;
+ this.timelineController.createCaptionsTrack(this.track);
+ };
+
+ return OutputFilter;
+}();
+
+/* harmony default export */ var output_filter = (OutputFilter);
+// CONCATENATED MODULE: ./src/utils/webvtt-parser.js
-var _vttparser2 = _interopRequireDefault(_vttparser);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// String.prototype.startsWith is not supported in IE11
var startsWith = function startsWith(inputString, searchString, position) {
@@ -29524,7 +28506,9 @@ var WebVTTParser = {
parse: function parse(vttByteArray, syncPTS, vttCCs, cc, callBack, errorCallBack) {
// Convert byteArray into string, replacing any somewhat exotic linefeeds with "\n", then split on that character.
var re = /\r\n|\n\r|\n|\r/g;
- var vttLines = String.fromCharCode.apply(null, new Uint8Array(vttByteArray)).trim().replace(re, '\n').split('\n');
+ // Uint8Array.prototype.reduce is not implemented in IE11
+ var vttLines = Object(id3["b" /* utf8ArrayToStr */])(new Uint8Array(vttByteArray)).trim().replace(re, '\n').split('\n');
+
var cueTime = '00:00.000';
var mpegTs = 0;
var localTime = 0;
@@ -29535,7 +28519,7 @@ var WebVTTParser = {
// let VTTCue = VTTCue || window.TextTrackCue;
// Create parser object using VTTCue with TextTrackCue fallback on certain browsers.
- var parser = new _vttparser2.default();
+ var parser = new vttparser();
parser.oncue = function (cue) {
// Adjust cue timing; clamp cues to start no earlier than - and drop cues that don't end after - 0 on timeline.
@@ -29562,10 +28546,10 @@ var WebVTTParser = {
// Create a unique hash id for a cue based on start/end times and text.
// This helps timeline-controller to avoid showing repeated captions.
- cue.id = hash(cue.startTime) + hash(cue.endTime) + hash(cue.text);
+ cue.id = hash(cue.startTime.toString()) + hash(cue.endTime.toString()) + hash(cue.text);
// Fix encoding of special characters. TODO: Test with all sorts of weird characters.
- cue.text = decodeURIComponent(escape(cue.text));
+ cue.text = decodeURIComponent(encodeURIComponent(cue.text));
if (cue.endTime > 0) {
cues.push(cue);
}
@@ -29629,204 +28613,1691 @@ var WebVTTParser = {
}
};
-module.exports = WebVTTParser;
+/* harmony default export */ var webvtt_parser = (WebVTTParser);
+// CONCATENATED MODULE: ./src/controller/timeline-controller.js
+function timeline_controller__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-},{"56":56}],58:[function(_dereq_,module,exports){
-'use strict';
+function timeline_controller__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+function timeline_controller__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+/*
+ * Timeline Controller
+*/
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
- * XHR based logger
- */
-var _logger = _dereq_(53);
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var XhrLoader = function () {
- function XhrLoader(config) {
- _classCallCheck(this, XhrLoader);
- if (config && config.xhrSetup) {
- this.xhrSetup = config.xhrSetup;
+
+
+
+function clearCurrentCues(track) {
+ if (track && track.cues) {
+ while (track.cues.length > 0) {
+ track.removeCue(track.cues[0]);
}
}
+}
+
+function reuseVttTextTrack(inUseTrack, manifestTrack) {
+ return inUseTrack && inUseTrack.label === manifestTrack.name && !(inUseTrack.textTrack1 || inUseTrack.textTrack2);
+}
+
+function intersection(x1, x2, y1, y2) {
+ return Math.min(x2, y2) - Math.max(x1, y1);
+}
+
+var timeline_controller_TimelineController = function (_EventHandler) {
+ timeline_controller__inherits(TimelineController, _EventHandler);
+
+ function TimelineController(hls) {
+ timeline_controller__classCallCheck(this, TimelineController);
+
+ var _this = timeline_controller__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].MEDIA_ATTACHING, events["a" /* default */].MEDIA_DETACHING, events["a" /* default */].FRAG_PARSING_USERDATA, events["a" /* default */].FRAG_DECRYPTED, events["a" /* default */].MANIFEST_LOADING, events["a" /* default */].MANIFEST_LOADED, events["a" /* default */].FRAG_LOADED, events["a" /* default */].LEVEL_SWITCHING, events["a" /* default */].INIT_PTS_FOUND));
- _createClass(XhrLoader, [{
- key: 'destroy',
- value: function destroy() {
- this.abort();
- this.loader = null;
+ _this.hls = hls;
+ _this.config = hls.config;
+ _this.enabled = true;
+ _this.Cues = hls.config.cueHandler;
+ _this.textTracks = [];
+ _this.tracks = [];
+ _this.unparsedVttFrags = [];
+ _this.initPTS = undefined;
+ _this.cueRanges = [];
+
+ if (_this.config.enableCEA708Captions) {
+ var channel1 = new output_filter(_this, 1);
+ var channel2 = new output_filter(_this, 2);
+
+ _this.cea608Parser = new cea_608_parser(0, channel1, channel2);
}
- }, {
- key: 'abort',
- value: function abort() {
- var loader = this.loader;
- if (loader && loader.readyState !== 4) {
- this.stats.aborted = true;
- loader.abort();
+ return _this;
+ }
+
+ TimelineController.prototype.addCues = function addCues(channel, startTime, endTime, screen) {
+ // skip cues which overlap more than 50% with previously parsed time ranges
+ var ranges = this.cueRanges;
+ var merged = false;
+ for (var i = ranges.length; i--;) {
+ var cueRange = ranges[i];
+ var overlap = intersection(cueRange[0], cueRange[1], startTime, endTime);
+ if (overlap >= 0) {
+ cueRange[0] = Math.min(cueRange[0], startTime);
+ cueRange[1] = Math.max(cueRange[1], endTime);
+ merged = true;
+ if (overlap / (endTime - startTime) > 0.5) {
+ return;
+ }
}
+ }
+ if (!merged) {
+ ranges.push([startTime, endTime]);
+ }
+ this.Cues.newCue(this[channel], startTime, endTime, screen);
+ };
- window.clearTimeout(this.requestTimeout);
- this.requestTimeout = null;
- window.clearTimeout(this.retryTimeout);
- this.retryTimeout = null;
+ // Triggered when an initial PTS is found; used for synchronisation of WebVTT.
+
+
+ TimelineController.prototype.onInitPtsFound = function onInitPtsFound(data) {
+ var _this2 = this;
+
+ if (typeof this.initPTS === 'undefined') {
+ this.initPTS = data.initPTS;
}
- }, {
- key: 'load',
- value: function load(context, config, callbacks) {
- this.context = context;
- this.config = config;
- this.callbacks = callbacks;
- this.stats = { trequest: performance.now(), retry: 0 };
- this.retryDelay = config.retryDelay;
- this.loadInternal();
+
+ // Due to asynchrony, initial PTS may arrive later than the first VTT fragments are loaded.
+ // Parse any unparsed fragments upon receiving the initial PTS.
+ if (this.unparsedVttFrags.length) {
+ this.unparsedVttFrags.forEach(function (frag) {
+ _this2.onFragLoaded(frag);
+ });
+ this.unparsedVttFrags = [];
}
- }, {
- key: 'loadInternal',
- value: function loadInternal() {
- var xhr,
- context = this.context;
+ };
+
+ TimelineController.prototype.getExistingTrack = function getExistingTrack(channelNumber) {
+ var media = this.media;
+ if (media) {
+ for (var i = 0; i < media.textTracks.length; i++) {
+ var textTrack = media.textTracks[i];
+ var propName = 'textTrack' + channelNumber;
+ if (textTrack[propName] === true) {
+ return textTrack;
+ }
+ }
+ }
+ return null;
+ };
+
+ TimelineController.prototype.sendAddTrackEvent = function sendAddTrackEvent(track, media) {
+ var e = null;
+ try {
+ e = new window.Event('addtrack');
+ } catch (err) {
+ //for IE11
+ e = document.createEvent('Event');
+ e.initEvent('addtrack', false, false);
+ }
+ e.track = track;
+ media.dispatchEvent(e);
+ };
- if (typeof XDomainRequest !== 'undefined') {
- xhr = this.loader = new XDomainRequest();
+ TimelineController.prototype.createCaptionsTrack = function createCaptionsTrack(track) {
+ var trackVar = 'textTrack' + track;
+ if (!this[trackVar]) {
+ //Enable reuse of existing text track.
+ var existingTrack = this.getExistingTrack(track);
+ if (!existingTrack) {
+ var textTrack = this.createTextTrack('captions', this.config['captionsTextTrack' + track + 'Label'], this.config.captionsTextTrack1LanguageCode);
+ if (textTrack) {
+ textTrack[trackVar] = true;
+ this[trackVar] = textTrack;
+ }
} else {
- xhr = this.loader = new XMLHttpRequest();
+ this[trackVar] = existingTrack;
+ clearCurrentCues(this[trackVar]);
+
+ this.sendAddTrackEvent(this[trackVar], this.media);
}
- var stats = this.stats;
- stats.tfirst = 0;
- stats.loaded = 0;
- var xhrSetup = this.xhrSetup;
+ }
+ };
- try {
- if (xhrSetup) {
- try {
- xhrSetup(xhr, context.url);
- } catch (e) {
- // fix xhrSetup: (xhr, url) => {xhr.setRequestHeader("Content-Language", "test");}
- // not working, as xhr.setRequestHeader expects xhr.readyState === OPEN
- xhr.open('GET', context.url, true);
- xhrSetup(xhr, context.url);
+ TimelineController.prototype.createTextTrack = function createTextTrack(kind, label, lang) {
+ var media = this.media;
+ if (media) {
+ return media.addTextTrack(kind, label, lang);
+ }
+ };
+
+ TimelineController.prototype.destroy = function destroy() {
+ event_handler.prototype.destroy.call(this);
+ };
+
+ TimelineController.prototype.onMediaAttaching = function onMediaAttaching(data) {
+ this.media = data.media;
+ this._cleanTracks();
+ };
+
+ TimelineController.prototype.onMediaDetaching = function onMediaDetaching() {
+ clearCurrentCues(this.textTrack1);
+ clearCurrentCues(this.textTrack2);
+ };
+
+ TimelineController.prototype.onManifestLoading = function onManifestLoading() {
+ this.lastSn = -1; // Detect discontiguity in fragment parsing
+ this.prevCC = -1;
+ this.vttCCs = { ccOffset: 0, presentationOffset: 0 }; // Detect discontinuity in subtitle manifests
+ this._cleanTracks();
+ };
+
+ TimelineController.prototype._cleanTracks = function _cleanTracks() {
+ // clear outdated subtitles
+ var media = this.media;
+ if (media) {
+ var textTracks = media.textTracks;
+ if (textTracks) {
+ for (var i = 0; i < textTracks.length; i++) {
+ clearCurrentCues(textTracks[i]);
+ }
+ }
+ }
+ };
+
+ TimelineController.prototype.onManifestLoaded = function onManifestLoaded(data) {
+ var _this3 = this;
+
+ this.textTracks = [];
+ this.unparsedVttFrags = this.unparsedVttFrags || [];
+ this.initPTS = undefined;
+ this.cueRanges = [];
+
+ if (this.config.enableWebVTT) {
+ this.tracks = data.subtitles || [];
+ var inUseTracks = this.media ? this.media.textTracks : [];
+
+ this.tracks.forEach(function (track, index) {
+ var textTrack = void 0;
+ if (index < inUseTracks.length) {
+ var inUseTrack = inUseTracks[index];
+ // Reuse tracks with the same label, but do not reuse 608/708 tracks
+ if (reuseVttTextTrack(inUseTrack, track)) {
+ textTrack = inUseTrack;
}
}
- if (!xhr.readyState) {
- xhr.open('GET', context.url, true);
+ if (!textTrack) {
+ textTrack = _this3.createTextTrack('subtitles', track.name, track.lang);
}
- } catch (e) {
- // IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS
- this.callbacks.onError({ code: xhr.status, text: e.message }, context);
+ textTrack.mode = track.default ? 'showing' : 'hidden';
+ _this3.textTracks.push(textTrack);
+ });
+ }
+ };
+
+ TimelineController.prototype.onLevelSwitching = function onLevelSwitching() {
+ this.enabled = this.hls.currentLevel.closedCaptions !== 'NONE';
+ };
+
+ TimelineController.prototype.onFragLoaded = function onFragLoaded(data) {
+ var frag = data.frag,
+ payload = data.payload;
+ if (frag.type === 'main') {
+ var sn = frag.sn;
+ // if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack
+ if (sn !== this.lastSn + 1) {
+ var cea608Parser = this.cea608Parser;
+ if (cea608Parser) {
+ cea608Parser.reset();
+ }
+ }
+ this.lastSn = sn;
+ }
+ // If fragment is subtitle type, parse as WebVTT.
+ else if (frag.type === 'subtitle') {
+ if (payload.byteLength) {
+ // We need an initial synchronisation PTS. Store fragments as long as none has arrived.
+ if (typeof this.initPTS === 'undefined') {
+ this.unparsedVttFrags.push(data);
+ return;
+ }
+
+ var decryptData = frag.decryptdata;
+ // If the subtitles are not encrypted, parse VTTs now. Otherwise, we need to wait.
+ if (decryptData == null || decryptData.key == null || decryptData.method !== 'AES-128') {
+ this._parseVTTs(frag, payload);
+ }
+ } else {
+ // In case there is no payload, finish unsuccessfully.
+ this.hls.trigger(events["a" /* default */].SUBTITLE_FRAG_PROCESSED, { success: false, frag: frag });
+ }
+ }
+ };
+
+ TimelineController.prototype._parseVTTs = function _parseVTTs(frag, payload) {
+ var vttCCs = this.vttCCs;
+ if (!vttCCs[frag.cc]) {
+ vttCCs[frag.cc] = { start: frag.start, prevCC: this.prevCC, new: true };
+ this.prevCC = frag.cc;
+ }
+ var textTracks = this.textTracks,
+ hls = this.hls;
+
+ // Parse the WebVTT file contents.
+ webvtt_parser.parse(payload, this.initPTS, vttCCs, frag.cc, function (cues) {
+ var currentTrack = textTracks[frag.trackId];
+ // Add cues and trigger event with success true.
+ cues.forEach(function (cue) {
+ // Sometimes there are cue overlaps on segmented vtts so the same
+ // cue can appear more than once in different vtt files.
+ // This avoid showing duplicated cues with same timecode and text.
+ if (!currentTrack.cues.getCueById(cue.id)) {
+ try {
+ currentTrack.addCue(cue);
+ } catch (err) {
+ var textTrackCue = new window.TextTrackCue(cue.startTime, cue.endTime, cue.text);
+ textTrackCue.id = cue.id;
+ currentTrack.addCue(textTrackCue);
+ }
+ }
+ });
+ hls.trigger(events["a" /* default */].SUBTITLE_FRAG_PROCESSED, { success: true, frag: frag });
+ }, function (e) {
+ // Something went wrong while parsing. Trigger event with success false.
+ logger["b" /* logger */].log('Failed to parse VTT cue: ' + e);
+ hls.trigger(events["a" /* default */].SUBTITLE_FRAG_PROCESSED, { success: false, frag: frag });
+ });
+ };
+
+ TimelineController.prototype.onFragDecrypted = function onFragDecrypted(data) {
+ var decryptedData = data.payload,
+ frag = data.frag;
+
+ if (frag.type === 'subtitle') {
+ if (typeof this.initPTS === 'undefined') {
+ this.unparsedVttFrags.push(data);
return;
}
- if (context.rangeEnd) {
- xhr.setRequestHeader('Range', 'bytes=' + context.rangeStart + '-' + (context.rangeEnd - 1));
+ this._parseVTTs(frag, decryptedData);
+ }
+ };
+
+ TimelineController.prototype.onFragParsingUserdata = function onFragParsingUserdata(data) {
+ // push all of the CEA-708 messages into the interpreter
+ // immediately. It will create the proper timestamps based on our PTS value
+ if (this.enabled && this.config.enableCEA708Captions) {
+ for (var i = 0; i < data.samples.length; i++) {
+ var ccdatas = this.extractCea608Data(data.samples[i].bytes);
+ this.cea608Parser.addData(data.samples[i].pts, ccdatas);
+ }
+ }
+ };
+
+ TimelineController.prototype.extractCea608Data = function extractCea608Data(byteArray) {
+ var count = byteArray[0] & 31;
+ var position = 2;
+ var tmpByte, ccbyte1, ccbyte2, ccValid, ccType;
+ var actualCCBytes = [];
+
+ for (var j = 0; j < count; j++) {
+ tmpByte = byteArray[position++];
+ ccbyte1 = 0x7F & byteArray[position++];
+ ccbyte2 = 0x7F & byteArray[position++];
+ ccValid = (4 & tmpByte) !== 0;
+ ccType = 3 & tmpByte;
+
+ if (ccbyte1 === 0 && ccbyte2 === 0) {
+ continue;
+ }
+
+ if (ccValid) {
+ if (ccType === 0) // || ccType === 1
+ {
+ actualCCBytes.push(ccbyte1);
+ actualCCBytes.push(ccbyte2);
+ }
+ }
+ }
+ return actualCCBytes;
+ };
+
+ return TimelineController;
+}(event_handler);
+
+/* harmony default export */ var timeline_controller = (timeline_controller_TimelineController);
+// CONCATENATED MODULE: ./src/controller/subtitle-track-controller.js
+var subtitle_track_controller__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function subtitle_track_controller__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function subtitle_track_controller__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function subtitle_track_controller__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+/*
+ * subtitle track controller
+*/
+
+
+
+
+
+function filterSubtitleTracks(textTrackList) {
+ var tracks = [];
+ for (var i = 0; i < textTrackList.length; i++) {
+ if (textTrackList[i].kind === 'subtitles') {
+ tracks.push(textTrackList[i]);
+ }
+ }
+ return tracks;
+}
+
+var subtitle_track_controller_SubtitleTrackController = function (_EventHandler) {
+ subtitle_track_controller__inherits(SubtitleTrackController, _EventHandler);
+
+ function SubtitleTrackController(hls) {
+ subtitle_track_controller__classCallCheck(this, SubtitleTrackController);
+
+ var _this = subtitle_track_controller__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].MEDIA_ATTACHED, events["a" /* default */].MEDIA_DETACHING, events["a" /* default */].MANIFEST_LOADING, events["a" /* default */].MANIFEST_LOADED, events["a" /* default */].SUBTITLE_TRACK_LOADED));
+
+ _this.tracks = [];
+ _this.trackId = -1;
+ _this.media = undefined;
+ _this.subtitleDisplay = false;
+ return _this;
+ }
+
+ SubtitleTrackController.prototype._onTextTracksChanged = function _onTextTracksChanged() {
+ // Media is undefined when switching streams via loadSource()
+ if (!this.media) {
+ return;
+ }
+
+ var trackId = -1;
+ var tracks = filterSubtitleTracks(this.media.textTracks);
+ for (var id = 0; id < tracks.length; id++) {
+ if (tracks[id].mode === 'showing') {
+ trackId = id;
+ }
+ }
+
+ // Setting current subtitleTrack will invoke code.
+ this.subtitleTrack = trackId;
+ };
+
+ SubtitleTrackController.prototype.destroy = function destroy() {
+ event_handler.prototype.destroy.call(this);
+ };
+
+ // Listen for subtitle track change, then extract the current track ID.
+
+
+ SubtitleTrackController.prototype.onMediaAttached = function onMediaAttached(data) {
+ var _this2 = this;
+
+ this.media = data.media;
+ if (!this.media) {
+ return;
+ }
+
+ if (this.queuedDefaultTrack !== undefined) {
+ this.subtitleTrack = this.queuedDefaultTrack;
+ delete this.queuedDefaultTrack;
+ }
+
+ this.trackChangeListener = this._onTextTracksChanged.bind(this);
+
+ this.useTextTrackPolling = !(this.media.textTracks && 'onchange' in this.media.textTracks);
+ if (this.useTextTrackPolling) {
+ this.subtitlePollingInterval = setInterval(function () {
+ _this2.trackChangeListener();
+ }, 500);
+ } else {
+ this.media.textTracks.addEventListener('change', this.trackChangeListener);
+ }
+ };
+
+ SubtitleTrackController.prototype.onMediaDetaching = function onMediaDetaching() {
+ if (!this.media) {
+ return;
+ }
+ if (this.useTextTrackPolling) {
+ clearInterval(this.subtitlePollingInterval);
+ } else {
+ this.media.textTracks.removeEventListener('change', this.trackChangeListener);
+ }
+
+ this.media = undefined;
+ };
+
+ // Reset subtitle tracks on manifest loading
+
+
+ SubtitleTrackController.prototype.onManifestLoading = function onManifestLoading() {
+ this.tracks = [];
+ this.trackId = -1;
+ };
+
+ // Fired whenever a new manifest is loaded.
+
+
+ SubtitleTrackController.prototype.onManifestLoaded = function onManifestLoaded(data) {
+ var _this3 = this;
+
+ var tracks = data.subtitles || [];
+ this.tracks = tracks;
+ this.trackId = -1;
+ this.hls.trigger(events["a" /* default */].SUBTITLE_TRACKS_UPDATED, { subtitleTracks: tracks });
+
+ // loop through available subtitle tracks and autoselect default if needed
+ // TODO: improve selection logic to handle forced, etc
+ tracks.forEach(function (track) {
+ if (track.default) {
+ // setting this.subtitleTrack will trigger internal logic
+ // if media has not been attached yet, it will fail
+ // we keep a reference to the default track id
+ // and we'll set subtitleTrack when onMediaAttached is triggered
+ if (_this3.media) {
+ _this3.subtitleTrack = track.id;
+ } else {
+ _this3.queuedDefaultTrack = track.id;
+ }
+ }
+ });
+ };
+
+ // Trigger subtitle track playlist reload.
+
+
+ SubtitleTrackController.prototype.onTick = function onTick() {
+ var trackId = this.trackId;
+ var subtitleTrack = this.tracks[trackId];
+ if (!subtitleTrack) {
+ return;
+ }
+
+ var details = subtitleTrack.details;
+ // check if we need to load playlist for this subtitle Track
+ if (details === undefined || details.live === true) {
+ // track not retrieved yet, or live playlist we need to (re)load it
+ logger["b" /* logger */].log('(re)loading playlist for subtitle track ' + trackId);
+ this.hls.trigger(events["a" /* default */].SUBTITLE_TRACK_LOADING, { url: subtitleTrack.url, id: trackId });
+ }
+ };
+
+ SubtitleTrackController.prototype.onSubtitleTrackLoaded = function onSubtitleTrackLoaded(data) {
+ var _this4 = this;
+
+ if (data.id < this.tracks.length) {
+ logger["b" /* logger */].log('subtitle track ' + data.id + ' loaded');
+ this.tracks[data.id].details = data.details;
+ // check if current playlist is a live playlist
+ if (data.details.live && !this.timer) {
+ // if live playlist we will have to reload it periodically
+ // set reload period to playlist target duration
+ this.timer = setInterval(function () {
+ _this4.onTick();
+ }, 1000 * data.details.targetduration, this);
+ }
+ if (!data.details.live && this.timer) {
+ // playlist is not live and timer is armed : stopping it
+ clearInterval(this.timer);
+ this.timer = null;
}
- xhr.onreadystatechange = this.readystatechange.bind(this);
- xhr.onprogress = this.loadprogress.bind(this);
- xhr.responseType = context.responseType;
+ }
+ };
+
+ /** get alternate subtitle tracks list from playlist **/
+
+
+ SubtitleTrackController.prototype.setSubtitleTrackInternal = function setSubtitleTrackInternal(newId) {
+ // check if level idx is valid
+ if (newId < -1 || newId >= this.tracks.length) {
+ return;
+ }
+
+ // stopping live reloading timer if any
+ if (this.timer) {
+ clearInterval(this.timer);
+ this.timer = null;
+ }
+
+ var textTracks = filterSubtitleTracks(this.media.textTracks);
+
+ // hide currently enabled subtitle track
+ if (this.trackId !== -1 && this.subtitleDisplay) {
+ textTracks[this.trackId].mode = 'hidden';
+ }
+
+ this.trackId = newId;
+ logger["b" /* logger */].log('switching to subtitle track ' + newId);
+ this.hls.trigger(events["a" /* default */].SUBTITLE_TRACK_SWITCH, { id: newId });
+
+ if (newId === -1) {
+ return;
+ }
- // setup timeout before we perform request
- this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), this.config.timeout);
- xhr.send();
+ var subtitleTrack = this.tracks[newId];
+ if (this.subtitleDisplay) {
+ textTracks[newId].mode = 'showing';
}
+
+ // check if we need to load playlist for this subtitle Track
+ var details = subtitleTrack.details;
+ if (details === undefined || details.live === true) {
+ // track not retrieved yet, or live playlist we need to (re)load it
+ logger["b" /* logger */].log('(re)loading playlist for subtitle track ' + newId);
+ this.hls.trigger(events["a" /* default */].SUBTITLE_TRACK_LOADING, { url: subtitleTrack.url, id: newId });
+ }
+ };
+
+ subtitle_track_controller__createClass(SubtitleTrackController, [{
+ key: 'subtitleTracks',
+ get: function get() {
+ return this.tracks;
+ }
+
+ /** get index of the selected subtitle track (index in subtitle track lists) **/
+
}, {
- key: 'readystatechange',
- value: function readystatechange(event) {
- var xhr = event.currentTarget,
- readyState = xhr.readyState,
- stats = this.stats,
- context = this.context,
- config = this.config;
+ key: 'subtitleTrack',
+ get: function get() {
+ return this.trackId;
+ }
- // don't proceed if xhr has been aborted
- if (stats.aborted) {
- return;
+ /** select a subtitle track, based on its index in subtitle track lists**/
+ ,
+ set: function set(subtitleTrackId) {
+ if (this.trackId !== subtitleTrackId) {
+ // || this.tracks[subtitleTrackId].details === undefined) {
+ this.setSubtitleTrackInternal(subtitleTrackId);
}
+ }
+ }]);
- // >= HEADERS_RECEIVED
- if (readyState >= 2) {
- // clear xhr timeout and rearm it if readyState less than 4
- window.clearTimeout(this.requestTimeout);
- if (stats.tfirst === 0) {
- stats.tfirst = Math.max(performance.now(), stats.trequest);
- }
- if (readyState === 4) {
- var status = xhr.status;
- // http status between 200 to 299 are all successful
- if (status >= 200 && status < 300) {
- stats.tload = Math.max(stats.tfirst, performance.now());
- var data = void 0,
- len = void 0;
- if (context.responseType === 'arraybuffer') {
- data = xhr.response;
- len = data.byteLength;
- } else {
- data = xhr.responseText;
- len = data.length;
- }
- stats.loaded = stats.total = len;
- var response = { url: xhr.responseURL, data: data };
- this.callbacks.onSuccess(response, stats, context);
- } else {
- // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error
- if (stats.retry >= config.maxRetry || status >= 400 && status < 499) {
- _logger.logger.error(status + ' while loading ' + context.url);
- this.callbacks.onError({ code: status, text: xhr.statusText }, context);
+ return SubtitleTrackController;
+}(event_handler);
+
+/* harmony default export */ var subtitle_track_controller = (subtitle_track_controller_SubtitleTrackController);
+// EXTERNAL MODULE: ./src/crypt/decrypter.js + 3 modules
+var decrypter = __webpack_require__(4);
+
+// CONCATENATED MODULE: ./src/controller/subtitle-stream-controller.js
+function subtitle_stream_controller__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function subtitle_stream_controller__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function subtitle_stream_controller__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+/*
+ * Subtitle Stream Controller
+*/
+
+
+
+
+
+
+var subtitle_stream_controller_State = {
+ STOPPED: 'STOPPED',
+ IDLE: 'IDLE',
+ KEY_LOADING: 'KEY_LOADING',
+ FRAG_LOADING: 'FRAG_LOADING'
+};
+
+var subtitle_stream_controller_SubtitleStreamController = function (_EventHandler) {
+ subtitle_stream_controller__inherits(SubtitleStreamController, _EventHandler);
+
+ function SubtitleStreamController(hls) {
+ subtitle_stream_controller__classCallCheck(this, SubtitleStreamController);
+
+ var _this = subtitle_stream_controller__possibleConstructorReturn(this, _EventHandler.call(this, hls, events["a" /* default */].MEDIA_ATTACHED, events["a" /* default */].ERROR, events["a" /* default */].KEY_LOADED, events["a" /* default */].FRAG_LOADED, events["a" /* default */].SUBTITLE_TRACKS_UPDATED, events["a" /* default */].SUBTITLE_TRACK_SWITCH, events["a" /* default */].SUBTITLE_TRACK_LOADED, events["a" /* default */].SUBTITLE_FRAG_PROCESSED));
+
+ _this.config = hls.config;
+ _this.vttFragSNsProcessed = {};
+ _this.vttFragQueues = undefined;
+ _this.currentlyProcessing = null;
+ _this.state = subtitle_stream_controller_State.STOPPED;
+ _this.currentTrackId = -1;
+ _this.ticks = 0;
+ _this.decrypter = new decrypter["a" /* default */](hls.observer, hls.config);
+ return _this;
+ }
+
+ SubtitleStreamController.prototype.destroy = function destroy() {
+ event_handler.prototype.destroy.call(this);
+ this.state = subtitle_stream_controller_State.STOPPED;
+ };
+
+ // Remove all queued items and create a new, empty queue for each track.
+
+
+ SubtitleStreamController.prototype.clearVttFragQueues = function clearVttFragQueues() {
+ var _this2 = this;
+
+ this.vttFragQueues = {};
+ this.tracks.forEach(function (track) {
+ _this2.vttFragQueues[track.id] = [];
+ });
+ };
+
+ // If no frag is being processed and queue isn't empty, initiate processing of next frag in line.
+
+
+ SubtitleStreamController.prototype.nextFrag = function nextFrag() {
+ if (this.currentlyProcessing === null && this.currentTrackId > -1 && this.vttFragQueues[this.currentTrackId].length) {
+ var frag = this.currentlyProcessing = this.vttFragQueues[this.currentTrackId].shift();
+ this.fragCurrent = frag;
+ this.hls.trigger(events["a" /* default */].FRAG_LOADING, { frag: frag });
+ this.state = subtitle_stream_controller_State.FRAG_LOADING;
+ }
+ };
+
+ // When fragment has finished processing, add sn to list of completed if successful.
+
+
+ SubtitleStreamController.prototype.onSubtitleFragProcessed = function onSubtitleFragProcessed(data) {
+ if (data.success) {
+ this.vttFragSNsProcessed[data.frag.trackId].push(data.frag.sn);
+ }
+ this.currentlyProcessing = null;
+ this.state = subtitle_stream_controller_State.IDLE;
+ this.nextFrag();
+ };
+
+ SubtitleStreamController.prototype.onMediaAttached = function onMediaAttached() {
+ this.state = subtitle_stream_controller_State.IDLE;
+ };
+
+ // If something goes wrong, procede to next frag, if we were processing one.
+
+
+ SubtitleStreamController.prototype.onError = function onError(data) {
+ var frag = data.frag;
+ // don't handle frag error not related to subtitle fragment
+ if (frag && frag.type !== 'subtitle') {
+ return;
+ }
+ if (this.currentlyProcessing) {
+ this.currentlyProcessing = null;
+ this.nextFrag();
+ }
+ };
+
+ SubtitleStreamController.prototype.tick = function tick() {
+ var _this3 = this;
+
+ this.ticks++;
+ if (this.ticks === 1) {
+ this.doTick();
+ if (this.ticks > 1) {
+ setTimeout(function () {
+ _this3.tick();
+ }, 1);
+ }
+ this.ticks = 0;
+ }
+ };
+
+ SubtitleStreamController.prototype.doTick = function doTick() {
+ var _this4 = this;
+
+ switch (this.state) {
+ case subtitle_stream_controller_State.IDLE:
+ var tracks = this.tracks;
+ var trackId = this.currentTrackId;
+
+ var processedFragSNs = this.vttFragSNsProcessed[trackId],
+ fragQueue = this.vttFragQueues[trackId],
+ currentFragSN = !!this.currentlyProcessing ? this.currentlyProcessing.sn : -1;
+
+ var alreadyProcessed = function alreadyProcessed(frag) {
+ return processedFragSNs.indexOf(frag.sn) > -1;
+ };
+
+ var alreadyInQueue = function alreadyInQueue(frag) {
+ return fragQueue.some(function (fragInQueue) {
+ return fragInQueue.sn === frag.sn;
+ });
+ };
+
+ // exit if tracks don't exist
+ if (!tracks) {
+ break;
+ }
+ var trackDetails;
+
+ if (trackId < tracks.length) {
+ trackDetails = tracks[trackId].details;
+ }
+
+ if (typeof trackDetails === 'undefined') {
+ break;
+ }
+
+ // Add all fragments that haven't been, aren't currently being and aren't waiting to be processed, to queue.
+ trackDetails.fragments.forEach(function (frag) {
+ if (!(alreadyProcessed(frag) || frag.sn === currentFragSN || alreadyInQueue(frag))) {
+ // Load key if subtitles are encrypted
+ if (frag.decryptdata && frag.decryptdata.uri != null && frag.decryptdata.key == null) {
+ logger["b" /* logger */].log('Loading key for ' + frag.sn);
+ _this4.state = subtitle_stream_controller_State.KEY_LOADING;
+ _this4.hls.trigger(events["a" /* default */].KEY_LOADING, { frag: frag });
} else {
- // retry
- _logger.logger.warn(status + ' while loading ' + context.url + ', retrying in ' + this.retryDelay + '...');
- // aborts and resets internal state
- this.destroy();
- // schedule retry
- this.retryTimeout = window.setTimeout(this.loadInternal.bind(this), this.retryDelay);
- // set exponential backoff
- this.retryDelay = Math.min(2 * this.retryDelay, config.maxRetryDelay);
- stats.retry++;
+ // Frags don't know their subtitle track ID, so let's just add that...
+ frag.trackId = trackId;
+ fragQueue.push(frag);
+ _this4.nextFrag();
}
}
- } else {
- // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet
- this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout);
+ });
+ }
+ };
+
+ // Got all new subtitle tracks.
+
+
+ SubtitleStreamController.prototype.onSubtitleTracksUpdated = function onSubtitleTracksUpdated(data) {
+ var _this5 = this;
+
+ logger["b" /* logger */].log('subtitle tracks updated');
+ this.tracks = data.subtitleTracks;
+ this.clearVttFragQueues();
+ this.vttFragSNsProcessed = {};
+ this.tracks.forEach(function (track) {
+ _this5.vttFragSNsProcessed[track.id] = [];
+ });
+ };
+
+ SubtitleStreamController.prototype.onSubtitleTrackSwitch = function onSubtitleTrackSwitch(data) {
+ this.currentTrackId = data.id;
+ this.clearVttFragQueues();
+ };
+
+ // Got a new set of subtitle fragments.
+
+
+ SubtitleStreamController.prototype.onSubtitleTrackLoaded = function onSubtitleTrackLoaded() {
+ this.tick();
+ };
+
+ SubtitleStreamController.prototype.onKeyLoaded = function onKeyLoaded() {
+ if (this.state === subtitle_stream_controller_State.KEY_LOADING) {
+ this.state = subtitle_stream_controller_State.IDLE;
+ this.tick();
+ }
+ };
+
+ SubtitleStreamController.prototype.onFragLoaded = function onFragLoaded(data) {
+ var fragCurrent = this.fragCurrent,
+ decryptData = data.frag.decryptdata;
+ var fragLoaded = data.frag,
+ hls = this.hls;
+ if (this.state === subtitle_stream_controller_State.FRAG_LOADING && fragCurrent && data.frag.type === 'subtitle' && fragCurrent.sn === data.frag.sn) {
+ // check to see if the payload needs to be decrypted
+ if (data.payload.byteLength > 0 && decryptData != null && decryptData.key != null && decryptData.method === 'AES-128') {
+ var startTime;
+ try {
+ startTime = performance.now();
+ } catch (error) {
+ startTime = Date.now();
}
+ // decrypt the subtitles
+ this.decrypter.decrypt(data.payload, decryptData.key.buffer, decryptData.iv.buffer, function (decryptedData) {
+ var endTime;
+ try {
+ endTime = performance.now();
+ } catch (error) {
+ endTime = Date.now();
+ }
+ hls.trigger(events["a" /* default */].FRAG_DECRYPTED, { frag: fragLoaded, payload: decryptedData, stats: { tstart: startTime, tdecrypt: endTime } });
+ });
}
}
+ };
+
+ return SubtitleStreamController;
+}(event_handler);
+
+/* harmony default export */ var subtitle_stream_controller = (subtitle_stream_controller_SubtitleStreamController);
+// CONCATENATED MODULE: ./src/config.js
+/**
+ * HLS config
+ */
+
+
+
+
+
+
+//import FetchLoader from './utils/fetch-loader';
+
+
+
+
+
+
+
+
+
+var hlsDefaultConfig = {
+ autoStartLoad: true, // used by stream-controller
+ startPosition: -1, // used by stream-controller
+ defaultAudioCodec: undefined, // used by stream-controller
+ debug: false, // used by logger
+ capLevelOnFPSDrop: false, // used by fps-controller
+ capLevelToPlayerSize: false, // used by cap-level-controller
+ initialLiveManifestSize: 1, // used by stream-controller
+ maxBufferLength: 30, // used by stream-controller
+ maxBufferSize: 60 * 1000 * 1000, // used by stream-controller
+ maxBufferHole: 0.5, // used by stream-controller
+ maxSeekHole: 2, // used by stream-controller
+ lowBufferWatchdogPeriod: 0.5, // used by stream-controller
+ highBufferWatchdogPeriod: 3, // used by stream-controller
+ nudgeOffset: 0.1, // used by stream-controller
+ nudgeMaxRetry: 3, // used by stream-controller
+ maxFragLookUpTolerance: 0.25, // used by stream-controller
+ liveSyncDurationCount: 3, // used by stream-controller
+ liveMaxLatencyDurationCount: Infinity, // used by stream-controller
+ liveSyncDuration: undefined, // used by stream-controller
+ liveMaxLatencyDuration: undefined, // used by stream-controller
+ liveDurationInfinity: false, // used by buffer-controller
+ maxMaxBufferLength: 600, // used by stream-controller
+ enableWorker: true, // used by demuxer
+ enableSoftwareAES: true, // used by decrypter
+ manifestLoadingTimeOut: 10000, // used by playlist-loader
+ manifestLoadingMaxRetry: 1, // used by playlist-loader
+ manifestLoadingRetryDelay: 1000, // used by playlist-loader
+ manifestLoadingMaxRetryTimeout: 64000, // used by playlist-loader
+ startLevel: undefined, // used by level-controller
+ levelLoadingTimeOut: 10000, // used by playlist-loader
+ levelLoadingMaxRetry: 4, // used by playlist-loader
+ levelLoadingRetryDelay: 1000, // used by playlist-loader
+ levelLoadingMaxRetryTimeout: 64000, // used by playlist-loader
+ fragLoadingTimeOut: 20000, // used by fragment-loader
+ fragLoadingMaxRetry: 6, // used by fragment-loader
+ fragLoadingRetryDelay: 1000, // used by fragment-loader
+ fragLoadingMaxRetryTimeout: 64000, // used by fragment-loader
+ fragLoadingLoopThreshold: 3, // used by stream-controller
+ startFragPrefetch: false, // used by stream-controller
+ fpsDroppedMonitoringPeriod: 5000, // used by fps-controller
+ fpsDroppedMonitoringThreshold: 0.2, // used by fps-controller
+ appendErrorMaxRetry: 3, // used by buffer-controller
+ loader: xhr_loader,
+ //loader: FetchLoader,
+ fLoader: undefined,
+ pLoader: undefined,
+ xhrSetup: undefined,
+ fetchSetup: undefined,
+ abrController: abr_controller,
+ bufferController: buffer_controller,
+ capLevelController: cap_level_controller,
+ fpsController: fps_controller,
+ stretchShortVideoTrack: false, // used by mp4-remuxer
+ maxAudioFramesDrift: 1, // used by mp4-remuxer
+ forceKeyFrameOnDiscontinuity: true, // used by ts-demuxer
+ abrEwmaFastLive: 3, // used by abr-controller
+ abrEwmaSlowLive: 9, // used by abr-controller
+ abrEwmaFastVoD: 3, // used by abr-controller
+ abrEwmaSlowVoD: 9, // used by abr-controller
+ abrEwmaDefaultEstimate: 5e5, // 500 kbps // used by abr-controller
+ abrBandWidthFactor: 0.95, // used by abr-controller
+ abrBandWidthUpFactor: 0.7, // used by abr-controller
+ abrMaxWithRealBitrate: false, // used by abr-controller
+ maxStarvationDelay: 4, // used by abr-controller
+ maxLoadingDelay: 4, // used by abr-controller
+ minAutoBitrate: 0 // used by hls
+};
+
+if (true) {
+ hlsDefaultConfig.subtitleStreamController = subtitle_stream_controller;
+ hlsDefaultConfig.subtitleTrackController = subtitle_track_controller;
+ hlsDefaultConfig.timelineController = timeline_controller;
+ hlsDefaultConfig.cueHandler = cues_namespaceObject;
+ hlsDefaultConfig.enableCEA708Captions = true; // used by timeline-controller
+ hlsDefaultConfig.enableWebVTT = true; // used by timeline-controller
+ hlsDefaultConfig.captionsTextTrack1Label = 'English'; // used by timeline-controller
+ hlsDefaultConfig.captionsTextTrack1LanguageCode = 'en'; // used by timeline-controller
+ hlsDefaultConfig.captionsTextTrack2Label = 'Spanish'; // used by timeline-controller
+ hlsDefaultConfig.captionsTextTrack2LanguageCode = 'es'; // used by timeline-controller
+}
+
+if (true) {
+ hlsDefaultConfig.audioStreamController = audio_stream_controller;
+ hlsDefaultConfig.audioTrackController = audio_track_controller;
+}
+// CONCATENATED MODULE: ./src/hls.js
+var hls__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function hls__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+/**
+ * HLS interface
+ */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var hls_Hls = function () {
+ Hls.isSupported = function isSupported() {
+ return is_supported_isSupported();
+ };
+
+ hls__createClass(Hls, null, [{
+ key: 'version',
+ get: function get() {
+ return "0.8.9";
+ }
}, {
- key: 'loadtimeout',
- value: function loadtimeout() {
- _logger.logger.warn('timeout while loading ' + this.context.url);
- this.callbacks.onTimeout(this.stats, this.context);
+ key: 'Events',
+ get: function get() {
+ return events["a" /* default */];
}
}, {
- key: 'loadprogress',
- value: function loadprogress(event) {
- var stats = this.stats;
- stats.loaded = event.loaded;
- if (event.lengthComputable) {
- stats.total = event.total;
+ key: 'ErrorTypes',
+ get: function get() {
+ return errors["b" /* ErrorTypes */];
+ }
+ }, {
+ key: 'ErrorDetails',
+ get: function get() {
+ return errors["a" /* ErrorDetails */];
+ }
+ }, {
+ key: 'DefaultConfig',
+ get: function get() {
+ if (!Hls.defaultConfig) {
+ return hlsDefaultConfig;
+ }
+ return Hls.defaultConfig;
+ },
+ set: function set(defaultConfig) {
+ Hls.defaultConfig = defaultConfig;
+ }
+ }]);
+
+ function Hls() {
+ var _this = this;
+
+ var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ hls__classCallCheck(this, Hls);
+
+ var defaultConfig = Hls.DefaultConfig;
+
+ if ((config.liveSyncDurationCount || config.liveMaxLatencyDurationCount) && (config.liveSyncDuration || config.liveMaxLatencyDuration)) {
+ throw new Error('Illegal hls.js config: don\'t mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration');
+ }
+
+ for (var prop in defaultConfig) {
+ if (prop in config) {
+ continue;
}
- var onProgress = this.callbacks.onProgress;
- if (onProgress) {
- // last args is to provide on progress data
- onProgress(stats, this.context, null);
+ config[prop] = defaultConfig[prop];
+ }
+
+ if (config.liveMaxLatencyDurationCount !== undefined && config.liveMaxLatencyDurationCount <= config.liveSyncDurationCount) {
+ throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');
+ }
+
+ if (config.liveMaxLatencyDuration !== undefined && (config.liveMaxLatencyDuration <= config.liveSyncDuration || config.liveSyncDuration === undefined)) {
+ throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');
+ }
+
+ Object(logger["a" /* enableLogs */])(config.debug);
+ this.config = config;
+ this._autoLevelCapping = -1;
+ // observer setup
+ var observer = this.observer = new events_default.a();
+ observer.trigger = function trigger(event) {
+ for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ data[_key - 1] = arguments[_key];
+ }
+
+ observer.emit.apply(observer, [event, event].concat(data));
+ };
+
+ observer.off = function off(event) {
+ for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
+ data[_key2 - 1] = arguments[_key2];
+ }
+
+ observer.removeListener.apply(observer, [event].concat(data));
+ };
+ this.on = observer.on.bind(observer);
+ this.off = observer.off.bind(observer);
+ this.trigger = observer.trigger.bind(observer);
+
+ // core controllers and network loaders
+ var abrController = this.abrController = new config.abrController(this);
+ var bufferController = new config.bufferController(this);
+ var capLevelController = new config.capLevelController(this);
+ var fpsController = new config.fpsController(this);
+ var playListLoader = new playlist_loader(this);
+ var fragmentLoader = new fragment_loader(this);
+ var keyLoader = new key_loader(this);
+ var id3TrackController = new id3_track_controller(this);
+
+ // network controllers
+ var levelController = this.levelController = new level_controller(this);
+ var streamController = this.streamController = new stream_controller(this);
+ var networkControllers = [levelController, streamController];
+
+ // optional audio stream controller
+ var Controller = config.audioStreamController;
+ if (Controller) {
+ networkControllers.push(new Controller(this));
+ }
+ this.networkControllers = networkControllers;
+
+ var coreComponents = [playListLoader, fragmentLoader, keyLoader, abrController, bufferController, capLevelController, fpsController, id3TrackController];
+
+ // optional audio track and subtitle controller
+ Controller = config.audioTrackController;
+ if (Controller) {
+ var audioTrackController = new Controller(this);
+ this.audioTrackController = audioTrackController;
+ coreComponents.push(audioTrackController);
+ }
+
+ Controller = config.subtitleTrackController;
+ if (Controller) {
+ var subtitleTrackController = new Controller(this);
+ this.subtitleTrackController = subtitleTrackController;
+ coreComponents.push(subtitleTrackController);
+ }
+
+ // optional subtitle controller
+ [config.subtitleStreamController, config.timelineController].forEach(function (Controller) {
+ if (Controller) {
+ coreComponents.push(new Controller(_this));
+ }
+ });
+ this.coreComponents = coreComponents;
+ }
+
+ Hls.prototype.destroy = function destroy() {
+ logger["b" /* logger */].log('destroy');
+ this.trigger(events["a" /* default */].DESTROYING);
+ this.detachMedia();
+ this.coreComponents.concat(this.networkControllers).forEach(function (component) {
+ component.destroy();
+ });
+ this.url = null;
+ this.observer.removeAllListeners();
+ this._autoLevelCapping = -1;
+ };
+
+ Hls.prototype.attachMedia = function attachMedia(media) {
+ logger["b" /* logger */].log('attachMedia');
+ this.media = media;
+ this.trigger(events["a" /* default */].MEDIA_ATTACHING, { media: media });
+ };
+
+ Hls.prototype.detachMedia = function detachMedia() {
+ logger["b" /* logger */].log('detachMedia');
+ this.trigger(events["a" /* default */].MEDIA_DETACHING);
+ this.media = null;
+ };
+
+ Hls.prototype.loadSource = function loadSource(url) {
+ url = url_toolkit_default.a.buildAbsoluteURL(window.location.href, url, { alwaysNormalize: true });
+ logger["b" /* logger */].log('loadSource:' + url);
+ this.url = url;
+ // when attaching to a source URL, trigger a playlist load
+ this.trigger(events["a" /* default */].MANIFEST_LOADING, { url: url });
+ };
+
+ Hls.prototype.startLoad = function startLoad() {
+ var startPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
+
+ logger["b" /* logger */].log('startLoad(' + startPosition + ')');
+ this.networkControllers.forEach(function (controller) {
+ controller.startLoad(startPosition);
+ });
+ };
+
+ Hls.prototype.stopLoad = function stopLoad() {
+ logger["b" /* logger */].log('stopLoad');
+ this.networkControllers.forEach(function (controller) {
+ controller.stopLoad();
+ });
+ };
+
+ Hls.prototype.swapAudioCodec = function swapAudioCodec() {
+ logger["b" /* logger */].log('swapAudioCodec');
+ this.streamController.swapAudioCodec();
+ };
+
+ Hls.prototype.recoverMediaError = function recoverMediaError() {
+ logger["b" /* logger */].log('recoverMediaError');
+ var media = this.media;
+ this.detachMedia();
+ this.attachMedia(media);
+ };
+
+ /** Return all quality levels **/
+
+
+ hls__createClass(Hls, [{
+ key: 'levels',
+ get: function get() {
+ return this.levelController.levels;
+ }
+
+ /** Return current playback quality level **/
+
+ }, {
+ key: 'currentLevel',
+ get: function get() {
+ return this.streamController.currentLevel;
+ }
+
+ /* set quality level immediately (-1 for automatic level selection) */
+ ,
+ set: function set(newLevel) {
+ logger["b" /* logger */].log('set currentLevel:' + newLevel);
+ this.loadLevel = newLevel;
+ this.streamController.immediateLevelSwitch();
+ }
+
+ /** Return next playback quality level (quality level of next fragment) **/
+
+ }, {
+ key: 'nextLevel',
+ get: function get() {
+ return this.streamController.nextLevel;
+ }
+
+ /* set quality level for next fragment (-1 for automatic level selection) */
+ ,
+ set: function set(newLevel) {
+ logger["b" /* logger */].log('set nextLevel:' + newLevel);
+ this.levelController.manualLevel = newLevel;
+ this.streamController.nextLevelSwitch();
+ }
+
+ /** Return the quality level of current/last loaded fragment **/
+
+ }, {
+ key: 'loadLevel',
+ get: function get() {
+ return this.levelController.level;
+ }
+
+ /* set quality level for current/next loaded fragment (-1 for automatic level selection) */
+ ,
+ set: function set(newLevel) {
+ logger["b" /* logger */].log('set loadLevel:' + newLevel);
+ this.levelController.manualLevel = newLevel;
+ }
+
+ /** Return the quality level of next loaded fragment **/
+
+ }, {
+ key: 'nextLoadLevel',
+ get: function get() {
+ return this.levelController.nextLoadLevel;
+ }
+
+ /** set quality level of next loaded fragment **/
+ ,
+ set: function set(level) {
+ this.levelController.nextLoadLevel = level;
+ }
+
+ /** Return first level (index of first level referenced in manifest)
+ **/
+
+ }, {
+ key: 'firstLevel',
+ get: function get() {
+ return Math.max(this.levelController.firstLevel, this.minAutoLevel);
+ }
+
+ /** set first level (index of first level referenced in manifest)
+ **/
+ ,
+ set: function set(newLevel) {
+ logger["b" /* logger */].log('set firstLevel:' + newLevel);
+ this.levelController.firstLevel = newLevel;
+ }
+
+ /** Return start level (level of first fragment that will be played back)
+ if not overrided by user, first level appearing in manifest will be used as start level
+ if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)
+ **/
+
+ }, {
+ key: 'startLevel',
+ get: function get() {
+ return this.levelController.startLevel;
+ }
+
+ /** set start level (level of first fragment that will be played back)
+ if not overrided by user, first level appearing in manifest will be used as start level
+ if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)
+ **/
+ ,
+ set: function set(newLevel) {
+ logger["b" /* logger */].log('set startLevel:' + newLevel);
+ var hls = this;
+ // if not in automatic start level detection, ensure startLevel is greater than minAutoLevel
+ if (newLevel !== -1) {
+ newLevel = Math.max(newLevel, hls.minAutoLevel);
+ }
+ hls.levelController.startLevel = newLevel;
+ }
+
+ /** Return the capping/max level value that could be used by automatic level selection algorithm **/
+
+ }, {
+ key: 'autoLevelCapping',
+ get: function get() {
+ return this._autoLevelCapping;
+ }
+
+ /** set the capping/max level value that could be used by automatic level selection algorithm **/
+ ,
+ set: function set(newLevel) {
+ logger["b" /* logger */].log('set autoLevelCapping:' + newLevel);
+ this._autoLevelCapping = newLevel;
+ }
+
+ /* check if we are in automatic level selection mode */
+
+ }, {
+ key: 'autoLevelEnabled',
+ get: function get() {
+ return this.levelController.manualLevel === -1;
+ }
+
+ /* return manual level */
+
+ }, {
+ key: 'manualLevel',
+ get: function get() {
+ return this.levelController.manualLevel;
+ }
+
+ /* return min level selectable in auto mode according to config.minAutoBitrate */
+
+ }, {
+ key: 'minAutoLevel',
+ get: function get() {
+ var hls = this,
+ levels = hls.levels,
+ minAutoBitrate = hls.config.minAutoBitrate,
+ len = levels ? levels.length : 0;
+ for (var i = 0; i < len; i++) {
+ var levelNextBitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate;
+ if (levelNextBitrate > minAutoBitrate) {
+ return i;
+ }
+ }
+ return 0;
+ }
+
+ /* return max level selectable in auto mode according to autoLevelCapping */
+
+ }, {
+ key: 'maxAutoLevel',
+ get: function get() {
+ var hls = this;
+ var levels = hls.levels;
+ var autoLevelCapping = hls.autoLevelCapping;
+ var maxAutoLevel = void 0;
+ if (autoLevelCapping === -1 && levels && levels.length) {
+ maxAutoLevel = levels.length - 1;
+ } else {
+ maxAutoLevel = autoLevelCapping;
+ }
+ return maxAutoLevel;
+ }
+
+ // return next auto level
+
+ }, {
+ key: 'nextAutoLevel',
+ get: function get() {
+ var hls = this;
+ // ensure next auto level is between min and max auto level
+ return Math.min(Math.max(hls.abrController.nextAutoLevel, hls.minAutoLevel), hls.maxAutoLevel);
+ }
+
+ // this setter is used to force next auto level
+ // this is useful to force a switch down in auto mode : in case of load error on level N, hls.js can set nextAutoLevel to N-1 for example)
+ // forced value is valid for one fragment. upon succesful frag loading at forced level, this value will be resetted to -1 by ABR controller
+ ,
+ set: function set(nextLevel) {
+ var hls = this;
+ hls.abrController.nextAutoLevel = Math.max(hls.minAutoLevel, nextLevel);
+ }
+
+ /** get alternate audio tracks list from playlist **/
+
+ }, {
+ key: 'audioTracks',
+ get: function get() {
+ var audioTrackController = this.audioTrackController;
+ return audioTrackController ? audioTrackController.audioTracks : [];
+ }
+
+ /** get index of the selected audio track (index in audio track lists) **/
+
+ }, {
+ key: 'audioTrack',
+ get: function get() {
+ var audioTrackController = this.audioTrackController;
+ return audioTrackController ? audioTrackController.audioTrack : -1;
+ }
+
+ /** select an audio track, based on its index in audio track lists**/
+ ,
+ set: function set(audioTrackId) {
+ var audioTrackController = this.audioTrackController;
+ if (audioTrackController) {
+ audioTrackController.audioTrack = audioTrackId;
+ }
+ }
+ }, {
+ key: 'liveSyncPosition',
+ get: function get() {
+ return this.streamController.liveSyncPosition;
+ }
+
+ /** get alternate subtitle tracks list from playlist **/
+
+ }, {
+ key: 'subtitleTracks',
+ get: function get() {
+ var subtitleTrackController = this.subtitleTrackController;
+ return subtitleTrackController ? subtitleTrackController.subtitleTracks : [];
+ }
+
+ /** get index of the selected subtitle track (index in subtitle track lists) **/
+
+ }, {
+ key: 'subtitleTrack',
+ get: function get() {
+ var subtitleTrackController = this.subtitleTrackController;
+ return subtitleTrackController ? subtitleTrackController.subtitleTrack : -1;
+ }
+
+ /** select an subtitle track, based on its index in subtitle track lists**/
+ ,
+ set: function set(subtitleTrackId) {
+ var subtitleTrackController = this.subtitleTrackController;
+ if (subtitleTrackController) {
+ subtitleTrackController.subtitleTrack = subtitleTrackId;
+ }
+ }
+ }, {
+ key: 'subtitleDisplay',
+ get: function get() {
+ var subtitleTrackController = this.subtitleTrackController;
+ return subtitleTrackController ? subtitleTrackController.subtitleDisplay : false;
+ },
+ set: function set(value) {
+ var subtitleTrackController = this.subtitleTrackController;
+ if (subtitleTrackController) {
+ subtitleTrackController.subtitleDisplay = value;
}
}
}]);
- return XhrLoader;
+ return Hls;
}();
-exports.default = XhrLoader;
+/* harmony default export */ var src_hls = __webpack_exports__["default"] = (hls_Hls);
+
+/***/ }),
+/* 9 */
+/***/ (function(module, exports, __webpack_require__) {
+
+function webpackBootstrapFunc (modules) {
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // identity function for calling harmony imports with the correct context
+/******/ __webpack_require__.i = function(value) { return value; };
+
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "/";
+
+/******/ // on error function for async loading
+/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
+
+ var f = __webpack_require__(__webpack_require__.s = ENTRY_MODULE)
+ return f.default || f // try to call default if defined to also support babel esmodule exports
+}
+
+// http://stackoverflow.com/a/2593661/130442
+function quoteRegExp (str) {
+ return (str + '').replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&')
+}
+
+function getModuleDependencies (module) {
+ var retval = []
+ var fnString = module.toString()
+ var wrapperSignature = fnString.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/)
+ if (!wrapperSignature) return retval
+
+ var webpackRequireName = wrapperSignature[1]
+ var re = new RegExp('(\\\\n|\\W)' + quoteRegExp(webpackRequireName) + '\\((\/\\*.*?\\*\/)?\s?.*?([\\.|\\-|\\w|\/|@]+).*?\\)', 'g') // additional chars when output.pathinfo is true
+ var match
+ while ((match = re.exec(fnString))) {
+ retval.push(match[3])
+ }
+ return retval
+}
+
+function getRequiredModules (sources, moduleId) {
+ var modulesQueue = [moduleId]
+ var requiredModules = []
+ var seenModules = {}
+
+ while (modulesQueue.length) {
+ var moduleToCheck = modulesQueue.pop()
+ if (seenModules[moduleToCheck] || !sources[moduleToCheck]) continue
+ seenModules[moduleToCheck] = true
+ requiredModules.push(moduleToCheck)
+ var newModules = getModuleDependencies(sources[moduleToCheck])
+ modulesQueue = modulesQueue.concat(newModules)
+ }
+
+ return requiredModules
+}
+
+module.exports = function (moduleId, options) {
+ options = options || {}
+ var sources = __webpack_require__.m
+
+ var requiredModules = options.all ? Object.keys(sources) : getRequiredModules(sources, moduleId)
+ var src = '(' + webpackBootstrapFunc.toString().replace('ENTRY_MODULE', JSON.stringify(moduleId)) + ')({' + requiredModules.map(function (id) { return '' + JSON.stringify(id) + ': ' + sources[id].toString() }).join(',') + '})(self);'
+
+ var blob = new window.Blob([src], { type: 'text/javascript' })
+ if (options.bare) { return blob }
+
+ var URL = window.URL || window.webkitURL || window.mozURL || window.msURL
+
+ var workerUrl = URL.createObjectURL(blob)
+ var worker = new window.Worker(workerUrl)
+ worker.objectURL = workerUrl
+
+ return worker
+}
+
+
+/***/ }),
+/* 10 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__demux_demuxer_inline__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__events__ = __webpack_require__(1);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_logger__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_events__ = __webpack_require__(5);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_events___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_events__);
+/* demuxer web worker.
+ * - listen to worker message, and trigger DemuxerInline upon reception of Fragments.
+ * - provides MP4 Boxes back to main thread using [transferable objects](https://developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast) in order to minimize message passing overhead.
+ */
+
+
+
+
+
+
+var DemuxerWorker = function DemuxerWorker(self) {
+ // observer setup
+ var observer = new __WEBPACK_IMPORTED_MODULE_3_events___default.a();
+ observer.trigger = function trigger(event) {
+ for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ data[_key - 1] = arguments[_key];
+ }
-},{"53":53}]},{},[40])(40)
+ observer.emit.apply(observer, [event, event].concat(data));
+ };
+
+ observer.off = function off(event) {
+ for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
+ data[_key2 - 1] = arguments[_key2];
+ }
+
+ observer.removeListener.apply(observer, [event].concat(data));
+ };
+
+ var forwardMessage = function forwardMessage(ev, data) {
+ self.postMessage({ event: ev, data: data });
+ };
+
+ self.addEventListener('message', function (ev) {
+ var data = ev.data;
+ //console.log('demuxer cmd:' + data.cmd);
+ switch (data.cmd) {
+ case 'init':
+ var config = JSON.parse(data.config);
+ self.demuxer = new __WEBPACK_IMPORTED_MODULE_0__demux_demuxer_inline__["a" /* default */](observer, data.typeSupported, config, data.vendor);
+ try {
+ Object(__WEBPACK_IMPORTED_MODULE_2__utils_logger__["a" /* enableLogs */])(config.debug === true);
+ } catch (err) {
+ console.warn('demuxerWorker: unable to enable logs');
+ }
+ // signal end of worker init
+ forwardMessage('init', null);
+ break;
+ case 'demux':
+ self.demuxer.push(data.data, data.decryptdata, data.initSegment, data.audioCodec, data.videoCodec, data.timeOffset, data.discontinuity, data.trackSwitch, data.contiguous, data.duration, data.accurateTimeOffset, data.defaultInitPTS);
+ break;
+ default:
+ break;
+ }
+ });
+
+ // forward events to main thread
+ observer.on(__WEBPACK_IMPORTED_MODULE_1__events__["a" /* default */].FRAG_DECRYPTED, forwardMessage);
+ observer.on(__WEBPACK_IMPORTED_MODULE_1__events__["a" /* default */].FRAG_PARSING_INIT_SEGMENT, forwardMessage);
+ observer.on(__WEBPACK_IMPORTED_MODULE_1__events__["a" /* default */].FRAG_PARSED, forwardMessage);
+ observer.on(__WEBPACK_IMPORTED_MODULE_1__events__["a" /* default */].ERROR, forwardMessage);
+ observer.on(__WEBPACK_IMPORTED_MODULE_1__events__["a" /* default */].FRAG_PARSING_METADATA, forwardMessage);
+ observer.on(__WEBPACK_IMPORTED_MODULE_1__events__["a" /* default */].FRAG_PARSING_USERDATA, forwardMessage);
+ observer.on(__WEBPACK_IMPORTED_MODULE_1__events__["a" /* default */].INIT_PTS_FOUND, forwardMessage);
+
+ // special case for FRAG_PARSING_DATA: pass data1/data2 as transferable object (no copy)
+ observer.on(__WEBPACK_IMPORTED_MODULE_1__events__["a" /* default */].FRAG_PARSING_DATA, function (ev, data) {
+ var transferable = [];
+ var message = { event: ev, data: data };
+ if (data.data1) {
+ message.data1 = data.data1.buffer;
+ transferable.push(data.data1.buffer);
+ delete data.data1;
+ }
+ if (data.data2) {
+ message.data2 = data.data2.buffer;
+ transferable.push(data.data2.buffer);
+ delete data.data2;
+ }
+ self.postMessage(message, transferable);
+ });
+};
+
+/* harmony default export */ __webpack_exports__["default"] = (DemuxerWorker);
+
+/***/ })
+/******/ ])["default"];
});
//# sourceMappingURL=hls.js.map
-
/***/ }),
-/* 174 */
+/* 182 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -29856,23 +30327,13 @@ var _playback = __webpack_require__(9);
var _playback2 = _interopRequireDefault(_playback);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
-var _style = __webpack_require__(175);
-
-var _style2 = _interopRequireDefault(_style);
-
var _events = __webpack_require__(4);
var _events2 = _interopRequireDefault(_events);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+__webpack_require__(183);
-// Copyright 2014 Globo.com Player authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var HTMLImg = function (_Playback) {
(0, _inherits3.default)(HTMLImg, _Playback);
@@ -29919,8 +30380,6 @@ var HTMLImg = function (_Playback) {
}
HTMLImg.prototype.render = function render() {
- var style = _styler2.default.getStyleFor(_style2.default);
- this.$el.append(style);
this.trigger(_events2.default.PLAYBACK_READY, this.name);
return this;
};
@@ -29935,7 +30394,9 @@ var HTMLImg = function (_Playback) {
};
return HTMLImg;
-}(_playback2.default);
+}(_playback2.default); // Copyright 2014 Globo.com Player authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
exports.default = HTMLImg;
@@ -29947,10 +30408,41 @@ HTMLImg.canPlay = function (resource) {
module.exports = exports['default'];
/***/ }),
-/* 175 */
+/* 183 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(184);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./style.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./style.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 184 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
@@ -29961,7 +30453,7 @@ exports.push([module.i, "[data-html-img] {\n max-width: 100%;\n max-height: 10
/***/ }),
-/* 176 */
+/* 185 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -29997,22 +30489,16 @@ var _template = __webpack_require__(8);
var _template2 = _interopRequireDefault(_template);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
var _events = __webpack_require__(4);
var _events2 = _interopRequireDefault(_events);
-var _style = __webpack_require__(177);
-
-var _style2 = _interopRequireDefault(_style);
-
-var _error = __webpack_require__(178);
+var _error = __webpack_require__(186);
var _error2 = _interopRequireDefault(_error);
+__webpack_require__(187);
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var NoOp = function (_Playback) {
@@ -30049,15 +30535,12 @@ var NoOp = function (_Playback) {
}
NoOp.prototype.render = function render() {
- var style = _styler2.default.getStyleFor(_style2.default);
var playbackNotSupported = this.options.playbackNotSupportedMessage || this.i18n.t('playback_not_supported');
this.$el.html(this.template({ message: playbackNotSupported }));
- this.$el.append(style);
this.trigger(_events2.default.PLAYBACK_READY, this.name);
var showForNoOp = !!(this.options.poster && this.options.poster.showForNoOp);
- if (this.options.autoPlay || !showForNoOp) {
- this.play();
- }
+ if (this.options.autoPlay || !showForNoOp) this.play();
+
return this;
};
@@ -30107,9 +30590,8 @@ var NoOp = function (_Playback) {
NoOp.prototype._loop = function _loop() {
var _this2 = this;
- if (this._stop) {
- return;
- }
+ if (this._stop) return;
+
this._noise();
this._animationHandle = (0, _utils.requestAnimationFrame)(function () {
return _this2._loop();
@@ -30142,27 +30624,58 @@ NoOp.canPlay = function (source) {
module.exports = exports['default'];
/***/ }),
-/* 177 */
+/* 186 */
+/***/ (function(module, exports) {
+
+module.exports = "<canvas data-no-op-canvas></canvas>\n<p data-no-op-msg><%=message%><p>\n";
+
+/***/ }),
+/* 187 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(188);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./style.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./style.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 188 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
// module
-exports.push([module.i, "[data-no-op] {\n position: absolute;\n height: 100%;\n width: 100%;\n text-align: center; }\n\n[data-no-op] p[data-no-op-msg] {\n position: absolute;\n text-align: center;\n font-size: 25px;\n left: 0;\n right: 0;\n color: white;\n padding: 10px;\n /* center vertically */\n top: 50%;\n -webkit-transform: translateY(-50%);\n -moz-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n -o-transform: translateY(-50%);\n transform: translateY(-50%);\n max-height: 100%;\n overflow: auto; }\n\n[data-no-op] canvas[data-no-op-canvas] {\n background-color: #777;\n height: 100%;\n width: 100%; }\n", ""]);
+exports.push([module.i, "[data-no-op] {\n position: absolute;\n height: 100%;\n width: 100%;\n text-align: center; }\n\n[data-no-op] p[data-no-op-msg] {\n position: absolute;\n text-align: center;\n font-size: 25px;\n left: 0;\n right: 0;\n color: white;\n padding: 10px;\n /* center vertically */\n top: 50%;\n -webkit-transform: translateY(-50%);\n transform: translateY(-50%);\n max-height: 100%;\n overflow: auto; }\n\n[data-no-op] canvas[data-no-op-canvas] {\n background-color: #777;\n height: 100%;\n width: 100%; }\n", ""]);
// exports
/***/ }),
-/* 178 */
-/***/ (function(module, exports) {
-
-module.exports = "<canvas data-no-op-canvas></canvas>\n<p data-no-op-msg><%=message%><p>\n";
-
-/***/ }),
-/* 179 */
+/* 189 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -30172,7 +30685,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _spinner_three_bounce = __webpack_require__(180);
+var _spinner_three_bounce = __webpack_require__(190);
var _spinner_three_bounce2 = _interopRequireDefault(_spinner_three_bounce);
@@ -30182,7 +30695,7 @@ exports.default = _spinner_three_bounce2.default;
module.exports = exports['default'];
/***/ }),
-/* 180 */
+/* 190 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -30216,28 +30729,18 @@ var _events = __webpack_require__(4);
var _events2 = _interopRequireDefault(_events);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
var _template = __webpack_require__(8);
var _template2 = _interopRequireDefault(_template);
-var _spinner = __webpack_require__(181);
+var _spinner = __webpack_require__(191);
var _spinner2 = _interopRequireDefault(_spinner);
-var _spinner3 = __webpack_require__(182);
-
-var _spinner4 = _interopRequireDefault(_spinner3);
+__webpack_require__(192);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-// Copyright 2014 Globo.com Player authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
var SpinnerThreeBouncePlugin = function (_UIContainerPlugin) {
(0, _inherits3.default)(SpinnerThreeBouncePlugin, _UIContainerPlugin);
(0, _createClass3.default)(SpinnerThreeBouncePlugin, [{
@@ -30286,11 +30789,9 @@ var SpinnerThreeBouncePlugin = function (_UIContainerPlugin) {
SpinnerThreeBouncePlugin.prototype.show = function show() {
var _this2 = this;
- if (this.showTimeout === null) {
- this.showTimeout = setTimeout(function () {
- return _this2.$el.show();
- }, 300);
- }
+ if (this.showTimeout === null) this.showTimeout = setTimeout(function () {
+ return _this2.$el.show();
+ }, 300);
};
SpinnerThreeBouncePlugin.prototype.hide = function hide() {
@@ -30303,44 +30804,74 @@ var SpinnerThreeBouncePlugin = function (_UIContainerPlugin) {
SpinnerThreeBouncePlugin.prototype.render = function render() {
this.$el.html(this.template());
- var style = _styler2.default.getStyleFor(_spinner4.default);
- this.container.$el.append(style);
this.container.$el.append(this.$el);
this.$el.hide();
- if (this.container.buffering) {
- this.onBuffering();
- }
+ if (this.container.buffering) this.onBuffering();
+
return this;
};
return SpinnerThreeBouncePlugin;
-}(_ui_container_plugin2.default);
+}(_ui_container_plugin2.default); // Copyright 2014 Globo.com Player authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
exports.default = SpinnerThreeBouncePlugin;
module.exports = exports['default'];
/***/ }),
-/* 181 */
+/* 191 */
/***/ (function(module, exports) {
module.exports = "<div data-bounce1></div><div data-bounce2></div><div data-bounce3></div>\n";
/***/ }),
-/* 182 */
+/* 192 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(193);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./spinner.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./spinner.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 193 */
+/***/ (function(module, exports, __webpack_require__) {
+
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
// module
-exports.push([module.i, ".spinner-three-bounce[data-spinner] {\n position: absolute;\n margin: 0 auto;\n width: 70px;\n text-align: center;\n z-index: 999;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n /* center vertically */\n top: 50%;\n -webkit-transform: translateY(-50%);\n -moz-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n -o-transform: translateY(-50%);\n transform: translateY(-50%); }\n .spinner-three-bounce[data-spinner] > div {\n width: 18px;\n height: 18px;\n background-color: #FFFFFF;\n border-radius: 100%;\n display: inline-block;\n -webkit-animation: bouncedelay 1.4s infinite ease-in-out;\n -moz-animation: bouncedelay 1.4s infinite ease-in-out;\n animation: bouncedelay 1.4s infinite ease-in-out;\n /* Prevent first frame from flickering when animation starts */\n -webkit-animation-fill-mode: both;\n -moz-animation-fill-mode: both;\n animation-fill-mode: both; }\n .spinner-three-bounce[data-spinner] [data-bounce1] {\n -webkit-animation-delay: -0.32s;\n -moz-animation-delay: -0.32s;\n animation-delay: -0.32s; }\n .spinner-three-bounce[data-spinner] [data-bounce2] {\n -webkit-animation-delay: -0.16s;\n -moz-animation-delay: -0.16s;\n animation-delay: -0.16s; }\n\n@-webkit-keyframes bouncedelay {\n 0%, 80%, 100% {\n -webkit-transform: scale(0); }\n 40% {\n -webkit-transform: scale(1); } }\n\n@-moz-keyframes bouncedelay {\n 0%, 80%, 100% {\n -moz-transform: scale(0); }\n 40% {\n -moz-transform: scale(1); } }\n\n@keyframes bouncedelay {\n 0%, 80%, 100% {\n -webkit-transform: scale(0);\n -moz-transform: scale(0);\n -ms-transform: scale(0);\n -o-transform: scale(0);\n transform: scale(0); }\n 40% {\n -webkit-transform: scale(1);\n -moz-transform: scale(1);\n -ms-transform: scale(1);\n -o-transform: scale(1);\n transform: scale(1); } }\n", ""]);
+exports.push([module.i, ".spinner-three-bounce[data-spinner] {\n position: absolute;\n margin: 0 auto;\n width: 70px;\n text-align: center;\n z-index: 999;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n /* center vertically */\n top: 50%;\n -webkit-transform: translateY(-50%);\n transform: translateY(-50%); }\n .spinner-three-bounce[data-spinner] > div {\n width: 18px;\n height: 18px;\n background-color: #FFFFFF;\n border-radius: 100%;\n display: inline-block;\n -webkit-animation: bouncedelay 1.4s infinite ease-in-out;\n animation: bouncedelay 1.4s infinite ease-in-out;\n /* Prevent first frame from flickering when animation starts */\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both; }\n .spinner-three-bounce[data-spinner] [data-bounce1] {\n -webkit-animation-delay: -0.32s;\n animation-delay: -0.32s; }\n .spinner-three-bounce[data-spinner] [data-bounce2] {\n -webkit-animation-delay: -0.16s;\n animation-delay: -0.16s; }\n\n@-webkit-keyframes bouncedelay {\n 0%, 80%, 100% {\n -webkit-transform: scale(0);\n transform: scale(0); }\n 40% {\n -webkit-transform: scale(1);\n transform: scale(1); } }\n\n@keyframes bouncedelay {\n 0%, 80%, 100% {\n -webkit-transform: scale(0);\n transform: scale(0); }\n 40% {\n -webkit-transform: scale(1);\n transform: scale(1); } }\n", ""]);
// exports
/***/ }),
-/* 183 */
+/* 194 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -30350,7 +30881,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _stats = __webpack_require__(184);
+var _stats = __webpack_require__(195);
var _stats2 = _interopRequireDefault(_stats);
@@ -30360,7 +30891,7 @@ exports.default = _stats2.default;
module.exports = exports['default'];
/***/ }),
-/* 184 */
+/* 195 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -30444,9 +30975,7 @@ var StatsPlugin = function (_ContainerPlugin) {
StatsPlugin.prototype.onPlay = function onPlay() {
this.state = 'PLAYING';
this.watchingTimeInit = Date.now();
- if (!this.intervalId) {
- this.intervalId = setInterval(this.report.bind(this), this.reportInterval);
- }
+ if (!this.intervalId) this.intervalId = setInterval(this.report.bind(this), this.reportInterval);
};
StatsPlugin.prototype.onStop = function onStop() {
@@ -30457,11 +30986,8 @@ var StatsPlugin = function (_ContainerPlugin) {
};
StatsPlugin.prototype.onBuffering = function onBuffering() {
- if (this.firstPlay) {
- this.startupTimeInit = Date.now();
- } else {
- this.rebufferingTimeInit = Date.now();
- }
+ if (this.firstPlay) this.startupTimeInit = Date.now();else this.rebufferingTimeInit = Date.now();
+
this.state = 'BUFFERING';
this.rebuffers++;
};
@@ -30474,6 +31000,7 @@ var StatsPlugin = function (_ContainerPlugin) {
} else if (this.rebufferingTimeInit) {
this.rebufferingTime += this.getRebufferingTime();
}
+
this.rebufferingTimeInit = undefined;
this.state = 'PLAYING';
};
@@ -30519,7 +31046,7 @@ exports.default = StatsPlugin;
module.exports = exports['default'];
/***/ }),
-/* 185 */
+/* 196 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -30529,7 +31056,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _watermark = __webpack_require__(186);
+var _watermark = __webpack_require__(197);
var _watermark2 = _interopRequireDefault(_watermark);
@@ -30539,7 +31066,7 @@ exports.default = _watermark2.default;
module.exports = exports['default'];
/***/ }),
-/* 186 */
+/* 197 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -30573,28 +31100,18 @@ var _events = __webpack_require__(4);
var _events2 = _interopRequireDefault(_events);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
var _template = __webpack_require__(8);
var _template2 = _interopRequireDefault(_template);
-var _watermark = __webpack_require__(187);
+var _watermark = __webpack_require__(198);
var _watermark2 = _interopRequireDefault(_watermark);
-var _watermark3 = __webpack_require__(188);
-
-var _watermark4 = _interopRequireDefault(_watermark3);
+__webpack_require__(199);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-// Copyright 2014 Globo.com Player authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
var WaterMarkPlugin = function (_UIContainerPlugin) {
(0, _inherits3.default)(WaterMarkPlugin, _UIContainerPlugin);
(0, _createClass3.default)(WaterMarkPlugin, [{
@@ -30605,7 +31122,7 @@ var WaterMarkPlugin = function (_UIContainerPlugin) {
}, {
key: 'template',
get: function get() {
- return (0, _template2.default)(_watermark4.default);
+ return (0, _template2.default)(_watermark2.default);
}
}]);
@@ -30647,23 +31164,60 @@ var WaterMarkPlugin = function (_UIContainerPlugin) {
this.$el.hide();
var templateOptions = { position: this.position, imageUrl: this.imageUrl, imageLink: this.imageLink };
this.$el.html(this.template(templateOptions));
- var style = _styler2.default.getStyleFor(_watermark2.default);
- this.container.$el.append(style);
this.container.$el.append(this.$el);
return this;
};
return WaterMarkPlugin;
-}(_ui_container_plugin2.default);
+}(_ui_container_plugin2.default); // Copyright 2014 Globo.com Player authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
exports.default = WaterMarkPlugin;
module.exports = exports['default'];
/***/ }),
-/* 187 */
+/* 198 */
+/***/ (function(module, exports) {
+
+module.exports = "<div data-watermark data-watermark-<%=position %>>\n<% if(typeof imageLink !== 'undefined') { %>\n<a target=_blank href=\"<%= imageLink %>\">\n<% } %>\n<img src=\"<%= imageUrl %>\">\n<% if(typeof imageLink !== 'undefined') { %>\n</a>\n<% } %>\n</div>\n";
+
+/***/ }),
+/* 199 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(200);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./watermark.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./watermark.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 200 */
+/***/ (function(module, exports, __webpack_require__) {
+
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
@@ -30674,13 +31228,7 @@ exports.push([module.i, "[data-watermark] {\n position: absolute;\n min-width:
/***/ }),
-/* 188 */
-/***/ (function(module, exports) {
-
-module.exports = "<div data-watermark data-watermark-<%=position %>>\n<% if(typeof imageLink !== 'undefined') { %>\n<a target=_blank href=\"<%= imageLink %>\">\n<% } %>\n<img src=\"<%= imageUrl %>\">\n<% if(typeof imageLink !== 'undefined') { %>\n</a>\n<% } %>\n</div>\n";
-
-/***/ }),
-/* 189 */
+/* 201 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -30714,10 +31262,6 @@ var _events = __webpack_require__(4);
var _events2 = _interopRequireDefault(_events);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
var _template = __webpack_require__(8);
var _template2 = _interopRequireDefault(_template);
@@ -30726,23 +31270,17 @@ var _playback = __webpack_require__(9);
var _playback2 = _interopRequireDefault(_playback);
-var _poster = __webpack_require__(190);
+var _poster = __webpack_require__(202);
var _poster2 = _interopRequireDefault(_poster);
-var _poster3 = __webpack_require__(191);
-
-var _poster4 = _interopRequireDefault(_poster3);
-
var _play = __webpack_require__(58);
var _play2 = _interopRequireDefault(_play);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+__webpack_require__(203);
-//Copyright 2014 Globo.com Player authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PosterPlugin = function (_UIContainerPlugin) {
(0, _inherits3.default)(PosterPlugin, _UIContainerPlugin);
@@ -30754,7 +31292,7 @@ var PosterPlugin = function (_UIContainerPlugin) {
}, {
key: 'template',
get: function get() {
- return (0, _template2.default)(_poster4.default);
+ return (0, _template2.default)(_poster2.default);
}
}, {
key: 'shouldRender',
@@ -30847,9 +31385,8 @@ var PosterPlugin = function (_UIContainerPlugin) {
};
PosterPlugin.prototype.update = function update() {
- if (!this.shouldRender) {
- return;
- }
+ if (!this.shouldRender) return;
+
var showPlayButton = !this.playRequested && !this.hasStartedPlaying && !this.container.buffering;
this.showPlayButton(showPlayButton);
if (!this.hasStartedPlaying) {
@@ -30857,21 +31394,16 @@ var PosterPlugin = function (_UIContainerPlugin) {
this.$el.show();
} else {
this.container.enableMediaControl();
- if (this.shouldHideOnPlay()) {
- this.$el.hide();
- }
+ if (this.shouldHideOnPlay()) this.$el.hide();
}
};
PosterPlugin.prototype.render = function render() {
- if (!this.shouldRender) {
- return;
- }
- var style = _styler2.default.getStyleFor(_poster2.default, { baseUrl: this.options.baseUrl });
+ if (!this.shouldRender) return;
+
this.$el.html(this.template());
- this.$el.append(style);
- var isRegularPoster = this.options.poster && this.options.poster.custom == undefined;
+ var isRegularPoster = this.options.poster && this.options.poster.custom === undefined;
if (isRegularPoster) {
var posterUrl = this.options.poster.url || this.options.poster;
@@ -30879,6 +31411,7 @@ var PosterPlugin = function (_UIContainerPlugin) {
} else if (this.options.poster) {
this.$el.css({ 'background': this.options.poster.custom });
}
+
this.container.$el.append(this.el);
this.$playWrapper = this.$el.find('.play-wrapper');
this.$playWrapper.append(_play2.default);
@@ -30887,9 +31420,7 @@ var PosterPlugin = function (_UIContainerPlugin) {
this.$playButton.attr('data-poster', '');
var buttonsColor = this.options.mediacontrol && this.options.mediacontrol.buttons;
- if (buttonsColor) {
- this.$el.find('svg path').css('fill', buttonsColor);
- }
+ if (buttonsColor) this.$el.find('svg path').css('fill', buttonsColor);
if (this.options.mediacontrol && this.options.mediacontrol.buttons) {
buttonsColor = this.options.mediacontrol.buttons;
@@ -30900,34 +31431,67 @@ var PosterPlugin = function (_UIContainerPlugin) {
};
return PosterPlugin;
-}(_ui_container_plugin2.default);
+}(_ui_container_plugin2.default); //Copyright 2014 Globo.com Player authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
exports.default = PosterPlugin;
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(57)))
/***/ }),
-/* 190 */
+/* 202 */
+/***/ (function(module, exports) {
+
+module.exports = "<div class=\"play-wrapper\" data-poster></div>\n";
+
+/***/ }),
+/* 203 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(204);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./poster.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./poster.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 204 */
+/***/ (function(module, exports, __webpack_require__) {
+
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
// module
-exports.push([module.i, ".player-poster[data-poster] {\n display: -webkit-box;\n display: -moz-box;\n display: box;\n display: -webkit-flex;\n display: -moz-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -moz-box-pack: center;\n box-pack: center;\n -webkit-justify-content: center;\n -moz-justify-content: center;\n -ms-justify-content: center;\n -o-justify-content: center;\n justify-content: center;\n -ms-flex-pack: center;\n -webkit-box-align: center;\n -moz-box-align: center;\n box-align: center;\n -webkit-align-items: center;\n -moz-align-items: center;\n -ms-align-items: center;\n -o-align-items: center;\n align-items: center;\n -ms-flex-align: center;\n position: absolute;\n height: 100%;\n width: 100%;\n z-index: 998;\n top: 0;\n left: 0;\n background-color: #000;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: 50% 50%; }\n .player-poster[data-poster].clickable {\n cursor: pointer; }\n .player-poster[data-poster]:hover .play-wrapper[data-poster] {\n opacity: 1; }\n .player-poster[data-poster] .play-wrapper[data-poster] {\n width: 100%;\n height: 25%;\n margin: 0 auto;\n opacity: 0.75;\n -webkit-transition: opacity 0.1s ease;\n -moz-transition: opacity 0.1s ease;\n transition: opacity 0.1s ease; }\n .player-poster[data-poster] .play-wrapper[data-poster] svg {\n height: 100%; }\n .player-poster[data-poster] .play-wrapper[data-poster] svg path {\n fill: #fff; }\n", ""]);
+exports.push([module.i, ".player-poster[data-poster] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n position: absolute;\n height: 100%;\n width: 100%;\n z-index: 998;\n top: 0;\n left: 0;\n background-color: #000;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: 50% 50%; }\n .player-poster[data-poster].clickable {\n cursor: pointer; }\n .player-poster[data-poster]:hover .play-wrapper[data-poster] {\n opacity: 1; }\n .player-poster[data-poster] .play-wrapper[data-poster] {\n width: 100%;\n height: 25%;\n margin: 0 auto;\n opacity: 0.75;\n transition: opacity 0.1s ease; }\n .player-poster[data-poster] .play-wrapper[data-poster] svg {\n height: 100%; }\n .player-poster[data-poster] .play-wrapper[data-poster] svg path {\n fill: #fff; }\n", ""]);
// exports
/***/ }),
-/* 191 */
-/***/ (function(module, exports) {
-
-module.exports = "<div class=\"play-wrapper\" data-poster></div>\n";
-
-/***/ }),
-/* 192 */
+/* 205 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -30937,7 +31501,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _google_analytics = __webpack_require__(193);
+var _google_analytics = __webpack_require__(206);
var _google_analytics2 = _interopRequireDefault(_google_analytics);
@@ -30947,7 +31511,7 @@ exports.default = _google_analytics2.default;
module.exports = exports['default'];
/***/ }),
-/* 193 */
+/* 206 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -31092,9 +31656,7 @@ var GoogleAnalytics = function (_ContainerPlugin) {
};
GoogleAnalytics.prototype.onPlaybackChanged = function onPlaybackChanged(playbackState) {
- if (playbackState.type !== null) {
- this.push(['Video', 'Playback Type - ' + playbackState.type, this.container.playback.src]);
- }
+ if (playbackState.type !== null) this.push(['Video', 'Playback Type - ' + playbackState.type, this.container.playback.src]);
};
GoogleAnalytics.prototype.onDVR = function onDVR(dvrInUse) {
@@ -31130,7 +31692,7 @@ exports.default = GoogleAnalytics;
module.exports = exports['default'];
/***/ }),
-/* 194 */
+/* 207 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -31140,7 +31702,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _click_to_pause = __webpack_require__(195);
+var _click_to_pause = __webpack_require__(208);
var _click_to_pause2 = _interopRequireDefault(_click_to_pause);
@@ -31150,7 +31712,7 @@ exports.default = _click_to_pause2.default;
module.exports = exports['default'];
/***/ }),
-/* 195 */
+/* 208 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -31211,19 +31773,17 @@ var ClickToPausePlugin = function (_ContainerPlugin) {
ClickToPausePlugin.prototype.click = function click() {
if (this.container.getPlaybackType() !== _playback2.default.LIVE || this.container.isDvrEnabled()) {
- if (this.container.isPlaying()) {
- this.container.pause();
- } else {
- this.container.play();
- }
+ if (this.container.isPlaying()) this.container.pause();else this.container.play();
}
};
ClickToPausePlugin.prototype.settingsUpdate = function settingsUpdate() {
- this.container.$el.removeClass('pointer-enabled');
- if (this.container.getPlaybackType() !== _playback2.default.LIVE || this.container.isDvrEnabled()) {
- this.container.$el.addClass('pointer-enabled');
- }
+ var pointerEnabled = this.container.getPlaybackType() !== _playback2.default.LIVE || this.container.isDvrEnabled();
+ if (pointerEnabled === this.pointerEnabled) return;
+
+ var method = pointerEnabled ? 'addClass' : 'removeClass';
+ this.container.$el[method]('pointer-enabled');
+ this.pointerEnabled = pointerEnabled;
};
return ClickToPausePlugin;
@@ -31235,7 +31795,7 @@ exports.default = ClickToPausePlugin;
module.exports = exports['default'];
/***/ }),
-/* 196 */
+/* 209 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -31245,7 +31805,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _dvr_controls = __webpack_require__(197);
+var _dvr_controls = __webpack_require__(210);
var _dvr_controls2 = _interopRequireDefault(_dvr_controls);
@@ -31255,7 +31815,7 @@ exports.default = _dvr_controls2.default;
module.exports = exports['default'];
/***/ }),
-/* 197 */
+/* 210 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -31293,22 +31853,16 @@ var _playback = __webpack_require__(9);
var _playback2 = _interopRequireDefault(_playback);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
var _events = __webpack_require__(4);
var _events2 = _interopRequireDefault(_events);
-var _dvr_controls = __webpack_require__(198);
-
-var _dvr_controls2 = _interopRequireDefault(_dvr_controls);
-
-var _index = __webpack_require__(199);
+var _index = __webpack_require__(211);
var _index2 = _interopRequireDefault(_index);
+__webpack_require__(212);
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var DVRControls = function (_UICorePlugin) {
@@ -31365,6 +31919,7 @@ var DVRControls = function (_UICorePlugin) {
};
DVRControls.prototype.dvrChanged = function dvrChanged(dvrEnabled) {
+ if (this.core.getPlaybackType() !== _playback2.default.LIVE) return;
this.settingsUpdate();
this.core.mediaControl.$el.addClass('live');
if (dvrEnabled) {
@@ -31378,18 +31933,16 @@ var DVRControls = function (_UICorePlugin) {
DVRControls.prototype.click = function click() {
var mediaControl = this.core.mediaControl;
var container = mediaControl.container;
- if (!container.isPlaying()) {
- container.play();
- }
- if (mediaControl.$el.hasClass('dvr')) {
- container.seek(container.getDuration());
- }
+ if (!container.isPlaying()) container.play();
+
+ if (mediaControl.$el.hasClass('dvr')) container.seek(container.getDuration());
};
DVRControls.prototype.settingsUpdate = function settingsUpdate() {
var _this2 = this;
this.stopListening();
+ this.core.mediaControl.$el.removeClass('live');
if (this.shouldRender()) {
this.render();
this.$el.click(function () {
@@ -31405,12 +31958,10 @@ var DVRControls = function (_UICorePlugin) {
};
DVRControls.prototype.render = function render() {
- this.style = this.style || _styler2.default.getStyleFor(_dvr_controls2.default, { baseUrl: this.core.options.baseUrl });
this.$el.html(this.template({
live: this.core.i18n.t('live'),
backToLive: this.core.i18n.t('back_to_live')
}));
- this.$el.append(this.style);
if (this.shouldRender()) {
this.core.mediaControl.$el.addClass('live');
this.core.mediaControl.$('.media-control-left-panel[data-media-control]').append(this.$el);
@@ -31425,27 +31976,58 @@ exports.default = DVRControls;
module.exports = exports['default'];
/***/ }),
-/* 198 */
+/* 211 */
+/***/ (function(module, exports) {
+
+module.exports = "<div class=\"live-info\"><%= live %></div>\n<button type=\"button\" class=\"live-button\" aria-label=\"<%= backToLive %>\"><%= backToLive %></button>\n";
+
+/***/ }),
+/* 212 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(213);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./dvr_controls.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./dvr_controls.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 213 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
// module
-exports.push([module.i, ".dvr-controls[data-dvr-controls] {\n display: inline-block;\n float: left;\n color: #fff;\n line-height: 32px;\n font-size: 10px;\n font-weight: bold;\n margin-left: 6px; }\n .dvr-controls[data-dvr-controls] .live-info {\n cursor: default;\n font-family: \"Roboto\", \"Open Sans\", Arial, sans-serif;\n text-transform: uppercase; }\n .dvr-controls[data-dvr-controls] .live-info:before {\n content: \"\";\n display: inline-block;\n position: relative;\n width: 7px;\n height: 7px;\n border-radius: 3.5px;\n margin-right: 3.5px;\n background-color: #ff0101; }\n .dvr-controls[data-dvr-controls] .live-info.disabled {\n opacity: 0.3; }\n .dvr-controls[data-dvr-controls] .live-info.disabled:before {\n background-color: #fff; }\n .dvr-controls[data-dvr-controls] .live-button {\n cursor: pointer;\n outline: none;\n display: none;\n border: 0;\n color: #fff;\n background-color: transparent;\n height: 32px;\n padding: 0;\n opacity: 0.7;\n font-family: \"Roboto\", \"Open Sans\", Arial, sans-serif;\n text-transform: uppercase;\n -webkit-transition: all 0.1s ease;\n -moz-transition: all 0.1s ease;\n transition: all 0.1s ease; }\n .dvr-controls[data-dvr-controls] .live-button:before {\n content: \"\";\n display: inline-block;\n position: relative;\n width: 7px;\n height: 7px;\n border-radius: 3.5px;\n margin-right: 3.5px;\n background-color: #fff; }\n .dvr-controls[data-dvr-controls] .live-button:hover {\n opacity: 1;\n text-shadow: rgba(255, 255, 255, 0.75) 0 0 5px; }\n\n.dvr .dvr-controls[data-dvr-controls] .live-info {\n display: none; }\n\n.dvr .dvr-controls[data-dvr-controls] .live-button {\n display: block; }\n\n.dvr.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n background-color: #005aff; }\n\n.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n background-color: #ff0101; }\n", ""]);
+exports.push([module.i, ".dvr-controls[data-dvr-controls] {\n display: inline-block;\n float: left;\n color: #fff;\n line-height: 32px;\n font-size: 10px;\n font-weight: bold;\n margin-left: 6px; }\n .dvr-controls[data-dvr-controls] .live-info {\n cursor: default;\n font-family: \"Roboto\", \"Open Sans\", Arial, sans-serif;\n text-transform: uppercase; }\n .dvr-controls[data-dvr-controls] .live-info:before {\n content: \"\";\n display: inline-block;\n position: relative;\n width: 7px;\n height: 7px;\n border-radius: 3.5px;\n margin-right: 3.5px;\n background-color: #ff0101; }\n .dvr-controls[data-dvr-controls] .live-info.disabled {\n opacity: 0.3; }\n .dvr-controls[data-dvr-controls] .live-info.disabled:before {\n background-color: #fff; }\n .dvr-controls[data-dvr-controls] .live-button {\n cursor: pointer;\n outline: none;\n display: none;\n border: 0;\n color: #fff;\n background-color: transparent;\n height: 32px;\n padding: 0;\n opacity: 0.7;\n font-family: \"Roboto\", \"Open Sans\", Arial, sans-serif;\n text-transform: uppercase;\n transition: all 0.1s ease; }\n .dvr-controls[data-dvr-controls] .live-button:before {\n content: \"\";\n display: inline-block;\n position: relative;\n width: 7px;\n height: 7px;\n border-radius: 3.5px;\n margin-right: 3.5px;\n background-color: #fff; }\n .dvr-controls[data-dvr-controls] .live-button:hover {\n opacity: 1;\n text-shadow: rgba(255, 255, 255, 0.75) 0 0 5px; }\n\n.dvr .dvr-controls[data-dvr-controls] .live-info {\n display: none; }\n\n.dvr .dvr-controls[data-dvr-controls] .live-button {\n display: block; }\n\n.dvr.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n background-color: #005aff; }\n\n.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n background-color: #ff0101; }\n", ""]);
// exports
/***/ }),
-/* 199 */
-/***/ (function(module, exports) {
-
-module.exports = "<div class=\"live-info\"><%= live %></div>\n<button type=\"button\" class=\"live-button\" aria-label=\"<%= backToLive %>\"><%= backToLive %></button>\n";
-
-/***/ }),
-/* 200 */
+/* 214 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -31455,7 +32037,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _closed_captions = __webpack_require__(201);
+var _closed_captions = __webpack_require__(215);
var _closed_captions2 = _interopRequireDefault(_closed_captions);
@@ -31465,7 +32047,7 @@ exports.default = _closed_captions2.default;
module.exports = exports['default'];
/***/ }),
-/* 201 */
+/* 215 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -31499,25 +32081,19 @@ var _template = __webpack_require__(8);
var _template2 = _interopRequireDefault(_template);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
var _events = __webpack_require__(4);
var _events2 = _interopRequireDefault(_events);
-var _cc = __webpack_require__(202);
+var _cc = __webpack_require__(216);
var _cc2 = _interopRequireDefault(_cc);
-var _closed_captions = __webpack_require__(203);
+var _closed_captions = __webpack_require__(217);
var _closed_captions2 = _interopRequireDefault(_closed_captions);
-var _closed_captions3 = __webpack_require__(204);
-
-var _closed_captions4 = _interopRequireDefault(_closed_captions3);
+__webpack_require__(218);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -31531,7 +32107,7 @@ var ClosedCaptions = function (_UICorePlugin) {
}, {
key: 'template',
get: function get() {
- return (0, _template2.default)(_closed_captions4.default);
+ return (0, _template2.default)(_closed_captions2.default);
}
}, {
key: 'events',
@@ -31635,9 +32211,7 @@ var ClosedCaptions = function (_UICorePlugin) {
var tracks = this.container ? this.container.closedCaptionsTracks : [];
for (var i = 0; i < tracks.length; i++) {
tracks[i].label = this._labelCb(tracks[i]);
- }
-
- this.$el.html(this.template({
+ }this.$el.html(this.template({
ariaLabel: this._ariaLabel,
disabledLabel: this.core.i18n.t('disabled'),
title: this._title,
@@ -31650,18 +32224,10 @@ var ClosedCaptions = function (_UICorePlugin) {
};
ClosedCaptions.prototype.render = function render() {
- if (!this.style) {
- this.style = _styler2.default.getStyleFor(_closed_captions2.default, { baseUrl: this.core.options.baseUrl });
- }
-
this.renderCcButton();
var $fullscreen = this.core.mediaControl.$el.find('button[data-fullscreen]');
- if ($fullscreen[0]) {
- this.$el.insertAfter($fullscreen);
- } else {
- this.core.mediaControl.$el.find('.media-control-right-panel[data-media-control]').prepend(this.$el);
- }
+ if ($fullscreen[0]) this.$el.insertAfter($fullscreen);else this.core.mediaControl.$el.find('.media-control-right-panel[data-media-control]').prepend(this.$el);
return this;
};
@@ -31673,16 +32239,53 @@ exports.default = ClosedCaptions;
module.exports = exports['default'];
/***/ }),
-/* 202 */
+/* 216 */
/***/ (function(module, exports) {
module.exports = "<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 49 41.8\" style=\"enable-background:new 0 0 49 41.8;\" xml:space=\"preserve\"><path d=\"M47.1,0H3.2C1.6,0,0,1.2,0,2.8v31.5C0,35.9,1.6,37,3.2,37h11.9l3.2,1.9l4.7,2.7c0.9,0.5,2-0.1,2-1.1V37h22.1 c1.6,0,1.9-1.1,1.9-2.7V2.8C49,1.2,48.7,0,47.1,0z M7.2,18.6c0-4.8,3.5-9.3,9.9-9.3c4.8,0,7.1,2.7,7.1,2.7l-2.5,4 c0,0-1.7-1.7-4.2-1.7c-2.8,0-4.3,2.1-4.3,4.3c0,2.1,1.5,4.4,4.5,4.4c2.5,0,4.9-2.1,4.9-2.1l2.2,4.2c0,0-2.7,2.9-7.6,2.9 C10.8,27.9,7.2,23.5,7.2,18.6z M36.9,27.9c-6.4,0-9.9-4.4-9.9-9.3c0-4.8,3.5-9.3,9.9-9.3C41.7,9.3,44,12,44,12l-2.5,4 c0,0-1.7-1.7-4.2-1.7c-2.8,0-4.3,2.1-4.3,4.3c0,2.1,1.5,4.4,4.5,4.4c2.5,0,4.9-2.1,4.9-2.1l2.2,4.2C44.5,25,41.9,27.9,36.9,27.9z\"></path></svg>"
/***/ }),
-/* 203 */
+/* 217 */
+/***/ (function(module, exports) {
+
+module.exports = "<button type=\"button\" class=\"cc-button media-control-button media-control-icon\" data-cc-button aria-label=\"<%= ariaLabel %>\"></button>\n<ul>\n <% if (title) { %>\n <li data-title><%= title %></li>\n <% }; %>\n <li><a href=\"#\" data-cc-select=\"-1\"><%= disabledLabel %></a></li>\n <% for (var i = 0; i < tracks.length; i++) { %>\n <li><a href=\"#\" data-cc-select=\"<%= tracks[i].id %>\"><%= tracks[i].label %></a></li>\n <% }; %>\n</ul>\n";
+
+/***/ }),
+/* 218 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(219);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./closed_captions.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./closed_captions.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 219 */
+/***/ (function(module, exports, __webpack_require__) {
+
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
@@ -31693,13 +32296,7 @@ exports.push([module.i, ".cc-controls[data-cc-controls] {\n float: right;\n po
/***/ }),
-/* 204 */
-/***/ (function(module, exports) {
-
-module.exports = "<button type=\"button\" class=\"cc-button media-control-button media-control-icon\" data-cc-button aria-label=\"<%= ariaLabel %>\"></button>\n<ul>\n <% if (title) { %>\n <li data-title><%= title %></li>\n <% }; %>\n <li><a href=\"#\" data-cc-select=\"-1\"><%= disabledLabel %></a></li>\n <% for (var i = 0; i < tracks.length; i++) { %>\n <li><a href=\"#\" data-cc-select=\"<%= tracks[i].id %>\"><%= tracks[i].label %></a></li>\n <% }; %>\n</ul>\n";
-
-/***/ }),
-/* 205 */
+/* 220 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -31709,7 +32306,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _favicon = __webpack_require__(206);
+var _favicon = __webpack_require__(221);
var _favicon2 = _interopRequireDefault(_favicon);
@@ -31719,7 +32316,7 @@ exports.default = _favicon2.default;
module.exports = exports['default'];
/***/ }),
-/* 206 */
+/* 221 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -31808,9 +32405,7 @@ var Favicon = function (_CorePlugin) {
Favicon.prototype.bindEvents = function bindEvents() {
this.listenTo(this.core, _events2.default.CORE_OPTIONS_CHANGE, this.configure);
this.listenTo(this.core.mediaControl, _events2.default.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged);
- if (this.core.mediaControl.container) {
- this.containerChanged();
- }
+ if (this.core.mediaControl.container) this.containerChanged();
};
Favicon.prototype.containerChanged = function containerChanged() {
@@ -31849,16 +32444,14 @@ var Favicon = function (_CorePlugin) {
};
Favicon.prototype.setPlayIcon = function setPlayIcon() {
- if (!this.playIcon) {
- this.playIcon = this.createIcon(_play2.default);
- }
+ if (!this.playIcon) this.playIcon = this.createIcon(_play2.default);
+
this.changeIcon(this.playIcon);
};
Favicon.prototype.setPauseIcon = function setPauseIcon() {
- if (!this.pauseIcon) {
- this.pauseIcon = this.createIcon(_pause2.default);
- }
+ if (!this.pauseIcon) this.pauseIcon = this.createIcon(_pause2.default);
+
this.changeIcon(this.pauseIcon);
};
@@ -31881,7 +32474,7 @@ exports.default = Favicon;
module.exports = exports['default'];
/***/ }),
-/* 207 */
+/* 222 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -31891,7 +32484,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-var _seek_time = __webpack_require__(208);
+var _seek_time = __webpack_require__(223);
var _seek_time2 = _interopRequireDefault(_seek_time);
@@ -31901,7 +32494,7 @@ exports.default = _seek_time2.default;
module.exports = exports['default'];
/***/ }),
-/* 208 */
+/* 223 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -31933,10 +32526,6 @@ var _ui_core_plugin = __webpack_require__(38);
var _ui_core_plugin2 = _interopRequireDefault(_ui_core_plugin);
-var _styler = __webpack_require__(7);
-
-var _styler2 = _interopRequireDefault(_styler);
-
var _template = __webpack_require__(8);
var _template2 = _interopRequireDefault(_template);
@@ -31949,20 +32538,14 @@ var _playback = __webpack_require__(9);
var _playback2 = _interopRequireDefault(_playback);
-var _seek_time = __webpack_require__(209);
+var _seek_time = __webpack_require__(224);
var _seek_time2 = _interopRequireDefault(_seek_time);
-var _seek_time3 = __webpack_require__(210);
-
-var _seek_time4 = _interopRequireDefault(_seek_time3);
+__webpack_require__(225);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-// Copyright 2014 Globo.com Player authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
var SeekTime = function (_UICorePlugin) {
(0, _inherits3.default)(SeekTime, _UICorePlugin);
(0, _createClass3.default)(SeekTime, [{
@@ -31973,7 +32556,7 @@ var SeekTime = function (_UICorePlugin) {
}, {
key: 'template',
get: function get() {
- return (0, _template2.default)(_seek_time4.default);
+ return (0, _template2.default)(_seek_time2.default);
}
}, {
key: 'attributes',
@@ -32020,11 +32603,7 @@ var SeekTime = function (_UICorePlugin) {
_this.duration = null;
_this.actualLiveTime = !!_this.mediaControl.options.actualLiveTime;
if (_this.actualLiveTime) {
- if (_this.mediaControl.options.actualLiveServerTime) {
- _this.actualLiveServerTimeDiff = new Date().getTime() - new Date(_this.mediaControl.options.actualLiveServerTime).getTime();
- } else {
- _this.actualLiveServerTimeDiff = 0;
- }
+ if (_this.mediaControl.options.actualLiveServerTime) _this.actualLiveServerTimeDiff = new Date().getTime() - new Date(_this.mediaControl.options.actualLiveServerTime).getTime();else _this.actualLiveServerTimeDiff = 0;
}
return _this;
}
@@ -32075,12 +32654,11 @@ var SeekTime = function (_UICorePlugin) {
e = new Date(d);
secondsSinceMidnight = (e - d.setHours(0, 0, 0, 0)) / 1000;
seekTime = secondsSinceMidnight - this.duration + this.hoverPosition * this.duration;
- if (seekTime < 0) {
- seekTime += 86400;
- }
+ if (seekTime < 0) seekTime += 86400;
} else {
seekTime = this.hoverPosition * this.duration;
}
+
return { seekTime: seekTime, secondsSinceMidnight: secondsSinceMidnight };
};
@@ -32131,9 +32709,7 @@ var SeekTime = function (_UICorePlugin) {
this.rendered = true;
this.displayedDuration = null;
this.displayedSeekTime = null;
- var style = _styler2.default.getStyleFor(_seek_time2.default);
this.$el.html(this.template());
- this.$el.append(style);
this.$el.hide();
this.mediaControl.$el.append(this.el);
this.$seekTimeEl = this.$el.find('[data-seek-time]');
@@ -32143,33 +32719,66 @@ var SeekTime = function (_UICorePlugin) {
};
return SeekTime;
-}(_ui_core_plugin2.default);
+}(_ui_core_plugin2.default); // Copyright 2014 Globo.com Player authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
exports.default = SeekTime;
module.exports = exports['default'];
/***/ }),
-/* 209 */
+/* 224 */
+/***/ (function(module, exports) {
+
+module.exports = "<span data-seek-time></span>\n<span data-duration></span>\n";
+
+/***/ }),
+/* 225 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// style-loader: Adds some css to the DOM by adding a <style> tag
+
+// load the styles
+var content = __webpack_require__(226);
+if(typeof content === 'string') content = [[module.i, content, '']];
+// Prepare cssTransformation
+var transform;
+
+var options = {"singleton":true,"hmr":true}
+options.transform = transform
+// add the styles to the DOM
+var update = __webpack_require__(10)(content, options);
+if(content.locals) module.exports = content.locals;
+// Hot Module Replacement
+if(false) {
+ // When the styles change, update the <style> tags
+ if(!content.locals) {
+ module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./seek_time.scss", function() {
+ var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/postcss-loader/lib/index.js!../../../../node_modules/sass-loader/lib/loader.js?includePaths[]=/Users/bruno/workspace/player/clappr/src/base/scss!./seek_time.scss");
+ if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
+ update(newContent);
+ });
+ }
+ // When the module is disposed, remove the <style> tags
+ module.hot.dispose(function() { update(); });
+}
+
+/***/ }),
+/* 226 */
/***/ (function(module, exports, __webpack_require__) {
-exports = module.exports = __webpack_require__(10)(undefined);
+exports = module.exports = __webpack_require__(7)(undefined);
// imports
// module
-exports.push([module.i, ".seek-time[data-seek-time] {\n position: absolute;\n white-space: nowrap;\n height: 20px;\n line-height: 20px;\n font-size: 0;\n left: -100%;\n bottom: 55px;\n background-color: rgba(2, 2, 2, 0.5);\n z-index: 9999;\n -webkit-transition: opacity 0.1s ease;\n -moz-transition: opacity 0.1s ease;\n transition: opacity 0.1s ease; }\n .seek-time[data-seek-time].hidden[data-seek-time] {\n opacity: 0; }\n .seek-time[data-seek-time] [data-seek-time] {\n display: inline-block;\n color: white;\n font-size: 10px;\n padding-left: 7px;\n padding-right: 7px;\n vertical-align: top; }\n .seek-time[data-seek-time] [data-duration] {\n display: inline-block;\n color: rgba(255, 255, 255, 0.5);\n font-size: 10px;\n padding-right: 7px;\n vertical-align: top; }\n .seek-time[data-seek-time] [data-duration]:before {\n content: \"|\";\n margin-right: 7px; }\n", ""]);
+exports.push([module.i, ".seek-time[data-seek-time] {\n position: absolute;\n white-space: nowrap;\n height: 20px;\n line-height: 20px;\n font-size: 0;\n left: -100%;\n bottom: 55px;\n background-color: rgba(2, 2, 2, 0.5);\n z-index: 9999;\n transition: opacity 0.1s ease; }\n .seek-time[data-seek-time].hidden[data-seek-time] {\n opacity: 0; }\n .seek-time[data-seek-time] [data-seek-time] {\n display: inline-block;\n color: white;\n font-size: 10px;\n padding-left: 7px;\n padding-right: 7px;\n vertical-align: top; }\n .seek-time[data-seek-time] [data-duration] {\n display: inline-block;\n color: rgba(255, 255, 255, 0.5);\n font-size: 10px;\n padding-right: 7px;\n vertical-align: top; }\n .seek-time[data-seek-time] [data-duration]:before {\n content: \"|\";\n margin-right: 7px; }\n", ""]);
// exports
/***/ }),
-/* 210 */
-/***/ (function(module, exports) {
-
-module.exports = "<span data-seek-time></span>\n<span data-duration></span>\n";
-
-/***/ }),
-/* 211 */
+/* 227 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -32223,9 +32832,7 @@ var SourcesPlugin = function (_CorePlugin) {
})[0] || this.core.containers[0];
if (firstValidSource) {
this.core.containers.forEach(function (container) {
- if (container !== firstValidSource) {
- container.destroy();
- }
+ if (container !== firstValidSource) container.destroy();
});
}
};
@@ -32243,7 +32850,7 @@ exports.default = SourcesPlugin;
module.exports = exports['default'];
/***/ }),
-/* 212 */
+/* 228 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -32305,9 +32912,7 @@ var EndVideo = function (_CorePlugin) {
EndVideo.prototype.ended = function ended() {
var exitOnEnd = typeof this.core.options.exitFullscreenOnEnd === 'undefined' || this.core.options.exitFullscreenOnEnd;
- if (exitOnEnd && _utils.Fullscreen.isFullscreen()) {
- this.core.toggleFullscreen();
- }
+ if (exitOnEnd && _utils.Fullscreen.isFullscreen()) this.core.toggleFullscreen();
};
(0, _createClass3.default)(EndVideo, [{
@@ -32323,7 +32928,7 @@ exports.default = EndVideo;
module.exports = exports['default'];
/***/ }),
-/* 213 */
+/* 229 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -32444,6 +33049,12 @@ var Strings = function (_CorePlugin) {
'back_to_live': 'canlı yayına dön',
'disabled': 'Engelli',
'playback_not_supported': 'Tarayıcınız bu videoyu oynatma desteğine sahip değil. Lütfen farklı bir tarayıcı ile deneyin.'
+ },
+ 'et': {
+ 'live': 'Otseülekanne',
+ 'back_to_live': 'Tagasi otseülekande juurde',
+ 'disabled': 'Keelatud',
+ 'playback_not_supported': 'Teie brauser ei toeta selle video taasesitust. Proovige kasutada muud brauserit.'
}
};
var strings = this.core.options.strings || {};
@@ -32457,6 +33068,7 @@ var Strings = function (_CorePlugin) {
this._messages['es-419'] = this._messages['es'];
this._messages['fr-FR'] = this._messages['fr'];
this._messages['tr-TR'] = this._messages['tr'];
+ this._messages['et-EE'] = this._messages['et'];
};
return Strings;
diff --git a/assets/clapprio/clappr.min.js b/assets/clapprio/clappr.min.js
index 963fde4..0e4e7b0 100644
--- a/assets/clapprio/clappr.min.js
+++ b/assets/clapprio/clappr.min.js
@@ -1 +1 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Clappr=e():t.Clappr=e()}(this,function(){return function(t){function e(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="<%=baseUrl%>/",e(e.s=87)}([function(t,e,i){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,i){"use strict";e.__esModule=!0;var r=i(33),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,n.default)(e))&&"function"!=typeof e?t:e}},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(119),a=r(n),o=i(71),s=r(o),l=i(33),u=r(l);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,u.default)(e)));t.prototype=(0,s.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(a.default?(0,a.default)(t,e):t.__proto__=e)}},function(t,e,i){"use strict";e.__esModule=!0;var r=i(70),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,n.default)(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}()},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(31),a=r(n),o=i(0),s=r(o),l=i(33),u=r(l),d=i(55),c=r(d),f=i(5),h=Array.prototype.slice,p=/\s+/,g=function(t,e,i,r){if(!i)return!0;if("object"===(void 0===i?"undefined":(0,u.default)(i))){for(var n in i)t[e].apply(t,[n,i[n]].concat(r));return!1}if(p.test(i)){for(var a=i.split(p),o=0,s=a.length;o<s;o++)t[e].apply(t,[a[o]].concat(r));return!1}return!0},y=function(t,e,i,r){function n(){try{switch(e.length){case 0:for(;++o<s;)(a=t[o]).callback.call(a.ctx);return;case 1:for(;++o<s;)(a=t[o]).callback.call(a.ctx,l);return;case 2:for(;++o<s;)(a=t[o]).callback.call(a.ctx,l,u);return;case 3:for(;++o<s;)(a=t[o]).callback.call(a.ctx,l,u,d);return;default:for(;++o<s;)(a=t[o]).callback.apply(a.ctx,e);return}}catch(t){c.default.error.apply(c.default,[i,"error on event",r,"trigger","-",t]),n()}}var a=void 0,o=-1,s=t.length,l=e[0],u=e[1],d=e[2];n()},v=function(){function t(){(0,s.default)(this,t)}return t.prototype.on=function(t,e,i){return g(this,"on",t,[e,i])&&e?(this._events||(this._events={}),(this._events[t]||(this._events[t]=[])).push({callback:e,context:i,ctx:i||this}),this):this},t.prototype.once=function(t,e,i){var r=this;if(!g(this,"once",t,[e,i])||!e)return this;var n=function(){return r.off(t,a)},a=function(){n(),e.apply(this,arguments)};return this.on(t,a,i)},t.prototype.off=function(t,e,i){var r=void 0,n=void 0,o=void 0,s=void 0,l=void 0,u=void 0,d=void 0,c=void 0;if(!this._events||!g(this,"off",t,[e,i]))return this;if(!t&&!e&&!i)return this._events=void 0,this;for(s=t?[t]:(0,a.default)(this._events),l=0,u=s.length;l<u;l++)if(t=s[l],o=this._events[t]){if(this._events[t]=r=[],e||i)for(d=0,c=o.length;d<c;d++)n=o[d],(e&&e!==n.callback&&e!==n.callback._callback||i&&i!==n.context)&&r.push(n);r.length||delete this._events[t]}return this},t.prototype.trigger=function(t){var e=this.name||this.constructor.name;if(c.default.debug.apply(c.default,[e].concat(Array.prototype.slice.call(arguments))),!this._events)return this;var i=h.call(arguments,1);if(!g(this,"trigger",t,i))return this;var r=this._events[t],n=this._events.all;return r&&y(r,i,e,t),n&&y(n,arguments,e,t),this},t.prototype.stopListening=function(t,e,i){var r=this._listeningTo;if(!r)return this;var n=!e&&!i;i||"object"!==(void 0===e?"undefined":(0,u.default)(e))||(i=this),t&&((r={})[t._listenId]=t);for(var o in r)t=r[o],t.off(e,i,this),(n||0===(0,a.default)(t._events).length)&&delete this._listeningTo[o];return this},t.register=function(e){t.Custom||(t.Custom={});var i="string"==typeof e&&e.toUpperCase().trim();i&&!t.Custom[i]?t.Custom[i]=i.toLowerCase().split("_").map(function(t,e){return 0==e?t:t=t[0].toUpperCase()+t.slice(1)}).join(""):c.default.error("Events","Error when register event: "+e)},t.listAvailableCustomEvents=function(){return t.Custom||(t.Custom={}),(0,a.default)(t.Custom).filter(function(e){return"string"==typeof t.Custom[e]})},t}();e.default=v;var m={listenTo:"on",listenToOnce:"once"};(0,a.default)(m).forEach(function(t){v.prototype[t]=function(e,i,r){return(this._listeningTo||(this._listeningTo={}))[e._listenId||(e._listenId=(0,f.uniqueId)("l"))]=e,r||"object"!==(void 0===i?"undefined":(0,u.default)(i))||(r=this),e[m[t]](i,r,this),this}}),v.PLAYER_READY="ready",v.PLAYER_RESIZE="resize",v.PLAYER_FULLSCREEN="fullscreen",v.PLAYER_PLAY="play",v.PLAYER_PAUSE="pause",v.PLAYER_STOP="stop",v.PLAYER_ENDED="ended",v.PLAYER_SEEK="seek",v.PLAYER_ERROR="error",v.PLAYER_TIMEUPDATE="timeupdate",v.PLAYER_VOLUMEUPDATE="volumeupdate",v.PLAYER_SUBTITLE_AVAILABLE="subtitleavailable",v.PLAYBACK_PROGRESS="playback:progress",v.PLAYBACK_TIMEUPDATE="playback:timeupdate",v.PLAYBACK_READY="playback:ready",v.PLAYBACK_BUFFERING="playback:buffering",v.PLAYBACK_BUFFERFULL="playback:bufferfull",v.PLAYBACK_SETTINGSUPDATE="playback:settingsupdate",v.PLAYBACK_LOADEDMETADATA="playback:loadedmetadata",v.PLAYBACK_HIGHDEFINITIONUPDATE="playback:highdefinitionupdate",v.PLAYBACK_BITRATE="playback:bitrate",v.PLAYBACK_LEVELS_AVAILABLE="playback:levels:available",v.PLAYBACK_LEVEL_SWITCH_START="playback:levels:switch:start",v.PLAYBACK_LEVEL_SWITCH_END="playback:levels:switch:end",v.PLAYBACK_PLAYBACKSTATE="playback:playbackstate",v.PLAYBACK_DVR="playback:dvr",v.PLAYBACK_MEDIACONTROL_DISABLE="playback:mediacontrol:disable",v.PLAYBACK_MEDIACONTROL_ENABLE="playback:mediacontrol:enable",v.PLAYBACK_ENDED="playback:ended",v.PLAYBACK_PLAY_INTENT="playback:play:intent",v.PLAYBACK_PLAY="playback:play",v.PLAYBACK_PAUSE="playback:pause",v.PLAYBACK_STOP="playback:stop",v.PLAYBACK_ERROR="playback:error",v.PLAYBACK_STATS_ADD="playback:stats:add",v.PLAYBACK_FRAGMENT_LOADED="playback:fragment:loaded",v.PLAYBACK_LEVEL_SWITCH="playback:level:switch",v.PLAYBACK_SUBTITLE_AVAILABLE="playback:subtitle:available",v.PLAYBACK_SUBTITLE_CHANGED="playback:subtitle:changed",v.CORE_CONTAINERS_CREATED="core:containers:created",v.CORE_OPTIONS_CHANGE="core:options:change",v.CORE_READY="core:ready",v.CORE_FULLSCREEN="core:fullscreen",v.CORE_SCREEN_ORIENTATION_CHANGED="core:screen:orientation:changed",v.CONTAINER_PLAYBACKSTATE="container:playbackstate",v.CONTAINER_PLAYBACKDVRSTATECHANGED="container:dvr",v.CONTAINER_BITRATE="container:bitrate",v.CONTAINER_STATS_REPORT="container:stats:report",v.CONTAINER_DESTROYED="container:destroyed",v.CONTAINER_READY="container:ready",v.CONTAINER_ERROR="container:error",v.CONTAINER_LOADEDMETADATA="container:loadedmetadata",v.CONTAINER_SUBTITLE_AVAILABLE="container:subtitle:available",v.CONTAINER_SUBTITLE_CHANGED="container:subtitle:changed",v.CONTAINER_TIMEUPDATE="container:timeupdate",v.CONTAINER_PROGRESS="container:progress",v.CONTAINER_PLAY="container:play",v.CONTAINER_STOP="container:stop",v.CONTAINER_PAUSE="container:pause",v.CONTAINER_ENDED="container:ended",v.CONTAINER_CLICK="container:click",v.CONTAINER_DBLCLICK="container:dblclick",v.CONTAINER_CONTEXTMENU="container:contextmenu",v.CONTAINER_MOUSE_ENTER="container:mouseenter",v.CONTAINER_MOUSE_LEAVE="container:mouseleave",v.CONTAINER_SEEK="container:seek",v.CONTAINER_VOLUME="container:volume",v.CONTAINER_FULLSCREEN="container:fullscreen",v.CONTAINER_STATE_BUFFERING="container:state:buffering",v.CONTAINER_STATE_BUFFERFULL="container:state:bufferfull",v.CONTAINER_SETTINGSUPDATE="container:settingsupdate",v.CONTAINER_HIGHDEFINITIONUPDATE="container:highdefinitionupdate",v.CONTAINER_MEDIACONTROL_SHOW="container:mediacontrol:show",v.CONTAINER_MEDIACONTROL_HIDE="container:mediacontrol:hide",v.CONTAINER_MEDIACONTROL_DISABLE="container:mediacontrol:disable",v.CONTAINER_MEDIACONTROL_ENABLE="container:mediacontrol:enable",v.CONTAINER_STATS_ADD="container:stats:add",v.CONTAINER_OPTIONS_CHANGE="container:options:change",v.MEDIACONTROL_RENDERED="mediacontrol:rendered",v.MEDIACONTROL_FULLSCREEN="mediacontrol:fullscreen",v.MEDIACONTROL_SHOW="mediacontrol:show",v.MEDIACONTROL_HIDE="mediacontrol:hide",v.MEDIACONTROL_MOUSEMOVE_SEEKBAR="mediacontrol:mousemove:seekbar",v.MEDIACONTROL_MOUSELEAVE_SEEKBAR="mediacontrol:mouseleave:seekbar",v.MEDIACONTROL_PLAYING="mediacontrol:playing",v.MEDIACONTROL_NOTPLAYING="mediacontrol:notplaying",v.MEDIACONTROL_CONTAINERCHANGED="mediacontrol:containerchanged",t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(e)for(var i in e){var r=(0,S.default)(e,i);r?(0,k.default)(t,i,r):t[i]=e[i]}return t}function a(t,e){var i=function(t){function i(){(0,v.default)(this,i);for(var r=arguments.length,n=Array(r),a=0;a<r;a++)n[a]=arguments[a];var o=(0,b.default)(this,t.call.apply(t,[this].concat(n)));return e.initialize&&e.initialize.apply(o,n),o}return(0,E.default)(i,t),i}(t);return n(i.prototype,e),i}function o(t,e){if(!isFinite(t))return"--:--";t*=1e3,t=parseInt(t/1e3);var i=t%60;t=parseInt(t/60);var r=t%60;t=parseInt(t/60);var n=t%24,a=parseInt(t/24),o="";return a&&a>0&&(o+=a+":",n<1&&(o+="00:")),(n&&n>0||e)&&(o+=("0"+n).slice(-2)+":"),o+=("0"+r).slice(-2)+":",o+=("0"+i).slice(-2),o.trim()}function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"t",e=0,i=P.params[t]||P.hashParams[t]||"",r=i.match(/[0-9]+[hms]+/g)||[];return r.length>0?function(){var t={h:3600,m:60,s:1};r.forEach(function(i){if(i){var r=i[i.length-1],n=parseInt(i.slice(0,i.length-1),10);e+=n*t[r]}})}():i&&(e=parseInt(i,10)),e}function l(t){return I[t]||(I[t]=0),t+ ++I[t]}function u(t){return t-parseFloat(t)+1>=0}function d(){var t=document.getElementsByTagName("script");return t.length?t[t.length-1].src:""}function c(){return window.navigator&&window.navigator.language}function f(){return window.performance&&window.performance.now?performance.now():Date.now()}function h(t,e){var i=t.indexOf(e);i>=0&&t.splice(i,1)}Object.defineProperty(e,"__esModule",{value:!0}),e.DomRecycler=e.cancelAnimationFrame=e.requestAnimationFrame=e.QueryString=e.Config=e.Fullscreen=void 0;var p=i(3),g=r(p),y=i(0),v=r(y),m=i(1),b=r(m),_=i(2),E=r(_),T=i(70),k=r(T),A=i(125),S=r(A);e.extend=a,e.formatTime=o,e.seekStringToSeconds=s,e.uniqueId=l,e.isNumber=u,e.currentScriptUrl=d,e.getBrowserLanguage=c,e.now=f,e.removeArrayItem=h,i(128);var L=i(13),R=r(L),w=i(6),C=r(w),O=e.Fullscreen={isFullscreen:function(){return!!(document.webkitFullscreenElement||document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)},requestFullscreen:function(t){t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen?t.msRequestFullscreen():t.querySelector&&t.querySelector("video")&&t.querySelector("video").webkitEnterFullScreen?t.querySelector("video").webkitEnterFullScreen():t.webkitEnterFullScreen&&t.webkitEnterFullScreen()},cancelFullscreen:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;t.exitFullscreen?t.exitFullscreen():t.webkitCancelFullScreen?t.webkitCancelFullScreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen()},fullscreenEnabled:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},D=e.Config=function(){function t(){(0,v.default)(this,t)}return t._defaultConfig=function(){return{volume:{value:100,parse:parseInt}}},t._defaultValueFor=function(t){try{return this._defaultConfig()[t].parse(this._defaultConfig()[t].value)}catch(t){return}},t._createKeyspace=function(t){return"clappr."+document.domain+"."+t},t.restore=function(t){return R.default.hasLocalstorage&&localStorage[this._createKeyspace(t)]?this._defaultConfig()[t].parse(localStorage[this._createKeyspace(t)]):this._defaultValueFor(t)},t.persist=function(t,e){if(R.default.hasLocalstorage)try{return localStorage[this._createKeyspace(t)]=e,!0}catch(t){return!1}},t}(),P=e.QueryString=function(){function t(){(0,v.default)(this,t)}return t.parse=function(t){for(var e=void 0,i=/\+/g,r=/([^&=]+)=?([^&]*)/g,n=function(t){return decodeURIComponent(t.replace(i," "))},a={};e=r.exec(t);)a[n(e[1]).toLowerCase()]=n(e[2]);return a},(0,g.default)(t,null,[{key:"params",get:function(){var t=window.location.search.substring(1);return t!==this.query&&(this._urlParams=this.parse(t),this.query=t),this._urlParams}},{key:"hashParams",get:function(){var t=window.location.hash.substring(1);return t!==this.hash&&(this._hashParams=this.parse(t),this.hash=t),this._hashParams}}]),t}(),I={},x=e.requestAnimationFrame=(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}).bind(window),N=e.cancelAnimationFrame=(window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout).bind(window),M=[],F=e.DomRecycler=function(){function t(){(0,v.default)(this,t)}return t.configure=function(t){this.options=C.default.extend(this.options,t)},t.create=function(t){return this.options.recycleVideo&&"video"===t&&M.length>0?M.shift():(0,C.default)("<"+t+">")},t.garbage=function(t){this.options.recycleVideo&&"VIDEO"===t[0].tagName.toUpperCase()&&(t.children().remove(),M.push(t))},t}();F.options={recycleVideo:!1},e.default={Config:D,Fullscreen:O,QueryString:P,DomRecycler:F,extend:a,formatTime:o,seekStringToSeconds:s,uniqueId:l,currentScriptUrl:d,isNumber:u,requestAnimationFrame:x,cancelAnimationFrame:N,getBrowserLanguage:c,now:f,removeArrayItem:h}},function(t,e){var i=function(){function t(t){return null==t?String(t):W[q.call(t)]||"object"}function e(e){return"function"==t(e)}function i(t){return null!=t&&t==t.window}function r(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function n(e){return"object"==t(e)}function a(t){return n(t)&&!i(t)&&Object.getPrototypeOf(t)==Object.prototype}function o(t){var e=!!t&&"length"in t&&t.length,r=A.type(t);return"function"!=r&&!i(t)&&("array"==r||0===e||"number"==typeof e&&e>0&&e-1 in t)}function s(t){return O.call(t,function(t){return null!=t})}function l(t){return t.length>0?A.fn.concat.apply([],t):t}function u(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function d(t){return t in x?x[t]:x[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function c(t,e){return"number"!=typeof e||N[u(t)]?e:e+"px"}function f(t){var e,i;return I[t]||(e=P.createElement(t),P.body.appendChild(e),i=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==i&&(i="block"),I[t]=i),I[t]}function h(t){return"children"in t?D.call(t.children):A.map(t.childNodes,function(t){if(1==t.nodeType)return t})}function p(t,e){var i,r=t?t.length:0;for(i=0;i<r;i++)this[i]=t[i];this.length=r,this.selector=e||""}function g(t,e,i){for(k in e)i&&(a(e[k])||Q(e[k]))?(a(e[k])&&!a(t[k])&&(t[k]={}),Q(e[k])&&!Q(t[k])&&(t[k]=[]),g(t[k],e[k],i)):e[k]!==T&&(t[k]=e[k])}function y(t,e){return null==e?A(t):A(t).filter(e)}function v(t,i,r,n){return e(i)?i.call(t,r,n):i}function m(t,e,i){null==i?t.removeAttribute(e):t.setAttribute(e,i)}function b(t,e){var i=t.className||"",r=i&&i.baseVal!==T;if(e===T)return r?i.baseVal:i;r?i.baseVal=e:t.className=e}function _(t){try{return t?"true"==t||"false"!=t&&("null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?A.parseJSON(t):t):t}catch(e){return t}}function E(t,e){e(t);for(var i=0,r=t.childNodes.length;i<r;i++)E(t.childNodes[i],e)}var T,k,A,S,L,R,w=[],C=w.concat,O=w.filter,D=w.slice,P=window.document,I={},x={},N={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},M=/^\s*<(\w+|!)[^>]*>/,F=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,B=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,U=/^(?:body|html)$/i,G=/([A-Z])/g,j=["val","css","html","text","data","width","height","offset"],V=["after","prepend","before","append"],K=P.createElement("table"),Y=P.createElement("tr"),H={tr:P.createElement("tbody"),tbody:K,thead:K,tfoot:K,td:Y,th:Y,"*":P.createElement("div")},$=/complete|loaded|interactive/,z=/^[\w-]*$/,W={},q=W.toString,X={},Z=P.createElement("div"),J={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Q=Array.isArray||function(t){return t instanceof Array};return X.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var i=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(i)return i.call(t,e);var r,n=t.parentNode,a=!n;return a&&(n=Z).appendChild(t),r=~X.qsa(n,e).indexOf(t),a&&Z.removeChild(t),r},L=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},R=function(t){return O.call(t,function(e,i){return t.indexOf(e)==i})},X.fragment=function(t,e,i){var r,n,o;return F.test(t)&&(r=A(P.createElement(RegExp.$1))),r||(t.replace&&(t=t.replace(B,"<$1></$2>")),e===T&&(e=M.test(t)&&RegExp.$1),e in H||(e="*"),o=H[e],o.innerHTML=""+t,r=A.each(D.call(o.childNodes),function(){o.removeChild(this)})),a(i)&&(n=A(r),A.each(i,function(t,e){j.indexOf(t)>-1?n[t](e):n.attr(t,e)})),r},X.Z=function(t,e){return new p(t,e)},X.isZ=function(t){return t instanceof X.Z},X.init=function(t,i){var r;if(!t)return X.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&M.test(t))r=X.fragment(t,RegExp.$1,i),t=null;else{if(i!==T)return A(i).find(t);r=X.qsa(P,t)}else{if(e(t))return A(P).ready(t);if(X.isZ(t))return t;if(Q(t))r=s(t);else if(n(t))r=[t],t=null;else if(M.test(t))r=X.fragment(t.trim(),RegExp.$1,i),t=null;else{if(i!==T)return A(i).find(t);r=X.qsa(P,t)}}return X.Z(r,t)},A=function(t,e){return X.init(t,e)},A.extend=function(t){var e,i=D.call(arguments,1);return"boolean"==typeof t&&(e=t,t=i.shift()),i.forEach(function(i){g(t,i,e)}),t},X.qsa=function(t,e){var i,r="#"==e[0],n=!r&&"."==e[0],a=r||n?e.slice(1):e,o=z.test(a);return t.getElementById&&o&&r?(i=t.getElementById(a))?[i]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:D.call(o&&!r&&t.getElementsByClassName?n?t.getElementsByClassName(a):t.getElementsByTagName(e):t.querySelectorAll(e))},A.contains=P.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},A.type=t,A.isFunction=e,A.isWindow=i,A.isArray=Q,A.isPlainObject=a,A.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},A.isNumeric=function(t){var e=Number(t),i=typeof t;return null!=t&&"boolean"!=i&&("string"!=i||t.length)&&!isNaN(e)&&isFinite(e)||!1},A.inArray=function(t,e,i){return w.indexOf.call(e,t,i)},A.camelCase=L,A.trim=function(t){return null==t?"":String.prototype.trim.call(t)},A.uuid=0,A.support={},A.expr={},A.noop=function(){},A.map=function(t,e){var i,r,n,a=[];if(o(t))for(r=0;r<t.length;r++)null!=(i=e(t[r],r))&&a.push(i);else for(n in t)null!=(i=e(t[n],n))&&a.push(i);return l(a)},A.each=function(t,e){var i,r;if(o(t)){for(i=0;i<t.length;i++)if(!1===e.call(t[i],i,t[i]))return t}else for(r in t)if(!1===e.call(t[r],r,t[r]))return t;return t},A.grep=function(t,e){return O.call(t,e)},window.JSON&&(A.parseJSON=JSON.parse),A.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){W["[object "+e+"]"]=e.toLowerCase()}),A.fn={constructor:X.Z,length:0,forEach:w.forEach,reduce:w.reduce,push:w.push,sort:w.sort,splice:w.splice,indexOf:w.indexOf,concat:function(){var t,e,i=[];for(t=0;t<arguments.length;t++)e=arguments[t],i[t]=X.isZ(e)?e.toArray():e;return C.apply(X.isZ(this)?this.toArray():this,i)},map:function(t){return A(A.map(this,function(e,i){return t.call(e,i,e)}))},slice:function(){return A(D.apply(this,arguments))},ready:function(t){return $.test(P.readyState)&&P.body?t(A):P.addEventListener("DOMContentLoaded",function(){t(A)},!1),this},get:function(t){return t===T?D.call(this):this[t>=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return w.every.call(this,function(e,i){return!1!==t.call(e,i,e)}),this},filter:function(t){return e(t)?this.not(this.not(t)):A(O.call(this,function(e){return X.matches(e,t)}))},add:function(t,e){return A(R(this.concat(A(t,e))))},is:function(t){return this.length>0&&X.matches(this[0],t)},not:function(t){var i=[];if(e(t)&&t.call!==T)this.each(function(e){t.call(this,e)||i.push(this)});else{var r="string"==typeof t?this.filter(t):o(t)&&e(t.item)?D.call(t):A(t);this.forEach(function(t){r.indexOf(t)<0&&i.push(t)})}return A(i)},has:function(t){return this.filter(function(){return n(t)?A.contains(this,t):A(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!n(t)?t:A(t)},last:function(){var t=this[this.length-1];return t&&!n(t)?t:A(t)},find:function(t){var e=this;return t?"object"==typeof t?A(t).filter(function(){var t=this;return w.some.call(e,function(e){return A.contains(e,t)})}):1==this.length?A(X.qsa(this[0],t)):this.map(function(){return X.qsa(this,t)}):A()},closest:function(t,e){var i=[],n="object"==typeof t&&A(t);return this.each(function(a,o){for(;o&&!(n?n.indexOf(o)>=0:X.matches(o,t));)o=o!==e&&!r(o)&&o.parentNode;o&&i.indexOf(o)<0&&i.push(o)}),A(i)},parents:function(t){for(var e=[],i=this;i.length>0;)i=A.map(i,function(t){if((t=t.parentNode)&&!r(t)&&e.indexOf(t)<0)return e.push(t),t});return y(e,t)},parent:function(t){return y(R(this.pluck("parentNode")),t)},children:function(t){return y(this.map(function(){return h(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||D.call(this.childNodes)})},siblings:function(t){return y(this.map(function(t,e){return O.call(h(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return A.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=f(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var i=e(t);if(this[0]&&!i)var r=A(t).get(0),n=r.parentNode||this.length>1;return this.each(function(e){A(this).wrapAll(i?t.call(this,e):n?r.cloneNode(!0):r)})},wrapAll:function(t){if(this[0]){A(this[0]).before(t=A(t));for(var e;(e=t.children()).length;)t=e.first();A(t).append(this)}return this},wrapInner:function(t){var i=e(t);return this.each(function(e){var r=A(this),n=r.contents(),a=i?t.call(this,e):t;n.length?n.wrapAll(a):r.append(a)})},unwrap:function(){return this.parent().each(function(){A(this).replaceWith(A(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=A(this);(t===T?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return A(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return A(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var i=this.innerHTML;A(this).empty().append(v(this,t,e,i))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var i=v(this,t,e,this.textContent);this.textContent=null==i?"":""+i}):0 in this?this.pluck("textContent").join(""):null},attr:function(t,e){var i;return"string"!=typeof t||1 in arguments?this.each(function(i){if(1===this.nodeType)if(n(t))for(k in t)m(this,k,t[k]);else m(this,t,v(this,e,i,this.getAttribute(t)))}):0 in this&&1==this[0].nodeType&&null!=(i=this[0].getAttribute(t))?i:T},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){m(this,t)},this)})},prop:function(t,e){return t=J[t]||t,1 in arguments?this.each(function(i){this[t]=v(this,e,i,this[t])}):this[0]&&this[0][t]},removeProp:function(t){return t=J[t]||t,this.each(function(){delete this[t]})},data:function(t,e){var i="data-"+t.replace(G,"-$1").toLowerCase(),r=1 in arguments?this.attr(i,e):this.attr(i);return null!==r?_(r):T},val:function(t){return 0 in arguments?(null==t&&(t=""),this.each(function(e){this.value=v(this,t,e,this.value)})):this[0]&&(this[0].multiple?A(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var i=A(this),r=v(this,t,e,i.offset()),n=i.offsetParent().offset(),a={top:r.top-n.top,left:r.left-n.left};"static"==i.css("position")&&(a.position="relative"),i.css(a)});if(!this.length)return null;if(P.documentElement!==this[0]&&!A.contains(P.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,i){if(arguments.length<2){var r=this[0];if("string"==typeof e){if(!r)return;return r.style[L(e)]||getComputedStyle(r,"").getPropertyValue(e)}if(Q(e)){if(!r)return;var n={},a=getComputedStyle(r,"");return A.each(e,function(t,e){n[e]=r.style[L(e)]||a.getPropertyValue(e)}),n}}var o="";if("string"==t(e))i||0===i?o=u(e)+":"+c(e,i):this.each(function(){this.style.removeProperty(u(e))});else for(k in e)e[k]||0===e[k]?o+=u(k)+":"+c(k,e[k])+";":this.each(function(){this.style.removeProperty(u(k))});return this.each(function(){this.style.cssText+=";"+o})},index:function(t){return t?this.indexOf(A(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return!!t&&w.some.call(this,function(t){return this.test(b(t))},d(t))},addClass:function(t){return t?this.each(function(e){if("className"in this){S=[];var i=b(this);v(this,t,e,i).split(/\s+/g).forEach(function(t){A(this).hasClass(t)||S.push(t)},this),S.length&&b(this,i+(i?" ":"")+S.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===T)return b(this,"");S=b(this),v(this,t,e,S).split(/\s+/g).forEach(function(t){S=S.replace(d(t)," ")}),b(this,S.trim())}})},toggleClass:function(t,e){return t?this.each(function(i){var r=A(this);v(this,t,i,b(this)).split(/\s+/g).forEach(function(t){(e===T?!r.hasClass(t):e)?r.addClass(t):r.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===T?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===T?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),i=this.offset(),r=U.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat(A(t).css("margin-top"))||0,i.left-=parseFloat(A(t).css("margin-left"))||0,r.top+=parseFloat(A(e[0]).css("border-top-width"))||0,r.left+=parseFloat(A(e[0]).css("border-left-width"))||0,{top:i.top-r.top,left:i.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||P.body;t&&!U.test(t.nodeName)&&"static"==A(t).css("position");)t=t.offsetParent;return t})}},A.fn.detach=A.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});A.fn[t]=function(n){var a,o=this[0];return n===T?i(o)?o["inner"+e]:r(o)?o.documentElement["scroll"+e]:(a=this.offset())&&a[t]:this.each(function(e){o=A(this),o.css(t,v(this,n,e,o[t]()))})}}),V.forEach(function(e,i){var r=i%2;A.fn[e]=function(){var e,n,a=A.map(arguments,function(i){var r=[];return e=t(i),"array"==e?(i.forEach(function(t){return t.nodeType!==T?r.push(t):A.zepto.isZ(t)?r=r.concat(t.get()):void(r=r.concat(X.fragment(t)))}),r):"object"==e||null==i?i:X.fragment(i)}),o=this.length>1;return a.length<1?this:this.each(function(t,e){n=r?e:e.parentNode,e=0==i?e.nextSibling:1==i?e.firstChild:2==i?e:null;var s=A.contains(P.documentElement,n);a.forEach(function(t){if(o)t=t.cloneNode(!0);else if(!n)return A(t).remove();n.insertBefore(t,e),s&&E(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var e=t.ownerDocument?t.ownerDocument.defaultView:window;e.eval.call(e,t.innerHTML)}})})})},A.fn[r?e+"To":"insert"+(i?"Before":"After")]=function(t){return A(t)[e](this),this}}),X.Z.prototype=p.prototype=A.fn,X.uniq=R,X.deserializeValue=_,A.zepto=X,A}();window.Zepto=i,void 0===window.$&&(window.$=i),function(t){function e(e,i,r){var n=t.Event(i);return t(e).trigger(n,r),!n.isDefaultPrevented()}function i(t,i,r,n){if(t.global)return e(i||b,r,n)}function r(e){e.global&&0==t.active++&&i(e,null,"ajaxStart")}function n(e){e.global&&!--t.active&&i(e,null,"ajaxStop")}function a(t,e){var r=e.context;if(!1===e.beforeSend.call(r,t,e)||!1===i(e,r,"ajaxBeforeSend",[t,e]))return!1;i(e,r,"ajaxSend",[t,e])}function o(t,e,r,n){var a=r.context;r.success.call(a,t,"success",e),n&&n.resolveWith(a,[t,"success",e]),i(r,a,"ajaxSuccess",[e,r,t]),l("success",e,r)}function s(t,e,r,n,a){var o=n.context;n.error.call(o,r,e,t),a&&a.rejectWith(o,[r,e,t]),i(n,o,"ajaxError",[r,n,t||e]),l(e,r,n)}function l(t,e,r){var a=r.context;r.complete.call(a,e,t),i(r,a,"ajaxComplete",[e,r]),n(r)}function u(t,e,i){if(i.dataFilter==d)return t;var r=i.context;return i.dataFilter.call(r,t,e)}function d(){}function c(t){return t&&(t=t.split(";",2)[0]),t&&(t==A?"html":t==k?"json":E.test(t)?"script":T.test(t)&&"xml")||"text"}function f(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function h(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()&&"jsonp"!=e.dataType||(e.url=f(e.url,e.data),e.data=void 0)}function p(e,i,r,n){return t.isFunction(i)&&(n=r,r=i,i=void 0),t.isFunction(r)||(n=r,r=void 0),{url:e,data:i,success:r,dataType:n}}function g(e,i,r,n){var a,o=t.isArray(i),s=t.isPlainObject(i);t.each(i,function(i,l){a=t.type(l),n&&(i=r?n:n+"["+(s||"object"==a||"array"==a?i:"")+"]"),!n&&o?e.add(l.name,l.value):"array"==a||!r&&"object"==a?g(e,l,r,i):e.add(i,l)})}var y,v,m=+new Date,b=window.document,_=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,E=/^(?:text|application)\/javascript/i,T=/^(?:text|application)\/xml/i,k="application/json",A="text/html",S=/^\s*$/,L=b.createElement("a");L.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,i){if(!("type"in e))return t.ajax(e);var r,n,l=e.jsonpCallback,u=(t.isFunction(l)?l():l)||"Zepto"+m++,d=b.createElement("script"),c=window[u],f=function(e){t(d).triggerHandler("error",e||"abort")},h={abort:f};return i&&i.promise(h),t(d).on("load error",function(a,l){clearTimeout(n),t(d).off().remove(),"error"!=a.type&&r?o(r[0],h,e,i):s(null,l||"error",h,e,i),window[u]=c,r&&t.isFunction(c)&&c(r[0]),c=r=void 0}),!1===a(h,e)?(f("abort"),h):(window[u]=function(){r=arguments},d.src=e.url.replace(/\?(.+)=\?/,"?$1="+u),b.head.appendChild(d),e.timeout>0&&(n=setTimeout(function(){f("timeout")},e.timeout)),h)},t.ajaxSettings={type:"GET",beforeSend:d,success:d,error:d,complete:d,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:k,xml:"application/xml, text/xml",html:A,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:d},t.ajax=function(e){var i,n,l=t.extend({},e||{}),p=t.Deferred&&t.Deferred();for(y in t.ajaxSettings)void 0===l[y]&&(l[y]=t.ajaxSettings[y]);r(l),l.crossDomain||(i=b.createElement("a"),i.href=l.url,i.href=i.href,l.crossDomain=L.protocol+"//"+L.host!=i.protocol+"//"+i.host),l.url||(l.url=window.location.toString()),(n=l.url.indexOf("#"))>-1&&(l.url=l.url.slice(0,n)),h(l);var g=l.dataType,m=/\?.+=\?/.test(l.url);if(m&&(g="jsonp"),!1!==l.cache&&(e&&!0===e.cache||"script"!=g&&"jsonp"!=g)||(l.url=f(l.url,"_="+Date.now())),"jsonp"==g)return m||(l.url=f(l.url,l.jsonp?l.jsonp+"=?":!1===l.jsonp?"":"callback=?")),t.ajaxJSONP(l,p);var _,E=l.accepts[g],T={},k=function(t,e){T[t.toLowerCase()]=[t,e]},A=/^([\w-]+:)\/\//.test(l.url)?RegExp.$1:window.location.protocol,R=l.xhr(),w=R.setRequestHeader;if(p&&p.promise(R),l.crossDomain||k("X-Requested-With","XMLHttpRequest"),k("Accept",E||"*/*"),(E=l.mimeType||E)&&(E.indexOf(",")>-1&&(E=E.split(",",2)[0]),R.overrideMimeType&&R.overrideMimeType(E)),(l.contentType||!1!==l.contentType&&l.data&&"GET"!=l.type.toUpperCase())&&k("Content-Type",l.contentType||"application/x-www-form-urlencoded"),l.headers)for(v in l.headers)k(v,l.headers[v]);if(R.setRequestHeader=k,R.onreadystatechange=function(){if(4==R.readyState){R.onreadystatechange=d,clearTimeout(_);var e,i=!1;if(R.status>=200&&R.status<300||304==R.status||0==R.status&&"file:"==A){if(g=g||c(l.mimeType||R.getResponseHeader("content-type")),"arraybuffer"==R.responseType||"blob"==R.responseType)e=R.response;else{e=R.responseText;try{e=u(e,g,l),"script"==g?(0,eval)(e):"xml"==g?e=R.responseXML:"json"==g&&(e=S.test(e)?null:t.parseJSON(e))}catch(t){i=t}if(i)return s(i,"parsererror",R,l,p)}o(e,R,l,p)}else s(R.statusText||null,R.status?"error":"abort",R,l,p)}},!1===a(R,l))return R.abort(),s(null,"abort",R,l,p),R;var C=!("async"in l)||l.async;if(R.open(l.type,l.url,C,l.username,l.password),l.xhrFields)for(v in l.xhrFields)R[v]=l.xhrFields[v];for(v in T)w.apply(R,T[v]);return l.timeout>0&&(_=setTimeout(function(){R.onreadystatechange=d,R.abort(),s(null,"timeout",R,l,p)},l.timeout)),R.send(l.data?l.data:null),R},t.get=function(){return t.ajax(p.apply(null,arguments))},t.post=function(){var e=p.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=p.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,i,r){if(!this.length)return this;var n,a=this,o=e.split(/\s/),s=p(e,i,r),l=s.success;return o.length>1&&(s.url=o[0],n=o[1]),s.success=function(e){a.html(n?t("<div>").html(e.replace(_,"")).find(n):e),l&&l.apply(a,arguments)},t.ajax(s),this};var R=encodeURIComponent;t.param=function(e,i){var r=[];return r.add=function(e,i){t.isFunction(i)&&(i=i()),null==i&&(i=""),this.push(R(e)+"="+R(i))},g(r,e,i),r.join("&").replace(/%20/g,"+")}}(i),function(t){t.Callbacks=function(e){e=t.extend({},e);var i,r,n,a,o,s,l=[],u=!e.once&&[],d=function(t){for(i=e.memory&&t,r=!0,s=a||0,a=0,o=l.length,n=!0;l&&s<o;++s)if(!1===l[s].apply(t[0],t[1])&&e.stopOnFalse){i=!1;break}n=!1,l&&(u?u.length&&d(u.shift()):i?l.length=0:c.disable())},c={add:function(){if(l){var r=l.length,s=function(i){t.each(i,function(t,i){"function"==typeof i?e.unique&&c.has(i)||l.push(i):i&&i.length&&"string"!=typeof i&&s(i)})};s(arguments),n?o=l.length:i&&(a=r,d(i))}return this},remove:function(){return l&&t.each(arguments,function(e,i){for(var r;(r=t.inArray(i,l,r))>-1;)l.splice(r,1),n&&(r<=o&&--o,r<=s&&--s)}),this},has:function(e){return!(!l||!(e?t.inArray(e,l)>-1:l.length))},empty:function(){return o=l.length=0,this},disable:function(){return l=u=i=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,i||c.disable(),this},locked:function(){return!u},fireWith:function(t,e){return!l||r&&!u||(e=e||[],e=[t,e.slice?e.slice():e],n?u.push(e):d(e)),this},fire:function(){return c.fireWith(this,arguments)},fired:function(){return!!r}};return c}}(i),function(t){function e(i){var r=[["resolve","done",t.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",t.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",t.Callbacks({memory:1})]],n="pending",a={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var i=arguments;return e(function(e){t.each(r,function(r,n){var s=t.isFunction(i[r])&&i[r];o[n[1]](function(){var i=s&&s.apply(this,arguments);if(i&&t.isFunction(i.promise))i.promise().done(e.resolve).fail(e.reject).progress(e.notify);else{var r=this===a?e.promise():this,o=s?[i]:arguments;e[n[0]+"With"](r,o)}})}),i=null}).promise()},promise:function(e){return null!=e?t.extend(e,a):a}},o={};return t.each(r,function(t,e){var i=e[2],s=e[3];a[e[1]]=i.add,s&&i.add(function(){n=s},r[1^t][2].disable,r[2][2].lock),o[e[0]]=function(){return o[e[0]+"With"](this===o?a:this,arguments),this},o[e[0]+"With"]=i.fireWith}),a.promise(o),i&&i.call(o,o),o}var i=Array.prototype.slice;t.when=function(r){var n,a,o,s=i.call(arguments),l=s.length,u=0,d=1!==l||r&&t.isFunction(r.promise)?l:0,c=1===d?r:e(),f=function(t,e,r){return function(a){e[t]=this,r[t]=arguments.length>1?i.call(arguments):a,r===n?c.notifyWith(e,r):--d||c.resolveWith(e,r)}};if(l>1)for(n=new Array(l),a=new Array(l),o=new Array(l);u<l;++u)s[u]&&t.isFunction(s[u].promise)?s[u].promise().done(f(u,o,s)).fail(c.reject).progress(f(u,a,n)):--d;return d||c.resolveWith(o,s),c.promise()},t.Deferred=e}(i),function(t){function e(t){return t._zid||(t._zid=f++)}function i(t,i,a,o){if(i=r(i),i.ns)var s=n(i.ns);return(y[e(t)]||[]).filter(function(t){return t&&(!i.e||t.e==i.e)&&(!i.ns||s.test(t.ns))&&(!a||e(t.fn)===e(a))&&(!o||t.sel==o)})}function r(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function n(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function a(t,e){return t.del&&!m&&t.e in b||!!e}function o(t){return _[t]||m&&b[t]||t}function s(i,n,s,l,d,f,h){var p=e(i),g=y[p]||(y[p]=[]);n.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var n=r(e);n.fn=s,n.sel=d,n.e in _&&(s=function(e){var i=e.relatedTarget;if(!i||i!==this&&!t.contains(this,i))return n.fn.apply(this,arguments)}),n.del=f;var p=f||s;n.proxy=function(t){if(t=u(t),!t.isImmediatePropagationStopped()){t.data=l;var e=p.apply(i,t._args==c?[t]:[t].concat(t._args));return!1===e&&(t.preventDefault(),t.stopPropagation()),e}},n.i=g.length,g.push(n),"addEventListener"in i&&i.addEventListener(o(n.e),n.proxy,a(n,h))})}function l(t,r,n,s,l){var u=e(t);(r||"").split(/\s/).forEach(function(e){i(t,e,n,s).forEach(function(e){delete y[u][e.i],"removeEventListener"in t&&t.removeEventListener(o(e.e),e.proxy,a(e,l))})})}function u(e,i){return!i&&e.isDefaultPrevented||(i||(i=e),t.each(A,function(t,r){var n=i[t];e[t]=function(){return this[r]=E,n&&n.apply(i,arguments)},e[r]=T}),e.timeStamp||(e.timeStamp=Date.now()),(i.defaultPrevented!==c?i.defaultPrevented:"returnValue"in i?!1===i.returnValue:i.getPreventDefault&&i.getPreventDefault())&&(e.isDefaultPrevented=E)),e}function d(t){var e,i={originalEvent:t};for(e in t)k.test(e)||t[e]===c||(i[e]=t[e]);return u(i,t)}var c,f=1,h=Array.prototype.slice,p=t.isFunction,g=function(t){return"string"==typeof t},y={},v={},m="onfocusin"in window,b={focus:"focusin",blur:"focusout"},_={mouseenter:"mouseover",mouseleave:"mouseout"};v.click=v.mousedown=v.mouseup=v.mousemove="MouseEvents",t.event={add:s,remove:l},t.proxy=function(i,r){var n=2 in arguments&&h.call(arguments,2);if(p(i)){var a=function(){return i.apply(r,n?n.concat(h.call(arguments)):arguments)};return a._zid=e(i),a}if(g(r))return n?(n.unshift(i[r],i),t.proxy.apply(null,n)):t.proxy(i[r],i);throw new TypeError("expected function")},t.fn.bind=function(t,e,i){return this.on(t,e,i)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,i,r){return this.on(t,e,i,r,1)};var E=function(){return!0},T=function(){return!1},k=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,A={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,i){return this.on(e,t,i)},t.fn.undelegate=function(t,e,i){return this.off(e,t,i)},t.fn.live=function(e,i){return t(document.body).delegate(this.selector,e,i),this},t.fn.die=function(e,i){return t(document.body).undelegate(this.selector,e,i),this},t.fn.on=function(e,i,r,n,a){var o,u,f=this;return e&&!g(e)?(t.each(e,function(t,e){f.on(t,i,r,e,a)}),f):(g(i)||p(n)||!1===n||(n=r,r=i,i=c),n!==c&&!1!==r||(n=r,r=c),!1===n&&(n=T),f.each(function(c,f){a&&(o=function(t){return l(f,t.type,n),n.apply(this,arguments)}),i&&(u=function(e){var r,a=t(e.target).closest(i,f).get(0);if(a&&a!==f)return r=t.extend(d(e),{currentTarget:a,liveFired:f}),(o||n).apply(a,[r].concat(h.call(arguments,1)))}),s(f,e,n,r,i,u||o)}))},t.fn.off=function(e,i,r){var n=this;return e&&!g(e)?(t.each(e,function(t,e){n.off(t,i,e)}),n):(g(i)||p(r)||!1===r||(r=i,i=c),!1===r&&(r=T),n.each(function(){l(this,e,r,i)}))},t.fn.trigger=function(e,i){return e=g(e)||t.isPlainObject(e)?t.Event(e):u(e),e._args=i,this.each(function(){e.type in b&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,i)})},t.fn.triggerHandler=function(e,r){var n,a;return this.each(function(o,s){n=d(g(e)?t.Event(e):e),n._args=r,n.target=s,t.each(i(s,e.type||e),function(t,e){if(a=e.proxy(n),n.isImmediatePropagationStopped())return!1})}),a},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){g(t)||(e=t,t=e.type);var i=document.createEvent(v[t]||"Events"),r=!0;if(e)for(var n in e)"bubbles"==n?r=!!e[n]:i[n]=e[n];return i.initEvent(t,r,!0),u(i)}}(i),function(){try{getComputedStyle(void 0)}catch(e){var t=getComputedStyle;window.getComputedStyle=function(e,i){try{return t(e,i)}catch(t){return null}}}}(),function(t){function e(e){return e=t(e),!(!e.width()&&!e.height())&&"none"!==e.css("display")}function i(t,e){t=t.replace(/=#\]/g,'="#"]');var i,r,n=s.exec(t);if(n&&n[2]in o&&(i=o[n[2]],r=n[3],t=n[1],r)){var a=Number(r);r=isNaN(a)?r.replace(/^["']|["']$/g,""):a}return e(t,i,r)}var r=t.zepto,n=r.qsa,a=r.matches,o=t.expr[":"]={visible:function(){if(e(this))return this},hidden:function(){if(!e(this))return this},selected:function(){if(this.selected)return this},checked:function(){if(this.checked)return this},parent:function(){return this.parentNode},first:function(t){if(0===t)return this},last:function(t,e){if(t===e.length-1)return this},eq:function(t,e,i){if(t===i)return this},contains:function(e,i,r){if(t(this).text().indexOf(r)>-1)return this},has:function(t,e,i){if(r.qsa(this,i).length)return this}},s=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*"),l=/^\s*>/,u="Zepto"+ +new Date;r.qsa=function(e,a){return i(a,function(i,o,s){try{var d;!i&&o?i="*":l.test(i)&&(d=t(e).addClass(u),i="."+u+" "+i);var c=n(e,i)}catch(t){throw console.error("error performing selector: %o",a),t}finally{d&&d.removeClass(u)}return o?r.uniq(t.map(c,function(t,e){return o.call(t,e,c,s)})):c})},r.matches=function(t,e){return i(e,function(e,i,r){return(!e||a(t,e))&&(!i||i.call(t,null,r)===t)})}}(i),t.exports=i},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(6),a=r(n),o=i(8),s=r(o),l={getStyleFor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{baseUrl:""};return(0,a.default)('<style class="clappr-style"></style>').html((0,s.default)(t.toString())(e))}};e.default=l,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},n=/(.)^/,a={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},o=/\\|'|\r|\n|\t|\u2028|\u2029/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},l=new RegExp("[&<>\"']","g"),u=function(t){return null===t?"":(""+t).replace(l,function(t){return s[t]})},d=0,c=function(t,e){var i,s=new RegExp([(r.escape||n).source,(r.interpolate||n).source,(r.evaluate||n).source].join("|")+"|$","g"),l=0,c="__p+='";t.replace(s,function(e,i,r,n,s){return c+=t.slice(l,s).replace(o,function(t){return"\\"+a[t]}),i&&(c+="'+\n((__t=("+i+"))==null?'':escapeExpr(__t))+\n'"),r&&(c+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),n&&(c+="';\n"+n+"\n__p+='"),l=s+e.length,e}),c+="';\n",r.variable||(c="with(obj||{}){\n"+c+"}\n"),c="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+c+"return __p;\n//# sourceURL=/microtemplates/source["+d+++"]";try{i=new Function(r.variable||"obj","escapeExpr",c)}catch(t){throw t.source=c,t}if(e)return i(e,u);var f=function(t){return i.call(this,t,u)};return f.source="function("+(r.variable||"obj")+"){\n"+c+"}",f};c.settings=r,e.default=c,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(5),h=i(21),p=r(h),g=function(t){function e(i,r){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n.settings={},n._i18n=r,n}return(0,c.default)(e,t),(0,u.default)(e,[{key:"isAudioOnly",get:function(){return!1}},{key:"ended",get:function(){return!1}},{key:"i18n",get:function(){return this._i18n}},{key:"buffering",get:function(){return!1}}]),e.prototype.consent=function(){},e.prototype.play=function(){},e.prototype.pause=function(){},e.prototype.stop=function(){},e.prototype.seek=function(t){},e.prototype.seekPercentage=function(t){},e.prototype.getStartTimeOffset=function(){return 0},e.prototype.getDuration=function(){return 0},e.prototype.isPlaying=function(){return!1},e.prototype.getPlaybackType=function(){return e.NO_OP},e.prototype.isHighDefinitionInUse=function(){return!1},e.prototype.volume=function(t){},e.prototype.destroy=function(){this.$el.remove()},(0,u.default)(e,[{key:"isReady",get:function(){return!1}},{key:"hasClosedCaptionsTracks",get:function(){return this.closedCaptionsTracks.length>0}},{key:"closedCaptionsTracks",get:function(){return[]}},{key:"closedCaptionsTrackId",get:function(){return-1},set:function(t){}}]),e}(p.default);e.default=g,g.extend=function(t){return(0,f.extend)(g,t)},g.canPlay=function(t,e){return!1},g.VOD="vod",g.AOD="aod",g.LIVE="live",g.NO_OP="no_op",g.type="playback",t.exports=e.default},function(t,e){function i(t,e){var i=t[1]||"",n=t[3];if(!n)return i;if(e&&"function"==typeof btoa){var a=r(n);return[i].concat(n.sources.map(function(t){return"/*# sourceURL="+n.sourceRoot+t+" */"})).concat([a]).join("\n")}return[i].join("\n")}function r(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var r=i(e,t);return e[2]?"@media "+e[2]+"{"+r+"}":r}).join("")},e.i=function(t,i){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},n=0;n<this.length;n++){var a=this[n][0];"number"==typeof a&&(r[a]=!0)}for(n=0;n<t.length;n++){var o=t[n];"number"==typeof o[0]&&r[o[0]]||(i&&!o[2]?o[2]=i:i&&(o[2]="("+o[2]+") and ("+i+")"),e.push(o))}},e}},function(t,e){var i=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=i)},function(t,e,i){var r=i(44)("wks"),n=i(32),a=i(15).Symbol,o="function"==typeof a;(t.exports=function(t){return r[t]||(r[t]=o&&a[t]||(o?a:n)("Symbol."+t))}).store=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={},n=function(){var t=navigator.userAgent,e=t.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[],i=void 0;if(/trident/i.test(e[1]))return i=/\brv[ :]+(\d+)/g.exec(t)||[],{name:"IE",version:parseInt(i[1]||"")};if("Chrome"===e[1]){if(null!=(i=t.match(/\bOPR\/(\d+)/)))return{name:"Opera",version:parseInt(i[1])};if(null!=(i=t.match(/\bEdge\/(\d+)/)))return{name:"Edge",version:parseInt(i[1])}}return e=e[2]?[e[1],e[2]]:[navigator.appName,navigator.appVersion,"-?"],(i=t.match(/version\/(\d+)/i))&&e.splice(1,1,i[1]),{name:e[0],version:parseInt(e[1])}}();r.isEdge=/edge/i.test(navigator.userAgent),r.isChrome=/chrome|CriOS/i.test(navigator.userAgent)&&!r.isEdge,r.isSafari=/safari/i.test(navigator.userAgent)&&!r.isChrome&&!r.isEdge,r.isFirefox=/firefox/i.test(navigator.userAgent),r.isLegacyIE=!!window.ActiveXObject,r.isIE=r.isLegacyIE||/trident.*rv:1\d/i.test(navigator.userAgent),r.isIE11=/trident.*rv:11/i.test(navigator.userAgent),r.isChromecast=r.isChrome&&/CrKey/i.test(navigator.userAgent),r.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone|IEMobile|Mobile Safari|Opera Mini/i.test(navigator.userAgent),r.isiOS=/iPad|iPhone|iPod/i.test(navigator.userAgent),r.isAndroid=/Android/i.test(navigator.userAgent),r.isWindowsPhone=/Windows Phone/i.test(navigator.userAgent),r.isWin8App=/MSAppHost/i.test(navigator.userAgent),r.isWiiU=/WiiU/i.test(navigator.userAgent),r.isPS4=/PlayStation 4/i.test(navigator.userAgent),r.hasLocalstorage=function(){try{return localStorage.setItem("clappr","clappr"),localStorage.removeItem("clappr"),!0}catch(t){return!1}}(),r.hasFlash=function(){try{return!!new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){return!(!navigator.mimeTypes||void 0===navigator.mimeTypes["application/x-shockwave-flash"]||!navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)}}(),r.name=n.name,r.version=n.version,e.default=r,t.exports=e.default},function(t,e,i){var r=i(91),n=i(40);t.exports=function(t){return r(n(t))}},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e,i){var r=i(23),n=i(63),a=i(47),o=Object.defineProperty;e.f=i(20)?Object.defineProperty:function(t,e,i){if(r(t),e=a(e,!0),r(i),n)try{return o(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(5),h=i(4),p=r(h),g=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r._options=i,r.uniqueId=(0,f.uniqueId)("o"),r}return(0,c.default)(e,t),(0,u.default)(e,[{key:"options",get:function(){return this._options}}]),e}(p.default);e.default=g,t.exports=e.default},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var r=i(15),n=i(11),a=i(46),o=i(22),s=function(t,e,i){var l,u,d,c=t&s.F,f=t&s.G,h=t&s.S,p=t&s.P,g=t&s.B,y=t&s.W,v=f?n:n[e]||(n[e]={}),m=v.prototype,b=f?r:h?r[e]:(r[e]||{}).prototype;f&&(i=e);for(l in i)(u=!c&&b&&void 0!==b[l])&&l in v||(d=u?b[l]:i[l],v[l]=f&&"function"!=typeof b[l]?i[l]:g&&u?a(d,r):y&&b[l]==d?function(t){var e=function(e,i,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(d):p&&"function"==typeof d?a(Function.call,d):d,p&&((v.virtual||(v.virtual={}))[l]=d,t&s.R&&m&&!m[l]&&o(m,l,d)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e,i){t.exports=!i(27)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(6),h=r(f),p=i(5),g=i(17),y=r(g),v=/^(\S+)\s*(.*)$/,m=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r.cid=(0,p.uniqueId)("c"),r._ensureElement(),r.delegateEvents(),r}return(0,c.default)(e,t),(0,u.default)(e,[{key:"tagName",get:function(){return"div"}},{key:"events",get:function(){return{}}},{key:"attributes",get:function(){return{}}}]),e.prototype.$=function(t){return this.$el.find(t)},e.prototype.render=function(){return this},e.prototype.remove=function(){return this.$el.remove(),this.stopListening(),this.undelegateEvents(),this},e.prototype.setElement=function(t,e){return this.$el&&this.undelegateEvents(),this.$el=t instanceof h.default?t:(0,h.default)(t),this.el=this.$el[0],!1!==e&&this.delegateEvents(),this},e.prototype.delegateEvents=function(t){if(!t&&!(t=this.events))return this;this.undelegateEvents();for(var e in t){var i=t[e];if(i&&i.constructor!==Function&&(i=this[t[e]]),i){var r=e.match(v),n=r[1],a=r[2];n+=".delegateEvents"+this.cid,""===a?this.$el.on(n,i.bind(this)):this.$el.on(n,a,i.bind(this))}}return this},e.prototype.undelegateEvents=function(){return this.$el.off(".delegateEvents"+this.cid),this},e.prototype._ensureElement=function(){if(this.el)this.setElement(this.el,!1);else{var t=h.default.extend({},this.attributes);this.id&&(t.id=this.id),this.className&&(t.class=this.className);var e=p.DomRecycler.create(this.tagName).attr(t);this.setElement(e,!1)}},e}(y.default);e.default=m,t.exports=e.default},function(t,e,i){var r=i(16),n=i(28);t.exports=i(20)?function(t,e,i){return r.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var r=i(26);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(4),s=r(o),l=new s.default,u=function t(){(0,a.default)(this,t)};e.default=u,u.on=function(t,e,i){l.on(t,e,i)},u.once=function(t,e,i){l.once(t,e,i)},u.off=function(t,e,i){l.off(t,e,i)},u.trigger=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];l.trigger.apply(l,[t].concat(i))},u.stopListening=function(t,e,i){l.stopListening(t,e,i)},t.exports=e.default},function(t,e,i){var r=i(60),n=i(45);t.exports=Object.keys||function(t){return r(t,n)}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports={}},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(2),u=r(l),d=i(5),c=i(17),f=r(c),h=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i.options));return r.core=i,r.enabled=!0,r.bindEvents(),r}return(0,u.default)(e,t),e.prototype.bindEvents=function(){},e.prototype.enable=function(){this.enabled||(this.bindEvents(),this.enabled=!0)},e.prototype.disable=function(){this.enabled&&(this.stopListening(),this.enabled=!1)},e.prototype.getExternalInterface=function(){return{}},e.prototype.destroy=function(){this.stopListening()},e}(f.default);e.default=h,h.extend=function(t){return(0,d.extend)(h,t)},h.type="core",t.exports=e.default},function(t,e,i){t.exports={default:i(89),__esModule:!0}},function(t,e){var i=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+r).toString(36))}},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(95),a=r(n),o=i(106),s=r(o),l="function"==typeof s.default&&"symbol"==typeof a.default?function(t){return typeof t}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":typeof t};e.default="function"==typeof s.default&&"symbol"===l(a.default)?function(t){return void 0===t?"undefined":l(t)}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":void 0===t?"undefined":l(t)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),n=function(t){return t&&t.__esModule?t:{default:t}}(r),a=function t(){(0,n.default)(this,t),this.options={},this.playbackPlugins=[],this.currentSize={width:0,height:0}};a._players={},a.getInstance=function(t){return a._players[t]||(a._players[t]=new a)},e.default=a,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(152),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(2),u=r(l),d=i(5),c=i(21),f=r(c),h=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i.options));return r.container=i,r.enabled=!0,r.bindEvents(),r}return(0,u.default)(e,t),e.prototype.enable=function(){this.enabled||(this.bindEvents(),this.$el.show(),this.enabled=!0)},e.prototype.disable=function(){this.stopListening(),this.$el.hide(),this.enabled=!1},e.prototype.bindEvents=function(){},e.prototype.destroy=function(){this.remove()},e}(f.default);e.default=h,h.extend=function(t){return(0,d.extend)(h,t)},h.type="container",t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(2),u=r(l),d=i(17),c=r(d),f=i(5),h=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i.options));return r.container=i,r.enabled=!0,r.bindEvents(),r}return(0,u.default)(e,t),e.prototype.enable=function(){this.enabled||(this.bindEvents(),this.enabled=!0)},e.prototype.disable=function(){this.enabled&&(this.stopListening(),this.enabled=!1)},e.prototype.bindEvents=function(){},e.prototype.destroy=function(){this.stopListening()},e}(c.default);e.default=h,h.extend=function(t){return(0,f.extend)(h,t)},h.type="container",t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(2),u=r(l),d=i(5),c=i(21),f=r(c),h=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i.options));return r.core=i,r.enabled=!0,r.bindEvents(),r.render(),r}return(0,u.default)(e,t),e.prototype.bindEvents=function(){},e.prototype.getExternalInterface=function(){return{}},e.prototype.enable=function(){this.enabled||(this.bindEvents(),this.$el.show(),this.enabled=!0)},e.prototype.disable=function(){this.stopListening(),this.$el.hide(),this.enabled=!1},e.prototype.destroy=function(){this.remove()},e.prototype.render=function(){return this},e}(f.default);e.default=h,h.extend=function(t){return(0,d.extend)(h,t)},h.type="core",t.exports=e.default},function(t,e,i){var r=i(40);t.exports=function(t){return Object(r(t))}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e){var i=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:i)(t)}},function(t,e,i){var r=i(44)("keys"),n=i(32);t.exports=function(t){return r[t]||(r[t]=n(t))}},function(t,e,i){var r=i(15),n=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return n[t]||(n[t]={})}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var r=i(94);t.exports=function(t,e,i){if(r(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,r){return t.call(e,i,r)};case 3:return function(i,r,n){return t.call(e,i,r,n)}}return function(){return t.apply(e,arguments)}}},function(t,e,i){var r=i(26);t.exports=function(t,e){if(!r(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!r(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!r(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!r(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=!0},function(t,e,i){var r=i(23),n=i(99),a=i(45),o=i(43)("IE_PROTO"),s=function(){},l=function(){var t,e=i(64)("iframe"),r=a.length;for(e.style.display="none",i(100).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;r--;)delete l.prototype[a[r]];return l()};t.exports=Object.create||function(t,e){var i;return null!==t?(s.prototype=r(t),i=new s,s.prototype=null,i[o]=t):i=l(),void 0===e?i:n(i,e)}},function(t,e,i){var r=i(16).f,n=i(18),a=i(12)("toStringTag");t.exports=function(t,e,i){t&&!n(t=i?t:t.prototype,a)&&r(t,a,{configurable:!0,value:e})}},function(t,e,i){e.f=i(12)},function(t,e,i){var r=i(15),n=i(11),a=i(48),o=i(51),s=i(16).f;t.exports=function(t){var e=n.Symbol||(n.Symbol=a?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:o.f(t)})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var r=i(53),n=i(28),a=i(14),o=i(47),s=i(18),l=i(63),u=Object.getOwnPropertyDescriptor;e.f=i(20)?u:function(t,e){if(t=a(t),e=o(e,!0),l)try{return u(t,e)}catch(t){}if(s(t,e))return n(!r.f.call(t,e),t[e])}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(129),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(130),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default={Kibo:n.default},t.exports=e.default},function(t,e){function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function n(t){if(d===setTimeout)return setTimeout(t,0);if((d===i||!d)&&setTimeout)return d=setTimeout,setTimeout(t,0);try{return d(t,0)}catch(e){try{return d.call(null,t,0)}catch(e){return d.call(this,t,0)}}}function a(t){if(c===clearTimeout)return clearTimeout(t);if((c===r||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(t);try{return c(t)}catch(e){try{return c.call(null,t)}catch(e){return c.call(this,t)}}}function o(){g&&h&&(g=!1,h.length?p=h.concat(p):y=-1,p.length&&s())}function s(){if(!g){var t=n(o);g=!0;for(var e=p.length;e;){for(h=p,p=[];++y<e;)h&&h[y].run();y=-1,e=p.length}h=null,g=!1,a(t)}}function l(t,e){this.fun=t,this.array=e}function u(){}var d,c,f=t.exports={};!function(){try{d="function"==typeof setTimeout?setTimeout:i}catch(t){d=i}try{c="function"==typeof clearTimeout?clearTimeout:r}catch(t){c=r}}();var h,p=[],g=!1,y=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];p.push(new l(t,e)),1!==p.length||g||n(s)},l.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#010101" d="M1.425.35L14.575 8l-13.15 7.65V.35z"></path></svg>'},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=i(164),t.exports=e.default},function(t,e,i){var r=i(18),n=i(14),a=i(92)(!1),o=i(43)("IE_PROTO");t.exports=function(t,e){var i,s=n(t),l=0,u=[];for(i in s)i!=o&&r(s,i)&&u.push(i);for(;e.length>l;)r(s,i=e[l++])&&(~a(u,i)||u.push(i));return u}},function(t,e,i){var r=i(42),n=Math.min;t.exports=function(t){return t>0?n(r(t),9007199254740991):0}},function(t,e,i){var r=i(19),n=i(11),a=i(27);t.exports=function(t,e){var i=(n.Object||{})[t]||Object[t],o={};o[t]=e(i),r(r.S+r.F*a(function(){i(1)}),"Object",o)}},function(t,e,i){t.exports=!i(20)&&!i(27)(function(){return 7!=Object.defineProperty(i(64)("div"),"a",{get:function(){return 7}}).a})},function(t,e,i){var r=i(26),n=i(15).document,a=r(n)&&r(n.createElement);t.exports=function(t){return a?n.createElement(t):{}}},function(t,e,i){"use strict";var r=i(97)(!0);i(66)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=r(e,i),this._i+=t.length,{value:t,done:!1})})},function(t,e,i){"use strict";var r=i(48),n=i(19),a=i(67),o=i(22),s=i(18),l=i(29),u=i(98),d=i(50),c=i(101),f=i(12)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,i,g,y,v,m){u(i,e,g);var b,_,E,T=function(t){if(!h&&t in L)return L[t];switch(t){case"keys":case"values":return function(){return new i(this,t)}}return function(){return new i(this,t)}},k=e+" Iterator",A="values"==y,S=!1,L=t.prototype,R=L[f]||L["@@iterator"]||y&&L[y],w=R||T(y),C=y?A?T("entries"):w:void 0,O="Array"==e?L.entries||R:R;if(O&&(E=c(O.call(new t)))!==Object.prototype&&(d(E,k,!0),r||s(E,f)||o(E,f,p)),A&&R&&"values"!==R.name&&(S=!0,w=function(){return R.call(this)}),r&&!m||!h&&!S&&L[f]||o(L,f,w),l[e]=w,l[k]=p,y)if(b={values:A?w:T("values"),keys:v?w:T("keys"),entries:C},m)for(_ in b)_ in L||a(L,_,b[_]);else n(n.P+n.F*(h||S),e,b);return b}},function(t,e,i){t.exports=i(22)},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,i){var r=i(60),n=i(45).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,n)}},function(t,e,i){t.exports={default:i(117),__esModule:!0}},function(t,e,i){t.exports={default:i(123),__esModule:!0}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(133),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(136),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(138),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){t.exports=i.p+"a8c874b93b3d848f39a71260c57e3863.cur"},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M1.712 14.76H6.43V1.24H1.71v13.52zm7.86-13.52v13.52h4.716V1.24H9.573z"></path></svg>'},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(151),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){t.exports={default:i(153),__esModule:!0}},function(t,e,i){"use strict";e.__esModule=!0;var r=i(78),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return(0,n.default)(t)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(163),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(168),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(169),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(172),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(174),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(176),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(189),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(88),a=r(n),o=i(5),s=r(o),l=i(4),u=r(l),d=i(9),c=r(d),f=i(37),h=r(f),p=i(30),g=r(p),y=i(38),v=r(y),m=i(36),b=r(m),_=i(17),E=r(_),T=i(21),k=r(T),A=i(13),S=r(A),L=i(73),R=r(L),w=i(72),C=r(w),O=i(77),D=r(O),P=i(24),I=r(P),x=i(74),N=r(x),M=i(34),F=r(M),B=i(59),U=r(B),G=i(80),j=r(G),V=i(82),K=r(V),Y=i(83),H=r(Y),$=i(81),z=r($),W=i(35),q=r(W),X=i(84),Z=r(X),J=i(85),Q=r(J),tt=i(86),et=r(tt),it=i(55),rt=r(it),nt=i(7),at=r(nt),ot=i(56),st=r(ot),lt=i(8),ut=r(lt),dt=i(6),ct=r(dt);e.default={Player:a.default,Mediator:I.default,Events:u.default,Browser:S.default,PlayerInfo:F.default,MediaControl:N.default,ContainerPlugin:h.default,UIContainerPlugin:b.default,CorePlugin:g.default,UICorePlugin:v.default,Playback:c.default,Container:R.default,Core:C.default,Loader:D.default,BaseObject:E.default,UIObject:k.default,Utils:s.default,BaseFlashPlayback:U.default,Flash:j.default,FlasHLS:K.default,HLS:H.default,HTML5Audio:z.default,HTML5Video:q.default,HTMLImg:Z.default,NoOp:Q.default,Poster:et.default,Log:rt.default,Styler:at.default,Vendor:st.default,version:"0.2.71",template:ut.default,$:ct.default},t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(31),a=r(n),o=i(0),s=r(o),l=i(1),u=r(l),d=i(3),c=r(d),f=i(2),h=r(f),p=i(5),g=i(17),y=r(g),v=i(4),m=r(v),b=i(13),_=r(b),E=i(131),T=r(E),k=i(77),A=r(k),S=i(34),L=r(S),R=i(6),w=r(R),C=(0,p.currentScriptUrl)().replace(/\/[^\/]+$/,""),O=function(t){function e(i){(0,s.default)(this,e);var r=(0,u.default)(this,t.call(this,i)),n={playerId:(0,p.uniqueId)(""),persistConfig:!0,width:640,height:360,baseUrl:C,allowUserInteraction:_.default.isMobile};return r._options=w.default.extend(n,i),r.options.sources=r._normalizeSources(i),r.options.chromeless||(r.options.allowUserInteraction=!0),r.options.allowUserInteraction||(r.options.disableKeyboardShortcuts=!0),r._registerOptionEventListeners(),r._coreFactory=new T.default(r),r.playerInfo=L.default.getInstance(r.options.playerId),r.playerInfo.currentSize={width:i.width,height:i.height},r.playerInfo.options=r.options,r.options.parentId?r.setParentId(r.options.parentId):r.options.parent&&r.attachTo(r.options.parent),r}return(0,h.default)(e,t),(0,c.default)(e,[{key:"loader",set:function(t){this._loader=t},get:function(){return this._loader||(this._loader=new A.default(this.options.plugins||{},this.options.playerId)),this._loader}},{key:"ended",get:function(){return this.core.mediaControl.container.ended}},{key:"buffering",get:function(){return this.core.mediaControl.container.buffering}},{key:"isReady",get:function(){return!!this._ready}},{key:"eventsMapping",get:function(){return{onReady:m.default.PLAYER_READY,onResize:m.default.PLAYER_RESIZE,onPlay:m.default.PLAYER_PLAY,onPause:m.default.PLAYER_PAUSE,onStop:m.default.PLAYER_STOP,onEnded:m.default.PLAYER_ENDED,onSeek:m.default.PLAYER_SEEK,onError:m.default.PLAYER_ERROR,onTimeUpdate:m.default.PLAYER_TIMEUPDATE,onVolumeUpdate:m.default.PLAYER_VOLUMEUPDATE,onSubtitleAvailable:m.default.PLAYER_SUBTITLE_AVAILABLE}}}]),e.prototype.setParentId=function(t){var e=document.querySelector(t);return e&&this.attachTo(e),this},e.prototype.attachTo=function(t){return this.options.parentElement=t,this.core=this._coreFactory.create(),this._addEventListeners(),this},e.prototype._addEventListeners=function(){return this.core.isReady?this._onReady():this.listenToOnce(this.core,m.default.CORE_READY,this._onReady),this.listenTo(this.core.mediaControl,m.default.MEDIACONTROL_CONTAINERCHANGED,this._containerChanged),this.listenTo(this.core,m.default.CORE_FULLSCREEN,this._onFullscreenChange),this},e.prototype._addContainerEventListeners=function(){var t=this.core.mediaControl.container;return t&&(this.listenTo(t,m.default.CONTAINER_PLAY,this._onPlay),this.listenTo(t,m.default.CONTAINER_PAUSE,this._onPause),this.listenTo(t,m.default.CONTAINER_STOP,this._onStop),this.listenTo(t,m.default.CONTAINER_ENDED,this._onEnded),this.listenTo(t,m.default.CONTAINER_SEEK,this._onSeek),this.listenTo(t,m.default.CONTAINER_ERROR,this._onError),this.listenTo(t,m.default.CONTAINER_TIMEUPDATE,this._onTimeUpdate),this.listenTo(t,m.default.CONTAINER_VOLUME,this._onVolumeUpdate),this.listenTo(t,m.default.CONTAINER_SUBTITLE_AVAILABLE,this._onSubtitleAvailable)),this},e.prototype._registerOptionEventListeners=function(){var t=this,e=this.options.events||{};return(0,a.default)(e).forEach(function(i){var r=t.eventsMapping[i];if(r){var n=e[i];n="function"==typeof n&&n,n&&t.on(r,n)}}),this},e.prototype._containerChanged=function(){this.stopListening(),this._addEventListeners()},e.prototype._onReady=function(){this._ready=!0,this._addContainerEventListeners(),this.trigger(m.default.PLAYER_READY)},e.prototype._onFullscreenChange=function(t){this.trigger(m.default.PLAYER_FULLSCREEN,t)},e.prototype._onVolumeUpdate=function(t){this.trigger(m.default.PLAYER_VOLUMEUPDATE,t)},e.prototype._onSubtitleAvailable=function(){this.trigger(m.default.PLAYER_SUBTITLE_AVAILABLE)},e.prototype._onPlay=function(){this.trigger(m.default.PLAYER_PLAY)},e.prototype._onPause=function(){this.trigger(m.default.PLAYER_PAUSE)},e.prototype._onStop=function(){this.trigger(m.default.PLAYER_STOP,this.getCurrentTime())},e.prototype._onEnded=function(){this.trigger(m.default.PLAYER_ENDED)},e.prototype._onSeek=function(t){this.trigger(m.default.PLAYER_SEEK,t)},e.prototype._onTimeUpdate=function(t){this.trigger(m.default.PLAYER_TIMEUPDATE,t)},e.prototype._onError=function(t){this.trigger(m.default.PLAYER_ERROR,t)},e.prototype._normalizeSources=function(t){var e=t.sources||(void 0!==t.source?[t.source]:[]);return 0===e.length?[{source:"",mimeType:""}]:e},e.prototype.resize=function(t){return this.core.resize(t),this},e.prototype.load=function(t,e,i){return void 0!==i&&this.configure({autoPlay:!!i}),this.core.load(t,e),this},e.prototype.destroy=function(){return this.core.destroy(),this},e.prototype.consent=function(){return this.core.getCurrentPlayback().consent(),this},e.prototype.play=function(){return this.core.mediaControl.container.play(),this},e.prototype.pause=function(){return this.core.mediaControl.container.pause(),this},e.prototype.stop=function(){return this.core.mediaControl.container.stop(),this},e.prototype.seek=function(t){return this.core.mediaControl.container.seek(t),this},e.prototype.seekPercentage=function(t){return this.core.mediaControl.container.seekPercentage(t),this},e.prototype.setVolume=function(t){return this.core&&this.core.mediaControl&&this.core.mediaControl.setVolume(t),this},e.prototype.getVolume=function(){return this.core&&this.core.mediaControl?this.core.mediaControl.volume:0},e.prototype.mute=function(){return this._mutedVolume=this.getVolume(),this.setVolume(0),this},e.prototype.unmute=function(){return this.setVolume("number"==typeof this._mutedVolume?this._mutedVolume:100),this._mutedVolume=null,this},e.prototype.isPlaying=function(){return this.core.mediaControl.container.isPlaying()},e.prototype.isDvrEnabled=function(){return this.core.mediaControl.container.isDvrEnabled()},e.prototype.isDvrInUse=function(){return this.core.mediaControl.container.isDvrInUse()},e.prototype.configure=function(t){return this.core.configure(t),this},e.prototype.getPlugin=function(t){return this.core.plugins.concat(this.core.mediaControl.container.plugins).filter(function(e){return e.name===t})[0]},e.prototype.getCurrentTime=function(){return this.core.mediaControl.container.getCurrentTime()},e.prototype.getStartTimeOffset=function(){return this.core.mediaControl.container.getStartTimeOffset()},e.prototype.getDuration=function(){return this.core.mediaControl.container.getDuration()},e}(y.default);e.default=O,t.exports=e.default},function(t,e,i){i(90),t.exports=i(11).Object.keys},function(t,e,i){var r=i(39),n=i(25);i(62)("keys",function(){return function(t){return n(r(t))}})},function(t,e,i){var r=i(41);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,i){var r=i(14),n=i(61),a=i(93);t.exports=function(t){return function(e,i,o){var s,l=r(e),u=n(l.length),d=a(o,u);if(t&&i!=i){for(;u>d;)if((s=l[d++])!=s)return!0}else for(;u>d;d++)if((t||d in l)&&l[d]===i)return t||d||0;return!t&&-1}}},function(t,e,i){var r=i(42),n=Math.max,a=Math.min;t.exports=function(t,e){return t=r(t),t<0?n(t+e,0):a(t,e)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){t.exports={default:i(96),__esModule:!0}},function(t,e,i){i(65),i(102),t.exports=i(51).f("iterator")},function(t,e,i){var r=i(42),n=i(40);t.exports=function(t){return function(e,i){var a,o,s=String(n(e)),l=r(i),u=s.length;return l<0||l>=u?t?"":void 0:(a=s.charCodeAt(l),a<55296||a>56319||l+1===u||(o=s.charCodeAt(l+1))<56320||o>57343?t?s.charAt(l):a:t?s.slice(l,l+2):o-56320+(a-55296<<10)+65536)}}},function(t,e,i){"use strict";var r=i(49),n=i(28),a=i(50),o={};i(22)(o,i(12)("iterator"),function(){return this}),t.exports=function(t,e,i){t.prototype=r(o,{next:n(1,i)}),a(t,e+" Iterator")}},function(t,e,i){var r=i(16),n=i(23),a=i(25);t.exports=i(20)?Object.defineProperties:function(t,e){n(t);for(var i,o=a(e),s=o.length,l=0;s>l;)r.f(t,i=o[l++],e[i]);return t}},function(t,e,i){t.exports=i(15).document&&document.documentElement},function(t,e,i){var r=i(18),n=i(39),a=i(43)("IE_PROTO"),o=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=n(t),r(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}},function(t,e,i){i(103);for(var r=i(15),n=i(22),a=i(29),o=i(12)("toStringTag"),s=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],l=0;l<5;l++){var u=s[l],d=r[u],c=d&&d.prototype;c&&!c[o]&&n(c,o,u),a[u]=a.Array}},function(t,e,i){"use strict";var r=i(104),n=i(105),a=i(29),o=i(14);t.exports=i(66)(Array,"Array",function(t,e){this._t=o(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,i=this._i++;return!t||i>=t.length?(this._t=void 0,n(1)):"keys"==e?n(0,i):"values"==e?n(0,t[i]):n(0,[i,t[i]])},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,i){t.exports={default:i(107),__esModule:!0}},function(t,e,i){i(108),i(114),i(115),i(116),t.exports=i(11).Symbol},function(t,e,i){"use strict";var r=i(15),n=i(18),a=i(20),o=i(19),s=i(67),l=i(109).KEY,u=i(27),d=i(44),c=i(50),f=i(32),h=i(12),p=i(51),g=i(52),y=i(110),v=i(111),m=i(112),b=i(23),_=i(14),E=i(47),T=i(28),k=i(49),A=i(113),S=i(54),L=i(16),R=i(25),w=S.f,C=L.f,O=A.f,D=r.Symbol,P=r.JSON,I=P&&P.stringify,x=h("_hidden"),N=h("toPrimitive"),M={}.propertyIsEnumerable,F=d("symbol-registry"),B=d("symbols"),U=d("op-symbols"),G=Object.prototype,j="function"==typeof D,V=r.QObject,K=!V||!V.prototype||!V.prototype.findChild,Y=a&&u(function(){return 7!=k(C({},"a",{get:function(){return C(this,"a",{value:7}).a}})).a})?function(t,e,i){var r=w(G,e);r&&delete G[e],C(t,e,i),r&&t!==G&&C(G,e,r)}:C,H=function(t){var e=B[t]=k(D.prototype);return e._k=t,e},$=j&&"symbol"==typeof D.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof D},z=function(t,e,i){return t===G&&z(U,e,i),b(t),e=E(e,!0),b(i),n(B,e)?(i.enumerable?(n(t,x)&&t[x][e]&&(t[x][e]=!1),i=k(i,{enumerable:T(0,!1)})):(n(t,x)||C(t,x,T(1,{})),t[x][e]=!0),Y(t,e,i)):C(t,e,i)},W=function(t,e){b(t);for(var i,r=v(e=_(e)),n=0,a=r.length;a>n;)z(t,i=r[n++],e[i]);return t},q=function(t,e){return void 0===e?k(t):W(k(t),e)},X=function(t){var e=M.call(this,t=E(t,!0));return!(this===G&&n(B,t)&&!n(U,t))&&(!(e||!n(this,t)||!n(B,t)||n(this,x)&&this[x][t])||e)},Z=function(t,e){if(t=_(t),e=E(e,!0),t!==G||!n(B,e)||n(U,e)){var i=w(t,e);return!i||!n(B,e)||n(t,x)&&t[x][e]||(i.enumerable=!0),i}},J=function(t){for(var e,i=O(_(t)),r=[],a=0;i.length>a;)n(B,e=i[a++])||e==x||e==l||r.push(e);return r},Q=function(t){for(var e,i=t===G,r=O(i?U:_(t)),a=[],o=0;r.length>o;)!n(B,e=r[o++])||i&&!n(G,e)||a.push(B[e]);return a};j||(D=function(){if(this instanceof D)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(i){this===G&&e.call(U,i),n(this,x)&&n(this[x],t)&&(this[x][t]=!1),Y(this,t,T(1,i))};return a&&K&&Y(G,t,{configurable:!0,set:e}),H(t)},s(D.prototype,"toString",function(){return this._k}),S.f=Z,L.f=z,i(69).f=A.f=J,i(53).f=X,i(68).f=Q,a&&!i(48)&&s(G,"propertyIsEnumerable",X,!0),p.f=function(t){return H(h(t))}),o(o.G+o.W+o.F*!j,{Symbol:D});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;tt.length>et;)h(tt[et++]);for(var tt=R(h.store),et=0;tt.length>et;)g(tt[et++]);o(o.S+o.F*!j,"Symbol",{for:function(t){return n(F,t+="")?F[t]:F[t]=D(t)},keyFor:function(t){if($(t))return y(F,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){K=!0},useSimple:function(){K=!1}}),o(o.S+o.F*!j,"Object",{create:q,defineProperty:z,defineProperties:W,getOwnPropertyDescriptor:Z,getOwnPropertyNames:J,getOwnPropertySymbols:Q}),P&&o(o.S+o.F*(!j||u(function(){var t=D();return"[null]"!=I([t])||"{}"!=I({a:t})||"{}"!=I(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!$(t)){for(var e,i,r=[t],n=1;arguments.length>n;)r.push(arguments[n++]);return e=r[1],"function"==typeof e&&(i=e),!i&&m(e)||(e=function(t,e){if(i&&(e=i.call(this,t,e)),!$(e))return e}),r[1]=e,I.apply(P,r)}}}),D.prototype[N]||i(22)(D.prototype,N,D.prototype.valueOf),c(D,"Symbol"),c(Math,"Math",!0),c(r.JSON,"JSON",!0)},function(t,e,i){var r=i(32)("meta"),n=i(26),a=i(18),o=i(16).f,s=0,l=Object.isExtensible||function(){return!0},u=!i(27)(function(){return l(Object.preventExtensions({}))}),d=function(t){o(t,r,{value:{i:"O"+ ++s,w:{}}})},c=function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!a(t,r)){if(!l(t))return"F";if(!e)return"E";d(t)}return t[r].i},f=function(t,e){if(!a(t,r)){if(!l(t))return!0;if(!e)return!1;d(t)}return t[r].w},h=function(t){return u&&p.NEED&&l(t)&&!a(t,r)&&d(t),t},p=t.exports={KEY:r,NEED:!1,fastKey:c,getWeak:f,onFreeze:h}},function(t,e,i){var r=i(25),n=i(14);t.exports=function(t,e){for(var i,a=n(t),o=r(a),s=o.length,l=0;s>l;)if(a[i=o[l++]]===e)return i}},function(t,e,i){var r=i(25),n=i(68),a=i(53);t.exports=function(t){var e=r(t),i=n.f;if(i)for(var o,s=i(t),l=a.f,u=0;s.length>u;)l.call(t,o=s[u++])&&e.push(o);return e}},function(t,e,i){var r=i(41);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,i){var r=i(14),n=i(69).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return n(t)}catch(t){return o.slice()}};t.exports.f=function(t){return o&&"[object Window]"==a.call(t)?s(t):n(r(t))}},function(t,e){},function(t,e,i){i(52)("asyncIterator")},function(t,e,i){i(52)("observable")},function(t,e,i){i(118);var r=i(11).Object;t.exports=function(t,e,i){return r.defineProperty(t,e,i)}},function(t,e,i){var r=i(19);r(r.S+r.F*!i(20),"Object",{defineProperty:i(16).f})},function(t,e,i){t.exports={default:i(120),__esModule:!0}},function(t,e,i){i(121),t.exports=i(11).Object.setPrototypeOf},function(t,e,i){var r=i(19);r(r.S,"Object",{setPrototypeOf:i(122).set})},function(t,e,i){var r=i(26),n=i(23),a=function(t,e){if(n(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=i(46)(Function.call,i(54).f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,i){return a(t,i),e?t.__proto__=i:r(t,i),t}}({},!1):void 0),check:a}},function(t,e,i){i(124);var r=i(11).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,i){var r=i(19);r(r.S,"Object",{create:i(49)})},function(t,e,i){t.exports={default:i(126),__esModule:!0}},function(t,e,i){i(127);var r=i(11).Object;t.exports=function(t,e){return r.getOwnPropertyDescriptor(t,e)}},function(t,e,i){var r=i(14),n=i(54).f;i(62)("getOwnPropertyDescriptor",function(){return function(t,e){return n(r(t),e)}})},function(t,e,i){"use strict";Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],n=0;n<i;){var a=e[n];if(t.call(r,a,n,e))return a;n++}}})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),n=function(t){return t&&t.__esModule?t:{default:t}}(r),a=i(56),o="font-weight: bold; font-size: 13px;",s="color: #ff8000;"+o,l="color: #ff0000;"+o,u=1,d=3,c=["color: #0000ff;font-weight: bold; font-size: 13px;","color: #006600;font-weight: bold; font-size: 13px;",s,l,l],f=["debug","info","warn","error","disabled"],h=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;(0,n.default)(this,t),this.kibo=new a.Kibo,this.kibo.down(["ctrl shift d"],function(){return e.onOff()}),this.BLACKLIST=["timeupdate","playback:timeupdate","playback:progress","container:hover","container:timeupdate","container:progress"],this.level=i,this.offLevel=r}return t.prototype.debug=function(t){this.log(t,0,Array.prototype.slice.call(arguments,1))},t.prototype.info=function(t){this.log(t,u,Array.prototype.slice.call(arguments,1))},t.prototype.warn=function(t){this.log(t,2,Array.prototype.slice.call(arguments,1))},t.prototype.error=function(t){this.log(t,3,Array.prototype.slice.call(arguments,1))},t.prototype.onOff=function(){this.level===this.offLevel?this.level=this.previousLevel:(this.previousLevel=this.level,this.level=this.offLevel),window.console&&window.console.log&&window.console.log("%c[Clappr.Log] set log level to "+f[this.level],s)},t.prototype.level=function(t){this.level=t},t.prototype.log=function(t,e,i){if(!(this.BLACKLIST.indexOf(i[0])>=0||e<this.level)){i||(i=t,t=null);var r=c[e],n="";t&&(n="["+t+"]"),window.console&&window.console.log&&window.console.log.apply(console,["%c["+f[e]+"]"+n,r].concat(i))}},t}();e.default=h,h.LEVEL_DEBUG=0,h.LEVEL_INFO=u,h.LEVEL_WARN=2,h.LEVEL_ERROR=3,h.getInstance=function(){return void 0===this._instance&&(this._instance=new this,this._instance.previousLevel=this._instance.level,this._instance.level=this._instance.offLevel),this._instance},h.setLevel=function(t){this.getInstance().level=t},h.debug=function(){this.getInstance().debug.apply(this.getInstance(),arguments)},h.info=function(){this.getInstance().info.apply(this.getInstance(),arguments)},h.warn=function(){this.getInstance().warn.apply(this.getInstance(),arguments)},h.error=function(){this.getInstance().error.apply(this.getInstance(),arguments)},t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){this.element=t||window.document,this.initialize()};r.KEY_NAMES_BY_CODE={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"caps_lock",27:"esc",32:"space",37:"left",38:"up",39:"right",40:"down",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},r.KEY_CODES_BY_NAME={},function(){for(var t in r.KEY_NAMES_BY_CODE)Object.prototype.hasOwnProperty.call(r.KEY_NAMES_BY_CODE,t)&&(r.KEY_CODES_BY_NAME[r.KEY_NAMES_BY_CODE[t]]=+t)}(),r.MODIFIERS=["shift","ctrl","alt"],r.registerEvent=function(){return document.addEventListener?function(t,e,i){t.addEventListener(e,i,!1)}:document.attachEvent?function(t,e,i){t.attachEvent("on"+e,i)}:void 0}(),r.unregisterEvent=function(){return document.removeEventListener?function(t,e,i){t.removeEventListener(e,i,!1)}:document.detachEvent?function(t,e,i){t.detachEvent("on"+e,i)}:void 0}(),r.stringContains=function(t,e){return-1!==t.indexOf(e)},r.neatString=function(t){return t.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")},r.capitalize=function(t){return t.toLowerCase().replace(/^./,function(t){return t.toUpperCase()})},r.isString=function(t){return r.stringContains(Object.prototype.toString.call(t),"String")},r.arrayIncludes=function(){return Array.prototype.indexOf?function(t,e){return-1!==t.indexOf(e)}:function(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return!0;return!1}}(),r.extractModifiers=function(t){var e,i;for(e=[],i=0;i<r.MODIFIERS.length;i++)r.stringContains(t,r.MODIFIERS[i])&&e.push(r.MODIFIERS[i]);return e},r.extractKey=function(t){var e,i;for(e=r.neatString(t).split(" "),i=0;i<e.length;i++)if(!r.arrayIncludes(r.MODIFIERS,e[i]))return e[i]},r.modifiersAndKey=function(t){var e,i;return r.stringContains(t,"any")?r.neatString(t).split(" ").slice(0,2).join(" "):(e=r.extractModifiers(t),i=r.extractKey(t),i&&!r.arrayIncludes(r.MODIFIERS,i)&&e.push(i),e.join(" "))},r.keyName=function(t){return r.KEY_NAMES_BY_CODE[t+""]},r.keyCode=function(t){return+r.KEY_CODES_BY_NAME[t]},r.prototype.initialize=function(){var t,e=this;for(this.lastKeyCode=-1,this.lastModifiers={},t=0;t<r.MODIFIERS.length;t++)this.lastModifiers[r.MODIFIERS[t]]=!1;this.keysDown={any:[]},this.keysUp={any:[]},this.downHandler=this.handler("down"),this.upHandler=this.handler("up"),r.registerEvent(this.element,"keydown",this.downHandler),r.registerEvent(this.element,"keyup",this.upHandler),r.registerEvent(window,"unload",function t(){r.unregisterEvent(e.element,"keydown",e.downHandler),r.unregisterEvent(e.element,"keyup",e.upHandler),r.unregisterEvent(window,"unload",t)})},r.prototype.handler=function(t){var e=this;return function(i){var n,a,o;for(i=i||window.event,e.lastKeyCode=i.keyCode,n=0;n<r.MODIFIERS.length;n++)e.lastModifiers[r.MODIFIERS[n]]=i[r.MODIFIERS[n]+"Key"];for(r.arrayIncludes(r.MODIFIERS,r.keyName(e.lastKeyCode))&&(e.lastModifiers[r.keyName(e.lastKeyCode)]=!0),a=e["keys"+r.capitalize(t)],n=0;n<a.any.length;n++)!1===a.any[n](i)&&i.preventDefault&&i.preventDefault();if(o=e.lastModifiersAndKey(),a[o])for(n=0;n<a[o].length;n++)!1===a[o][n](i)&&i.preventDefault&&i.preventDefault()}},r.prototype.registerKeys=function(t,e,i){var n,a,o=this["keys"+r.capitalize(t)];for(r.isString(e)&&(e=[e]),n=0;n<e.length;n++)a=e[n],a=r.modifiersAndKey(a+""),o[a]?o[a].push(i):o[a]=[i];return this},r.prototype.unregisterKeys=function(t,e,i){var n,a,o,s=this["keys"+r.capitalize(t)];for(r.isString(e)&&(e=[e]),n=0;n<e.length;n++)if(o=e[n],o=r.modifiersAndKey(o+""),null===i)delete s[o];else if(s[o])for(a=0;a<s[o].length;a++)if(String(s[o][a])===String(i)){s[o].splice(a,1);break}return this},r.prototype.off=function(t){return this.unregisterKeys("down",t,null)},r.prototype.delegate=function(t,e,i){return null!==i||void 0!==i?this.registerKeys(t,e,i):this.unregisterKeys(t,e,i)},r.prototype.down=function(t,e){return this.delegate("down",t,e)},r.prototype.up=function(t,e){return this.delegate("up",t,e)},r.prototype.lastKey=function(t){return t?this.lastModifiers[t]:r.keyName(this.lastKeyCode)},r.prototype.lastModifiersAndKey=function(){var t,e;for(t=[],e=0;e<r.MODIFIERS.length;e++)this.lastKey(r.MODIFIERS[e])&&t.push(r.MODIFIERS[e]);return r.arrayIncludes(t,this.lastKey())||t.push(this.lastKey()),t.join(" ")},e.default=r,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(132),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(17),h=r(f),p=i(72),g=r(p),y=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this));return r.player=i,r._options=i.options,r}return(0,c.default)(e,t),(0,u.default)(e,[{key:"loader",get:function(){return this.player.loader}}]),e.prototype.create=function(){return this.options.loader=this.loader,this.core=new g.default(this.options),this.addCorePlugins(),this.core.createContainers(this.options),this.core},e.prototype.addCorePlugins=function(){var t=this;return this.loader.corePlugins.forEach(function(e){var i=new e(t.core);t.core.addPlugin(i),t.setupExternalInterface(i)}),this.core},e.prototype.setupExternalInterface=function(t){var e=t.getExternalInterface();for(var i in e)this.player[i]=e[i].bind(t)},e}(h.default);e.default=y,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(5),h=i(4),p=r(h),g=i(7),y=r(g),v=i(21),m=r(v),b=i(13),_=r(b),E=i(134),T=r(E),k=i(74),A=r(k),S=i(24),L=r(S),R=i(34),w=r(R),C=i(6),O=r(C),D=i(149),P=r(D),I=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r.configureDomRecycler(),r.playerInfo=w.default.getInstance(i.playerId),r.firstResize=!0,r.plugins=[],r.containers=[],r.setupMediaControl(null),r._boundFullscreenHandler=function(){return r.handleFullscreenChange()},(0,O.default)(document).bind("fullscreenchange",r._boundFullscreenHandler),(0,O.default)(document).bind("MSFullscreenChange",r._boundFullscreenHandler),(0,O.default)(document).bind("mozfullscreenchange",r._boundFullscreenHandler),_.default.isMobile&&(0,O.default)(window).bind("resize",function(t){r.handleWindowResize(t)}),r}return(0,c.default)(e,t),(0,u.default)(e,[{key:"events",get:function(){return{webkitfullscreenchange:"handleFullscreenChange",mousemove:"showMediaControl",mouseleave:"hideMediaControl"}}},{key:"attributes",get:function(){return{"data-player":"",tabindex:9999}}},{key:"isReady",get:function(){return!!this.ready}},{key:"i18n",get:function(){return this.getPlugin("strings")||{t:function(t){return t}}}}]),e.prototype.configureDomRecycler=function(){var t=!!(this.options&&this.options.playback&&this.options.playback.recycleVideo);f.DomRecycler.configure({recycleVideo:t})},e.prototype.createContainers=function(t){var e=this;this.defer=O.default.Deferred(),this.defer.promise(this),this.containerFactory=new T.default(t,t.loader,this.i18n),this.containerFactory.createContainers().then(function(t){return e.setupContainers(t)}).then(function(t){return e.resolveOnContainersReady(t)})},e.prototype.updateSize=function(){f.Fullscreen.isFullscreen()?this.setFullscreen():this.setPlayerSize()},e.prototype.setFullscreen=function(){_.default.isiOS||(this.$el.addClass("fullscreen"),this.$el.removeAttr("style"),this.playerInfo.previousSize={width:this.options.width,height:this.options.height},this.playerInfo.currentSize={width:(0,O.default)(window).width(),height:(0,O.default)(window).height()})},e.prototype.setPlayerSize=function(){this.$el.removeClass("fullscreen"),this.playerInfo.currentSize=this.playerInfo.previousSize,this.playerInfo.previousSize={width:(0,O.default)(window).width(),height:(0,O.default)(window).height()},this.resize(this.playerInfo.currentSize)},e.prototype.resize=function(t){(0,f.isNumber)(t.height)||(0,f.isNumber)(t.width)?(this.el.style.height=t.height+"px",this.el.style.width=t.width+"px"):(this.el.style.height=""+t.height,this.el.style.width=""+t.width),this.playerInfo.previousSize={width:this.options.width,height:this.options.height},this.options.width=t.width,this.options.height=t.height,this.playerInfo.currentSize=t,this.triggerResize(this.playerInfo.currentSize)},e.prototype.enableResizeObserver=function(){var t=this,e=function(){t.playerInfo.computedSize.width==t.el.clientWidth&&t.playerInfo.computedSize.height==t.el.clientHeight||(t.playerInfo.computedSize={width:t.el.clientWidth,height:t.el.clientHeight},t.triggerResize(t.playerInfo.computedSize))};this.resizeObserverInterval=setInterval(e,500)},e.prototype.triggerResize=function(t){(this.firstResize||this.oldHeight!==t.height||this.oldWidth!==t.width)&&(L.default.trigger(this.options.playerId+":"+p.default.PLAYER_RESIZE,t),this.oldHeight=t.height,this.oldWidth=t.width,this.firstResize=!1)},e.prototype.disableResizeObserver=function(){this.resizeObserverInterval&&clearInterval(this.resizeObserverInterval)},e.prototype.resolveOnContainersReady=function(t){var e=this;O.default.when.apply(O.default,t).done(function(){e.defer.resolve(e),e.ready=!0,e.trigger(p.default.CORE_READY)})},e.prototype.addPlugin=function(t){this.plugins.push(t)},e.prototype.hasPlugin=function(t){return!!this.getPlugin(t)},e.prototype.getPlugin=function(t){return this.plugins.filter(function(e){return e.name===t})[0]},e.prototype.load=function(t,e){var i=this;this.options.mimeType=e,t=t&&t.constructor===Array?t:[t],this.containers.forEach(function(t){return t.destroy()}),this.mediaControl.container=null,this.containerFactory.options=O.default.extend(this.options,{sources:t}),this.containerFactory.createContainers().then(function(t){i.setupContainers(t)})},e.prototype.destroy=function(){this.disableResizeObserver(),this.containers.forEach(function(t){return t.destroy()}),this.plugins.forEach(function(t){return t.destroy()}),this.$el.remove(),this.mediaControl.destroy(),(0,O.default)(document).unbind("fullscreenchange",this._boundFullscreenHandler),(0,O.default)(document).unbind("MSFullscreenChange",this._boundFullscreenHandler),(0,O.default)(document).unbind("mozfullscreenchange",this._boundFullscreenHandler)},e.prototype.handleFullscreenChange=function(){this.trigger(p.default.CORE_FULLSCREEN,f.Fullscreen.isFullscreen()),this.updateSize(),this.mediaControl.show()},e.prototype.handleWindowResize=function(t){var e=(0,O.default)(window).width()>(0,O.default)(window).height()?"landscape":"portrait";this._screenOrientation!==e&&(this._screenOrientation=e,this.trigger(p.default.CORE_SCREEN_ORIENTATION_CHANGED,{event:t,orientation:this._screenOrientation}))},e.prototype.setMediaControlContainer=function(t){this.mediaControl.setContainer(t),this.mediaControl.render()},e.prototype.disableMediaControl=function(){this.mediaControl.disable(),this.$el.removeClass("nocursor")},e.prototype.enableMediaControl=function(){this.mediaControl.enable()},e.prototype.removeContainer=function(t){this.stopListening(t),this.containers=this.containers.filter(function(e){return e!==t})},e.prototype.appendContainer=function(t){this.listenTo(t,p.default.CONTAINER_DESTROYED,this.removeContainer),this.containers.push(t)},e.prototype.setupContainers=function(t){return t.map(this.appendContainer.bind(this)),this.trigger(p.default.CORE_CONTAINERS_CREATED),this.renderContainers(),this.setupMediaControl(this.getCurrentContainer()),this.render(),this.$el.appendTo(this.options.parentElement),this.containers},e.prototype.renderContainers=function(){var t=this;this.containers.map(function(e){return t.el.appendChild(e.render().el)})},e.prototype.createContainer=function(t,e){var i=this.containerFactory.createContainer(t,e);return this.appendContainer(i),this.el.appendChild(i.render().el),i},e.prototype.setupMediaControl=function(t){this.mediaControl?this.mediaControl.setContainer(t):(this.mediaControl=this.createMediaControl(O.default.extend({container:t,focusElement:this.el},this.options)),this.listenTo(this.mediaControl,p.default.MEDIACONTROL_FULLSCREEN,this.toggleFullscreen),this.listenTo(this.mediaControl,p.default.MEDIACONTROL_SHOW,this.onMediaControlShow.bind(this,!0)),this.listenTo(this.mediaControl,p.default.MEDIACONTROL_HIDE,this.onMediaControlShow.bind(this,!1)))},e.prototype.createMediaControl=function(t){return t.mediacontrol&&t.mediacontrol.external?new t.mediacontrol.external(t).render():new A.default(t).render()},e.prototype.getCurrentContainer=function(){return this.mediaControl&&this.mediaControl.container?this.mediaControl.container:this.containers[0]},e.prototype.getCurrentPlayback=function(){var t=this.getCurrentContainer();return t&&t.playback},e.prototype.getPlaybackType=function(){var t=this.getCurrentContainer();return t&&t.getPlaybackType()},e.prototype.toggleFullscreen=function(){f.Fullscreen.isFullscreen()?(f.Fullscreen.cancelFullscreen(),_.default.isiOS||this.$el.removeClass("fullscreen nocursor")):(f.Fullscreen.requestFullscreen(this.el),_.default.isiOS||this.$el.addClass("fullscreen")),this.mediaControl.show()},e.prototype.showMediaControl=function(t){this.mediaControl.show(t)},e.prototype.hideMediaControl=function(){this.mediaControl.hide(this.options.hideMediaControlDelay)},e.prototype.onMediaControlShow=function(t){this.getCurrentContainer().trigger(t?p.default.CONTAINER_MEDIACONTROL_SHOW:p.default.CONTAINER_MEDIACONTROL_HIDE),t?this.$el.removeClass("nocursor"):f.Fullscreen.isFullscreen()&&this.$el.addClass("nocursor")},e.prototype.configure=function(t){var e=this;this._options=O.default.extend(this._options,t),this.configureDomRecycler();var i=t.source||t.sources;i?this.load(i,t.mimeType||this.options.mimeType):(this.trigger(p.default.CORE_OPTIONS_CHANGE),this.containers.forEach(function(t){t.configure(e.options)}))},e.prototype.render=function(){this.$style&&this.$style.remove(),this.$style=y.default.getStyleFor(P.default,{baseUrl:this.options.baseUrl}),this.$el.append(this.$style),this.$el.append(this.mediaControl.render().el),this.options.width=this.options.width||this.$el.width(),this.options.height=this.options.height||this.$el.height();var t={width:this.options.width,height:this.options.height};return this.playerInfo.previousSize=this.playerInfo.currentSize=this.playerInfo.computedSize=t,this.updateSize(),this.previousSize={width:this.$el.width(),height:this.$el.height()},this.enableResizeObserver(),this},e}(m.default);e.default=I,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(135),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(33),a=r(n),o=i(0),s=r(o),l=i(1),u=r(l),d=i(3),c=r(d),f=i(2),h=r(f),p=i(17),g=r(p),y=i(4),v=r(y),m=i(73),b=r(m),_=i(6),E=r(_),T=function(t){function e(i,r,n){(0,s.default)(this,e);var a=(0,u.default)(this,t.call(this,i));return a._i18n=n,a.loader=r,a}return(0,h.default)(e,t),(0,c.default)(e,[{key:"options",get:function(){return this._options},set:function(t){this._options=t}}]),e.prototype.createContainers=function(){var t=this;return E.default.Deferred(function(e){e.resolve(t.options.sources.map(function(e){return t.createContainer(e)}))})},e.prototype.findPlaybackPlugin=function(t,e){return this.loader.playbackPlugins.filter(function(i){return i.canPlay(t,e)})[0]},e.prototype.createContainer=function(t){var e=null,i=this.options.mimeType;"object"===(void 0===t?"undefined":(0,a.default)(t))?(e=t.source.toString(),t.mimeType&&(i=t.mimeType)):e=t.toString(),e.match(/^\/\//)&&(e=window.location.protocol+e);var r=E.default.extend({},this.options,{src:e,mimeType:i}),n=this.findPlaybackPlugin(e,i),o=new n(r,this._i18n);r=E.default.extend({},r,{playback:o});var s=new b.default(r,this._i18n),l=E.default.Deferred();return l.promise(s),this.addContainerPlugins(s),this.listenToOnce(s,v.default.CONTAINER_READY,function(){return l.resolve(s)}),s},e.prototype.addContainerPlugins=function(t){this.loader.containerPlugins.forEach(function(e){t.addPlugin(new e(t))})},e}(g.default);e.default=T,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(4),h=r(f),p=i(21),g=r(p),y=i(7),v=r(y),m=i(137),b=r(m),_=i(6),E=r(_),T=function(t){function e(i,r){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n._i18n=r,n.currentTime=0,n.volume=100,n.playback=i.playback,n.settings=E.default.extend({},n.playback.settings),n.isReady=!1,n.mediaControlDisabled=!1,n.plugins=[n.playback],n.bindEvents(),n}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"Container"}},{key:"attributes",get:function(){return{class:"container","data-container":""}}},{key:"events",get:function(){return{click:"clicked",dblclick:"dblClicked",doubleTap:"dblClicked",contextmenu:"onContextMenu",mouseenter:"mouseEnter",mouseleave:"mouseLeave"}}},{key:"ended",get:function(){return this.playback.ended}},{key:"buffering",get:function(){return this.playback.buffering}},{key:"i18n",get:function(){return this._i18n}},{key:"hasClosedCaptionsTracks",get:function(){return this.playback.hasClosedCaptionsTracks}},{key:"closedCaptionsTracks",get:function(){return this.playback.closedCaptionsTracks}},{key:"closedCaptionsTrackId",get:function(){return this.playback.closedCaptionsTrackId},set:function(t){this.playback.closedCaptionsTrackId=t}}]),e.prototype.bindEvents=function(){this.listenTo(this.playback,h.default.PLAYBACK_PROGRESS,this.progress),this.listenTo(this.playback,h.default.PLAYBACK_TIMEUPDATE,this.timeUpdated),this.listenTo(this.playback,h.default.PLAYBACK_READY,this.ready),this.listenTo(this.playback,h.default.PLAYBACK_BUFFERING,this.onBuffering),this.listenTo(this.playback,h.default.PLAYBACK_BUFFERFULL,this.bufferfull),this.listenTo(this.playback,h.default.PLAYBACK_SETTINGSUPDATE,this.settingsUpdate),this.listenTo(this.playback,h.default.PLAYBACK_LOADEDMETADATA,this.loadedMetadata),this.listenTo(this.playback,h.default.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinitionUpdate),this.listenTo(this.playback,h.default.PLAYBACK_BITRATE,this.updateBitrate),this.listenTo(this.playback,h.default.PLAYBACK_PLAYBACKSTATE,this.playbackStateChanged),this.listenTo(this.playback,h.default.PLAYBACK_DVR,this.playbackDvrStateChanged),this.listenTo(this.playback,h.default.PLAYBACK_MEDIACONTROL_DISABLE,this.disableMediaControl),this.listenTo(this.playback,h.default.PLAYBACK_MEDIACONTROL_ENABLE,this.enableMediaControl),this.listenTo(this.playback,h.default.PLAYBACK_ENDED,this.onEnded),this.listenTo(this.playback,h.default.PLAYBACK_PLAY,this.playing),this.listenTo(this.playback,h.default.PLAYBACK_PAUSE,this.paused),this.listenTo(this.playback,h.default.PLAYBACK_STOP,this.stopped),this.listenTo(this.playback,h.default.PLAYBACK_ERROR,this.error),this.listenTo(this.playback,h.default.PLAYBACK_SUBTITLE_AVAILABLE,this.subtitleAvailable),this.listenTo(this.playback,h.default.PLAYBACK_SUBTITLE_CHANGED,this.subtitleChanged)},e.prototype.subtitleAvailable=function(){this.trigger(h.default.CONTAINER_SUBTITLE_AVAILABLE)},e.prototype.subtitleChanged=function(t){this.trigger(h.default.CONTAINER_SUBTITLE_CHANGED,t)},e.prototype.playbackStateChanged=function(t){this.trigger(h.default.CONTAINER_PLAYBACKSTATE,t)},e.prototype.playbackDvrStateChanged=function(t){this.settings=this.playback.settings,this.dvrInUse=t,this.trigger(h.default.CONTAINER_PLAYBACKDVRSTATECHANGED,t)},e.prototype.updateBitrate=function(t){this.trigger(h.default.CONTAINER_BITRATE,t)},e.prototype.statsReport=function(t){this.trigger(h.default.CONTAINER_STATS_REPORT,t)},e.prototype.getPlaybackType=function(){return this.playback.getPlaybackType()},e.prototype.isDvrEnabled=function(){return!!this.playback.dvrEnabled},e.prototype.isDvrInUse=function(){return!!this.dvrInUse},e.prototype.destroy=function(){this.trigger(h.default.CONTAINER_DESTROYED,this,this.name),this.stopListening(),this.plugins.forEach(function(t){return t.destroy()}),this.$el.remove()},e.prototype.setStyle=function(t){this.$el.css(t)},e.prototype.animate=function(t,e){return this.$el.animate(t,e).promise()},e.prototype.ready=function(){this.isReady=!0,this.trigger(h.default.CONTAINER_READY,this.name)},e.prototype.isPlaying=function(){return this.playback.isPlaying()},e.prototype.getStartTimeOffset=function(){return this.playback.getStartTimeOffset()},e.prototype.getCurrentTime=function(){return this.currentTime},e.prototype.getDuration=function(){return this.playback.getDuration()},e.prototype.error=function(t){this.isReady||this.ready(),this.trigger(h.default.CONTAINER_ERROR,{error:t,container:this},this.name)},e.prototype.loadedMetadata=function(t){this.trigger(h.default.CONTAINER_LOADEDMETADATA,t)},e.prototype.timeUpdated=function(t){this.currentTime=t.current,this.trigger(h.default.CONTAINER_TIMEUPDATE,t,this.name)},e.prototype.progress=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];this.trigger.apply(this,[h.default.CONTAINER_PROGRESS].concat(e,[this.name]))},e.prototype.playing=function(){this.trigger(h.default.CONTAINER_PLAY,this.name)},e.prototype.paused=function(){this.trigger(h.default.CONTAINER_PAUSE,this.name)},e.prototype.play=function(){this.playback.play()},e.prototype.stop=function(){this.playback.stop(),this.currentTime=0},e.prototype.pause=function(){this.playback.pause()},e.prototype.onEnded=function(){this.trigger(h.default.CONTAINER_ENDED,this,this.name),this.currentTime=0},e.prototype.stopped=function(){this.trigger(h.default.CONTAINER_STOP)},e.prototype.clicked=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(h.default.CONTAINER_CLICK,this,this.name)},e.prototype.dblClicked=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(h.default.CONTAINER_DBLCLICK,this,this.name)},e.prototype.onContextMenu=function(t){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(h.default.CONTAINER_CONTEXTMENU,t,this.name)},e.prototype.seek=function(t){this.trigger(h.default.CONTAINER_SEEK,t,this.name),this.playback.seek(t)},e.prototype.seekPercentage=function(t){var e=this.getDuration();if(t>=0&&t<=100){var i=e*(t/100);this.seek(i)}},e.prototype.setVolume=function(t){this.volume=parseInt(t,10),this.trigger(h.default.CONTAINER_VOLUME,t,this.name),this.playback.volume(t)},e.prototype.fullscreen=function(){this.trigger(h.default.CONTAINER_FULLSCREEN,this.name)},e.prototype.onBuffering=function(){this.trigger(h.default.CONTAINER_STATE_BUFFERING,this.name)},e.prototype.bufferfull=function(){this.trigger(h.default.CONTAINER_STATE_BUFFERFULL,this.name)},e.prototype.addPlugin=function(t){this.plugins.push(t)},e.prototype.hasPlugin=function(t){return!!this.getPlugin(t)},e.prototype.getPlugin=function(t){return this.plugins.filter(function(e){return e.name===t})[0]},e.prototype.mouseEnter=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(h.default.CONTAINER_MOUSE_ENTER)},e.prototype.mouseLeave=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(h.default.CONTAINER_MOUSE_LEAVE)},e.prototype.settingsUpdate=function(){this.settings=this.playback.settings,this.trigger(h.default.CONTAINER_SETTINGSUPDATE)},e.prototype.highDefinitionUpdate=function(t){this.trigger(h.default.CONTAINER_HIGHDEFINITIONUPDATE,t)},e.prototype.isHighDefinitionInUse=function(){return this.playback.isHighDefinitionInUse()},e.prototype.disableMediaControl=function(){this.mediaControlDisabled||(this.mediaControlDisabled=!0,this.trigger(h.default.CONTAINER_MEDIACONTROL_DISABLE))},e.prototype.enableMediaControl=function(){this.mediaControlDisabled&&(this.mediaControlDisabled=!1,this.trigger(h.default.CONTAINER_MEDIACONTROL_ENABLE))},e.prototype.updateStyle=function(){!this.options.chromeless||this.options.allowUserInteraction?this.$el.removeClass("chromeless"):this.$el.addClass("chromeless")},e.prototype.configure=function(t){this._options=E.default.extend(this._options,t),this.updateStyle(),this.trigger(h.default.CONTAINER_OPTIONS_CHANGE)},e.prototype.render=function(){var t=v.default.getStyleFor(b.default);return this.$el.append(t),this.$el.append(this.playback.render().el),this.updateStyle(),this},e}(g.default);e.default=T,t.exports=e.default},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,".container[data-container]{position:absolute;background-color:#000;height:100%;width:100%}.container[data-container] .chromeless{cursor:default}[data-player]:not(.nocursor) .container[data-container]:not(.chromeless).pointer-enabled{cursor:pointer}",""])},function(t,e,i){"use strict";(function(r){function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=i(139),o=n(a),s=i(0),l=n(s),u=i(1),d=n(u),c=i(3),f=n(c),h=i(2),p=n(h),g=i(5),y=i(56),v=i(4),m=n(v),b=i(7),_=n(b),E=i(21),T=n(E),k=i(13),A=n(k),S=i(24),L=n(S),R=i(8),w=n(R),C=i(9),O=n(C),D=i(6),P=n(D),I=i(141),x=n(I),N=i(142),M=n(N),F=i(58),B=n(F),U=i(76),G=n(U),j=i(143),V=n(j),K=i(144),Y=n(K),H=i(145),$=n(H),z=i(146),W=n(z),q=i(147),X=n(q),Z=i(148),J=n(Z),Q=function(t){function e(i){(0,l.default)(this,e);var r=(0,d.default)(this,t.call(this,i));r.persistConfig=r.options.persistConfig,r.container=i.container,r.currentPositionValue=null,r.currentDurationValue=null;var n=r.persistConfig?g.Config.restore("volume"):100;return r.setVolume(r.options.mute?0:n),r.keepVisible=!1,r.fullScreenOnVideoTagSupported=null,r.addEventListeners(),r.settings={left:["play","stop","pause"],right:["volume"],default:["position","seekbar","duration"]},r.container?P.default.isEmptyObject(r.container.settings)||(r.settings=P.default.extend({},r.container.settings)):r.settings={},r.userDisabled=!1,(r.container&&r.container.mediaControlDisabled||r.options.chromeless)&&r.disable(),r.stopDragHandler=function(t){return r.stopDrag(t)},r.updateDragHandler=function(t){return r.updateDrag(t)},(0,P.default)(document).bind("mouseup",r.stopDragHandler),(0,P.default)(document).bind("mousemove",r.updateDragHandler),r}return(0,p.default)(e,t),(0,f.default)(e,[{key:"name",get:function(){return"MediaControl"}},{key:"disabled",get:function(){return this.userDisabled||this.container&&this.container.getPlaybackType()===O.default.NO_OP}},{key:"attributes",get:function(){return{class:"media-control","data-media-control":""}}},{key:"events",get:function(){return{"click [data-play]":"play","click [data-pause]":"pause","click [data-playpause]":"togglePlayPause","click [data-stop]":"stop","click [data-playstop]":"togglePlayStop","click [data-fullscreen]":"toggleFullscreen","click .bar-container[data-seekbar]":"seek","click .bar-container[data-volume]":"onVolumeClick","click .drawer-icon[data-volume]":"toggleMute","mouseenter .drawer-container[data-volume]":"showVolumeBar","mouseleave .drawer-container[data-volume]":"hideVolumeBar","mousedown .bar-container[data-volume]":"startVolumeDrag","mousemove .bar-container[data-volume]":"mousemoveOnVolumeBar","mousedown .bar-scrubber[data-seekbar]":"startSeekDrag","mousemove .bar-container[data-seekbar]":"mousemoveOnSeekBar","mouseleave .bar-container[data-seekbar]":"mouseleaveOnSeekBar","mouseenter .media-control-layer[data-controls]":"setUserKeepVisible","mouseleave .media-control-layer[data-controls]":"resetUserKeepVisible"}}},{key:"template",get:function(){return(0,w.default)(M.default)}},{key:"stylesheet",get:function(){return _.default.getStyleFor(x.default,{baseUrl:this.options.baseUrl})}},{key:"volume",get:function(){return this.container&&this.container.isReady?this.container.volume:this.intendedVolume}},{key:"muted",get:function(){return 0===this.volume}}]),e.prototype.addEventListeners=function(){this.container&&(L.default.on(this.options.playerId+":"+m.default.PLAYER_RESIZE,this.playerResize,this),this.listenTo(this.container,m.default.CONTAINER_PLAY,this.changeTogglePlay),this.listenTo(this.container,m.default.CONTAINER_PAUSE,this.changeTogglePlay),this.listenTo(this.container,m.default.CONTAINER_STOP,this.changeTogglePlay),this.listenTo(this.container,m.default.CONTAINER_DBLCLICK,this.toggleFullscreen),this.listenTo(this.container,m.default.CONTAINER_TIMEUPDATE,this.onTimeUpdate),this.listenTo(this.container,m.default.CONTAINER_PROGRESS,this.updateProgressBar),this.listenTo(this.container,m.default.CONTAINER_SETTINGSUPDATE,this.settingsUpdate),this.listenTo(this.container,m.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.settingsUpdate),this.listenTo(this.container,m.default.CONTAINER_HIGHDEFINITIONUPDATE,this.highDefinitionUpdate),this.listenTo(this.container,m.default.CONTAINER_MEDIACONTROL_DISABLE,this.disable),this.listenTo(this.container,m.default.CONTAINER_MEDIACONTROL_ENABLE,this.enable),this.listenTo(this.container,m.default.CONTAINER_ENDED,this.ended),this.listenTo(this.container,m.default.CONTAINER_VOLUME,this.onVolumeChanged),"video"===this.container.playback.el.nodeName.toLowerCase()&&this.listenToOnce(this.container,m.default.CONTAINER_LOADEDMETADATA,this.onLoadedMetadataOnVideoTag))},e.prototype.disable=function(){this.userDisabled=!0,this.hide(),this.$el.hide()},e.prototype.enable=function(){this.options.chromeless||(this.userDisabled=!1,this.show())},e.prototype.play=function(){this.container.play()},e.prototype.pause=function(){this.container.pause()},e.prototype.stop=function(){this.container.stop()},e.prototype.onVolumeChanged=function(){this.updateVolumeUI()},e.prototype.onLoadedMetadataOnVideoTag=function(){var t=this.container.playback.el;!g.Fullscreen.fullscreenEnabled()&&t.webkitSupportsFullscreen&&(this.fullScreenOnVideoTagSupported=!0,this.settingsUpdate())},e.prototype.updateVolumeUI=function(){if(this.rendered){this.$volumeBarContainer.find(".bar-fill-2").css({});var t=this.$volumeBarContainer.width(),e=this.$volumeBarBackground.width(),i=(t-e)/2,r=e*this.volume/100+i;this.$volumeBarFill.css({width:this.volume+"%"}),this.$volumeBarScrubber.css({left:r}),this.$volumeBarContainer.find(".segmented-bar-element").removeClass("fill");var n=Math.ceil(this.volume/10);this.$volumeBarContainer.find(".segmented-bar-element").slice(0,n).addClass("fill"),this.$volumeIcon.html(""),this.$volumeIcon.removeClass("muted"),this.muted?(this.$volumeIcon.append($.default),this.$volumeIcon.addClass("muted")):this.$volumeIcon.append(Y.default),this.applyButtonStyle(this.$volumeIcon)}},e.prototype.changeTogglePlay=function(){this.$playPauseToggle.html(""),this.$playStopToggle.html(""),this.container&&this.container.isPlaying()?(this.$playPauseToggle.append(G.default),this.$playStopToggle.append(V.default),this.trigger(m.default.MEDIACONTROL_PLAYING)):(this.$playPauseToggle.append(B.default),this.$playStopToggle.append(B.default),this.trigger(m.default.MEDIACONTROL_NOTPLAYING),A.default.isMobile&&this.show()),this.applyButtonStyle(this.$playPauseToggle),this.applyButtonStyle(this.$playStopToggle)},e.prototype.mousemoveOnSeekBar=function(t){if(this.settings.seekEnabled){var e=t.pageX-this.$seekBarContainer.offset().left-this.$seekBarHover.width()/2;this.$seekBarHover.css({left:e})}this.trigger(m.default.MEDIACONTROL_MOUSEMOVE_SEEKBAR,t)},e.prototype.mouseleaveOnSeekBar=function(t){this.trigger(m.default.MEDIACONTROL_MOUSELEAVE_SEEKBAR,t)},e.prototype.onVolumeClick=function(t){this.setVolume(this.getVolumeFromUIEvent(t))},e.prototype.mousemoveOnVolumeBar=function(t){this.draggingVolumeBar&&this.setVolume(this.getVolumeFromUIEvent(t))},e.prototype.playerResize=function(t){this.$fullscreenToggle.html(""),g.Fullscreen.isFullscreen()?this.$fullscreenToggle.append(X.default):this.$fullscreenToggle.append(W.default),this.applyButtonStyle(this.$fullscreenToggle),this.$el.removeClass("w320"),(t.width<=320||this.options.hideVolumeBar)&&this.$el.addClass("w320")},e.prototype.togglePlayPause=function(){return this.container.isPlaying()?this.container.pause():this.container.play(),!1},e.prototype.togglePlayStop=function(){this.container.isPlaying()?this.container.stop():this.container.play()},e.prototype.startSeekDrag=function(t){this.settings.seekEnabled&&(this.draggingSeekBar=!0,this.$el.addClass("dragging"),this.$seekBarLoaded.addClass("media-control-notransition"),this.$seekBarPosition.addClass("media-control-notransition"),this.$seekBarScrubber.addClass("media-control-notransition"),t&&t.preventDefault())},e.prototype.startVolumeDrag=function(t){this.draggingVolumeBar=!0,this.$el.addClass("dragging"),t&&t.preventDefault()},e.prototype.stopDrag=function(t){this.draggingSeekBar&&this.seek(t),this.$el.removeClass("dragging"),this.$seekBarLoaded.removeClass("media-control-notransition"),this.$seekBarPosition.removeClass("media-control-notransition"),this.$seekBarScrubber.removeClass("media-control-notransition dragging"),this.draggingSeekBar=!1,this.draggingVolumeBar=!1},e.prototype.updateDrag=function(t){if(this.draggingSeekBar){t.preventDefault();var e=t.pageX-this.$seekBarContainer.offset().left,i=e/this.$seekBarContainer.width()*100;i=Math.min(100,Math.max(i,0)),this.setSeekPercentage(i)}else this.draggingVolumeBar&&(t.preventDefault(),this.setVolume(this.getVolumeFromUIEvent(t)))},e.prototype.getVolumeFromUIEvent=function(t){return(t.pageX-this.$volumeBarContainer.offset().left)/this.$volumeBarContainer.width()*100},e.prototype.toggleMute=function(){this.setVolume(this.muted?100:0)},e.prototype.setVolume=function(t){var e=this;t=Math.min(100,Math.max(t,0)),this.intendedVolume=t,this.persistConfig&&g.Config.persist("volume",t);var i=function(){e.container.isReady?e.container.setVolume(t):e.listenToOnce(e.container,m.default.CONTAINER_READY,function(){e.container.setVolume(t)})};this.container?i():this.listenToOnce(this,m.default.MEDIACONTROL_CONTAINERCHANGED,function(){i()})},e.prototype.toggleFullscreen=function(){this.trigger(m.default.MEDIACONTROL_FULLSCREEN,this.name),this.container.fullscreen(),this.resetUserKeepVisible()},e.prototype.setContainer=function(t){this.container&&(this.stopListening(this.container),this.fullScreenOnVideoTagSupported=null),L.default.off(this.options.playerId+":"+m.default.PLAYER_RESIZE,this.playerResize,this),this.container=t,this.setVolume(this.intendedVolume),this.changeTogglePlay(),this.addEventListeners(),this.settingsUpdate(),this.container.trigger(m.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.container.isDvrInUse()),this.container.mediaControlDisabled&&this.disable(),this.trigger(m.default.MEDIACONTROL_CONTAINERCHANGED)},e.prototype.showVolumeBar=function(){this.hideVolumeId&&clearTimeout(this.hideVolumeId),this.$volumeBarContainer.removeClass("volume-bar-hide")},e.prototype.hideVolumeBar=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:400;this.$volumeBarContainer&&(this.draggingVolumeBar?this.hideVolumeId=setTimeout(function(){return t.hideVolumeBar()},e):(this.hideVolumeId&&clearTimeout(this.hideVolumeId),this.hideVolumeId=setTimeout(function(){return t.$volumeBarContainer.addClass("volume-bar-hide")},e)))},e.prototype.ended=function(){this.changeTogglePlay()},e.prototype.updateProgressBar=function(t){var e=t.start/t.total*100,i=t.current/t.total*100;this.$seekBarLoaded.css({left:e+"%",width:i-e+"%"})},e.prototype.onTimeUpdate=function(t){if(!this.draggingSeekBar){var e=t.current<0?t.total:t.current;this.currentPositionValue=e,this.currentDurationValue=t.total,this.renderSeekBar()}},e.prototype.renderSeekBar=function(){if(null!==this.currentPositionValue&&null!==this.currentDurationValue){this.currentSeekBarPercentage=100,(this.container.getPlaybackType()!==O.default.LIVE||this.container.isDvrInUse())&&(this.currentSeekBarPercentage=this.currentPositionValue/this.currentDurationValue*100),this.setSeekPercentage(this.currentSeekBarPercentage);var t=(0,g.formatTime)(this.currentPositionValue),e=(0,g.formatTime)(this.currentDurationValue);t!==this.displayedPosition&&(this.$position.text(t),this.displayedPosition=t),e!==this.displayedDuration&&(this.$duration.text(e),this.displayedDuration=e)}},e.prototype.seek=function(t){if(this.settings.seekEnabled){var e=t.pageX-this.$seekBarContainer.offset().left,i=e/this.$seekBarContainer.width()*100;return i=Math.min(100,Math.max(i,0)),this.container.seekPercentage(i),this.setSeekPercentage(i),!1}},e.prototype.setKeepVisible=function(){this.keepVisible=!0},e.prototype.resetKeepVisible=function(){this.keepVisible=!1},e.prototype.setUserKeepVisible=function(){this.userKeepVisible=!0},e.prototype.resetUserKeepVisible=function(){this.userKeepVisible=!1},e.prototype.isVisible=function(){return!this.$el.hasClass("media-control-hide")},e.prototype.show=function(t){var e=this;if(!this.disabled){(!t||t.clientX!==this.lastMouseX&&t.clientY!==this.lastMouseY||navigator.userAgent.match(/firefox/i))&&(clearTimeout(this.hideId),this.$el.show(),this.trigger(m.default.MEDIACONTROL_SHOW,this.name),this.$el.removeClass("media-control-hide"),this.hideId=setTimeout(function(){return e.hide()},2e3),t&&(this.lastMouseX=t.clientX,this.lastMouseY=t.clientY))}},e.prototype.hide=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.isVisible()&&(!A.default.isMobile||this.container.isPlaying())){var i=e||2e3;clearTimeout(this.hideId),(this.disabled||!1!==this.options.hideMediaControl)&&(!this.disabled&&(e||this.userKeepVisible||this.keepVisible||this.draggingSeekBar||this.draggingVolumeBar)?this.hideId=setTimeout(function(){return t.hide()},i):(this.trigger(m.default.MEDIACONTROL_HIDE,this.name),this.$el.addClass("media-control-hide"),this.hideVolumeBar(0)))}},e.prototype.settingsUpdate=function(){var t=this.getSettings();!t||this.fullScreenOnVideoTagSupported||g.Fullscreen.fullscreenEnabled()||(t.default&&(0,g.removeArrayItem)(t.default,"fullscreen"),t.left&&(0,g.removeArrayItem)(t.left,"fullscreen"),t.right&&(0,g.removeArrayItem)(t.right,"fullscreen")),(0,o.default)(this.settings)!==(0,o.default)(t)&&(this.settings=t,this.render())},e.prototype.getSettings=function(){return P.default.extend(!0,{},this.container.settings)},e.prototype.highDefinitionUpdate=function(t){var e=t?"addClass":"removeClass";this.$hdIndicator[e]("enabled")},e.prototype.createCachedElements=function(){var t=this.$el.find(".media-control-layer");this.$duration=t.find(".media-control-indicator[data-duration]"),this.$fullscreenToggle=t.find("button.media-control-button[data-fullscreen]"),this.$playPauseToggle=t.find("button.media-control-button[data-playpause]"),this.$playStopToggle=t.find("button.media-control-button[data-playstop]"),this.$position=t.find(".media-control-indicator[data-position]"),this.$seekBarContainer=t.find(".bar-container[data-seekbar]"),this.$seekBarHover=t.find(".bar-hover[data-seekbar]"),this.$seekBarLoaded=t.find(".bar-fill-1[data-seekbar]"),this.$seekBarPosition=t.find(".bar-fill-2[data-seekbar]"),this.$seekBarScrubber=t.find(".bar-scrubber[data-seekbar]"),this.$volumeBarContainer=t.find(".bar-container[data-volume]"),this.$volumeContainer=t.find(".drawer-container[data-volume]"),this.$volumeIcon=t.find(".drawer-icon[data-volume]"),this.$volumeBarBackground=this.$el.find(".bar-background[data-volume]"),this.$volumeBarFill=this.$el.find(".bar-fill-1[data-volume]"),this.$volumeBarScrubber=this.$el.find(".bar-scrubber[data-volume]"),this.$hdIndicator=this.$el.find("button.media-control-button[data-hd-indicator]"),this.resetIndicators(),this.initializeIcons()},e.prototype.resetIndicators=function(){this.displayedPosition=this.$position.text(),this.displayedDuration=this.$duration.text()},e.prototype.initializeIcons=function(){var t=this.$el.find(".media-control-layer");t.find("button.media-control-button[data-play]").append(B.default),t.find("button.media-control-button[data-pause]").append(G.default),t.find("button.media-control-button[data-stop]").append(V.default),this.$playPauseToggle.append(B.default),this.$playStopToggle.append(B.default),this.$volumeIcon.append(Y.default),this.$fullscreenToggle.append(W.default),this.$hdIndicator.append(J.default)},e.prototype.setSeekPercentage=function(t){t=Math.max(Math.min(t,100),0),this.displayedSeekBarPercentage!==t&&(this.displayedSeekBarPercentage=t,this.$seekBarPosition.removeClass("media-control-notransition"),this.$seekBarScrubber.removeClass("media-control-notransition"),this.$seekBarPosition.css({width:t+"%"}),this.$seekBarScrubber.css({left:t+"%"}))},e.prototype.seekRelative=function(t){if(this.settings.seekEnabled){var e=this.container.getCurrentTime(),i=this.container.getDuration(),r=Math.min(Math.max(e+t,0),i);r=Math.min(100*r/i,100),this.container.seekPercentage(r)}},e.prototype.bindKeyAndShow=function(t,e){var i=this;this.kibo.down(t,function(){return i.show(),e()})},e.prototype.bindKeyEvents=function(){var t=this;this.unbindKeyEvents(),this.kibo=new y.Kibo(this.options.focusElement),this.bindKeyAndShow("space",function(){return t.togglePlayPause()}),this.bindKeyAndShow("left",function(){return t.seekRelative(-5)}),this.bindKeyAndShow("right",function(){return t.seekRelative(5)}),this.bindKeyAndShow("shift left",function(){return t.seekRelative(-10)}),this.bindKeyAndShow("shift right",function(){return t.seekRelative(10)}),this.bindKeyAndShow("shift ctrl left",function(){return t.seekRelative(-15)}),this.bindKeyAndShow("shift ctrl right",function(){return t.seekRelative(15)}),["1","2","3","4","5","6","7","8","9","0"].forEach(function(e){t.bindKeyAndShow(e,function(){return t.settings.seekEnabled&&t.container.seekPercentage(10*e)})})},e.prototype.unbindKeyEvents=function(){this.kibo&&(this.kibo.off("space"),this.kibo.off("left"),this.kibo.off("right"),this.kibo.off("shift left"),this.kibo.off("shift right"),this.kibo.off("shift ctrl left"),this.kibo.off("shift ctrl right"),this.kibo.off(["1","2","3","4","5","6","7","8","9","0"]))},e.prototype.parseColors=function(){if(this.options.mediacontrol){this.buttonsColor=this.options.mediacontrol.buttons;var t=this.options.mediacontrol.seekbar;this.$el.find(".bar-fill-2[data-seekbar]").css("background-color",t),this.$el.find(".media-control-icon svg path").css("fill",this.buttonsColor),this.$el.find(".segmented-bar-element[data-volume]").css("boxShadow","inset 2px 0 0 "+this.buttonsColor)}},e.prototype.applyButtonStyle=function(t){this.buttonsColor&&t&&(0,P.default)(t).find("svg path").css("fill",this.buttonsColor)},e.prototype.destroy=function(){this.remove(),(0,P.default)(document).unbind("mouseup",this.stopDragHandler),(0,P.default)(document).unbind("mousemove",this.updateDragHandler),this.unbindKeyEvents()},e.prototype.render=function(){var t=this;this.$el.html(this.template({settings:this.settings})),this.$el.append(this.stylesheet),this.createCachedElements(),this.$playPauseToggle.addClass("paused"),this.$playStopToggle.addClass("stopped"),this.changeTogglePlay(),this.hideId=setTimeout(function(){return t.hide()},1e3),this.disabled&&this.hide(),A.default.isSafari&&A.default.isMobile&&(A.default.version<10?this.$volumeContainer.css("display","none"):this.$volumeBarContainer.css("display","none")),this.$seekBarPosition.addClass("media-control-notransition"),this.$seekBarScrubber.addClass("media-control-notransition");var e=0;return this.displayedSeekBarPercentage&&(e=this.displayedSeekBarPercentage),this.displayedSeekBarPercentage=null,this.setSeekPercentage(e),r.nextTick(function(){t.settings.seekEnabled||t.$seekBarContainer.addClass("seek-disabled"),A.default.isMobile||t.options.disableKeyboardShortcuts||t.bindKeyEvents(),t.playerResize({width:t.options.width,height:t.options.height}),t.hideVolumeBar(0)}),this.parseColors(),this.highDefinitionUpdate(),this.rendered=!0,this.updateVolumeUI(),this.trigger(m.default.MEDIACONTROL_RENDERED),this},e}(T.default);e.default=Q,Q.extend=function(t){return(0,g.extend)(Q,t)},t.exports=e.default}).call(e,i(57))},function(t,e,i){t.exports={default:i(140),__esModule:!0}},function(t,e,i){var r=i(11),n=r.JSON||(r.JSON={stringify:JSON.stringify});t.exports=function(t){return n.stringify.apply(n,arguments)}},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,".media-control-notransition{-webkit-transition:none!important;-moz-transition:none!important;transition:none!important}.media-control[data-media-control]{position:absolute;width:100%;height:100%;z-index:9999;pointer-events:none}.media-control[data-media-control].dragging{pointer-events:auto;cursor:-webkit-grabbing!important;cursor:grabbing!important;cursor:url("+i(75)+"),move}.media-control[data-media-control].dragging *{cursor:-webkit-grabbing!important;cursor:grabbing!important;cursor:url("+i(75)+'),move}.media-control[data-media-control] .media-control-background[data-background]{position:absolute;height:40%;width:100%;bottom:0;background:-webkit-linear-gradient(transparent,rgba(0,0,0,.9));background:linear-gradient(transparent,rgba(0,0,0,.9));-webkit-transition:opacity .6s ease-out;-moz-transition:opacity .6s ease-out;transition:opacity .6s ease-out}.media-control[data-media-control] .media-control-icon{line-height:0;letter-spacing:0;speak:none;color:#fff;opacity:.5;vertical-align:middle;text-align:left;-webkit-transition:all .1s ease;-moz-transition:all .1s ease;transition:all .1s ease}.media-control[data-media-control] .media-control-icon:hover{color:#fff;opacity:.75;text-shadow:hsla(0,0%,100%,.8) 0 0 5px}.media-control[data-media-control].media-control-hide .media-control-background[data-background]{opacity:0}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls]{bottom:-50px}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls]{position:absolute;bottom:7px;width:100%;height:32px;font-size:0;vertical-align:middle;pointer-events:auto;-webkit-transition:bottom .4s ease-out;-moz-transition:bottom .4s ease-out;transition:bottom .4s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control]{position:absolute;top:0;left:4px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control]{height:100%;text-align:center;line-height:32px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control]{position:absolute;top:0;right:4px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button{background-color:transparent;border:0;margin:0 6px;padding:0;cursor:pointer;display:inline-block;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg{width:100%;height:22px}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg path{fill:#fff}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus{outline:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop]{float:left;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen]{float:right;background-color:transparent;border:0;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator]{background-color:transparent;border:0;cursor:default;display:none;float:right;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled{display:block;opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled:hover{opacity:1;text-shadow:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop]{float:left}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration],.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{display:inline-block;font-size:10px;color:#fff;cursor:default;line-height:32px;position:relative}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{margin:0 6px 0 7px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]{color:hsla(0,0%,100%,.5);margin-right:6px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before{content:"|";margin-right:7px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]{position:absolute;top:-20px;left:0;display:inline-block;vertical-align:middle;width:100%;height:25px;cursor:pointer}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar]{width:100%;height:1px;position:relative;top:12px;background-color:#666}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#c2c2c2;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#005aff;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:0;position:absolute;top:-3px;width:5px;height:7px;background-color:hsla(0,0%,100%,.5);-webkit-transition:opacity .1s ease;-moz-transition:opacity .1s ease;transition:opacity .1s ease}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]:hover .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled{cursor:default}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled:hover .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{position:absolute;-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);-ms-transform:translateX(-50%);-o-transform:translateX(-50%);transform:translateX(-50%);top:2px;left:0;width:20px;height:20px;opacity:1;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar]{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:10px;box-shadow:0 0 0 6px hsla(0,0%,100%,.2);background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume]{float:right;display:inline-block;height:32px;cursor:pointer;margin:0 6px;box-sizing:border-box}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume]{float:left;bottom:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]{background-color:transparent;border:0;box-sizing:content-box;width:32px;height:32px;opacity:.5}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:hover{opacity:.75}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg{height:24px;position:relative;top:3px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg path{fill:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted svg{margin-left:2px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume]{float:left;position:relative;overflow:hidden;top:6px;width:42px;height:18px;padding:3px 0;-webkit-transition:width .2s ease-out;-moz-transition:width .2s ease-out;transition:width .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume]{height:1px;position:relative;top:7px;margin:0 3px;background-color:#666}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#c2c2c2;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-2[data-volume]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#005aff;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-hover[data-volume]{opacity:0;position:absolute;top:-3px;width:5px;height:7px;background-color:hsla(0,0%,100%,.5);-webkit-transition:opacity .1s ease;-moz-transition:opacity .1s ease;transition:opacity .1s ease}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume]{position:absolute;-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);-ms-transform:translateX(-50%);-o-transform:translateX(-50%);transform:translateX(-50%);top:0;left:0;width:20px;height:20px;opacity:1;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume]{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:10px;box-shadow:0 0 0 6px hsla(0,0%,100%,.2);background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]{float:left;width:4px;padding-left:2px;height:12px;opacity:.5;box-shadow:inset 2px 0 0 #fff;-webkit-transition:-webkit-transform .2s ease-out;-moz-transition:-moz-transform .2s ease-out;transition:transform .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume].fill{box-shadow:inset 2px 0 0 #fff;opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:first-of-type{padding-left:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:hover{-webkit-transform:scaleY(1.5);-moz-transform:scaleY(1.5);-ms-transform:scaleY(1.5);-o-transform:scaleY(1.5);transform:scaleY(1.5)}.media-control[data-media-control].w320 .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide{width:0;height:12px;top:9px;padding:0}',""])},function(t,e){t.exports='<div class="media-control-background" data-background></div>\n<div class="media-control-layer" data-controls>\n <% var renderBar = function(name) { %>\n <div class="bar-container" data-<%= name %>>\n <div class="bar-background" data-<%= name %>>\n <div class="bar-fill-1" data-<%= name %>></div>\n <div class="bar-fill-2" data-<%= name %>></div>\n <div class="bar-hover" data-<%= name %>></div>\n </div>\n <div class="bar-scrubber" data-<%= name %>>\n <div class="bar-scrubber-icon" data-<%= name %>></div>\n </div>\n </div>\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n <div class="bar-container" data-<%= name %>>\n <% for (var i = 0; i < segments; i++) { %>\n <div class="segmented-bar-element" data-<%= name %>></div>\n <% } %>\n </div>\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n <div class="drawer-container" data-<%= name %>>\n <div class="drawer-icon-container" data-<%= name %>>\n <div class="drawer-icon media-control-icon" data-<%= name %>></div>\n <span class="drawer-text" data-<%= name %>></span>\n </div>\n <% renderContent(name); %>\n </div>\n <% }; %>\n <% var renderIndicator = function(name) { %>\n <div class="media-control-indicator" data-<%= name %>></div>\n <% }; %>\n <% var renderButton = function(name) { %>\n <button type="button" class="media-control-button media-control-icon" data-<%= name %> aria-label="<%= name %>"></button>\n <% }; %>\n <% var templates = {\n bar: renderBar,\n segmentedBar: renderSegmentedBar,\n };\n var render = function(settingsList) {\n settingsList.forEach(function(setting) {\n if(setting === "seekbar") {\n renderBar(setting);\n } else if (setting === "volume") {\n renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function(name) { return renderSegmentedBar(name); });\n } else if (setting === "duration" || setting === "position") {\n renderIndicator(setting);\n } else {\n renderButton(setting);\n }\n });\n }; %>\n <% if (settings.default && settings.default.length) { %>\n <div class="media-control-center-panel" data-media-control>\n <% render(settings.default); %>\n </div>\n <% } %>\n <% if (settings.left && settings.left.length) { %>\n <div class="media-control-left-panel" data-media-control>\n <% render(settings.left); %>\n </div>\n <% } %>\n <% if (settings.right && settings.right.length) { %>\n <div class="media-control-right-panel" data-media-control>\n <% render(settings.right); %>\n </div>\n <% } %>\n</div>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M1.712 1.24h12.6v13.52h-12.6z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M11.5 11h-.002v1.502L7.798 10H4.5V6h3.297l3.7-2.502V4.5h.003V11zM11 4.49L7.953 6.5H5v3h2.953L11 11.51V4.49z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M9.75 11.51L6.7 9.5H3.75v-3H6.7L9.75 4.49v.664l.497.498V3.498L6.547 6H3.248v4h3.296l3.7 2.502v-2.154l-.497.5v.662zm3-5.165L12.404 6l-1.655 1.653L9.093 6l-.346.345L10.402 8 8.747 9.654l.346.347 1.655-1.653L12.403 10l.348-.346L11.097 8l1.655-1.655z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#010101" d="M7.156 8L4 11.156V8.5H3V13h4.5v-1H4.844L8 8.844 7.156 8zM8.5 3v1h2.657L8 7.157 8.846 8 12 4.844V7.5h1V3H8.5z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#010101" d="M13.5 3.344l-.844-.844L9.5 5.656V3h-1v4.5H13v-1h-2.656L13.5 3.344zM3 9.5h2.656L2.5 12.656l.844.844L6.5 10.344V13h1V8.5H3v1z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#010101" d="M5.375 7.062H2.637V4.26H.502v7.488h2.135V8.9h2.738v2.848h2.133V4.26H5.375v2.802zm5.97-2.81h-2.84v7.496h2.798c2.65 0 4.195-1.607 4.195-3.77v-.022c0-2.162-1.523-3.704-4.154-3.704zm2.06 3.758c0 1.21-.81 1.896-2.03 1.896h-.83V6.093h.83c1.22 0 2.03.696 2.03 1.896v.02z"></path></svg>'},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,'@font-face{font-family:Roboto;font-style:normal;font-weight:400;src:local("Roboto"),local("Roboto-Regular"),url('+i(150)+') format("truetype")}[data-player]{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);-o-transform:translateZ(0);transform:translateZ(0);position:relative;margin:0;padding:0;border:0;font-style:normal;font-weight:400;text-align:center;overflow:hidden;font-size:100%;font-family:Roboto,Open Sans,Arial,sans-serif;text-shadow:0 0 0;box-sizing:border-box}[data-player] a,[data-player] abbr,[data-player] acronym,[data-player] address,[data-player] applet,[data-player] article,[data-player] aside,[data-player] audio,[data-player] b,[data-player] big,[data-player] blockquote,[data-player] canvas,[data-player] caption,[data-player] center,[data-player] cite,[data-player] code,[data-player] dd,[data-player] del,[data-player] details,[data-player] dfn,[data-player] div,[data-player] dl,[data-player] dt,[data-player] em,[data-player] embed,[data-player] fieldset,[data-player] figcaption,[data-player] figure,[data-player] footer,[data-player] form,[data-player] h1,[data-player] h2,[data-player] h3,[data-player] h4,[data-player] h5,[data-player] h6,[data-player] header,[data-player] hgroup,[data-player] i,[data-player] iframe,[data-player] img,[data-player] ins,[data-player] kbd,[data-player] label,[data-player] legend,[data-player] li,[data-player] mark,[data-player] menu,[data-player] nav,[data-player] object,[data-player] ol,[data-player] output,[data-player] p,[data-player] pre,[data-player] q,[data-player] ruby,[data-player] s,[data-player] samp,[data-player] section,[data-player] small,[data-player] span,[data-player] strike,[data-player] strong,[data-player] sub,[data-player] summary,[data-player] sup,[data-player] table,[data-player] tbody,[data-player] td,[data-player] tfoot,[data-player] th,[data-player] thead,[data-player] time,[data-player] tr,[data-player] tt,[data-player] u,[data-player] ul,[data-player] var,[data-player] video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}[data-player] table{border-collapse:collapse;border-spacing:0}[data-player] caption,[data-player] td,[data-player] th{text-align:left;font-weight:400;vertical-align:middle}[data-player] blockquote,[data-player] q{quotes:none}[data-player] blockquote:after,[data-player] blockquote:before,[data-player] q:after,[data-player] q:before{content:"";content:none}[data-player] a img{border:none}[data-player]:focus{outline:0}[data-player] *{max-width:none;box-sizing:inherit;float:none}[data-player] div{display:block}[data-player].fullscreen{width:100%!important;height:100%!important;top:0;left:0}[data-player].nocursor{cursor:none}.clappr-style{display:none!important}',""])},function(t,e,i){t.exports=i.p+"38861cba61c66739c1452c3a71e39852.ttf"},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(71),a=r(n),o=i(0),s=r(o),l=i(1),u=r(l),d=i(2),c=r(d),f=i(17),h=r(f),p=i(34),g=r(p),y=i(35),v=r(y),m=i(80),b=r(m),_=i(81),E=r(_),T=i(82),k=r(T),A=i(83),S=r(A),L=i(84),R=r(L),w=i(85),C=r(w),O=i(179),D=r(O),P=i(183),I=r(P),x=i(185),N=r(x),M=i(86),F=r(M),B=i(192),U=r(B),G=i(194),j=r(G),V=i(196),K=r(V),Y=i(200),H=r(Y),$=i(205),z=r($),W=i(207),q=r(W),X=i(211),Z=r(X),J=i(212),Q=r(J),tt=i(213),et=r(tt),it=function(t){function e(i,r){(0,s.default)(this,e);var n=(0,u.default)(this,t.call(this));return n.playerId=r,n.playbackPlugins=[S.default,v.default,E.default,b.default,k.default,R.default,C.default],n.containerPlugins=[D.default,N.default,F.default,I.default,U.default,j.default],n.corePlugins=[K.default,H.default,z.default,q.default,Z.default,Q.default,et.default],i&&(Array.isArray(i)||n.validateExternalPluginsType(i),n.addExternalPlugins(i)),n}return(0,c.default)(e,t),e.prototype.groupPluginsByType=function(t){return Array.isArray(t)&&(t=t.reduce(function(t,e){return t[e.type]||(t[e.type]=[]),t[e.type].push(e),t},{})),t},e.prototype.removeDups=function(t){var e=function(t,e){return t[e.prototype.name]&&delete t[e.prototype.name],t[e.prototype.name]=e,t},i=t.reduceRight(e,(0,a.default)(null)),r=[];for(var n in i)r.unshift(i[n]);return r},e.prototype.addExternalPlugins=function(t){t=this.groupPluginsByType(t),t.playback&&(this.playbackPlugins=this.removeDups(t.playback.concat(this.playbackPlugins))),t.container&&(this.containerPlugins=this.removeDups(t.container.concat(this.containerPlugins))),t.core&&(this.corePlugins=this.removeDups(t.core.concat(this.corePlugins))),g.default.getInstance(this.playerId).playbackPlugins=this.playbackPlugins},e.prototype.validateExternalPluginsType=function(t){["playback","container","core"].forEach(function(e){(t[e]||[]).forEach(function(t){var i="external "+t.type+" plugin on "+e+" array";if(t.type!==e)throw new ReferenceError(i)})})},e}(h.default);e.default=it,t.exports=e.default},function(t,e,i){"use strict";(function(r){function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=i(78),o=n(a),s=i(0),l=n(s),u=i(1),d=n(u),c=i(3),f=n(c),h=i(2),p=n(h),g=i(79),y=n(g),v=i(31),m=n(v),b=i(5),_=i(9),E=n(_),T=i(7),k=n(T),A=i(13),S=n(A),L=i(4),R=n(L),w=i(161),C=n(w),O=i(6),D=n(O),P=i(8),I=n(P),x=i(162),N=n(x),M={mp4:["avc1.42E01E","avc1.58A01E","avc1.4D401E","avc1.64001E","mp4v.20.8","mp4v.20.240","mp4a.40.2"].map(function(t){return'video/mp4; codecs="'+t+', mp4a.40.2"'}),ogg:['video/ogg; codecs="theora, vorbis"','video/ogg; codecs="dirac"','video/ogg; codecs="theora, speex"'],"3gpp":['video/3gpp; codecs="mp4v.20.8, samr"'],webm:['video/webm; codecs="vp8, vorbis"'],mkv:['video/x-matroska; codecs="theora, vorbis"'],m3u8:["application/x-mpegurl"]};M.ogv=M.ogg,M["3gp"]=M["3gpp"];var F={wav:["audio/wav"],mp3:["audio/mp3",'audio/mpeg;codecs="mp3"'],aac:['audio/mp4;codecs="mp4a.40.5"'],oga:["audio/ogg"]},B=(0,m.default)(F).reduce(function(t,e){return[].concat((0,y.default)(t),(0,y.default)(F[e]))},[]),U=function(t){function e(){(0,l.default)(this,e);for(var i=arguments.length,n=Array(i),a=0;a<i;a++)n[a]=arguments[a];var o=(0,d.default)(this,t.call.apply(t,[this].concat(n)));o._destroyed=!1,o._loadStarted=!1,o._playheadMoving=!1,o._playheadMovingTimer=null,o._stopped=!1,o._ccTrackId=-1,o._setupSrc(o.options.src),o.options.playback||(o.options.playback=o.options||{}),o.options.playback.disableContextMenu=o.options.playback.disableContextMenu||o.options.disableVideoTagContextMenu;var s=o.options.playback,u=s.preload||(S.default.isSafari?"auto":o.options.preload),c=void 0;return o.options.poster&&("string"==typeof o.options.poster?c=o.options.poster:"string"==typeof o.options.poster.url&&(c=o.options.poster.url)),D.default.extend(o.el,{loop:o.options.loop,poster:c,preload:u||"metadata",controls:(s.controls||o.options.useVideoTagDefaultControls)&&"controls",crossOrigin:s.crossOrigin,"x-webkit-playsinline":s.playInline}),s.playInline&&o.$el.attr({playsinline:"playsinline"}),s.crossOrigin&&o.$el.attr({crossorigin:s.crossOrigin}),o.settings={default:["seekbar"]},o.settings.left=["playpause","position","duration"],o.settings.right=["fullscreen","volume","hd-indicator"],s.externalTracks&&o._setupExternalTracks(s.externalTracks),o.options.autoPlay&&r.nextTick(function(){return!o._destroyed&&o.play()}),o}return(0,p.default)(e,t),(0,f.default)(e,[{key:"name",get:function(){return"html5_video"}},{key:"tagName",get:function(){return this.isAudioOnly?"audio":"video"}},{key:"isAudioOnly",get:function(){var t=this.options.src,i=e._mimeTypesForUrl(t,F,this.options.mimeType);return this.options.playback&&this.options.playback.audioOnly||this.options.audioOnly||B.indexOf(i[0])>=0}},{key:"attributes",get:function(){return{"data-html5-video":""}}},{key:"events",get:function(){return{canplay:"_onCanPlay",canplaythrough:"_handleBufferingEvents",durationchange:"_onDurationChange",ended:"_onEnded",error:"_onError",loadeddata:"_onLoadedData",loadedmetadata:"_onLoadedMetadata",pause:"_onPause",playing:"_onPlaying",progress:"_onProgress",seeked:"_handleBufferingEvents",seeking:"_handleBufferingEvents",stalled:"_handleBufferingEvents",timeupdate:"_onTimeUpdate",waiting:"_onWaiting"}}},{key:"ended",get:function(){return this.el.ended}},{key:"buffering",get:function(){return!!this._bufferingState}}]),e.prototype._setupExternalTracks=function(t){this._externalTracks=t.map(function(t){return{kind:t.kind||"subtitles",label:t.label,lang:t.lang,src:t.src}})},e.prototype._setupSrc=function(t){this.el.src!==t&&(this._ccIsSetup=!1,this.el.src=t,this._src=this.el.src)},e.prototype._onLoadedMetadata=function(t){this._handleBufferingEvents(),this.trigger(R.default.PLAYBACK_LOADEDMETADATA,{duration:t.target.duration,data:t}),this._updateSettings();var e=void 0===this._options.autoSeekFromUrl||this._options.autoSeekFromUrl;this.getPlaybackType()!==E.default.LIVE&&e&&this._checkInitialSeek()},e.prototype._onDurationChange=function(){this._updateSettings(),this._onTimeUpdate(),this._onProgress()},e.prototype._updateSettings=function(){this.getPlaybackType()===E.default.VOD||this.getPlaybackType()===E.default.AOD?this.settings.left=["playpause","position","duration"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(R.default.PLAYBACK_SETTINGSUPDATE)},e.prototype.isSeekEnabled=function(){return isFinite(this.getDuration())},e.prototype.getPlaybackType=function(){var t="audio"===this.tagName?E.default.AOD:E.default.VOD;return[0,void 0,1/0].indexOf(this.el.duration)>=0?E.default.LIVE:t},e.prototype.isHighDefinitionInUse=function(){return!1},e.prototype.consent=function(){!this.isPlaying()&&this.el.load()},e.prototype.play=function(){this.trigger(R.default.PLAYBACK_PLAY_INTENT),this._stopped=!1,this._setupSrc(this._src),this._handleBufferingEvents();var t=this.el.play();t&&t.catch&&t.catch(function(){})},e.prototype.pause=function(){this.el.pause()},e.prototype.stop=function(){this.pause(),this._stopped=!0,this.el.removeAttribute("src"),this._stopPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(R.default.PLAYBACK_STOP)},e.prototype.volume=function(t){0===t?(this.$el.attr({muted:"true"}),this.el.muted=!0):(this.$el.attr({muted:null}),this.el.muted=!1),this.el.volume=t/100},e.prototype.mute=function(){this.el.volume=0},e.prototype.unmute=function(){this.el.volume=1},e.prototype.isMuted=function(){return!!this.el.volume},e.prototype.isPlaying=function(){return!this.el.paused&&!this.el.ended},e.prototype._startPlayheadMovingChecks=function(){null===this._playheadMovingTimer&&(this._playheadMovingTimeOnCheck=null,this._determineIfPlayheadMoving(),this._playheadMovingTimer=setInterval(this._determineIfPlayheadMoving.bind(this),500))},e.prototype._stopPlayheadMovingChecks=function(){null!==this._playheadMovingTimer&&(clearInterval(this._playheadMovingTimer),this._playheadMovingTimer=null,this._playheadMoving=!1)},e.prototype._determineIfPlayheadMoving=function(){var t=this._playheadMovingTimeOnCheck,e=this.el.currentTime;this._playheadMoving=t!==e,this._playheadMovingTimeOnCheck=e,this._handleBufferingEvents()},e.prototype._onWaiting=function(){this._loadStarted=!0,this._handleBufferingEvents()},e.prototype._onLoadedData=function(){this._loadStarted=!0,this._handleBufferingEvents()},e.prototype._onCanPlay=function(){this._handleBufferingEvents()},e.prototype._onPlaying=function(){this._checkForClosedCaptions(),this._startPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(R.default.PLAYBACK_PLAY)},e.prototype._onPause=function(){this._stopPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(R.default.PLAYBACK_PAUSE)},e.prototype._onEnded=function(){this._handleBufferingEvents(),this.trigger(R.default.PLAYBACK_ENDED,this.name)},e.prototype._handleBufferingEvents=function(){var t=!this.el.ended&&!this.el.paused,e=this._loadStarted&&!this.el.ended&&!this._stopped&&(t&&!this._playheadMoving||this.el.readyState<this.el.HAVE_FUTURE_DATA);this._bufferingState!==e&&(this._bufferingState=e,e?this.trigger(R.default.PLAYBACK_BUFFERING,this.name):this.trigger(R.default.PLAYBACK_BUFFERFULL,this.name))},e.prototype._onError=function(){this.trigger(R.default.PLAYBACK_ERROR,this.el.error,this.name)},e.prototype.destroy=function(){this._destroyed=!0,this.handleTextTrackChange&&this.el.textTracks.removeEventListener("change",this.handleTextTrackChange),this.$el.remove(),this.el.src="",this._src=null,b.DomRecycler.garbage(this.$el)},e.prototype.seek=function(t){this.el.currentTime=t},e.prototype.seekPercentage=function(t){var e=this.el.duration*(t/100);this.seek(e)},e.prototype._checkInitialSeek=function(){var t=(0,b.seekStringToSeconds)();0!==t&&this.seek(t)},e.prototype.getCurrentTime=function(){return this.el.currentTime},e.prototype.getDuration=function(){return this.el.duration},e.prototype._onTimeUpdate=function(){this._handleBufferingEvents(),this.getPlaybackType()===E.default.LIVE?this.trigger(R.default.PLAYBACK_TIMEUPDATE,{current:1,total:1},this.name):this.trigger(R.default.PLAYBACK_TIMEUPDATE,{current:this.el.currentTime,total:this.el.duration},this.name)},e.prototype._onProgress=function(){if(this.el.buffered.length){for(var t=[],e=0,i=0;i<this.el.buffered.length;i++)t=[].concat((0,y.default)(t),[{start:this.el.buffered.start(i),end:this.el.buffered.end(i)}]),this.el.currentTime>=t[i].start&&this.el.currentTime<=t[i].end&&(e=i);var r={start:t[e].start,current:t[e].end,total:this.el.duration};this.trigger(R.default.PLAYBACK_PROGRESS,r,t)}},e.prototype._typeFor=function(t){var i=e._mimeTypesForUrl(t,M,this.options.mimeType);return 0==i.length&&(i=e._mimeTypesForUrl(t,F,this.options.mimeType)),(i[0]||"").split(";")[0]},e.prototype._ready=function(){this._isReadyState||(this._isReadyState=!0,this.trigger(R.default.PLAYBACK_READY,this.name))},e.prototype._checkForClosedCaptions=function(){if(this.isHTML5Video&&!this._ccIsSetup){if(this.hasClosedCaptionsTracks){this.trigger(R.default.PLAYBACK_SUBTITLE_AVAILABLE);var t=this.closedCaptionsTrackId;this.closedCaptionsTrackId=t,this.handleTextTrackChange=this._handleTextTrackChange.bind(this),this.el.textTracks.addEventListener("change",this.handleTextTrackChange)}this._ccIsSetup=!0}},e.prototype._handleTextTrackChange=function(){var t=this.closedCaptionsTracks,e=t.find(function(t){return"showing"===t.track.mode})||{id:-1};this._ccTrackId!==e.id&&(this._ccTrackId=e.id,this.trigger(R.default.PLAYBACK_SUBTITLE_CHANGED,{id:e.id}))},e.prototype.render=function(){var t=k.default.getStyleFor(C.default);return this.options.playback.disableContextMenu&&this.$el.on("contextmenu",function(){return!1}),this._externalTracks&&this._externalTracks.length>0&&this.$el.html(this.template({tracks:this._externalTracks})),this.$el.append(t),this._ready(),this},(0,f.default)(e,[{key:"isReady",get:function(){return this._isReadyState}},{key:"isHTML5Video",get:function(){return this.name===e.prototype.name}},{key:"closedCaptionsTracks",get:function(){var t=0,e=function(){return t++};return(this.el.textTracks?(0,o.default)(this.el.textTracks):[]).filter(function(t){return"subtitles"===t.kind||"captions"===t.kind}).map(function(t){return{id:e(),name:t.label,track:t}})}},{key:"closedCaptionsTrackId",get:function(){return this._ccTrackId},set:function(t){if((0,b.isNumber)(t)){var e=this.closedCaptionsTracks,i=void 0;if(-1!==t){if(!(i=e.find(function(e){return e.id===t})))return;if("showing"===i.track.mode)return}e.filter(function(t){return"hidden"!==t.track.mode}).forEach(function(t){return t.track.mode="hidden"}),i&&(i.track.mode="showing"),this._ccTrackId=t,this.trigger(R.default.PLAYBACK_SUBTITLE_CHANGED,{id:t})}}},{key:"template",get:function(){return(0,I.default)(N.default)}}]),e}(E.default);e.default=U,U._mimeTypesForUrl=function(t,e,i){var r=(t.split("?")[0].match(/.*\.(.*)$/)||[])[1],n=i||r&&e[r.toLowerCase()]||[];return n.constructor===Array?n:[n]},U._canPlay=function(t,e,i,r){var n=U._mimeTypesForUrl(i,e,r),a=document.createElement(t);return!!n.filter(function(t){return!!a.canPlayType(t).replace(/no/,"")})[0]},U.canPlay=function(t,e){return U._canPlay("audio",F,t,e)||U._canPlay("video",M,t,e)},t.exports=e.default}).call(e,i(57))},function(t,e,i){i(65),i(154),t.exports=i(11).Array.from},function(t,e,i){"use strict";var r=i(46),n=i(19),a=i(39),o=i(155),s=i(156),l=i(61),u=i(157),d=i(158);n(n.S+n.F*!i(160)(function(t){Array.from(t)}),"Array",{from:function(t){var e,i,n,c,f=a(t),h="function"==typeof this?this:Array,p=arguments.length,g=p>1?arguments[1]:void 0,y=void 0!==g,v=0,m=d(f);if(y&&(g=r(g,p>2?arguments[2]:void 0,2)),void 0==m||h==Array&&s(m))for(e=l(f.length),i=new h(e);e>v;v++)u(i,v,y?g(f[v],v):f[v]);else for(c=m.call(f),i=new h;!(n=c.next()).done;v++)u(i,v,y?o(c,g,[n.value,v],!0):n.value);return i.length=v,i}})},function(t,e,i){var r=i(23);t.exports=function(t,e,i,n){try{return n?e(r(i)[0],i[1]):e(i)}catch(e){var a=t.return;throw void 0!==a&&r(a.call(t)),e}}},function(t,e,i){var r=i(29),n=i(12)("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[n]===t)}},function(t,e,i){"use strict";var r=i(16),n=i(28);t.exports=function(t,e,i){e in t?r.f(t,e,n(0,i)):t[e]=i}},function(t,e,i){var r=i(159),n=i(12)("iterator"),a=i(29);t.exports=i(11).getIteratorMethod=function(t){if(void 0!=t)return t[n]||t["@@iterator"]||a[r(t)]}},function(t,e,i){var r=i(41),n=i(12)("toStringTag"),a="Arguments"==r(function(){return arguments}()),o=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,i,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=o(e=Object(t),n))?i:a?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,i){var r=i(12)("iterator"),n=!1;try{var a=[7][r]();a.return=function(){n=!0},Array.from(a,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!n)return!1;var i=!1;try{var a=[7],o=a[r]();o.next=function(){return{done:i=!0}},a[r]=function(){return o},t(a)}catch(t){}return i}},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,"[data-html5-video]{position:absolute;height:100%;width:100%;display:block}",""])},function(t,e){t.exports='<% for (var i = 0; i < tracks.length; i++) { %>\n <track data-html5-video-track="<%= i %>" kind="<%= tracks[i].kind %>" label="<%= tracks[i].label %>" srclang="<%= tracks[i].lang %>" src="<%= tracks[i].src %>" />\n<% }; %>\n'},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(5),h=i(59),p=r(h),g=i(13),y=r(g),v=i(24),m=r(v),b=i(8),_=r(b),E=i(6),T=r(E),k=i(4),A=r(k),S=i(9),L=r(S),R=i(167),w=r(R),C=function(t){function e(){(0,a.default)(this,e);for(var i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];var o=(0,s.default)(this,t.call.apply(t,[this].concat(r)));return o._src=o.options.src,o._baseUrl=o.options.baseUrl,o._autoPlay=o.options.autoPlay,o.settings={default:["seekbar"]},o.settings.left=["playpause","position","duration"],o.settings.right=["fullscreen","volume"],o.settings.seekEnabled=!0,o._isReadyState=!1,o._addListeners(),o}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"flash"}},{key:"swfPath",get:function(){return(0,_.default)(w.default)({baseUrl:this._baseUrl})}},{key:"ended",get:function(){return"ENDED"===this._currentState}},{key:"buffering",get:function(){return!!this._bufferingState&&"ENDED"!==this._currentState}}]),e.prototype._bootstrap=function(){var t=this;this.el.playerPlay?(this.el.width="100%",this.el.height="100%","PLAYING"===this._currentState?this._firstPlay():(this._currentState="IDLE",this._autoPlay&&this.play()),(0,T.default)('<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%" />').insertAfter(this.$el),this.getDuration()>0?this._metadataLoaded():m.default.once(this.uniqueId+":timeupdate",this._metadataLoaded,this)):(this._attempts=this._attempts||0,++this._attempts<=60?setTimeout(function(){return t._bootstrap()},50):this.trigger(A.default.PLAYBACK_ERROR,{message:"Max number of attempts reached"},this.name))},e.prototype._metadataLoaded=function(){this._isReadyState=!0,this.trigger(A.default.PLAYBACK_READY,this.name),this.trigger(A.default.PLAYBACK_SETTINGSUPDATE,this.name)},e.prototype.getPlaybackType=function(){return L.default.VOD},e.prototype.isHighDefinitionInUse=function(){return!1},e.prototype._updateTime=function(){this.trigger(A.default.PLAYBACK_TIMEUPDATE,{current:this.el.getPosition(),total:this.el.getDuration()},this.name)},e.prototype._addListeners=function(){m.default.on(this.uniqueId+":progress",this._progress,this),m.default.on(this.uniqueId+":timeupdate",this._updateTime,this),m.default.on(this.uniqueId+":statechanged",this._checkState,this),m.default.on(this.uniqueId+":flashready",this._bootstrap,this)},e.prototype.stopListening=function(){t.prototype.stopListening.call(this),m.default.off(this.uniqueId+":progress"),m.default.off(this.uniqueId+":timeupdate"),m.default.off(this.uniqueId+":statechanged"),m.default.off(this.uniqueId+":flashready")},e.prototype._checkState=function(){this._isIdle||"PAUSED"===this._currentState||("PLAYING_BUFFERING"!==this._currentState&&"PLAYING_BUFFERING"===this.el.getState()?(this._bufferingState=!0,this.trigger(A.default.PLAYBACK_BUFFERING,this.name),this._currentState="PLAYING_BUFFERING"):"PLAYING"===this.el.getState()?(this._bufferingState=!1,this.trigger(A.default.PLAYBACK_BUFFERFULL,this.name),this._currentState="PLAYING"):"IDLE"===this.el.getState()?this._currentState="IDLE":"ENDED"===this.el.getState()&&(this.trigger(A.default.PLAYBACK_ENDED,this.name),this.trigger(A.default.PLAYBACK_TIMEUPDATE,{current:0,total:this.el.getDuration()},this.name),this._currentState="ENDED",this._isIdle=!0))},e.prototype._progress=function(){"IDLE"!==this._currentState&&"ENDED"!==this._currentState&&this.trigger(A.default.PLAYBACK_PROGRESS,{start:0,current:this.el.getBytesLoaded(),total:this.el.getBytesTotal()})},e.prototype._firstPlay=function(){var t=this;this.el.playerPlay?(this._isIdle=!1,this.el.playerPlay(this._src),this.listenToOnce(this,A.default.PLAYBACK_BUFFERFULL,function(){return t._checkInitialSeek()}),this._currentState="PLAYING"):this.listenToOnce(this,A.default.PLAYBACK_READY,this._firstPlay)},e.prototype._checkInitialSeek=function(){var t=(0,f.seekStringToSeconds)(window.location.href);0!==t&&this.seekSeconds(t)},e.prototype.play=function(){this.trigger(A.default.PLAYBACK_PLAY_INTENT),"PAUSED"===this._currentState||"PLAYING_BUFFERING"===this._currentState?(this._currentState="PLAYING",this.el.playerResume(),this.trigger(A.default.PLAYBACK_PLAY,this.name)):"PLAYING"!==this._currentState&&(this._firstPlay(),this.trigger(A.default.PLAYBACK_PLAY,this.name))},e.prototype.volume=function(t){var e=this;this.isReady?this.el.playerVolume(t):this.listenToOnce(this,A.default.PLAYBACK_BUFFERFULL,function(){return e.volume(t)})},e.prototype.pause=function(){this._currentState="PAUSED",this.el.playerPause(),this.trigger(A.default.PLAYBACK_PAUSE,this.name)},e.prototype.stop=function(){this.el.playerStop(),this.trigger(A.default.PLAYBACK_STOP),this.trigger(A.default.PLAYBACK_TIMEUPDATE,{current:0,total:0},this.name)},e.prototype.isPlaying=function(){return!!(this.isReady&&this._currentState.indexOf("PLAYING")>-1)},e.prototype.getDuration=function(){return this.el.getDuration()},e.prototype.seekPercentage=function(t){var e=this;if(this.el.getDuration()>0){var i=this.el.getDuration()*(t/100);this.seek(i)}else this.listenToOnce(this,A.default.PLAYBACK_BUFFERFULL,function(){return e.seekPercentage(t)})},e.prototype.seek=function(t){var e=this;this.isReady&&this.el.playerSeek?(this.el.playerSeek(t),this.trigger(A.default.PLAYBACK_TIMEUPDATE,{current:t,total:this.el.getDuration()},this.name),"PAUSED"===this._currentState&&this.el.playerPause()):this.listenToOnce(this,A.default.PLAYBACK_BUFFERFULL,function(){return e.seek(t)})},e.prototype.destroy=function(){clearInterval(this.bootstrapId),t.prototype.stopListening.call(this),this.$el.remove()},(0,u.default)(e,[{key:"isReady",get:function(){return this._isReadyState}}]),e}(p.default);e.default=C,C.canPlay=function(t){if(y.default.hasFlash&&t&&t.constructor===String){var e=t.split("?")[0].match(/.*\.(.*)$/)||[];return e.length>1&&!y.default.isMobile&&e[1].toLowerCase().match(/^(mp4|mov|f4v|3gpp|3gp)$/)}return!1},t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(3),s=r(o),l=i(1),u=r(l),d=i(2),c=r(d),f=i(9),h=r(f),p=i(7),g=r(p),y=i(8),v=r(y),m=i(13),b=r(m),_=i(165),E=r(_),T=i(166),k=r(T),A=function(t){function e(){return(0,a.default)(this,e),(0,u.default)(this,t.apply(this,arguments))}return(0,c.default)(e,t),e.prototype.setElement=function(t){this.$el=t,this.el=t[0]},e.prototype.render=function(){return this.$el.html(this.template({cid:this.cid,swfPath:this.swfPath,baseUrl:this.baseUrl,playbackId:this.uniqueId,wmode:this.wmode,callbackName:"window.Clappr.flashlsCallbacks."+this.cid})),b.default.isIE&&(this.$("embed").remove(),b.default.isLegacyIE&&this.$el.attr("classid","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000")),this.el.id=this.cid,this.$el.append(g.default.getStyleFor(k.default)),this},(0,s.default)(e,[{key:"tagName",get:function(){return"object"}},{key:"swfPath",get:function(){return""}},{key:"wmode",get:function(){return"transparent"}},{key:"template",get:function(){return(0,v.default)(E.default)}},{key:"attributes",get:function(){var t="application/x-shockwave-flash";return b.default.isLegacyIE&&(t=""),{class:"clappr-flash-playback",type:t,width:"100%",height:"100%",data:this.swfPath,"data-flash-playback":this.name}}}]),e}(h.default);e.default=A,t.exports=e.default},function(t,e){t.exports='<param name="movie" value="<%= swfPath %>">\n<param name="quality" value="autohigh">\n<param name="swliveconnect" value="true">\n<param name="allowScriptAccess" value="always">\n<param name="bgcolor" value="#000000">\n<param name="allowFullScreen" value="false">\n<param name="wmode" value="<%= wmode %>">\n<param name="tabindex" value="1">\n<param name="FlashVars" value="playbackId=<%= playbackId %>&callback=<%= callbackName %>">\n<embed\n name="<%= cid %>"\n type="application/x-shockwave-flash"\n disabled="disabled"\n tabindex="-1"\n enablecontextmenu="false"\n allowScriptAccess="always"\n quality="autohigh"\n pluginspage="http://www.macromedia.com/go/getflashplayer"\n wmode="<%= wmode %>"\n swliveconnect="true"\n allowfullscreen="false"\n bgcolor="#000000"\n FlashVars="playbackId=<%= playbackId %>&callback=<%= callbackName %>"\n data="<%= swfPath %>"\n src="<%= swfPath %>"\n width="100%"\n height="100%">\n</embed>\n'},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,".clappr-flash-playback[data-flash-playback]{display:block;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none}",""])},function(t,e,i){t.exports=i.p+"4b76590b32dab62bc95c1b7951efae78.swf"},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(3),s=r(o),l=i(1),u=r(l),d=i(2),c=r(d),f=i(4),h=r(f),p=i(9),g=r(p),y=i(35),v=r(y),m=function(t){function e(){return(0,a.default)(this,e),(0,u.default)(this,t.apply(this,arguments))}return(0,c.default)(e,t),e.prototype.updateSettings=function(){this.settings.left=["playpause","position","duration"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(h.default.PLAYBACK_SETTINGSUPDATE)},e.prototype.getPlaybackType=function(){return g.default.AOD},(0,s.default)(e,[{key:"name",get:function(){return"html5_audio"}},{key:"tagName",get:function(){return"audio"}},{key:"isAudioOnly",get:function(){return!0}}]),e}(v.default);e.default=m,m.canPlay=function(t,e){var i={wav:["audio/wav"],mp3:["audio/mp3",'audio/mpeg;codecs="mp3"'],aac:['audio/mp4;codecs="mp4a.40.5"'],oga:["audio/ogg"]};return v.default._canPlay("audio",i,t,e)},t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(59),h=r(f),p=i(4),g=r(p),y=i(8),v=r(y),m=i(9),b=r(m),_=i(24),E=r(_),T=i(13),k=r(T),A=i(170),S=r(A),L=i(171),R=r(L),w=i(6),C=r(w),O=function(t){function e(){(0,a.default)(this,e);for(var i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];var o=(0,s.default)(this,t.call.apply(t,[this].concat(r)));return o._src=o.options.src,o._baseUrl=o.options.baseUrl,o._initHlsParameters(o.options),o.highDefinition=!1,o._autoPlay=o.options.autoPlay,o._loop=o.options.loop,o._defaultSettings={left:["playstop"],default:["seekbar"],right:["fullscreen","volume","hd-indicator"],seekEnabled:!1},o.settings=C.default.extend({},o._defaultSettings),o._playbackType=b.default.LIVE,o._hasEnded=!1,o._addListeners(),o}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"flashls"}},{key:"swfPath",get:function(){return(0,v.default)(R.default)({baseUrl:this._baseUrl})}},{key:"levels",get:function(){return this._levels||[]}},{key:"currentLevel",get:function(){return null===this._currentLevel||void 0===this._currentLevel?-1:this._currentLevel},set:function(t){this._currentLevel=t,this.trigger(g.default.PLAYBACK_LEVEL_SWITCH_START),this.el.playerSetCurrentLevel(t)}},{key:"ended",get:function(){return this._hasEnded}},{key:"buffering",get:function(){return!!this._bufferingState&&!this._hasEnded}}]),e.prototype._initHlsParameters=function(t){this._autoStartLoad=void 0===t.autoStartLoad||t.autoStartLoad,this._capLevelToStage=void 0!==t.capLevelToStage&&t.capLevelToStage,this._maxLevelCappingMode=void 0===t.maxLevelCappingMode?"downscale":t.maxLevelCappingMode,this._minBufferLength=void 0===t.minBufferLength?-1:t.minBufferLength,this._minBufferLengthCapping=void 0===t.minBufferLengthCapping?-1:t.minBufferLengthCapping,this._maxBufferLength=void 0===t.maxBufferLength?120:t.maxBufferLength,this._maxBackBufferLength=void 0===t.maxBackBufferLength?30:t.maxBackBufferLength,this._lowBufferLength=void 0===t.lowBufferLength?3:t.lowBufferLength,this._mediaTimePeriod=void 0===t.mediaTimePeriod?100:t.mediaTimePeriod,this._fpsDroppedMonitoringPeriod=void 0===t.fpsDroppedMonitoringPeriod?5e3:t.fpsDroppedMonitoringPeriod,this._fpsDroppedMonitoringThreshold=void 0===t.fpsDroppedMonitoringThreshold?.2:t.fpsDroppedMonitoringThreshold,this._capLevelonFPSDrop=void 0!==t.capLevelonFPSDrop&&t.capLevelonFPSDrop,this._smoothAutoSwitchonFPSDrop=void 0===t.smoothAutoSwitchonFPSDrop?this.capLevelonFPSDrop:t.smoothAutoSwitchonFPSDrop,this._switchDownOnLevelError=void 0===t.switchDownOnLevelError||t.switchDownOnLevelError,this._seekMode=void 0===t.seekMode?"ACCURATE":t.seekMode,this._keyLoadMaxRetry=void 0===t.keyLoadMaxRetry?3:t.keyLoadMaxRetry,this._keyLoadMaxRetryTimeout=void 0===t.keyLoadMaxRetryTimeout?64e3:t.keyLoadMaxRetryTimeout,this._fragmentLoadMaxRetry=void 0===t.fragmentLoadMaxRetry?3:t.fragmentLoadMaxRetry,this._fragmentLoadMaxRetryTimeout=void 0===t.fragmentLoadMaxRetryTimeout?4e3:t.fragmentLoadMaxRetryTimeout,this._fragmentLoadSkipAfterMaxRetry=void 0===t.fragmentLoadSkipAfterMaxRetry||t.fragmentLoadSkipAfterMaxRetry,this._maxSkippedFragments=void 0===t.maxSkippedFragments?5:t.maxSkippedFragments,this._flushLiveURLCache=void 0!==t.flushLiveURLCache&&t.flushLiveURLCache,this._initialLiveManifestSize=void 0===t.initialLiveManifestSize?1:t.initialLiveManifestSize,this._manifestLoadMaxRetry=void 0===t.manifestLoadMaxRetry?3:t.manifestLoadMaxRetry,this._manifestLoadMaxRetryTimeout=void 0===t.manifestLoadMaxRetryTimeout?64e3:t.manifestLoadMaxRetryTimeout,this._manifestRedundantLoadmaxRetry=void 0===t.manifestRedundantLoadmaxRetry?3:t.manifestRedundantLoadmaxRetry,this._startFromBitrate=void 0===t.startFromBitrate?-1:t.startFromBitrate,this._startFromLevel=void 0===t.startFromLevel?-1:t.startFromLevel,this._autoStartMaxDuration=void 0===t.autoStartMaxDuration?-1:t.autoStartMaxDuration,this._seekFromLevel=void 0===t.seekFromLevel?-1:t.seekFromLevel,this._useHardwareVideoDecoder=void 0!==t.useHardwareVideoDecoder&&t.useHardwareVideoDecoder,this._hlsLogEnabled=void 0===t.hlsLogEnabled||t.hlsLogEnabled,this._logDebug=void 0!==t.logDebug&&t.logDebug,this._logDebug2=void 0!==t.logDebug2&&t.logDebug2,this._logWarn=void 0===t.logWarn||t.logWarn,this._logError=void 0===t.logError||t.logError,this._hlsMinimumDvrSize=void 0===t.hlsMinimumDvrSize?60:t.hlsMinimumDvrSize},e.prototype._addListeners=function(){var t=this;E.default.on(this.cid+":flashready",function(){return t._bootstrap()}),E.default.on(this.cid+":timeupdate",function(e){return t._updateTime(e)}),E.default.on(this.cid+":playbackstate",function(e){return t._setPlaybackState(e)}),E.default.on(this.cid+":levelchanged",function(e){return t._levelChanged(e)}),E.default.on(this.cid+":error",function(e,i,r){return t._flashPlaybackError(e,i,r)}),E.default.on(this.cid+":fragmentloaded",function(e){return t._onFragmentLoaded(e)}),E.default.on(this.cid+":levelendlist",function(e){return t._onLevelEndlist(e)})},e.prototype.stopListening=function(){t.prototype.stopListening.call(this),E.default.off(this.cid+":flashready"),E.default.off(this.cid+":timeupdate"),E.default.off(this.cid+":playbackstate"),E.default.off(this.cid+":levelchanged"),E.default.off(this.cid+":playbackerror"),E.default.off(this.cid+":fragmentloaded"),E.default.off(this.cid+":manifestloaded"),E.default.off(this.cid+":levelendlist")},e.prototype._bootstrap=function(){var t=this;this.el.playerLoad?(this.el.width="100%",this.el.height="100%",this._isReadyState=!0,this._srcLoaded=!1,this._currentState="IDLE",this._setFlashSettings(),this._updatePlaybackType(),(this._autoPlay||this._shouldPlayOnManifestLoaded)&&this.play(),this.trigger(g.default.PLAYBACK_READY,this.name)):(this._bootstrapAttempts=this._bootstrapAttempts||0,++this._bootstrapAttempts<=60?setTimeout(function(){return t._bootstrap()},50):this.trigger(g.default.PLAYBACK_ERROR,{message:"Max number of attempts reached"},this.name))},e.prototype._setFlashSettings=function(){this.el.playerSetAutoStartLoad(this._autoStartLoad),this.el.playerSetCapLevelToStage(this._capLevelToStage),this.el.playerSetMaxLevelCappingMode(this._maxLevelCappingMode),this.el.playerSetMinBufferLength(this._minBufferLength),this.el.playerSetMinBufferLengthCapping(this._minBufferLengthCapping),this.el.playerSetMaxBufferLength(this._maxBufferLength),this.el.playerSetMaxBackBufferLength(this._maxBackBufferLength),this.el.playerSetLowBufferLength(this._lowBufferLength),this.el.playerSetMediaTimePeriod(this._mediaTimePeriod),this.el.playerSetFpsDroppedMonitoringPeriod(this._fpsDroppedMonitoringPeriod),this.el.playerSetFpsDroppedMonitoringThreshold(this._fpsDroppedMonitoringThreshold),this.el.playerSetCapLevelonFPSDrop(this._capLevelonFPSDrop),this.el.playerSetSmoothAutoSwitchonFPSDrop(this._smoothAutoSwitchonFPSDrop),this.el.playerSetSwitchDownOnLevelError(this._switchDownOnLevelError),this.el.playerSetSeekMode(this._seekMode),this.el.playerSetKeyLoadMaxRetry(this._keyLoadMaxRetry),this.el.playerSetKeyLoadMaxRetryTimeout(this._keyLoadMaxRetryTimeout),this.el.playerSetFragmentLoadMaxRetry(this._fragmentLoadMaxRetry),this.el.playerSetFragmentLoadMaxRetryTimeout(this._fragmentLoadMaxRetryTimeout),this.el.playerSetFragmentLoadSkipAfterMaxRetry(this._fragmentLoadSkipAfterMaxRetry),this.el.playerSetMaxSkippedFragments(this._maxSkippedFragments),this.el.playerSetFlushLiveURLCache(this._flushLiveURLCache),this.el.playerSetInitialLiveManifestSize(this._initialLiveManifestSize),this.el.playerSetManifestLoadMaxRetry(this._manifestLoadMaxRetry),this.el.playerSetManifestLoadMaxRetryTimeout(this._manifestLoadMaxRetryTimeout),this.el.playerSetManifestRedundantLoadmaxRetry(this._manifestRedundantLoadmaxRetry),this.el.playerSetStartFromBitrate(this._startFromBitrate),this.el.playerSetStartFromLevel(this._startFromLevel),this.el.playerSetAutoStartMaxDuration(this._autoStartMaxDuration),this.el.playerSetSeekFromLevel(this._seekFromLevel),this.el.playerSetUseHardwareVideoDecoder(this._useHardwareVideoDecoder),this.el.playerSetLogInfo(this._hlsLogEnabled),this.el.playerSetLogDebug(this._logDebug),this.el.playerSetLogDebug2(this._logDebug2),this.el.playerSetLogWarn(this._logWarn),this.el.playerSetLogError(this._logError)},e.prototype.setAutoStartLoad=function(t){this._autoStartLoad=t,this.el.playerSetAutoStartLoad(this._autoStartLoad)},e.prototype.setCapLevelToStage=function(t){this._capLevelToStage=t,this.el.playerSetCapLevelToStage(this._capLevelToStage)},e.prototype.setMaxLevelCappingMode=function(t){this._maxLevelCappingMode=t,this.el.playerSetMaxLevelCappingMode(this._maxLevelCappingMode)},e.prototype.setSetMinBufferLength=function(t){this._minBufferLength=t,this.el.playerSetMinBufferLength(this._minBufferLength)},e.prototype.setMinBufferLengthCapping=function(t){this._minBufferLengthCapping=t,this.el.playerSetMinBufferLengthCapping(this._minBufferLengthCapping)},e.prototype.setMaxBufferLength=function(t){this._maxBufferLength=t,this.el.playerSetMaxBufferLength(this._maxBufferLength)},e.prototype.setMaxBackBufferLength=function(t){this._maxBackBufferLength=t,this.el.playerSetMaxBackBufferLength(this._maxBackBufferLength)},e.prototype.setLowBufferLength=function(t){this._lowBufferLength=t,this.el.playerSetLowBufferLength(this._lowBufferLength)},e.prototype.setMediaTimePeriod=function(t){this._mediaTimePeriod=t,this.el.playerSetMediaTimePeriod(this._mediaTimePeriod)},e.prototype.setFpsDroppedMonitoringPeriod=function(t){this._fpsDroppedMonitoringPeriod=t,this.el.playerSetFpsDroppedMonitoringPeriod(this._fpsDroppedMonitoringPeriod)},e.prototype.setFpsDroppedMonitoringThreshold=function(t){this._fpsDroppedMonitoringThreshold=t,this.el.playerSetFpsDroppedMonitoringThreshold(this._fpsDroppedMonitoringThreshold)},e.prototype.setCapLevelonFPSDrop=function(t){this._capLevelonFPSDrop=t,this.el.playerSetCapLevelonFPSDrop(this._capLevelonFPSDrop)},e.prototype.setSmoothAutoSwitchonFPSDrop=function(t){this._smoothAutoSwitchonFPSDrop=t,this.el.playerSetSmoothAutoSwitchonFPSDrop(this._smoothAutoSwitchonFPSDrop)},e.prototype.setSwitchDownOnLevelError=function(t){this._switchDownOnLevelError=t,this.el.playerSetSwitchDownOnLevelError(this._switchDownOnLevelError)},e.prototype.setSeekMode=function(t){this._seekMode=t,this.el.playerSetSeekMode(this._seekMode)},e.prototype.setKeyLoadMaxRetry=function(t){this._keyLoadMaxRetry=t,this.el.playerSetKeyLoadMaxRetry(this._keyLoadMaxRetry)},e.prototype.setKeyLoadMaxRetryTimeout=function(t){this._keyLoadMaxRetryTimeout=t,this.el.playerSetKeyLoadMaxRetryTimeout(this._keyLoadMaxRetryTimeout)},e.prototype.setFragmentLoadMaxRetry=function(t){this._fragmentLoadMaxRetry=t,this.el.playerSetFragmentLoadMaxRetry(this._fragmentLoadMaxRetry)},e.prototype.setFragmentLoadMaxRetryTimeout=function(t){this._fragmentLoadMaxRetryTimeout=t,this.el.playerSetFragmentLoadMaxRetryTimeout(this._fragmentLoadMaxRetryTimeout)},e.prototype.setFragmentLoadSkipAfterMaxRetry=function(t){this._fragmentLoadSkipAfterMaxRetry=t,this.el.playerSetFragmentLoadSkipAfterMaxRetry(this._fragmentLoadSkipAfterMaxRetry)},e.prototype.setMaxSkippedFragments=function(t){this._maxSkippedFragments=t,this.el.playerSetMaxSkippedFragments(this._maxSkippedFragments)},e.prototype.setFlushLiveURLCache=function(t){this._flushLiveURLCache=t,this.el.playerSetFlushLiveURLCache(this._flushLiveURLCache)},e.prototype.setInitialLiveManifestSize=function(t){this._initialLiveManifestSize=t,this.el.playerSetInitialLiveManifestSize(this._initialLiveManifestSize)},e.prototype.setManifestLoadMaxRetry=function(t){this._manifestLoadMaxRetry=t,this.el.playerSetManifestLoadMaxRetry(this._manifestLoadMaxRetry)},e.prototype.setManifestLoadMaxRetryTimeout=function(t){this._manifestLoadMaxRetryTimeout=t,this.el.playerSetManifestLoadMaxRetryTimeout(this._manifestLoadMaxRetryTimeout)},e.prototype.setManifestRedundantLoadmaxRetry=function(t){this._manifestRedundantLoadmaxRetry=t,this.el.playerSetManifestRedundantLoadmaxRetry(this._manifestRedundantLoadmaxRetry)},e.prototype.setStartFromBitrate=function(t){this._startFromBitrate=t,this.el.playerSetStartFromBitrate(this._startFromBitrate)},e.prototype.setStartFromLevel=function(t){this._startFromLevel=t,this.el.playerSetStartFromLevel(this._startFromLevel)},e.prototype.setAutoStartMaxDuration=function(t){this._autoStartMaxDuration=t,this.el.playerSetAutoStartMaxDuration(this._autoStartMaxDuration)},e.prototype.setSeekFromLevel=function(t){this._seekFromLevel=t,this.el.playerSetSeekFromLevel(this._seekFromLevel)},e.prototype.setUseHardwareVideoDecoder=function(t){this._useHardwareVideoDecoder=t,this.el.playerSetUseHardwareVideoDecoder(this._useHardwareVideoDecoder)},e.prototype.setSetLogInfo=function(t){this._hlsLogEnabled=t,this.el.playerSetLogInfo(this._hlsLogEnabled)},e.prototype.setLogDebug=function(t){this._logDebug=t,this.el.playerSetLogDebug(this._logDebug)},e.prototype.setLogDebug2=function(t){this._logDebug2=t,this.el.playerSetLogDebug2(this._logDebug2)},e.prototype.setLogWarn=function(t){this._logWarn=t,this.el.playerSetLogWarn(this._logWarn)},e.prototype.setLogError=function(t){this._logError=t,this.el.playerSetLogError(this._logError)},e.prototype._levelChanged=function(t){var e=this.el.getLevels()[t];e&&(this.highDefinition=e.height>=720||e.bitrate/1e3>=2e3,this.trigger(g.default.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this._levels&&0!==this._levels.length||this._fillLevels(),this.trigger(g.default.PLAYBACK_BITRATE,{height:e.height,width:e.width,bandwidth:e.bitrate,bitrate:e.bitrate,level:t}),this.trigger(g.default.PLAYBACK_LEVEL_SWITCH_END))},e.prototype._updateTime=function(t){if("IDLE"!==this._currentState){var e=this._normalizeDuration(t.duration),i=Math.min(Math.max(t.position,0),e),r=this._dvrEnabled,n=this._playbackType===b.default.LIVE;this._dvrEnabled=n&&e>this._hlsMinimumDvrSize,100!==e&&void 0!==n&&(this._dvrEnabled!==r&&(this._updateSettings(),this.trigger(g.default.PLAYBACK_SETTINGSUPDATE,this.name)),!n||this._dvrEnabled&&this._dvrInUse||(i=e),this.trigger(g.default.PLAYBACK_TIMEUPDATE,{current:i,total:e},this.name))}},e.prototype.play=function(){this.trigger(g.default.PLAYBACK_PLAY_INTENT),"PAUSED"===this._currentState?this.el.playerResume():this._srcLoaded||"PLAYING"===this._currentState?this.el.playerPlay():this._firstPlay()},e.prototype.getPlaybackType=function(){return this._playbackType?this._playbackType:null},e.prototype.getCurrentLevelIndex=function(){return this._currentLevel},e.prototype.getCurrentLevel=function(){return this.levels[this.currentLevel]},e.prototype.getCurrentBitrate=function(){return this.levels[this.currentLevel].bitrate},e.prototype.setCurrentLevel=function(t){this.currentLevel=t},e.prototype.isHighDefinitionInUse=function(){return this.highDefinition},e.prototype.getLevels=function(){return this.levels},e.prototype._setPlaybackState=function(t){["PLAYING_BUFFERING","PAUSED_BUFFERING"].indexOf(t)>=0?(this._bufferingState=!0,this.trigger(g.default.PLAYBACK_BUFFERING,this.name),this._updateCurrentState(t)):["PLAYING","PAUSED"].indexOf(t)>=0?(["PLAYING_BUFFERING","PAUSED_BUFFERING","IDLE"].indexOf(this._currentState)>=0&&(this._bufferingState=!1,this.trigger(g.default.PLAYBACK_BUFFERFULL,this.name)),this._updateCurrentState(t)):"IDLE"===t&&(this._srcLoaded=!1,this._loop&&["PLAYING_BUFFERING","PLAYING"].indexOf(this._currentState)>=0?(this.play(),this.seek(0)):(this._updateCurrentState(t),this._hasEnded=!0,this.trigger(g.default.PLAYBACK_TIMEUPDATE,{current:0,total:this.getDuration()},this.name),this.trigger(g.default.PLAYBACK_ENDED,this.name)))},e.prototype._updateCurrentState=function(t){this._currentState=t,"IDLE"!==t&&(this._hasEnded=!1),this._updatePlaybackType(),"PLAYING"===t?this.trigger(g.default.PLAYBACK_PLAY,this.name):"PAUSED"===t&&this.trigger(g.default.PLAYBACK_PAUSE,this.name)},e.prototype._updatePlaybackType=function(){this._playbackType=this.el.getType(),this._playbackType&&(this._playbackType=this._playbackType.toLowerCase(),this._playbackType===b.default.VOD?this._startReportingProgress():this._stopReportingProgress()),this.trigger(g.default.PLAYBACK_PLAYBACKSTATE,{type:this._playbackType})},e.prototype._startReportingProgress=function(){this._reportingProgress||(this._reportingProgress=!0)},e.prototype._stopReportingProgress=function(){this._reportingProgress=!1},e.prototype._onFragmentLoaded=function(t){if(this.trigger(g.default.PLAYBACK_FRAGMENT_LOADED,t),this._reportingProgress&&this.el.getPosition){var e=this.el.getPosition()+this.el.getbufferLength();this.trigger(g.default.PLAYBACK_PROGRESS,{start:this.el.getPosition(),current:e,total:this.el.getDuration()})}},e.prototype._onLevelEndlist=function(){this._updatePlaybackType()},e.prototype._firstPlay=function(){var t=this;this._shouldPlayOnManifestLoaded=!0,this.el.playerLoad&&(E.default.once(this.cid+":manifestloaded",function(e,i){return t._manifestLoaded(e,i)}),this._setFlashSettings(),this.el.playerLoad(this._src),this._srcLoaded=!0)},e.prototype.volume=function(t){var e=this;this.isReady?this.el.playerVolume(t):this.listenToOnce(this,g.default.PLAYBACK_BUFFERFULL,function(){return e.volume(t)})},e.prototype.pause=function(){(this._playbackType!==b.default.LIVE||this._dvrEnabled)&&(this.el.playerPause(),this._playbackType===b.default.LIVE&&this._dvrEnabled&&this._updateDvr(!0))},e.prototype.stop=function(){this._srcLoaded=!1,this.el.playerStop(),this.trigger(g.default.PLAYBACK_STOP),this.trigger(g.default.PLAYBACK_TIMEUPDATE,{current:0,total:0},this.name)},e.prototype.isPlaying=function(){return!!this._currentState&&!!this._currentState.match(/playing/i)},e.prototype.getDuration=function(){return this._normalizeDuration(this.el.getDuration())},e.prototype._normalizeDuration=function(t){return this._playbackType===b.default.LIVE&&(t=Math.max(0,t-10)),t},e.prototype.seekPercentage=function(t){var e=this.el.getDuration(),i=0;t>0&&(i=e*t/100),this.seek(i)},e.prototype.seek=function(t){var e=this.getDuration();if(this._playbackType===b.default.LIVE){var i=e-t>3;this._updateDvr(i)}this.el.playerSeek(t),this.trigger(g.default.PLAYBACK_TIMEUPDATE,{current:t,total:e},this.name)},e.prototype._updateDvr=function(t){var e=!!this._dvrInUse;this._dvrInUse=t,this._dvrInUse!==e&&(this._updateSettings(),this.trigger(g.default.PLAYBACK_DVR,this._dvrInUse),this.trigger(g.default.PLAYBACK_STATS_ADD,{dvr:this._dvrInUse}))},e.prototype._flashPlaybackError=function(t,e,i){this.trigger(g.default.PLAYBACK_ERROR,{code:t,url:e,message:i}),this.trigger(g.default.PLAYBACK_STOP)},e.prototype._manifestLoaded=function(t,e){this._shouldPlayOnManifestLoaded&&(this._shouldPlayOnManifestLoaded=!1,this.el.playerPlay()),this._fillLevels(),this.trigger(g.default.PLAYBACK_LOADEDMETADATA,{duration:t,data:e})},e.prototype._fillLevels=function(){var t=this.el.getLevels(),e=t.length;this._levels=[];for(var i=0;i<e;i++)this._levels.push({id:i,label:t[i].height+"p",level:t[i]});this.trigger(g.default.PLAYBACK_LEVELS_AVAILABLE,this._levels)},e.prototype.destroy=function(){this.stopListening(),this.$el.remove()},e.prototype._updateSettings=function(){this.settings=C.default.extend({},this._defaultSettings),this._playbackType===b.default.VOD||this._dvrInUse?(this.settings.left=["playpause","position","duration"],this.settings.seekEnabled=!0):this._dvrEnabled?(this.settings.left=["playpause"],this.settings.seekEnabled=!0):this.settings.seekEnabled=!1},e.prototype._createCallbacks=function(){var t=this;window.Clappr||(window.Clappr={}),window.Clappr.flashlsCallbacks||(window.Clappr.flashlsCallbacks={}),this.flashlsEvents=new S.default(this.cid),window.Clappr.flashlsCallbacks[this.cid]=function(e,i){t.flashlsEvents[e].apply(t.flashlsEvents,i)}},e.prototype.render=function(){return t.prototype.render.call(this),this._createCallbacks(),this},(0,u.default)(e,[{key:"isReady",get:function(){return this._isReadyState}},{key:"dvrEnabled",get:function(){return!!this._dvrEnabled}}]),e}(h.default);e.default=O,O.canPlay=function(t,e){var i=t.split("?")[0].match(/.*\.(.*)$/)||[];return k.default.hasFlash&&(i.length>1&&"m3u8"===i[1].toLowerCase()||"application/x-mpegURL"===e||"application/vnd.apple.mpegurl"===e)},t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(24),s=r(o),l=function(){function t(e){(0,a.default)(this,t),this.instanceId=e}return t.prototype.ready=function(){s.default.trigger(this.instanceId+":flashready")},t.prototype.videoSize=function(t,e){s.default.trigger(this.instanceId+":videosizechanged",t,e)},t.prototype.complete=function(){s.default.trigger(this.instanceId+":complete")},t.prototype.error=function(t,e,i){s.default.trigger(this.instanceId+":error",t,e,i)},t.prototype.manifest=function(t,e){s.default.trigger(this.instanceId+":manifestloaded",t,e)},t.prototype.audioLevelLoaded=function(t){s.default.trigger(this.instanceId+":audiolevelloaded",t)},t.prototype.levelLoaded=function(t){s.default.trigger(this.instanceId+":levelloaded",t)},t.prototype.levelEndlist=function(t){s.default.trigger(this.instanceId+":levelendlist",t)},t.prototype.fragmentLoaded=function(t){s.default.trigger(this.instanceId+":fragmentloaded",t)},t.prototype.fragmentPlaying=function(t){s.default.trigger(this.instanceId+":fragmentplaying",t)},t.prototype.position=function(t){s.default.trigger(this.instanceId+":timeupdate",t)},t.prototype.state=function(t){s.default.trigger(this.instanceId+":playbackstate",t)},t.prototype.seekState=function(t){s.default.trigger(this.instanceId+":seekstate",t)},t.prototype.switch=function(t){s.default.trigger(this.instanceId+":levelchanged",t)},t.prototype.audioTracksListChange=function(t){s.default.trigger(this.instanceId+":audiotracklistchanged",t)},t.prototype.audioTrackChange=function(t){s.default.trigger(this.instanceId+":audiotrackchanged",t)},t}();e.default=l,t.exports=e.default},function(t,e,i){t.exports=i.p+"809981e5b09d5336c45d72d0869ada2a.swf"},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(79),a=r(n),o=i(0),s=r(o),l=i(1),u=r(l),d=i(3),c=r(d),f=i(2),h=r(f),p=i(35),g=r(p),y=i(173),v=r(y),m=i(4),b=r(m),_=i(9),E=r(_),T=i(5),k=i(55),A=r(k),S=function(t){function e(){(0,s.default)(this,e);for(var i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];var a=(0,u.default)(this,t.call.apply(t,[this].concat(r)));return a.options.playback||(a.options.playback=a.options),a._minDvrSize=void 0===a.options.hlsMinimumDvrSize?60:a.options.hlsMinimumDvrSize,a._extrapolatedWindowNumSegments=a.options.playback&&void 0!==a.options.playback.extrapolatedWindowNumSegments?a.options.playback.extrapolatedWindowNumSegments:2,a._playbackType=E.default.VOD,a._lastTimeUpdate=null,a._lastDuration=null,a._playableRegionStartTime=0,a._localStartTimeCorrelation=null,a._localEndTimeCorrelation=null,a._playableRegionDuration=0,a._durationExcludesAfterLiveSyncPoint=!1,a._segmentTargetDuration=null,a._playlistType=null,a._recoverAttemptsRemaining=a.options.hlsRecoverAttempts||16,a._startTimeUpdateTimer(),a}return(0,h.default)(e,t),(0,c.default)(e,[{key:"name",get:function(){return"hls"}},{key:"levels",get:function(){return this._levels||[]}},{key:"currentLevel",get:function(){return null===this._currentLevel||void 0===this._currentLevel?-1:this._currentLevel},set:function(t){this._currentLevel=t,this.trigger(b.default.PLAYBACK_LEVEL_SWITCH_START),this._hls.currentLevel=this._currentLevel}},{key:"_startTime",get:function(){return this._playbackType===E.default.LIVE&&"EVENT"!==this._playlistType?this._extrapolatedStartTime:this._playableRegionStartTime}},{key:"_now",get:function(){return(0,T.now)()}},{key:"_extrapolatedStartTime",get:function(){if(!this._localStartTimeCorrelation)return this._playableRegionStartTime;var t=this._localStartTimeCorrelation,e=this._now-t.local,i=(t.remote+e)/1e3;return Math.min(i,this._playableRegionStartTime+this._extrapolatedWindowDuration)}},{key:"_extrapolatedEndTime",get:function(){var t=this._playableRegionStartTime+this._playableRegionDuration;if(!this._localEndTimeCorrelation)return t;var e=this._localEndTimeCorrelation,i=this._now-e.local,r=(e.remote+i)/1e3;return Math.max(t-this._extrapolatedWindowDuration,Math.min(r,t))}},{key:"_duration",get:function(){return this._extrapolatedEndTime-this._startTime}},{key:"_extrapolatedWindowDuration",get:function(){return null===this._segmentTargetDuration?0:this._extrapolatedWindowNumSegments*this._segmentTargetDuration}}],[{key:"HLSJS",get:function(){return v.default}}]),e.prototype._setupHls=function(){var t=this;this._ccIsSetup=!1,this._ccTracksUpdated=!1,this._hls=new v.default(this.options.playback.hlsjsConfig||{}),this._hls.on(v.default.Events.MEDIA_ATTACHED,function(){return t._hls.loadSource(t.options.src)}),this._hls.on(v.default.Events.LEVEL_LOADED,function(e,i){return t._updatePlaybackType(e,i)}),this._hls.on(v.default.Events.LEVEL_UPDATED,function(e,i){return t._onLevelUpdated(e,i)}),this._hls.on(v.default.Events.LEVEL_SWITCH,function(e,i){return t._onLevelSwitch(e,i)}),this._hls.on(v.default.Events.FRAG_LOADED,function(e,i){return t._onFragmentLoaded(e,i)}),this._hls.on(v.default.Events.ERROR,function(e,i){return t._onHLSJSError(e,i)}),this._hls.on(v.default.Events.SUBTITLE_TRACK_LOADED,function(e,i){return t._onSubtitleLoaded(e,i)}),this._hls.on(v.default.Events.SUBTITLE_TRACKS_UPDATED,function(){return t._ccTracksUpdated=!0}),this._hls.attachMedia(this.el)},e.prototype._recover=function(t,e){this._recoveredDecodingError?this._recoveredAudioCodecError?(A.default.error("hlsjs: failed to recover"),this.trigger(b.default.PLAYBACK_ERROR,"hlsjs: could not recover from error, evt "+t+", data "+e+" ",this.name)):(this._recoveredAudioCodecError=!0,this._hls.swapAudioCodec(),this._hls.recoverMediaError()):(this._recoveredDecodingError=!0,this._hls.recoverMediaError())},e.prototype._setupSrc=function(t){},e.prototype._startTimeUpdateTimer=function(){var t=this;this._timeUpdateTimer=setInterval(function(){t._onDurationChange(),t._onTimeUpdate()},100)},e.prototype._stopTimeUpdateTimer=function(){clearInterval(this._timeUpdateTimer)},e.prototype.getDuration=function(){return this._duration},e.prototype.getCurrentTime=function(){return Math.max(0,this.el.currentTime-this._startTime)},e.prototype.getStartTimeOffset=function(){return this._startTime},e.prototype.seekPercentage=function(t){var e=this._duration;t>0&&(e=this._duration*(t/100)),this.seek(e)},e.prototype.seek=function(e){e<0&&(A.default.warn("Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point."),e=this.getDuration()),this.dvrEnabled&&this._updateDvr(e<this.getDuration()-3),e+=this._startTime,t.prototype.seek.call(this,e)},e.prototype.seekToLivePoint=function(){this.seek(this.getDuration())},e.prototype._updateDvr=function(t){this.trigger(b.default.PLAYBACK_DVR,t),this.trigger(b.default.PLAYBACK_STATS_ADD,{dvr:t})},e.prototype._updateSettings=function(){this._playbackType===E.default.VOD?this.settings.left=["playpause","position","duration"]:this.dvrEnabled?this.settings.left=["playpause"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(b.default.PLAYBACK_SETTINGSUPDATE)},e.prototype._onHLSJSError=function(t,e){if(e.fatal)if(this._recoverAttemptsRemaining>0)switch(this._recoverAttemptsRemaining-=1,e.type){case v.default.ErrorTypes.NETWORK_ERROR:switch(e.details){case v.default.ErrorDetails.MANIFEST_LOAD_ERROR:case v.default.ErrorDetails.MANIFEST_LOAD_TIMEOUT:case v.default.ErrorDetails.MANIFEST_PARSING_ERROR:case v.default.ErrorDetails.LEVEL_LOAD_ERROR:case v.default.ErrorDetails.LEVEL_LOAD_TIMEOUT:A.default.error("hlsjs: unrecoverable network fatal error, evt "+t+", data "+e+" "),this.trigger(b.default.PLAYBACK_ERROR,{evt:t,data:e},this.name);break;default:A.default.warn("hlsjs: trying to recover from network error, evt "+t+", data "+e+" "),this._hls.startLoad()}break;case v.default.ErrorTypes.MEDIA_ERROR:A.default.warn("hlsjs: trying to recover from media error, evt "+t+", data "+e+" "),this._recover(t,e);break;default:A.default.error("hlsjs: trying to recover from error, evt "+t+", data "+e+" "),this.trigger(b.default.PLAYBACK_ERROR,"hlsjs: could not recover from error, evt "+t+", data "+e+" ",this.name)}else A.default.error("hlsjs: could not recover from error after maximum number of attempts, evt "+t+", data "+e+" "),this.trigger(b.default.PLAYBACK_ERROR,{evt:t,data:e},this.name);else A.default.warn("hlsjs: non-fatal error occurred, evt "+t+", data "+e+" ")},e.prototype._onTimeUpdate=function(){var t={current:this.getCurrentTime(),total:this.getDuration()};this._lastTimeUpdate&&t.current===this._lastTimeUpdate.current&&t.total===this._lastTimeUpdate.total||(this._lastTimeUpdate=t,this.trigger(b.default.PLAYBACK_TIMEUPDATE,t,this.name))},e.prototype._onDurationChange=function(){var e=this.getDuration();this._lastDuration!==e&&(this._lastDuration=e,t.prototype._onDurationChange.call(this))},e.prototype._onProgress=function(){if(this.el.buffered.length){for(var t=[],e=0,i=0;i<this.el.buffered.length;i++)t=[].concat((0,a.default)(t),[{start:Math.max(0,this.el.buffered.start(i)-this._playableRegionStartTime),end:Math.max(0,this.el.buffered.end(i)-this._playableRegionStartTime)}]),this.el.currentTime>=t[i].start&&this.el.currentTime<=t[i].end&&(e=i);var r={start:t[e].start,current:t[e].end,total:this.getDuration()};this.trigger(b.default.PLAYBACK_PROGRESS,r,t)}},e.prototype.play=function(){this._hls||this._setupHls(),t.prototype.play.call(this)},e.prototype.pause=function(){this._hls&&(t.prototype.pause.call(this),this.dvrEnabled&&this._updateDvr(!0))},e.prototype.stop=function(){this._hls&&(t.prototype.stop.call(this),this._hls.destroy(),delete this._hls)},e.prototype.destroy=function(){this._stopTimeUpdateTimer(),this._hls&&(this._hls.destroy(),delete this._hls),t.prototype.destroy.call(this)},e.prototype._updatePlaybackType=function(t,e){this._playbackType=e.details.live?E.default.LIVE:E.default.VOD,this._fillLevels(),this._onLevelUpdated(t,e),this._ccTracksUpdated&&this._playbackType===E.default.LIVE&&this.hasClosedCaptionsTracks&&this._onSubtitleLoaded()},e.prototype._fillLevels=function(){this._levels=this._hls.levels.map(function(t,e){return{id:e,level:t,label:t.bitrate/1e3+"Kbps"}}),this.trigger(b.default.PLAYBACK_LEVELS_AVAILABLE,this._levels)},e.prototype._onLevelUpdated=function(t,e){this._segmentTargetDuration=e.details.targetduration,this._playlistType=e.details.type||null;var i=!1,r=!1,n=e.details.fragments,a=this._playableRegionStartTime,o=this._playableRegionDuration;if(0!==n.length){if(this._playableRegionStartTime!==n[0].start&&(i=!0,this._playableRegionStartTime=n[0].start),i)if(this._localStartTimeCorrelation){var s=this._localStartTimeCorrelation,l=this._now-s.local,u=(s.remote+l)/1e3;u<n[0].start?this._localStartTimeCorrelation={local:this._now,remote:1e3*n[0].start}:u>a+this._extrapolatedWindowDuration&&(this._localStartTimeCorrelation={local:this._now,remote:1e3*Math.max(n[0].start,a+this._extrapolatedWindowDuration)})}else this._localStartTimeCorrelation={local:this._now,remote:1e3*(n[0].start+this._extrapolatedWindowDuration/2)};var d=e.details.totalduration;if(this._playbackType===E.default.LIVE){var c=e.details.targetduration,f=this.options.playback||{},h=f.liveSyncDurationCount||v.default.DefaultConfig.liveSyncDurationCount,p=c*h;p<=d?(d-=p,this._durationExcludesAfterLiveSyncPoint=!0):this._durationExcludesAfterLiveSyncPoint=!1}d!==this._playableRegionDuration&&(r=!0,this._playableRegionDuration=d);var g=n[0].start+d,y=a+o;if(g!==y)if(this._localEndTimeCorrelation){var m=this._localEndTimeCorrelation,b=this._now-m.local,_=(m.remote+b)/1e3;_>g?this._localEndTimeCorrelation={local:this._now,remote:1e3*g}:_<g-this._extrapolatedWindowDuration?this._localEndTimeCorrelation={local:this._now,remote:1e3*(g-this._extrapolatedWindowDuration)}:_>y&&(this._localEndTimeCorrelation={local:this._now,remote:1e3*y})}else this._localEndTimeCorrelation={local:this._now,remote:1e3*g};r&&this._onDurationChange(),i&&this._onProgress()}},e.prototype._onFragmentLoaded=function(t,e){this.trigger(b.default.PLAYBACK_FRAGMENT_LOADED,e)},e.prototype._onSubtitleLoaded=function(){if(!this._ccIsSetup){this.trigger(b.default.PLAYBACK_SUBTITLE_AVAILABLE);var t=this._playbackType===E.default.LIVE?-1:this.closedCaptionsTrackId;this.closedCaptionsTrackId=t,this._ccIsSetup=!0}},e.prototype._onLevelSwitch=function(t,e){this.levels.length||this._fillLevels(),this.trigger(b.default.PLAYBACK_LEVEL_SWITCH_END),this.trigger(b.default.PLAYBACK_LEVEL_SWITCH,e);var i=this._hls.levels[e.level];i&&(this.highDefinition=i.height>=720||i.bitrate/1e3>=2e3,this.trigger(b.default.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this.trigger(b.default.PLAYBACK_BITRATE,{height:i.height,width:i.width,bandwidth:i.bitrate,bitrate:i.bitrate,level:e.level}))},e.prototype.getPlaybackType=function(){return this._playbackType},e.prototype.isSeekEnabled=function(){return this._playbackType===E.default.VOD||this.dvrEnabled},(0,c.default)(e,[{key:"dvrEnabled",get:function(){return this._durationExcludesAfterLiveSyncPoint&&this._duration>=this._minDvrSize&&this.getPlaybackType()===E.default.LIVE}}]),e}(g.default);e.default=S,S.canPlay=function(t,e){var i=t.split("?")[0].match(/.*\.(.*)$/)||[],r=i.length>1&&"m3u8"===i[1].toLowerCase()||"application/x-mpegURL"===e||"application/vnd.apple.mpegurl"===e;return!(!v.default.isSupported()||!r)},t.exports=e.default},function(t,e,i){var r,r;!function(e){t.exports=e()}(function(){var t;return function t(e,i,n){function a(s,l){if(!i[s]){if(!e[s]){var u="function"==typeof r&&r;if(!l&&u)return r(s,!0);if(o)return o(s,!0);var d=new Error("Cannot find module '"+s+"'");throw d.code="MODULE_NOT_FOUND",d}var c=i[s]={exports:{}};e[s][0].call(c.exports,function(t){var i=e[s][1][t];return a(i||t)},c,c.exports,t,e,i,n)}return i[s].exports}for(var o="function"==typeof r&&r,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(t,e,i){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function a(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!a(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,i,r,a,l,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var d=new Error('Uncaught, unspecified "error" event. ('+e+")");throw d.context=e,d}if(i=this._events[t],s(i))return!1;if(n(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),i.apply(this,a)}else if(o(i))for(a=Array.prototype.slice.call(arguments,1),u=i.slice(),r=u.length,l=0;l<r;l++)u[l].apply(this,a);return!0},r.prototype.addListener=function(t,e){var i;if(!n(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function i(){this.removeListener(t,i),r||(r=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var r=!1;return i.listener=e,this.on(t,i),this},r.prototype.removeListener=function(t,e){var i,r,a,s;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(i=this._events[t],a=i.length,r=-1,i===e||n(i.listener)&&i.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(i)){for(s=a;s-- >0;)if(i[s]===e||i[s].listener&&i[s].listener===e){r=s;break}if(r<0)return this;1===i.length?(i.length=0,delete this._events[t]):i.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(i=this._events[t],n(i))this.removeListener(t,i);else if(i)for(;i.length;)this.removeListener(t,i[i.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},{}],2:[function(e,i,r){!function(e){var n=/^((?:[^\/;?#]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,a=/^([^\/;?#]*)(.*)$/,o=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,l={buildAbsoluteURL:function(t,e,i){if(i=i||{},t=t.trim(),!(e=e.trim())){if(!i.alwaysNormalize)return t;var r=this.parseURL(t);if(!o)throw new Error("Error trying to parse base URL.");return r.path=l.normalizePath(r.path),l.buildURLFromParts(r)}var n=this.parseURL(e);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return i.alwaysNormalize?(n.path=l.normalizePath(n.path),l.buildURLFromParts(n)):e;var o=this.parseURL(t);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var s=a.exec(o.path);o.netLoc=s[1],o.path=s[2]}o.netLoc&&!o.path&&(o.path="/");var u={scheme:o.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(u.netLoc=o.netLoc,"/"!==n.path[0]))if(n.path){var d=o.path,c=d.substring(0,d.lastIndexOf("/")+1)+n.path;u.path=l.normalizePath(c)}else u.path=o.path,n.params||(u.params=o.params,n.query||(u.query=o.query));return null===u.path&&(u.path=i.alwaysNormalize?l.normalizePath(n.path):n.path),l.buildURLFromParts(u)},parseURL:function(t){var e=n.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(o,"");t.length!==(t=t.replace(s,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};"object"==typeof r&&"object"==typeof i?i.exports=l:"function"==typeof t&&t.amd?t([],function(){return l}):"object"==typeof r?r.URLToolkit=l:e.URLToolkit=l}(this)},{}],3:[function(t,e,i){var r=arguments[3],n=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function i(t){y[t]=!0;for(var e in n[t][1]){var r=n[t][1][e];y[r]||i(r)}}for(var s,l=Object.keys(a),u=0,d=l.length;u<d;u++){var c=l[u],f=a[c].exports;if(f===t||f&&f.default===t){s=c;break}}if(!s){s=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var h={},u=0,d=l.length;u<d;u++){var c=l[u];h[c]=c}n[s]=[Function(["require","module","exports"],"("+t+")(self)"),h]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),g={};g[s]=s,n[p]=[Function(["require"],"var f = require("+o(s)+");(f.default ? f.default : f)(self);"),g];var y={};i(p);var v="("+r+")({"+Object.keys(y).map(function(t){return o(t)+":["+n[t][0]+","+o(n[t][1])+"]"}).join(",")+"},{},["+o(p)+"])",m=window.URL||window.webkitURL||window.mozURL||window.msURL,b=new Blob([v],{type:"text/javascript"});if(e&&e.bare)return b;var _=m.createObjectURL(b),E=new Worker(_);return E.objectURL=_,E}},{}],4:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(i,"__esModule",{value:!0}),i.hlsDefaultConfig=void 0;var n=t(5),a=r(n),o=t(8),s=r(o),l=t(9),u=r(l),d=t(10),c=r(d),f=t(58),h=r(f),p=t(7),g=r(p),y=t(6),v=r(y),m=t(50),b=r(m),_=t(16),E=r(_),T=t(15),k=r(T),A=t(14),S=r(A);i.hlsDefaultConfig={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,maxBufferSize:6e7,maxBufferHole:.5,maxSeekHole:2,lowBufferWatchdogPeriod:.5,highBufferWatchdogPeriod:3,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,fragLoadingLoopThreshold:3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:h.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,fetchSetup:void 0,abrController:a.default,bufferController:s.default,capLevelController:u.default,fpsController:c.default,audioStreamController:v.default,audioTrackController:g.default,subtitleStreamController:S.default,subtitleTrackController:k.default,timelineController:E.default,cueHandler:b.default,enableCEA708Captions:!0,enableWebVTT:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",stretchShortVideoTrack:!1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0}},{10:10,14:14,15:15,16:16,5:5,50:50,58:58,6:6,7:7,8:8,9:9}],5:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(35),u=r(l),d=t(34),c=r(d),f=t(37),h=r(f),p=t(33),g=t(53),y=t(51),v=r(y),m=function(t){function e(t){n(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.default.FRAG_LOADING,u.default.FRAG_LOADED,u.default.FRAG_BUFFERED,u.default.ERROR));return i.lastLoadedFragLevel=0,i._nextAutoLevel=-1,i.hls=t,i.onCheck=i._abandonRulesCheck.bind(i),i}return o(e,t),s(e,[{key:"destroy",value:function(){this.clearTimer(),c.default.prototype.destroy.call(this)}},{key:"onFragLoading",value:function(t){var e=t.frag;if("main"===e.type){if(this.timer||(this.timer=setInterval(this.onCheck,100)),!this._bwEstimator){var i=this.hls,r=t.frag.level,n=i.levels[r].details.live,a=i.config,o=void 0,s=void 0;n?(o=a.abrEwmaFastLive,s=a.abrEwmaSlowLive):(o=a.abrEwmaFastVoD,s=a.abrEwmaSlowVoD),this._bwEstimator=new v.default(i,s,o,a.abrEwmaDefaultEstimate)}this.fragCurrent=e}}},{key:"_abandonRulesCheck",value:function(){var t=this.hls,e=t.media,i=this.fragCurrent,r=i.loader,n=t.minAutoLevel;if(!r||r.stats&&r.stats.aborted)return g.logger.warn("frag loader destroy or aborted, disarm abandonRules"),void this.clearTimer();var a=r.stats;if(e&&(!e.paused&&0!==e.playbackRate||!e.readyState)&&i.autoLevel&&i.level){var o=performance.now()-a.trequest,s=Math.abs(e.playbackRate);if(o>500*i.duration/s){var l=t.levels,d=Math.max(1,a.bw?a.bw/8:1e3*a.loaded/o),c=l[i.level],f=c.realBitrate?Math.max(c.realBitrate,c.bitrate):c.bitrate,p=a.total?a.total:Math.max(a.loaded,Math.round(i.duration*f/8)),y=e.currentTime,v=(p-a.loaded)/d,m=(h.default.bufferInfo(e,y,t.config.maxBufferHole).end-y)/s;if(m<2*i.duration/s&&v>m){var b=void 0,_=void 0;for(_=i.level-1;_>n;_--){var E=l[_].realBitrate?Math.max(l[_].realBitrate,l[_].bitrate):l[_].bitrate;if((b=i.duration*E/(6.4*d))<m)break}b<v&&(g.logger.warn("loading too slow, abort fragment loading and switch to level "+_+":fragLoadedDelay["+_+"]<fragLoadedDelay["+(i.level-1)+"];bufferStarvationDelay:"+b.toFixed(1)+"<"+v.toFixed(1)+":"+m.toFixed(1)),t.nextLoadLevel=_,this._bwEstimator.sample(o,a.loaded),r.abort(),this.clearTimer(),t.trigger(u.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,stats:a}))}}}}},{key:"onFragLoaded",value:function(t){var e=t.frag;if("main"===e.type&&!isNaN(e.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=e.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var i=this.hls.levels[e.level],r=(i.loaded?i.loaded.bytes:0)+t.stats.loaded,n=(i.loaded?i.loaded.duration:0)+t.frag.duration;i.loaded={bytes:r,duration:n},i.realBitrate=Math.round(8*r/n)}if(t.frag.bitrateTest){var a=t.stats;a.tparsed=a.tbuffered=a.tload,this.onFragBuffered(t)}}}},{key:"onFragBuffered",value:function(t){var e=t.stats,i=t.frag;if(!(!0===e.aborted||1!==i.loadCounter||"main"!==i.type||isNaN(i.sn)||i.bitrateTest&&e.tload!==e.tbuffered)){var r=e.tparsed-e.trequest;g.logger.log("latency/loading/parsing/append/kbps:"+Math.round(e.tfirst-e.trequest)+"/"+Math.round(e.tload-e.tfirst)+"/"+Math.round(e.tparsed-e.tload)+"/"+Math.round(e.tbuffered-e.tparsed)+"/"+Math.round(8*e.loaded/(e.tbuffered-e.trequest))),this._bwEstimator.sample(r,e.loaded),e.bwEstimate=this._bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=r/1e3:this.bitrateTestDelay=0}}},{key:"onError",value:function(t){switch(t.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}}},{key:"clearTimer",value:function(){this.timer&&(clearInterval(this.timer),this.timer=null)}},{key:"_findBestLevel",value:function(t,e,i,r,n,a,o,s,l){for(var u=n;u>=r;u--){var d=l[u],c=d.details,f=c?c.totalduration/c.fragments.length:e,h=!!c&&c.live,p=void 0;p=u<=t?o*i:s*i;var y=l[u].realBitrate?Math.max(l[u].realBitrate,l[u].bitrate):l[u].bitrate,v=y*f/p;if(g.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+u+"/"+Math.round(p)+"/"+y+"/"+f+"/"+a+"/"+v),p>y&&(!v||h&&!this.bitrateTestDelay||v<a))return u}return-1}},{key:"nextAutoLevel",get:function(){var t=this._nextAutoLevel,e=this._bwEstimator;if(!(-1===t||e&&e.canEstimate()))return t;var i=this._nextABRAutoLevel;return-1!==t&&(i=Math.min(t,i)),i},set:function(t){this._nextAutoLevel=t}},{key:"_nextABRAutoLevel",get:function(){var t=this.hls,e=t.maxAutoLevel,i=t.levels,r=t.config,n=t.minAutoLevel,a=t.media,o=this.lastLoadedFragLevel,s=this.fragCurrent?this.fragCurrent.duration:0,l=a?a.currentTime:0,u=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,d=this._bwEstimator?this._bwEstimator.getEstimate():r.abrEwmaDefaultEstimate,c=(h.default.bufferInfo(a,l,r.maxBufferHole).end-l)/u,f=this._findBestLevel(o,s,d,n,e,c,r.abrBandWidthFactor,r.abrBandWidthUpFactor,i);if(f>=0)return f;g.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var p=s?Math.min(s,r.maxStarvationDelay):r.maxStarvationDelay,y=r.abrBandWidthFactor,v=r.abrBandWidthUpFactor;if(0===c){var m=this.bitrateTestDelay;if(m){p=(s?Math.min(s,r.maxLoadingDelay):r.maxLoadingDelay)-m,g.logger.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*p)+" ms"),y=v=1}}return f=this._findBestLevel(o,s,d,n,e,c+p,y,v,i),Math.max(f,0)}}]),e}(c.default);i.default=m},{33:33,34:34,35:35,37:37,51:51,53:53}],6:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(48),u=r(l),d=t(37),c=r(d),f=t(25),h=r(f),p=t(35),g=r(p),y=t(34),v=r(y),m=t(38),b=r(m),_=t(54),E=r(_),T=t(33),k=t(53),A={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS"},S=function(t){function e(t){n(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,g.default.MEDIA_ATTACHED,g.default.MEDIA_DETACHING,g.default.AUDIO_TRACKS_UPDATED,g.default.AUDIO_TRACK_SWITCHING,g.default.AUDIO_TRACK_LOADED,g.default.KEY_LOADED,g.default.FRAG_LOADED,g.default.FRAG_PARSING_INIT_SEGMENT,g.default.FRAG_PARSING_DATA,g.default.FRAG_PARSED,g.default.ERROR,g.default.BUFFER_CREATED,g.default.BUFFER_APPENDED,g.default.BUFFER_FLUSHED,g.default.INIT_PTS_FOUND));return i.config=t.config,i.audioCodecSwap=!1,i.ticks=0,i._state=A.STOPPED,i.ontick=i.tick.bind(i),i.initPTS=[],i.waitingFragment=null,i}return o(e,t),s(e,[{key:"destroy",value:function(){this.stopLoad(),this.timer&&(clearInterval(this.timer),this.timer=null),v.default.prototype.destroy.call(this),this.state=A.STOPPED}},{key:"onInitPtsFound",value:function(t){var e=t.id,i=t.frag.cc,r=t.initPTS;"main"===e&&(this.initPTS[i]=r,k.logger.log("InitPTS for cc:"+i+" found from video track:"+r),this.state===A.WAITING_INIT_PTS&&(k.logger.log("sending pending audio frag to demuxer"),this.state=A.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null))}},{key:"startLoad",value:function(t){if(this.tracks){var e=this.lastCurrentTime;this.stopLoad(),this.timer||(this.timer=setInterval(this.ontick,100)),this.fragLoadError=0,e>0&&-1===t?(k.logger.log("audio:override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=A.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:t,this.state=A.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=t,this.state=A.STOPPED}},{key:"stopLoad",value:function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=A.STOPPED}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){var t,e,i,r=this.hls,n=r.config;switch(this.state){case A.ERROR:case A.PAUSED:case A.BUFFER_FLUSHING:break;case A.STARTING:this.state=A.WAITING_TRACK,this.loadedmetadata=!1;break;case A.IDLE:var a=this.tracks;if(!a)break;if(!this.media&&(this.startFragRequested||!n.startFragPrefetch))break;t=this.loadedmetadata?this.media.currentTime:this.nextLoadPosition;var o=this.mediaBuffer?this.mediaBuffer:this.media,s=c.default.bufferInfo(o,t,n.maxBufferHole),l=s.len,d=s.end,f=this.fragPrevious,h=n.maxMaxBufferLength,p=this.audioSwitch,y=this.trackId;if((l<h||p)&&y<a.length){if(void 0===(i=a[y].details)){this.state=A.WAITING_TRACK;break}if(!p&&!i.live&&f&&f.sn===i.endSN&&(!this.media.seeking||this.media.duration-d<f.duration/2)){this.hls.trigger(g.default.BUFFER_EOS,{type:"audio"}),this.state=A.ENDED;break}var v=i.fragments,m=v.length,b=v[0].start,_=v[m-1].start+v[m-1].duration,E=void 0;if(p)if(i.live&&!i.PTSKnown)k.logger.log("switching audiotrack, live stream, unknown PTS,load first fragment"),d=0;else if(d=t,i.PTSKnown&&t<b){if(!(s.end>b||s.nextStart))return;k.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=b+.05}if(i.initSegment&&!i.initSegment.data)E=i.initSegment;else if(d<=b){if(E=v[0],i.live&&E.loadIdx&&E.loadIdx===this.fragLoadIdx){var S=s.nextStart?s.nextStart:b;return k.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(S+.05)),void(this.media.currentTime=S+.05)}}else{var L=void 0,R=n.maxFragLookUpTolerance,w=f?v[f.sn-v[0].sn+1]:void 0,C=function(t){var e=Math.min(R,t.duration);return t.start+t.duration-e<=d?1:t.start-e>d&&t.start?-1:0};d<_?(d>_-R&&(R=0),L=w&&!C(w)?w:u.default.search(v,C)):L=v[m-1],L&&(E=L,b=L.start,f&&E.level===f.level&&E.sn===f.sn&&(E.sn<i.endSN?(E=v[E.sn+1-i.startSN],k.logger.log("SN just loaded, load next one: "+E.sn)):E=null))}if(E)if(E.decryptdata&&null!=E.decryptdata.uri&&null==E.decryptdata.key)k.logger.log("Loading key for "+E.sn+" of ["+i.startSN+" ,"+i.endSN+"],track "+y),this.state=A.KEY_LOADING,r.trigger(g.default.KEY_LOADING,{frag:E});else{if(k.logger.log("Loading "+E.sn+" of ["+i.startSN+" ,"+i.endSN+"],track "+y+", currentTime:"+t+",bufferEnd:"+d.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,E.loadCounter){E.loadCounter++;var O=n.fragLoadingLoopThreshold;if(E.loadCounter>O&&Math.abs(this.fragLoadIdx-E.loadIdx)<O)return void r.trigger(g.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_LOOP_LOADING_ERROR,fatal:!1,frag:E})}else E.loadCounter=1;E.loadIdx=this.fragLoadIdx,this.fragCurrent=E,this.startFragRequested=!0,isNaN(E.sn)||(this.nextLoadPosition=E.start+E.duration),r.trigger(g.default.FRAG_LOADING,{frag:E}),this.state=A.FRAG_LOADING}}break;case A.WAITING_TRACK:e=this.tracks[this.trackId],e&&e.details&&(this.state=A.IDLE);break;case A.FRAG_LOADING_WAITING_RETRY:var D=performance.now(),P=this.retryDate;o=this.media;var I=o&&o.seeking;(!P||D>=P||I)&&(k.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=A.IDLE);break;case A.WAITING_INIT_PTS:case A.STOPPED:case A.FRAG_LOADING:case A.PARSING:case A.PARSED:case A.ENDED:}}},{key:"onMediaAttached",value:function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("ended",this.onvended);var i=this.config;this.tracks&&i.autoStartLoad&&this.startLoad(i.startPosition)}},{key:"onMediaDetaching",value:function(){var t=this.media;t&&t.ended&&(k.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var e=this.tracks;e&&e.forEach(function(t){t.details&&t.details.fragments.forEach(function(t){t.loadCounter=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){this.state===A.ENDED&&(this.state=A.IDLE),this.media&&(this.lastCurrentTime=this.media.currentTime),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.tick()}},{key:"onMediaEnded",value:function(){this.startPosition=this.lastCurrentTime=0}},{key:"onAudioTracksUpdated",value:function(t){k.logger.log("audio tracks updated"),this.tracks=t.audioTracks}},{key:"onAudioTrackSwitching",value:function(t){var e=!!t.url;this.trackId=t.id,this.state=A.IDLE,this.fragCurrent=null,this.state=A.PAUSED,this.waitingFragment=null,e?this.timer||(this.timer=setInterval(this.ontick,100)):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),e&&(this.audioSwitch=!0,this.state=A.IDLE,void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold)),this.tick()}},{key:"onAudioTrackLoaded",value:function(t){var e=t.details,i=t.id,r=this.tracks[i],n=e.totalduration,a=0;if(k.logger.log("track "+i+" loaded ["+e.startSN+","+e.endSN+"],duration:"+n),e.live){var o=r.details;o&&e.fragments.length>0?(b.default.mergeDetails(o,e),a=e.fragments[0].start,e.PTSKnown?k.logger.log("live audio playlist sliding:"+a.toFixed(3)):k.logger.log("live audio playlist - outdated PTS, unknown sliding")):(e.PTSKnown=!1,k.logger.log("live audio playlist - first load, unknown sliding"))}else e.PTSKnown=!1;if(r.details=e,!this.startFragRequested){if(-1===this.startPosition){var s=e.startTimeOffset;isNaN(s)?this.startPosition=0:(k.logger.log("start time offset found in playlist, adjust startPosition to "+s),this.startPosition=s)}this.nextLoadPosition=this.startPosition}this.state===A.WAITING_TRACK&&(this.state=A.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===A.KEY_LOADING&&(this.state=A.IDLE,this.tick())}},{key:"onFragLoaded",value:function(t){var e=this.fragCurrent,i=t.frag;if(this.state===A.FRAG_LOADING&&e&&"audio"===i.type&&i.level===e.level&&i.sn===e.sn){var r=this.tracks[this.trackId],n=r.details,a=n.totalduration,o=e.level,s=e.sn,l=e.cc,u=this.config.defaultAudioCodec||r.audioCodec||"mp4a.40.2",d=this.stats=t.stats;if("initSegment"===s)this.state=A.IDLE,d.tparsed=d.tbuffered=performance.now(),n.initSegment.data=t.payload,this.hls.trigger(g.default.FRAG_BUFFERED,{stats:d,frag:e,id:"audio"}),this.tick();else{this.state=A.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new h.default(this.hls,"audio"));var c=this.initPTS[l],f=n.initSegment?n.initSegment.data:[];if(n.initSegment||void 0!==c){this.pendingBuffering=!0,k.logger.log("Demuxing "+s+" of ["+n.startSN+" ,"+n.endSN+"],track "+o);this.demuxer.push(t.payload,f,u,null,e,a,!1,c)}else k.logger.log("unknown video PTS for continuity counter "+l+", waiting for video PTS before demuxing audio frag "+s+" of ["+n.startSN+" ,"+n.endSN+"],track "+o),this.waitingFragment=t,this.state=A.WAITING_INIT_PTS}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(t){var e=this.fragCurrent,i=t.frag;if(e&&"audio"===t.id&&i.sn===e.sn&&i.level===e.level&&this.state===A.PARSING){var r=t.tracks,n=void 0;if(r.video&&delete r.video,n=r.audio){n.levelCodec="mp4a.40.2",n.id=t.id,this.hls.trigger(g.default.BUFFER_CODECS,r),k.logger.log("audio track:audio,container:"+n.container+",codecs[level/parsed]=["+n.levelCodec+"/"+n.codec+"]");var a=n.initSegment;if(a){var o={type:"audio",data:a,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[o]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(g.default.BUFFER_APPENDING,o))}this.tick()}}}},{key:"onFragParsingData",value:function(t){var e=this,i=this.fragCurrent,r=t.frag;if(i&&"audio"===t.id&&"audio"===t.type&&r.sn===i.sn&&r.level===i.level&&this.state===A.PARSING){var n=this.trackId,a=this.tracks[n],o=this.hls;isNaN(t.endPTS)&&(t.endPTS=t.startPTS+i.duration,t.endDTS=t.startDTS+i.duration),k.logger.log("parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb),b.default.updateFragPTSDTS(a.details,i,t.startPTS,t.endPTS);var s=this.audioSwitch,l=this.media,u=!1;if(s&&l)if(l.readyState){var d=l.currentTime;k.logger.log("switching audio track : currentTime:"+d),d>=t.startPTS&&(k.logger.log("switching audio track : flushing all audio"),this.state=A.BUFFER_FLUSHING,o.trigger(g.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),u=!0,this.audioSwitch=!1,o.trigger(g.default.AUDIO_TRACK_SWITCHED,{id:n}))}else this.audioSwitch=!1,o.trigger(g.default.AUDIO_TRACK_SWITCHED,{id:n});var c=this.pendingData;this.audioSwitch||([t.data1,t.data2].forEach(function(e){e&&e.length&&c.push({type:t.type,data:e,parent:"audio",content:"data"})}),!u&&c.length&&(c.forEach(function(t){e.state===A.PARSING&&(e.pendingBuffering=!0,e.hls.trigger(g.default.BUFFER_APPENDING,t))}),this.pendingData=[],this.appended=!0)),this.tick()}}},{key:"onFragParsed",value:function(t){var e=this.fragCurrent,i=t.frag;e&&"audio"===t.id&&i.sn===e.sn&&i.level===e.level&&this.state===A.PARSING&&(this.stats.tparsed=performance.now(),this.state=A.PARSED,this._checkAppendedParsed())}},{key:"onBufferCreated",value:function(t){var e=t.tracks.audio;e&&(this.mediaBuffer=e.buffer,this.loadedmetadata=!0)}},{key:"onBufferAppended",value:function(t){if("audio"===t.parent){var e=this.state;e!==A.PARSING&&e!==A.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==A.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent,e=this.stats,i=this.hls;if(t){this.fragPrevious=t,e.tbuffered=performance.now(),i.trigger(g.default.FRAG_BUFFERED,{stats:e,frag:t,id:"audio"});var r=this.mediaBuffer?this.mediaBuffer:this.media;k.logger.log("audio buffered : "+E.default.toString(r.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,i.trigger(g.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=A.IDLE}this.tick()}}},{key:"onError",value:function(t){var e=t.frag;if(!e||"audio"===e.type)switch(t.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:if(!t.fatal){var i=this.fragLoadError;i?i++:i=1;var r=this.config;if(i<=r.fragLoadingMaxRetry){this.fragLoadError=i,e.loadCounter=0;var n=Math.min(Math.pow(2,i-1)*r.fragLoadingRetryDelay,r.fragLoadingMaxRetryTimeout);k.logger.warn("audioStreamController: frag loading failed, retry in "+n+" ms"),this.retryDate=performance.now()+n,this.state=A.FRAG_LOADING_WAITING_RETRY}else k.logger.error("audioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=A.ERROR}break;case T.ErrorDetails.FRAG_LOOP_LOADING_ERROR:case T.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case T.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case T.ErrorDetails.KEY_LOAD_ERROR:case T.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==A.ERROR&&(this.state=t.fatal?A.ERROR:A.IDLE,k.logger.warn("audioStreamController: "+t.details+" while loading frag,switch to "+this.state+" state ..."));break;case T.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===t.parent&&(this.state===A.PARSING||this.state===A.PARSED)){var a=this.mediaBuffer,o=this.media.currentTime;if(a&&c.default.isBuffered(a,o)&&c.default.isBuffered(a,o+.5)){var s=this.config;s.maxMaxBufferLength>=s.maxBufferLength&&(s.maxMaxBufferLength/=2,k.logger.warn("audio:reduce max buffer length to "+s.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*s.fragLoadingLoopThreshold),this.state=A.IDLE}else k.logger.warn("buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=A.BUFFER_FLUSHING,this.hls.trigger(g.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}}}},{key:"onBufferFlushed",value:function(){var t=this,e=this.pendingData;e&&e.length?(k.logger.log("appending pending audio data on Buffer Flushed"),e.forEach(function(e){t.hls.trigger(g.default.BUFFER_APPENDING,e)}),this.appended=!0,this.pendingData=[],this.state=A.PARSED):(this.state=A.IDLE,this.fragPrevious=null,this.tick())}},{key:"state",set:function(t){if(this.state!==t){var e=this.state;this._state=t,k.logger.log("audio stream:"+e+"->"+t)}},get:function(){return this._state}}]),e}(v.default);i.default=S},{25:25,33:33,34:34,35:35,37:37,38:38,48:48,53:53,54:54}],7:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(35),u=r(l),d=t(34),c=r(d),f=t(53),h=function(t){function e(t){n(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.default.MANIFEST_LOADING,u.default.MANIFEST_LOADED,u.default.AUDIO_TRACK_LOADED));return i.ticks=0,i.ontick=i.tick.bind(i),i}return o(e,t),s(e,[{key:"destroy",value:function(){c.default.prototype.destroy.call(this)}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){this.updateTrack(this.trackId)}},{key:"onManifestLoading",value:function(){this.tracks=[],this.trackId=-1}},{key:"onManifestLoaded",value:function(t){var e=this,i=t.audioTracks||[],r=!1;this.tracks=i,this.hls.trigger(u.default.AUDIO_TRACKS_UPDATED,{audioTracks:i});var n=0;i.forEach(function(t){if(t.default)return e.audioTrack=n,void(r=!0);n++}),!1===r&&i.length&&(f.logger.log("no default audio track defined, use first audio track as default"),this.audioTrack=0)}},{key:"onAudioTrackLoaded",value:function(t){t.id<this.tracks.length&&(f.logger.log("audioTrack "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.timer&&(this.timer=setInterval(this.ontick,1e3*t.details.targetduration)),!t.details.live&&this.timer&&(clearInterval(this.timer),this.timer=null))}},{key:"setAudioTrackInternal",value:function(t){if(t>=0&&t<this.tracks.length){this.timer&&(clearInterval(this.timer),this.timer=null),this.trackId=t,f.logger.log("switching to audioTrack "+t);var e=this.tracks[t],i=this.hls,r=e.type,n=e.url,a={id:t,type:r,url:n};i.trigger(u.default.AUDIO_TRACK_SWITCH,a),i.trigger(u.default.AUDIO_TRACK_SWITCHING,a);var o=e.details;!n||void 0!==o&&!0!==o.live||(f.logger.log("(re)loading playlist for audioTrack "+t),i.trigger(u.default.AUDIO_TRACK_LOADING,{url:n,id:t}))}}},{key:"updateTrack",value:function(t){if(t>=0&&t<this.tracks.length){this.timer&&(clearInterval(this.timer),this.timer=null),this.trackId=t,f.logger.log("updating audioTrack "+t);var e=this.tracks[t],i=e.url,r=e.details;!i||void 0!==r&&!0!==r.live||(f.logger.log("(re)loading playlist for audioTrack "+t),this.hls.trigger(u.default.AUDIO_TRACK_LOADING,{url:i,id:t}))}}},{key:"audioTracks",get:function(){return this.tracks}},{key:"audioTrack",get:function(){return this.trackId},set:function(t){this.trackId===t&&void 0!==this.tracks[t].details||this.setAudioTrackInternal(t)}}]),e}(c.default);i.default=h},{34:34,35:35,53:53}],8:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(35),u=r(l),d=t(34),c=r(d),f=t(53),h=t(33),p=function(t){function e(t){n(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.default.MEDIA_ATTACHING,u.default.MEDIA_DETACHING,u.default.MANIFEST_PARSED,u.default.BUFFER_RESET,u.default.BUFFER_APPENDING,u.default.BUFFER_CODECS,u.default.BUFFER_EOS,u.default.BUFFER_FLUSHING,u.default.LEVEL_PTS_UPDATED,u.default.LEVEL_UPDATED));return i._msDuration=null,i._levelDuration=null,i.onsbue=i.onSBUpdateEnd.bind(i),i.onsbe=i.onSBUpdateError.bind(i),i.pendingTracks={},i.tracks={},i}return o(e,t),s(e,[{key:"destroy",value:function(){c.default.prototype.destroy.call(this)}},{key:"onLevelPtsUpdated",value:function(t){var e=t.type,i=this.tracks.audio;if("audio"===e&&i&&"audio/mpeg"===i.container){var r=this.sourceBuffer.audio;if(Math.abs(r.timestampOffset-t.start)>.1){var n=r.updating;try{r.abort()}catch(t){n=!0,f.logger.warn("can not abort audio buffer: "+t)}n?this.audioTimestampOffset=t.start:(f.logger.warn("change mpeg audio timestamp offset from "+r.timestampOffset+" to "+t.start),r.timestampOffset=t.start)}}}},{key:"onManifestParsed",value:function(t){var e=t.audio,i=t.video,r=0;t.altAudio&&(e||i)&&(r=(e?1:0)+(i?1:0),f.logger.log(r+" sourceBuffer(s) expected")),this.sourceBufferNb=r}},{key:"onMediaAttaching",value:function(t){var e=this.media=t.media;if(e){var i=this.mediaSource=new MediaSource;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),i.addEventListener("sourceopen",this.onmso),i.addEventListener("sourceended",this.onmse),i.addEventListener("sourceclose",this.onmsc),e.src=URL.createObjectURL(i)}}},{key:"onMediaDetaching",value:function(){f.logger.log("media source detaching");var t=this.mediaSource;if(t){if("open"===t.readyState)try{t.endOfStream()}catch(t){f.logger.warn("onMediaDetaching:"+t.message+" while calling endOfStream")}t.removeEventListener("sourceopen",this.onmso),t.removeEventListener("sourceended",this.onmse),t.removeEventListener("sourceclose",this.onmsc),this.media&&(URL.revokeObjectURL(this.media.src),this.media.removeAttribute("src"),this.media.load()),this.mediaSource=null,this.media=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(u.default.MEDIA_DETACHED)}},{key:"onMediaSourceOpen",value:function(){f.logger.log("media source opened"),this.hls.trigger(u.default.MEDIA_ATTACHED,{media:this.media});var t=this.mediaSource;t&&t.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()}},{key:"checkPendingTracks",value:function(){var t=this.pendingTracks,e=Object.keys(t).length;e&&(this.sourceBufferNb<=e||0===this.sourceBufferNb)&&(this.createSourceBuffers(t),this.pendingTracks={},this.doAppending())}},{key:"onMediaSourceClose",value:function(){f.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){f.logger.log("media source ended")}},{key:"onSBUpdateEnd",value:function(){if(this.audioTimestampOffset){var t=this.sourceBuffer.audio;f.logger.warn("change mpeg audio timestamp offset from "+t.timestampOffset+" to "+this.audioTimestampOffset),t.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var e=this.parent,i=this.segments.reduce(function(t,i){return i.parent===e?t+1:t},0);this.hls.trigger(u.default.BUFFER_APPENDED,{parent:e,pending:i}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()}},{key:"onSBUpdateError",value:function(t){f.logger.error("sourceBuffer error:",t),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferReset",value:function(){var t=this.sourceBuffer;for(var e in t){var i=t[e];try{this.mediaSource.removeSourceBuffer(i),i.removeEventListener("updateend",this.onsbue),i.removeEventListener("error",this.onsbe)}catch(t){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}},{key:"onBufferCodecs",value:function(t){if(0===Object.keys(this.sourceBuffer).length){for(var e in t)this.pendingTracks[e]=t[e];var i=this.mediaSource;i&&"open"===i.readyState&&this.checkPendingTracks()}}},{key:"createSourceBuffers",value:function(t){var e=this.sourceBuffer,i=this.mediaSource;for(var r in t)if(!e[r]){var n=t[r],a=n.levelCodec||n.codec,o=n.container+";codecs="+a;f.logger.log("creating sourceBuffer("+o+")");try{var s=e[r]=i.addSourceBuffer(o);s.addEventListener("updateend",this.onsbue),s.addEventListener("error",this.onsbe),this.tracks[r]={codec:a,container:n.container},n.buffer=s}catch(t){f.logger.error("error while trying to add sourceBuffer:"+t.message),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:t,mimeType:o})}}this.hls.trigger(u.default.BUFFER_CREATED,{tracks:t})}},{key:"onBufferAppending",value:function(t){this._needsFlush||(this.segments?this.segments.push(t):this.segments=[t],this.doAppending())}},{key:"onBufferAppendFail",value:function(t){f.logger.error("sourceBuffer error:",t.event),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferEos",value:function(t){var e=this.sourceBuffer,i=t.type;for(var r in e)i&&r!==i||e[r].ended||(e[r].ended=!0,f.logger.log(r+" sourceBuffer now EOS"));this.checkEos()}},{key:"checkEos",value:function(){var t=this.sourceBuffer,e=this.mediaSource;if(!e||"open"!==e.readyState)return void(this._needsEos=!1);for(var i in t){var r=t[i];if(!r.ended)return;if(r.updating)return void(this._needsEos=!0)}f.logger.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{e.endOfStream()}catch(t){f.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}},{key:"onBufferFlushing",value:function(t){this.flushRange.push({start:t.startOffset,end:t.endOffset,type:t.type}),this.flushBufferCounter=0,this.doFlush()}},{key:"onLevelUpdated",value:function(t){var e=t.details;0!==e.fragments.length&&(this._levelDuration=e.totalduration+e.fragments[0].start,this.updateMediaElementDuration())}},{key:"updateMediaElementDuration",value:function(){var t=this.media,e=this.mediaSource,i=this.sourceBuffer,r=this._levelDuration;if(null!==r&&t&&e&&i&&0!==t.readyState&&"open"===e.readyState){for(var n in i)if(i[n].updating)return;null===this._msDuration&&(this._msDuration=e.duration);var a=t.duration;(r>this._msDuration&&r>a||a===1/0||isNaN(a))&&(f.logger.log("Updating mediasource duration to "+r.toFixed(3)),this._msDuration=e.duration=r)}}},{key:"doFlush",value:function(){for(;this.flushRange.length;){var t=this.flushRange[0];if(!this.flushBuffer(t.start,t.end,t.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var e=0,i=this.sourceBuffer;try{for(var r in i)e+=i[r].buffered.length}catch(t){f.logger.error("error while accessing sourceBuffer.buffered")}this.appended=e,this.hls.trigger(u.default.BUFFER_FLUSHED)}}},{key:"doAppending",value:function(){var t=this.hls,e=this.sourceBuffer,i=this.segments;if(Object.keys(e).length){if(this.media.error)return this.segments=[],void f.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(i&&i.length){var r=i.shift();try{var n=r.type,a=e[n];a?a.updating?i.unshift(r):(a.ended=!1,this.parent=r.parent,a.appendBuffer(r.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(e){f.logger.error("error while trying to append buffer:"+e.message),i.unshift(r);var o={type:h.ErrorTypes.MEDIA_ERROR,parent:r.parent};if(22===e.code)return this.segments=[],o.details=h.ErrorDetails.BUFFER_FULL_ERROR,o.fatal=!1,void t.trigger(u.default.ERROR,o);if(this.appendError?this.appendError++:this.appendError=1,o.details=h.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>t.config.appendErrorMaxRetry)return f.logger.log("fail "+t.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),i=[],o.fatal=!0,void t.trigger(u.default.ERROR,o);o.fatal=!1,t.trigger(u.default.ERROR,o)}}}}},{key:"flushBuffer",value:function(t,e,i){var r,n,a,o,s,l,u=this.sourceBuffer;if(Object.keys(u).length){if(f.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+t+"/"+e),this.flushBufferCounter<this.appended){for(var d in u)if(!i||d===i){if(r=u[d],r.ended=!1,r.updating)return f.logger.warn("cannot flush, sb updating in progress"),!1;try{for(n=0;n<r.buffered.length;n++)if(a=r.buffered.start(n),o=r.buffered.end(n),-1!==navigator.userAgent.toLowerCase().indexOf("firefox")&&e===Number.POSITIVE_INFINITY?(s=t,l=e):(s=Math.max(a,t),l=Math.min(o,e)),Math.min(l,o)-s>.5)return this.flushBufferCounter++,f.logger.log("flush "+d+" ["+s+","+l+"], of ["+a+","+o+"], pos:"+this.media.currentTime),r.remove(s,l),!1}catch(t){f.logger.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else f.logger.warn("abort flushing too many retries");f.logger.log("buffer flushed")}return!0}}]),e}(c.default);i.default=p},{33:33,34:34,35:35,53:53}],9:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(35),u=r(l),d=t(34),c=r(d),f=function(t){function e(t){return n(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.default.FPS_DROP_LEVEL_CAPPING,u.default.MEDIA_ATTACHING,u.default.MANIFEST_PARSED))}return o(e,t),s(e,[{key:"destroy",value:function(){this.hls.config.capLevelToPlayerSize&&(this.media=this.restrictedLevels=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer)))}},{key:"onFpsDropLevelCapping",value:function(t){this.restrictedLevels||(this.restrictedLevels=[]),this.isLevelRestricted(t.droppedLevel)||this.restrictedLevels.push(t.droppedLevel)}},{key:"onMediaAttaching",value:function(t){this.media=t.media instanceof HTMLVideoElement?t.media:null}},{key:"onManifestParsed",value:function(t){var e=this.hls;e.config.capLevelToPlayerSize&&(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.levels=t.levels,e.firstLevel=this.getMaxLevel(t.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}},{key:"detectPlayerSize",value:function(){if(this.media){var t=this.levels?this.levels.length:0;if(t){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t-1),e.autoLevelCapping>this.autoLevelCapping&&e.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}}},{key:"getMaxLevel",value:function(t){var e=0,i=void 0,r=void 0,n=this.mediaWidth,a=this.mediaHeight,o=0,s=0;for(i=0;i<=t&&(r=this.levels[i],!this.isLevelRestricted(i))&&(e=i,o=r.width,s=r.height,!(n<=o||a<=s));i++);return e}},{key:"isLevelRestricted",value:function(t){return!(!this.restrictedLevels||-1===this.restrictedLevels.indexOf(t))}},{key:"contentScaleFactor",get:function(){var t=1;try{t=window.devicePixelRatio}catch(t){}return t}},{key:"mediaWidth",get:function(){var t=void 0,e=this.media;return e&&(t=e.width||e.clientWidth||e.offsetWidth,t*=this.contentScaleFactor),t}},{key:"mediaHeight",get:function(){var t=void 0,e=this.media;return e&&(t=e.height||e.clientHeight||e.offsetHeight,t*=this.contentScaleFactor),t}}]),e}(c.default);i.default=f},{34:34,35:35}],10:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(35),u=r(l),d=t(34),c=r(d),f=t(53),h=function(t){function e(t){return n(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.default.MEDIA_ATTACHING))}return o(e,t),s(e,[{key:"destroy",value:function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1}},{key:"onMediaAttaching",value:function(t){var e=this.hls.config;if(e.capLevelOnFPSDrop){"function"==typeof(this.video=t.media instanceof HTMLVideoElement?t.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),e.fpsDroppedMonitoringPeriod)}}},{key:"checkFPS",value:function(t,e,i){var r=performance.now();if(e){if(this.lastTime){var n=r-this.lastTime,a=i-this.lastDroppedFrames,o=e-this.lastDecodedFrames,s=1e3*a/n,l=this.hls;if(l.trigger(u.default.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:i}),s>0&&a>l.config.fpsDroppedMonitoringThreshold*o){var d=l.currentLevel;f.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===l.autoLevelCapping||l.autoLevelCapping>=d)&&(d-=1,l.trigger(u.default.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:l.currentLevel}),l.autoLevelCapping=d,l.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=i,this.lastDecodedFrames=e}}},{key:"checkFPSInterval",value:function(){var t=this.video;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)}}]),e}(c.default);i.default=h},{34:34,35:35,53:53}],11:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(35),u=r(l),d=t(34),c=r(d),f=function(t){function e(t){n(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.default.MEDIA_ATTACHED,u.default.MEDIA_DETACHING,u.default.FRAG_PARSING_METADATA));return i.id3Track=void 0,i.media=void 0,i}return o(e,t),s(e,[{key:"destroy",value:function(){c.default.prototype.destroy.call(this)}},{key:"onMediaAttached",value:function(t){this.media=t.media,this.media&&(this.id3Track=this.media.addTextTrack("metadata","id3"),this.id3Track.mode="hidden")}},{key:"onMediaDetaching",value:function(){this.media=void 0}},{key:"onFragParsingMetadata",value:function(t){var e=t.frag,i=t.samples,r=e.start,n=e.start+e.duration;r===n&&(n+=1e-4);for(var a=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,o=0;o<i.length;o++){var s=this.parseID3Frame(i[o].data),l=this.decodeID3Frame(s);if(l){var u=new a(r,n,"");u.value=l,this.id3Track.addCue(u)}}}},{key:"parseID3Frame",value:function(t){if(!(t.length<21)&&73===t[0]&&68===t[1]&&51===t[2]){var e=String.fromCharCode(t[10],t[11],t[12],t[13]);return t=t.subarray(20),{type:e,data:t}}}},{key:"decodeID3Frame",value:function(t){return"TXXX"===t.type?this.decodeTxxxFrame(t):"PRIV"===t.type?this.decodePrivFrame(t):"T"===t.type[0]?this.decodeTextFrame(t):void 0}},{key:"decodeTxxxFrame",value:function(t){if(!(t.size<2)&&3===t.data[0]){var e=1,i=this.utf8ArrayToStr(t.data.subarray(e));e+=i.length+1;return{key:"TXXX",description:i,data:this.utf8ArrayToStr(t.data.subarray(e))}}}},{key:"decodeTextFrame",value:function(t){if(!(t.size<2)&&3===t.data[0]){var e=t.data.subarray(1);return{key:t.type,data:this.utf8ArrayToStr(e)}}}},{key:"decodePrivFrame",value:function(t){if(!(t.size<2)){var e=this.utf8ArrayToStr(t.data);return{key:"PRIV",info:e,data:t.data.subarray(e.length+1).buffer}}}},{key:"utf8ArrayToStr",value:function(t){for(var e=void 0,i=void 0,r="",n=0,a=t.length;n<a;){var o=t[n++];switch(o>>4){case 0:return r;case 1:case 2:case 3:case 4:case 5:case 6:case 7:r+=String.fromCharCode(o);break;case 12:case 13:e=t[n++],r+=String.fromCharCode((31&o)<<6|63&e);break;case 14:e=t[n++],i=t[n++],r+=String.fromCharCode((15&o)<<12|(63&e)<<6|(63&i)<<0)}}return r}}]),e}(c.default);i.default=f},{34:34,35:35}],12:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(35),u=r(l),d=t(34),c=r(d),f=t(53),h=t(33),p=t(37),g=r(p),y=function(t){function e(t){n(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.default.MANIFEST_LOADED,u.default.LEVEL_LOADED,u.default.FRAG_LOADED,u.default.ERROR));return i.ontick=i.tick.bind(i),i._manualLevel=-1,i}return o(e,t),s(e,[{key:"destroy",value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this._manualLevel=-1}},{key:"startLoad",value:function(){this.canload=!0;var t=this._levels;t&&t.forEach(function(t){t.loadError=0;var e=t.details;e&&e.live&&(t.details=void 0)}),this.timer&&this.tick()}},{key:"stopLoad",value:function(){this.canload=!1}},{key:"onManifestLoaded",value:function(t){var e,i=[],r=[],n={},a=!1,o=!1,s=this.hls,l=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),d=function(t,e){return MediaSource.isTypeSupported(t+"/mp4;codecs="+e)};if(t.levels.forEach(function(t){t.videoCodec&&(a=!0),l&&t.audioCodec&&-1!==t.audioCodec.indexOf("mp4a.40.34")&&(t.audioCodec=void 0),(t.audioCodec||t.attrs&&t.attrs.AUDIO)&&(o=!0);var e=n[t.bitrate];void 0===e?(n[t.bitrate]=i.length,t.url=[t.url],t.urlId=0,i.push(t)):i[e].url.push(t.url)}),a&&o?i.forEach(function(t){t.videoCodec&&r.push(t)}):r=i,r=r.filter(function(t){var e=t.audioCodec,i=t.videoCodec;return(!e||d("audio",e))&&(!i||d("video",i))}),r.length){e=r[0].bitrate,r.sort(function(t,e){return t.bitrate-e.bitrate}),this._levels=r;for(var c=0;c<r.length;c++)if(r[c].bitrate===e){this._firstLevel=c,f.logger.log("manifest loaded,"+r.length+" level(s) found, first bitrate:"+e);break}s.trigger(u.default.MANIFEST_PARSED,{levels:r,firstLevel:this._firstLevel,stats:t.stats,audio:o,video:a,altAudio:t.audioTracks.length>0})}else s.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:s.url,reason:"no level with compatible codecs found in manifest"})}},{key:"setLevelInternal",value:function(t){var e=this._levels,i=this.hls;if(t>=0&&t<e.length){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this._level!==t){f.logger.log("switching to level "+t),this._level=t;var r=e[t];r.level=t,i.trigger(u.default.LEVEL_SWITCH,r),i.trigger(u.default.LEVEL_SWITCHING,r)}var n=e[t],a=n.details;if(!a||!0===a.live){var o=n.urlId;i.trigger(u.default.LEVEL_LOADING,{url:n.url[o],level:t,id:o})}}else i.trigger(u.default.ERROR,{type:h.ErrorTypes.OTHER_ERROR,details:h.ErrorDetails.LEVEL_SWITCH_ERROR,level:t,fatal:!1,reason:"invalid level idx"})}},{key:"onError",value:function(t){if(!t.fatal){var e=t.details,i=this.hls,r=void 0,n=void 0,a=!1;switch(e){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:case h.ErrorDetails.FRAG_LOOP_LOADING_ERROR:case h.ErrorDetails.KEY_LOAD_ERROR:case h.ErrorDetails.KEY_LOAD_TIMEOUT:r=t.frag.level;break;case h.ErrorDetails.LEVEL_LOAD_ERROR:case h.ErrorDetails.LEVEL_LOAD_TIMEOUT:r=t.context.level,a=!0;break;case h.ErrorDetails.REMUX_ALLOC_ERROR:r=t.level}if(void 0!==r){n=this._levels[r],n.loadError?n.loadError++:n.loadError=1;var o=n.url.length;if(o>1&&n.loadError<o)n.urlId=(n.urlId+1)%o,n.details=void 0,f.logger.warn("level controller,"+e+" for level "+r+": switching to redundant stream id "+n.urlId);else{if(-1===this._manualLevel&&r)f.logger.warn("level controller,"+e+": switch-down for next fragment"),i.nextAutoLevel=Math.max(0,r-1);else if(n&&n.details&&n.details.live)f.logger.warn("level controller,"+e+" on live stream, discard"),a&&(this._level=void 0);else if(e===h.ErrorDetails.LEVEL_LOAD_ERROR||e===h.ErrorDetails.LEVEL_LOAD_TIMEOUT){var s=i.media,l=s&&g.default.isBuffered(s,s.currentTime)&&g.default.isBuffered(s,s.currentTime+.5);if(l){var u=i.config.levelLoadingRetryDelay;f.logger.warn("level controller,"+e+", but media buffered, retry in "+u+"ms"),this.timer=setTimeout(this.ontick,u),t.levelRetry=!0}else f.logger.error("cannot recover "+e+" error"),this._level=void 0,this.timer&&(clearTimeout(this.timer),this.timer=null),t.fatal=!0}}}}}},{key:"onFragLoaded",value:function(t){var e=t.frag;if(e&&"main"===e.type){var i=this._levels[e.level];i&&(i.loadError=0)}}},{key:"onLevelLoaded",value:function(t){var e=t.level;if(e===this._level){var i=this._levels[e];i.loadError=0;var r=t.details;if(r.live){var n=1e3*(r.averagetargetduration?r.averagetargetduration:r.targetduration),a=i.details;a&&r.endSN===a.endSN&&(n/=2,f.logger.log("same live playlist, reload twice faster")),n-=performance.now()-t.stats.trequest,n=Math.max(1e3,Math.round(n)),f.logger.log("live playlist, reload in "+n+" ms"),this.timer=setTimeout(this.ontick,n)}else this.timer=null}}},{key:"tick",value:function(){var t=this._level;if(void 0!==t&&this.canload){var e=this._levels[t];if(e&&e.url){var i=e.urlId;this.hls.trigger(u.default.LEVEL_LOADING,{url:e.url[i],level:t,id:i})}}}},{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this._level},set:function(t){var e=this._levels;e&&e.length>t&&(this._level===t&&void 0!==e[t].details||this.setLevelInternal(t))}},{key:"manualLevel",get:function(){return this._manualLevel},set:function(t){this._manualLevel=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this._manualLevel?this._manualLevel:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this._manualLevel&&(this.hls.nextAutoLevel=t)}}]),e}(c.default);i.default=y},{33:33,34:34,35:35,37:37,53:53}],13:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(48),u=r(l),d=t(37),c=r(d),f=t(25),h=r(f),p=t(35),g=r(p),y=t(34),v=r(y),m=t(38),b=r(m),_=t(54),E=r(_),T=t(33),k=t(53),A={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_LEVEL:"WAITING_LEVEL",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR"},S=function(t){function e(t){n(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,g.default.MEDIA_ATTACHED,g.default.MEDIA_DETACHING,g.default.MANIFEST_LOADING,g.default.MANIFEST_PARSED,g.default.LEVEL_LOADED,g.default.KEY_LOADED,g.default.FRAG_LOADED,g.default.FRAG_LOAD_EMERGENCY_ABORTED,g.default.FRAG_PARSING_INIT_SEGMENT,g.default.FRAG_PARSING_DATA,g.default.FRAG_PARSED,g.default.ERROR,g.default.AUDIO_TRACK_SWITCHING,g.default.AUDIO_TRACK_SWITCHED,g.default.BUFFER_CREATED,g.default.BUFFER_APPENDED,g.default.BUFFER_FLUSHED));return i.config=t.config,i.audioCodecSwap=!1,i.ticks=0,i._state=A.STOPPED,i.ontick=i.tick.bind(i),i}return o(e,t),s(e,[{key:"destroy",value:function(){this.stopLoad(),this.timer&&(clearInterval(this.timer),this.timer=null),v.default.prototype.destroy.call(this),this.state=A.STOPPED}},{key:"startLoad",value:function(t){if(this.levels){var e=this.lastCurrentTime,i=this.hls;if(this.stopLoad(),this.timer||(this.timer=setInterval(this.ontick,100)),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var r=i.startLevel;-1===r&&(r=0,this.bitrateTest=!0),this.level=i.nextLoadLevel=r,this.loadedmetadata=!1}e>0&&-1===t&&(k.logger.log("override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=A.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this.forceStartLoad=!0,this.state=A.STOPPED}},{key:"stopLoad",value:function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=A.STOPPED,this.forceStartLoad=!1}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){switch(this.state){case A.ERROR:break;case A.BUFFER_FLUSHING:this.fragLoadError=0;break;case A.IDLE:this._doTickIdle();break;case A.WAITING_LEVEL:var t=this.levels[this.level];t&&t.details&&(this.state=A.IDLE);break;case A.FRAG_LOADING_WAITING_RETRY:var e=performance.now(),i=this.retryDate;(!i||e>=i||this.media&&this.media.seeking)&&(k.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=A.IDLE);break;case A.ERROR:case A.STOPPED:case A.FRAG_LOADING:case A.PARSING:case A.PARSED:case A.ENDED:}this._checkBuffer(),this._checkFragmentChanged()}},{key:"_doTickIdle",value:function(){var t=this.hls,e=t.config,i=this.media;if(void 0===this.levelLastLoaded||i||!this.startFragRequested&&e.startFragPrefetch){var r=void 0;r=this.loadedmetadata?i.currentTime:this.nextLoadPosition;var n=t.nextLoadLevel,a=this.levels[n];if(a){var o=a.bitrate,s=void 0;s=o?Math.max(8*e.maxBufferSize/o,e.maxBufferLength):e.maxBufferLength,s=Math.min(s,e.maxMaxBufferLength);var l=c.default.bufferInfo(this.mediaBuffer?this.mediaBuffer:i,r,e.maxBufferHole),u=l.len;if(!(u>=s)){k.logger.trace("buffer length of "+u.toFixed(3)+" is below max of "+s.toFixed(3)+". checking for more payload ..."),this.level=t.nextLoadLevel=n;var d=a.details;if(void 0===d||d.live&&this.levelLastLoaded!==n)return void(this.state=A.WAITING_LEVEL);var f=this.fragPrevious;if(!d.live&&f&&f.sn===d.endSN){if(Math.min(i.duration,f.start+f.duration)-Math.max(l.end,f.start)<=Math.max(.2,f.duration)){var h={};return this.altAudio&&(h.type="video"),this.hls.trigger(g.default.BUFFER_EOS,h),void(this.state=A.ENDED)}}this._fetchPayloadOrEos(r,l,d)}}}}},{key:"_fetchPayloadOrEos",value:function(t,e,i){var r=this.fragPrevious,n=this.level,a=i.fragments,o=a.length;if(0!==o){var s=a[0].start,l=a[o-1].start+a[o-1].duration,u=e.end,d=void 0;if(i.initSegment&&!i.initSegment.data)d=i.initSegment;else if(i.live){var c=this.config.initialLiveManifestSize;if(o<c)return void k.logger.warn("Can not start playback of a level, reason: not enough fragments "+o+" < "+c);if(null===(d=this._ensureFragmentAtLivePoint(i,u,s,l,r,a,o)))return}else u<s&&(d=a[0]);d||(d=this._findFragment(s,r,o,a,u,l,i)),d&&this._loadFragmentOrKey(d,n,i,t,u)}}},{key:"_ensureFragmentAtLivePoint",value:function(t,e,i,r,n,a,o){var s=this.hls.config,l=this.media,u=void 0,d=void 0!==s.liveMaxLatencyDuration?s.liveMaxLatencyDuration:s.liveMaxLatencyDurationCount*t.targetduration;if(e<Math.max(i-s.maxFragLookUpTolerance,r-d)){var c=this.liveSyncPosition=this.computeLivePosition(i,t);k.logger.log("buffer end: "+e.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+c.toFixed(3)),e=c,l&&l.readyState&&l.duration>c&&(l.currentTime=c)}if(t.PTSKnown&&e>r&&l&&l.readyState)return null;if(this.startFragRequested&&!t.PTSKnown){if(n){var f=n.sn+1;f>=t.startSN&&f<=t.endSN&&(u=a[f-t.startSN],k.logger.log("live playlist, switching playlist, load frag with next SN: "+u.sn))}u||(u=a[Math.min(o-1,Math.round(o/2))],k.logger.log("live playlist, switching playlist, unknown, load middle frag : "+u.sn))}return u}},{key:"_findFragment",value:function(t,e,i,r,n,a,o){var s=this.hls.config,l=void 0,d=void 0,c=s.maxFragLookUpTolerance,f=e?r[e.sn-r[0].sn+1]:void 0,h=function(t){var e=Math.min(c,t.duration);return t.start+t.duration-e<=n?1:t.start-e>n&&t.start?-1:0};if(n<a?(n>a-c&&(c=0),d=f&&!h(f)?f:u.default.search(r,h)):d=r[i-1],d){l=d;var p=l.sn-o.startSN,g=e&&l.level===e.level,y=r[p-1],v=r[p+1];if(e&&l.sn===e.sn)if(g&&!l.backtracked)if(l.sn<o.endSN){var m=e.deltaPTS;m&&m>s.maxBufferHole&&e.dropped&&p?(l=y,k.logger.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"),e.loadCounter--):(l=v,k.logger.log("SN just loaded, load next one: "+l.sn))}else l=null;else l.backtracked&&(v&&v.backtracked?(k.logger.warn("Already backtracked from fragment "+v.sn+", will not backtrack to fragment "+l.sn+". Loading fragment "+v.sn),l=v):(k.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),l.dropped=0,y?(y.loadCounter&&y.loadCounter--,l=y,l.backtracked=!0):l=null))}return l}},{key:"_loadFragmentOrKey",value:function(t,e,i,r,n){var a=this.hls,o=a.config;if(!t.decryptdata||null==t.decryptdata.uri||null!=t.decryptdata.key){if(k.logger.log("Loading "+t.sn+" of ["+i.startSN+" ,"+i.endSN+"],level "+e+", currentTime:"+r.toFixed(3)+",bufferEnd:"+n.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,t.loadCounter){t.loadCounter++;var s=o.fragLoadingLoopThreshold;if(t.loadCounter>s&&Math.abs(this.fragLoadIdx-t.loadIdx)<s)return void a.trigger(g.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_LOOP_LOADING_ERROR,fatal:!1,frag:t})}else t.loadCounter=1;return t.loadIdx=this.fragLoadIdx,this.fragCurrent=t,this.startFragRequested=!0,isNaN(t.sn)||(this.nextLoadPosition=t.start+t.duration),t.autoLevel=a.autoLevelEnabled,t.bitrateTest=this.bitrateTest,a.trigger(g.default.FRAG_LOADING,{frag:t}),this.demuxer||(this.demuxer=new h.default(a,"main")),void(this.state=A.FRAG_LOADING)}k.logger.log("Loading key for "+t.sn+" of ["+i.startSN+" ,"+i.endSN+"],level "+e),this.state=A.KEY_LOADING,a.trigger(g.default.KEY_LOADING,{frag:t})}},{key:"getBufferedFrag",value:function(t){return u.default.search(this._bufferedFrags,function(e){return t<e.startPTS?-1:t>e.endPTS?1:0})}},{key:"followingBufferedFrag",value:function(t){return t?this.getBufferedFrag(t.endPTS+.5):null}},{key:"_checkFragmentChanged",value:function(){var t,e,i=this.media;if(i&&i.readyState&&!1===i.seeking&&(e=i.currentTime,e>i.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=e),c.default.isBuffered(i,e)?t=this.getBufferedFrag(e):c.default.isBuffered(i,e+.1)&&(t=this.getBufferedFrag(e+.1)),t)){var r=t;if(r!==this.fragPlaying){this.hls.trigger(g.default.FRAG_CHANGED,{frag:r});var n=r.level;this.fragPlaying&&this.fragPlaying.level===n||this.hls.trigger(g.default.LEVEL_SWITCHED,{level:n}),this.fragPlaying=r}}}},{key:"immediateLevelSwitch",value:function(){if(k.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,e=void 0;t?(e=t.paused,t.pause()):e=!0,this.previouslyPaused=e}var i=this.fragCurrent;i&&i.loader&&i.loader.abort(),this.fragCurrent=null,this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"immediateLevelSwitchEnd",value:function(){var t=this.media;t&&t.buffered.length&&(this.immediateSwitch=!1,c.default.isBuffered(t,t.currentTime)&&(t.currentTime-=1e-4),this.previouslyPaused||t.play())}},{key:"nextLevelSwitch",value:function(){var t=this.media;if(t&&t.readyState){var e=void 0,i=void 0,r=void 0;if(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,i=this.getBufferedFrag(t.currentTime),i&&i.startPTS>1&&this.flushMainBuffer(0,i.startPTS-1),t.paused)e=0;else{var n=this.hls.nextLoadLevel,a=this.levels[n],o=this.fragLastKbps;e=o&&this.fragCurrent?this.fragCurrent.duration*a.bitrate/(1e3*o)+1:0}if((r=this.getBufferedFrag(t.currentTime+e))&&(r=this.followingBufferedFrag(r))){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(r.startPTS,Number.POSITIVE_INFINITY)}}}},{key:"flushMainBuffer",value:function(t,e){this.state=A.BUFFER_FLUSHING;var i={startOffset:t,endOffset:e};this.altAudio&&(i.type="video"),this.hls.trigger(g.default.BUFFER_FLUSHING,i)}},{key:"onMediaAttached",value:function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("seeked",this.onvseeked),e.addEventListener("ended",this.onvended);var i=this.config;this.levels&&i.autoStartLoad&&this.hls.startLoad(i.startPosition)}},{key:"onMediaDetaching",value:function(){var t=this.media;t&&t.ended&&(k.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var e=this.levels;e&&e.forEach(function(t){t.details&&t.details.fragments.forEach(function(t){t.loadCounter=void 0,t.backtracked=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("seeked",this.onvseeked),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){var t=this.media,e=t?t.currentTime:void 0,i=this.config;isNaN(e)||k.logger.log("media seeking to "+e.toFixed(3));var r=this.mediaBuffer?this.mediaBuffer:t,n=c.default.bufferInfo(r,e,this.config.maxBufferHole);if(this.state===A.FRAG_LOADING){var a=this.fragCurrent;if(0===n.len&&a){var o=i.maxFragLookUpTolerance,s=a.start-o,l=a.start+a.duration+o;e<s||e>l?(a.loader&&(k.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),a.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=A.IDLE):k.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===A.ENDED&&(0===n.len&&(this.fragPrevious=0),this.state=A.IDLE);t&&(this.lastCurrentTime=e),this.state!==A.FRAG_LOADING&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*i.fragLoadingLoopThreshold),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=e),this.tick()}},{key:"onMediaSeeked",value:function(){var t=this.media,e=t?t.currentTime:void 0;isNaN(e)||k.logger.log("media seeked to "+e.toFixed(3)),this.tick()}},{key:"onMediaEnded",value:function(){k.logger.log("media ended"),this.startPosition=this.lastCurrentTime=0}},{key:"onManifestLoading",value:function(){k.logger.log("trigger BUFFER_RESET"),this.hls.trigger(g.default.BUFFER_RESET),this._bufferedFrags=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0}},{key:"onManifestParsed",value:function(t){var e,i=!1,r=!1;t.levels.forEach(function(t){(e=t.audioCodec)&&(-1!==e.indexOf("mp4a.40.2")&&(i=!0),-1!==e.indexOf("mp4a.40.5")&&(r=!0))}),this.audioCodecSwitch=i&&r,this.audioCodecSwitch&&k.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startLevelLoaded=!1,this.startFragRequested=!1;var n=this.config;(n.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(n.startPosition)}},{key:"onLevelLoaded",value:function(t){var e=t.details,i=t.level,r=this.levels[i],n=e.totalduration,a=0;if(k.logger.log("level "+i+" loaded ["+e.startSN+","+e.endSN+"],duration:"+n),this.levelLastLoaded=i,e.live){var o=r.details;o&&e.fragments.length>0?(b.default.mergeDetails(o,e),a=e.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(a,o),e.PTSKnown?k.logger.log("live playlist sliding:"+a.toFixed(3)):k.logger.log("live playlist - outdated PTS, unknown sliding")):(e.PTSKnown=!1,k.logger.log("live playlist - first load, unknown sliding"))}else e.PTSKnown=!1;if(r.details=e,this.hls.trigger(g.default.LEVEL_UPDATED,{details:e,level:i}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var s=e.startTimeOffset;isNaN(s)?e.live?(this.startPosition=this.computeLivePosition(a,e),k.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(s<0&&(k.logger.log("negative start time offset "+s+", count from end of last fragment"),s=a+n+s),k.logger.log("start time offset found in playlist, adjust startPosition to "+s),this.startPosition=s),this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===A.WAITING_LEVEL&&(this.state=A.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===A.KEY_LOADING&&(this.state=A.IDLE,this.tick())}},{key:"onFragLoaded",value:function(t){var e=this.fragCurrent,i=t.frag;if(this.state===A.FRAG_LOADING&&e&&"main"===i.type&&i.level===e.level&&i.sn===e.sn){var r=t.stats,n=this.levels[e.level],a=n.details;if(k.logger.log("Loaded "+e.sn+" of ["+a.startSN+" ,"+a.endSN+"],level "+e.level),this.bitrateTest=!1,this.stats=r,!0===i.bitrateTest&&this.hls.nextLoadLevel)this.state=A.IDLE,this.startFragRequested=!1,r.tparsed=r.tbuffered=performance.now(),this.hls.trigger(g.default.FRAG_BUFFERED,{stats:r,frag:e,id:"main"}),this.tick();else if("initSegment"===i.sn)this.state=A.IDLE,r.tparsed=r.tbuffered=performance.now(),a.initSegment.data=t.payload,this.hls.trigger(g.default.FRAG_BUFFERED,{stats:r,frag:e,id:"main"}),this.tick();else{this.state=A.PARSING;var o=a.totalduration,s=e.level,l=e.sn,u=this.config.defaultAudioCodec||n.audioCodec;this.audioCodecSwap&&(k.logger.log("swapping playlist audio codec"),void 0===u&&(u=this.lastAudioCodec),u&&(u=-1!==u.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,k.logger.log("Parsing "+l+" of ["+a.startSN+" ,"+a.endSN+"],level "+s+", cc "+e.cc);var d=this.demuxer;d||(d=this.demuxer=new h.default(this.hls,"main"));var c=this.media,f=c&&c.seeking,p=!f&&(a.PTSKnown||!a.live),y=a.initSegment?a.initSegment.data:[];d.push(t.payload,y,u,n.videoCodec,e,o,p,void 0)}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(t){var e=this.fragCurrent,i=t.frag;if(e&&"main"===t.id&&i.sn===e.sn&&i.level===e.level&&this.state===A.PARSING){var r,n,a=t.tracks;if(a.audio&&this.altAudio&&delete a.audio,n=a.audio){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(k.logger.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==n.metadata.channelCount&&-1===s.indexOf("firefox")&&(o="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==n.container&&(o="mp4a.40.2",k.logger.log("Android: force audio codec to "+o)),n.levelCodec=o,n.id=t.id}n=a.video,n&&(n.levelCodec=this.levels[this.level].videoCodec,n.id=t.id),this.hls.trigger(g.default.BUFFER_CODECS,a);for(r in a){n=a[r],k.logger.log("main track:"+r+",container:"+n.container+",codecs[level/parsed]=["+n.levelCodec+"/"+n.codec+"]");var l=n.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(g.default.BUFFER_APPENDING,{type:r,data:l,parent:"main",content:"initSegment"}))}this.tick()}}},{key:"onFragParsingData",value:function(t){var e=this,i=this.fragCurrent,r=t.frag;if(i&&"main"===t.id&&r.sn===i.sn&&r.level===i.level&&("audio"!==t.type||!this.altAudio)&&this.state===A.PARSING){var n=this.levels[this.level],a=i;if(isNaN(t.endPTS)&&(t.endPTS=t.startPTS+i.duration,t.endDTS=t.startDTS+i.duration),k.logger.log("Parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb+",dropped:"+(t.dropped||0)),"video"===t.type)if(a.dropped=t.dropped,a.dropped){if(!a.backtracked)return k.logger.warn("missing video frame(s), backtracking fragment"),a.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=A.IDLE,this.fragPrevious=a,void this.tick();k.logger.warn("Already backtracked on this fragment, appending with the gap")}else a.backtracked=!1;var o=b.default.updateFragPTSDTS(n.details,a,t.startPTS,t.endPTS,t.startDTS,t.endDTS),s=this.hls;s.trigger(g.default.LEVEL_PTS_UPDATED,{details:n.details,level:this.level,drift:o,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(i){i&&i.length&&e.state===A.PARSING&&(e.appended=!0,e.pendingBuffering=!0,s.trigger(g.default.BUFFER_APPENDING,{type:t.type,data:i,parent:"main",content:"data"}))}),this.tick()}}},{key:"onFragParsed",value:function(t){var e=this.fragCurrent,i=t.frag;e&&"main"===t.id&&i.sn===e.sn&&i.level===e.level&&this.state===A.PARSING&&(this.stats.tparsed=performance.now(),this.state=A.PARSED,this._checkAppendedParsed())}},{key:"onAudioTrackSwitching",value:function(t){var e=!!t.url,i=t.id;if(!e){if(this.mediaBuffer!==this.media){k.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var r=this.fragCurrent;r.loader&&(k.logger.log("switching to main audio track, cancel main fragment load"),r.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=A.IDLE}var n=this.hls;n.trigger(g.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),n.trigger(g.default.AUDIO_TRACK_SWITCHED,{id:i}),this.altAudio=!1}}},{key:"onAudioTrackSwitched",value:function(t){var e=t.id,i=!!this.hls.audioTracks[e].url;if(i){var r=this.videoBuffer;r&&this.mediaBuffer!==r&&(k.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=i,this.tick()}},{key:"onBufferCreated",value:function(t){var e=t.tracks,i=void 0,r=void 0,n=!1;for(var a in e){var o=e[a];"main"===o.id?(r=a,i=o,"video"===a&&(this.videoBuffer=e[a].buffer)):n=!0}n&&i?(k.logger.log("alternate track found, use "+r+".buffered to schedule main fragment loading"),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}},{key:"onBufferAppended",value:function(t){if("main"===t.parent){var e=this.state;e!==A.PARSING&&e!==A.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==A.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent;if(t){var e=this.mediaBuffer?this.mediaBuffer:this.media;k.logger.log("main buffered : "+E.default.toString(e.buffered));var i=this._bufferedFrags.filter(function(t){return c.default.isBuffered(e,(t.startPTS+t.endPTS)/2)});i.push(t),this._bufferedFrags=i.sort(function(t,e){return t.startPTS-e.startPTS}),this.fragPrevious=t;var r=this.stats;r.tbuffered=performance.now(),this.fragLastKbps=Math.round(8*r.total/(r.tbuffered-r.tfirst)),this.hls.trigger(g.default.FRAG_BUFFERED,{stats:r,frag:t,id:"main"}),this.state=A.IDLE}this.tick()}}},{key:"onError",value:function(t){var e=t.frag||this.fragCurrent;if(!e||"main"===e.type){var i=this.media,r=i&&c.default.isBuffered(i,i.currentTime)&&c.default.isBuffered(i,i.currentTime+.5);switch(t.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:case T.ErrorDetails.KEY_LOAD_ERROR:case T.ErrorDetails.KEY_LOAD_TIMEOUT:if(!t.fatal){var n=this.fragLoadError;n?n++:n=1;var a=this.config;if(n<=a.fragLoadingMaxRetry||r||e.autoLevel&&e.level){this.fragLoadError=n,e.loadCounter=0;var o=Math.min(Math.pow(2,n-1)*a.fragLoadingRetryDelay,a.fragLoadingMaxRetryTimeout);k.logger.warn("mediaController: frag loading failed, retry in "+o+" ms"),this.retryDate=performance.now()+o,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.state=A.FRAG_LOADING_WAITING_RETRY}else k.logger.error("mediaController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=A.ERROR}break;case T.ErrorDetails.FRAG_LOOP_LOADING_ERROR:t.fatal||(r?(this._reduceMaxBufferLength(e.duration),this.state=A.IDLE):e.autoLevel&&0!==e.level||(t.fatal=!0,this.state=A.ERROR));break;case T.ErrorDetails.LEVEL_LOAD_ERROR:case T.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==A.ERROR&&(t.fatal?(this.state=A.ERROR,k.logger.warn("streamController: "+t.details+",switch to "+this.state+" state ...")):t.levelRetry||this.state!==A.WAITING_LEVEL||(this.state=A.IDLE));break;case T.ErrorDetails.BUFFER_FULL_ERROR:"main"!==t.parent||this.state!==A.PARSING&&this.state!==A.PARSED||(r?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=A.IDLE):(k.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}}},{key:"_reduceMaxBufferLength",value:function(t){var e=this.config;e.maxMaxBufferLength>=t&&(e.maxMaxBufferLength/=2,k.logger.warn("main:reduce max buffer length to "+e.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*e.fragLoadingLoopThreshold)}},{key:"_checkBuffer",value:function(){var t=this.media;if(t&&t.readyState){var e=t.currentTime,i=this.mediaBuffer?this.mediaBuffer:t,r=i.buffered;if(!this.loadedmetadata&&r.length){this.loadedmetadata=!0;var n=t.seeking?e:this.startPosition,a=c.default.isBuffered(i,n);e===n&&a||(k.logger.log("target start position:"+n),a||(n=r.start(0),k.logger.log("target start position not buffered, seek to buffered.start(0) "+n)),k.logger.log("adjust currentTime from "+e+" to "+n),t.currentTime=n)}else if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var o=c.default.bufferInfo(t,e,0),s=!(t.paused||t.ended||0===t.buffered.length),l=e!==this.lastCurrentTime,u=this.config;if(l)this.stallReported&&(k.logger.warn("playback not stuck anymore @"+e+", after "+Math.round(performance.now()-this.stalled)+"ms"),this.stallReported=!1),this.stalled=void 0,this.nudgeRetry=0;else if(s){var d=performance.now(),f=this.hls;if(this.stalled){var h=d-this.stalled,p=o.len,y=this.nudgeRetry||0;if(p<=.5&&h>1e3*u.lowBufferWatchdogPeriod){this.stallReported||(this.stallReported=!0,k.logger.warn("playback stalling in low buffer @"+e),f.trigger(g.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p}));var v=o.nextStart,m=v-e;if(v&&m<u.maxSeekHole&&m>0){this.nudgeRetry=++y;var b=y*u.nudgeOffset;k.logger.log("adjust currentTime from "+t.currentTime+" to next buffered @ "+v+" + nudge "+b),t.currentTime=v+b,this.stalled=void 0,f.trigger(g.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:v+b-e})}}else if(p>.5&&h>1e3*u.highBufferWatchdogPeriod)if(this.stallReported||(this.stallReported=!0,k.logger.warn("playback stalling in high buffer @"+e),f.trigger(g.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p})),this.stalled=void 0,this.nudgeRetry=++y,y<u.nudgeMaxRetry){var _=t.currentTime,E=_+y*u.nudgeOffset;k.logger.log("adjust currentTime from "+_+" to "+E),t.currentTime=E,f.trigger(g.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else k.logger.error("still stuck in high buffer @"+e+" after "+u.nudgeMaxRetry+", raise fatal error"),f.trigger(g.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})}else this.stalled=d,this.stallReported=!1}}}}},{key:"onFragLoadEmergencyAborted",value:function(){this.state=A.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()}},{key:"onBufferFlushed",value:function(){var t=this.mediaBuffer?this.mediaBuffer:this.media;this._bufferedFrags=this._bufferedFrags.filter(function(e){return c.default.isBuffered(t,(e.startPTS+e.endPTS)/2)}),this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.state=A.IDLE,this.fragPrevious=null}},{key:"swapAudioCodec",value:function(){this.audioCodecSwap=!this.audioCodecSwap}},{key:"computeLivePosition",value:function(t,e){var i=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*e.targetduration;return t+Math.max(0,e.totalduration-i)}},{key:"state",set:function(t){if(this.state!==t){var e=this.state;this._state=t,k.logger.log("main stream:"+e+"->"+t),this.hls.trigger(g.default.STREAM_STATE_TRANSITION,{previousState:e,nextState:t})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var t=this.media;if(t){var e=this.getBufferedFrag(t.currentTime);if(e)return e.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;return t?this.followingBufferedFrag(this.getBufferedFrag(t.currentTime)):null}},{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(t){this._liveSyncPosition=t}}]),e}(v.default);i.default=S},{25:25,33:33,34:34,35:35,37:37,38:38,48:48,53:53,54:54}],14:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(35),u=r(l),d=t(34),c=r(d),f=t(53),h=function(t){function e(t){n(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.default.ERROR,u.default.SUBTITLE_TRACKS_UPDATED,u.default.SUBTITLE_TRACK_SWITCH,u.default.SUBTITLE_TRACK_LOADED,u.default.SUBTITLE_FRAG_PROCESSED));return i.config=t.config,i.vttFragSNsProcessed={},i.vttFragQueues=void 0,i.currentlyProcessing=null,i.currentTrackId=-1,i}return o(e,t),s(e,[{key:"destroy",value:function(){c.default.prototype.destroy.call(this)}},{key:"clearVttFragQueues",value:function(){var t=this;this.vttFragQueues={},this.tracks.forEach(function(e){t.vttFragQueues[e.id]=[]})}},{key:"nextFrag",value:function(){if(null===this.currentlyProcessing&&this.currentTrackId>-1&&this.vttFragQueues[this.currentTrackId].length){var t=this.currentlyProcessing=this.vttFragQueues[this.currentTrackId].shift();this.hls.trigger(u.default.FRAG_LOADING,{frag:t})}}},{key:"onSubtitleFragProcessed",value:function(t){t.success&&this.vttFragSNsProcessed[t.frag.trackId].push(t.frag.sn),this.currentlyProcessing=null,this.nextFrag()}},{key:"onError",value:function(t){var e=t.frag;e&&"subtitle"!==e.type||this.currentlyProcessing&&(this.currentlyProcessing=null,this.nextFrag())}},{key:"onSubtitleTracksUpdated",value:function(t){var e=this;f.logger.log("subtitle tracks updated"),this.tracks=t.subtitleTracks,this.clearVttFragQueues(),this.vttFragSNsProcessed={},this.tracks.forEach(function(t){e.vttFragSNsProcessed[t.id]=[]})}},{key:"onSubtitleTrackSwitch",value:function(t){this.currentTrackId=t.id,this.clearVttFragQueues()}},{key:"onSubtitleTrackLoaded",value:function(t){var e=this.vttFragSNsProcessed[t.id],i=this.vttFragQueues[t.id],r=this.currentlyProcessing?this.currentlyProcessing.sn:-1,n=function(t){return e.indexOf(t.sn)>-1},a=function(t){return i.some(function(e){return e.sn===t.sn})};t.details.fragments.forEach(function(e){n(e)||e.sn===r||a(e)||(e.trackId=t.id,i.push(e))}),this.nextFrag()}}]),e}(c.default);i.default=h},{34:34,35:35,53:53}],15:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t){for(var e=[],i=0;i<t.length;i++)"subtitles"===t[i].kind&&e.push(t[i]);return e}Object.defineProperty(i,"__esModule",{value:!0});var l=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),u=t(35),d=r(u),c=t(34),f=r(c),h=t(53),p=function(t){function e(t){n(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,d.default.MEDIA_ATTACHED,d.default.MEDIA_DETACHING,d.default.MANIFEST_LOADING,d.default.MANIFEST_LOADED,d.default.SUBTITLE_TRACK_LOADED));return i.tracks=[],i.trackId=-1,i.media=void 0,i}return o(e,t),l(e,[{key:"destroy",value:function(){f.default.prototype.destroy.call(this)}},{key:"onMediaAttached",value:function(t){var e=this;this.media=t.media,this.media&&this.media.textTracks.addEventListener("change",function(){if(e.media){for(var t=-1,i=s(e.media.textTracks),r=0;r<i.length;r++)"showing"===i[r].mode&&(t=r);e.subtitleTrack=t}})}},{key:"onMediaDetaching",value:function(){this.media=void 0}},{key:"onManifestLoading",value:function(){this.tracks=[],this.trackId=-1}},{key:"onManifestLoaded",value:function(t){var e=this,i=t.subtitles||[],r=!1;this.tracks=i,this.trackId=-1,this.hls.trigger(d.default.SUBTITLE_TRACKS_UPDATED,{subtitleTracks:i}),i.forEach(function(t){t.default&&(e.subtitleTrack=t.id,r=!0)})}},{key:"onTick",value:function(){var t=this.trackId,e=this.tracks[t];if(e){var i=e.details;void 0!==i&&!0!==i.live||(h.logger.log("(re)loading playlist for subtitle track "+t),this.hls.trigger(d.default.SUBTITLE_TRACK_LOADING,{url:e.url,id:t}))}}},{key:"onSubtitleTrackLoaded",value:function(t){var e=this;t.id<this.tracks.length&&(h.logger.log("subtitle track "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.timer&&(this.timer=setInterval(function(){e.onTick()},1e3*t.details.targetduration,this)),!t.details.live&&this.timer&&(clearInterval(this.timer),this.timer=null))}},{key:"setSubtitleTrackInternal",value:function(t){if(t>=0&&t<this.tracks.length){this.timer&&(clearInterval(this.timer),this.timer=null),this.trackId=t,h.logger.log("switching to subtitle track "+t);var e=this.tracks[t];this.hls.trigger(d.default.SUBTITLE_TRACK_SWITCH,{id:t});var i=e.details;void 0!==i&&!0!==i.live||(h.logger.log("(re)loading playlist for subtitle track "+t),this.hls.trigger(d.default.SUBTITLE_TRACK_LOADING,{url:e.url,id:t}))}}},{key:"subtitleTracks",get:function(){return this.tracks}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.trackId!==t&&this.setSubtitleTrackInternal(t)}}]),e}(f.default);i.default=p},{34:34,35:35,53:53}],16:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t){if(t&&t.cues)for(;t.cues.length>0;)t.removeCue(t.cues[0])}function l(t,e){return t&&t.label===e.name&&!(t.textTrack1||t.textTrack2)}function u(t,e,i,r){return Math.min(e,r)-Math.max(t,i)}Object.defineProperty(i,"__esModule",{value:!0});var d=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),c=t(35),f=r(c),h=t(34),p=r(h),g=t(49),y=r(g),v=t(57),m=r(v),b=t(53),_=function(t){function e(t){n(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,f.default.MEDIA_ATTACHING,f.default.MEDIA_DETACHING,f.default.FRAG_PARSING_USERDATA,f.default.MANIFEST_LOADING,f.default.MANIFEST_LOADED,f.default.FRAG_LOADED,f.default.LEVEL_SWITCHING,f.default.INIT_PTS_FOUND));if(i.hls=t,i.config=t.config,i.enabled=!0,i.Cues=t.config.cueHandler,i.textTracks=[],i.tracks=[],i.unparsedVttFrags=[],i.initPTS=void 0,i.cueRanges=[],i.config.enableCEA708Captions){var r=i,o=function(t,e){var i=null;try{i=new window.Event("addtrack")}catch(t){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=t,e.dispatchEvent(i)},l={newCue:function(t,e,i){if(!r.textTrack1){var n=r.getExistingTrack("1");if(n)r.textTrack1=n,s(r.textTrack1),o(r.textTrack1,r.media);else{var a=r.createTextTrack("captions",r.config.captionsTextTrack1Label,r.config.captionsTextTrack1LanguageCode);a&&(a.textTrack1=!0,r.textTrack1=a)}}r.addCues("textTrack1",t,e,i)}},u={newCue:function(t,e,i){if(!r.textTrack2){var n=r.getExistingTrack("2");if(n)r.textTrack2=n,s(r.textTrack2),o(r.textTrack2,r.media);else{var a=r.createTextTrack("captions",r.config.captionsTextTrack2Label,r.config.captionsTextTrack1LanguageCode);a&&(a.textTrack2=!0,r.textTrack2=a)}}r.addCues("textTrack2",t,e,i)}};i.cea608Parser=new y.default(0,l,u)}return i}return o(e,t),d(e,[{key:"addCues",value:function(t,e,i,r){for(var n=this.cueRanges,a=!1,o=n.length;o--;){var s=n[o],l=u(s[0],s[1],e,i);if(l>=0&&(s[0]=Math.min(s[0],e),s[1]=Math.max(s[1],i),a=!0,l/(i-e)>.5))return}a||n.push([e,i]),this.Cues.newCue(this[t],e,i,r)}},{key:"onInitPtsFound",value:function(t){var e=this;void 0===this.initPTS&&(this.initPTS=t.initPTS),this.unparsedVttFrags.length&&(this.unparsedVttFrags.forEach(function(t){e.onFragLoaded(t)}),this.unparsedVttFrags=[])}},{key:"getExistingTrack",value:function(t){var e=this.media;if(e)for(var i=0;i<e.textTracks.length;i++){var r=e.textTracks[i],n="textTrack"+t;if(!0===r[n])return r}return null}},{key:"createTextTrack",value:function(t,e,i){var r=this.media;if(r)return r.addTextTrack(t,e,i)}},{key:"destroy",value:function(){p.default.prototype.destroy.call(this)}},{key:"onMediaAttaching",value:function(t){this.media=t.media}},{key:"onMediaDetaching",value:function(){s(this.textTrack1),s(this.textTrack2)}},{key:"onManifestLoading",value:function(){this.lastSn=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0};var t=this.media;if(t){var e=t.textTracks;if(e)for(var i=0;i<e.length;i++)s(e[i])}}},{key:"onManifestLoaded",value:function(t){var e=this;if(this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=void 0,this.cueRanges=[],this.config.enableWebVTT){this.tracks=t.subtitles||[];var i=this.media?this.media.textTracks:[];this.tracks.forEach(function(t,r){var n=void 0;if(r<i.length){var a=i[r];l(a,t)&&(n=a)}n||(n=e.createTextTrack("subtitles",t.name,t.lang)),n.mode=t.default?"showing":"hidden",e.textTracks.push(n)})}}},{key:"onLevelSwitching",value:function(){this.enabled="NONE"!==this.hls.currentLevel.closedCaptions}},{key:"onFragLoaded",value:function(t){var e=t.frag,i=t.payload;if("main"===e.type){var r=e.sn;if(r!==this.lastSn+1){var n=this.cea608Parser;n&&n.reset()}this.lastSn=r}else if("subtitle"===e.type)if(i.byteLength){if(void 0===this.initPTS)return void this.unparsedVttFrags.push(t);var a=this.vttCCs;a[e.cc]||(a[e.cc]={start:e.start,prevCC:this.prevCC,new:!0},this.prevCC=e.cc);var o=this.textTracks,s=this.hls;m.default.parse(i,this.initPTS,a,e.cc,function(t){var i=o[e.trackId];t.forEach(function(t){i.cues.getCueById(t.id)||i.addCue(t)}),s.trigger(f.default.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},function(t){b.logger.log("Failed to parse VTT cue: "+t),s.trigger(f.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e})})}else this.hls.trigger(f.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e})}},{key:"onFragParsingUserdata",value:function(t){if(this.enabled&&this.config.enableCEA708Captions)for(var e=0;e<t.samples.length;e++){var i=this.extractCea608Data(t.samples[e].bytes);this.cea608Parser.addData(t.samples[e].pts,i)}}},{key:"extractCea608Data",value:function(t){for(var e,i,r,n,a,o=31&t[0],s=2,l=[],u=0;u<o;u++)e=t[s++],i=127&t[s++],r=127&t[s++],n=0!=(4&e),a=3&e,0===i&&0===r||n&&0===a&&(l.push(i),l.push(r));return l}}]),e}(p.default);i.default=_},{34:34,35:35,49:49,53:53,57:57}],17:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=function(){function t(e,i){r(this,t),this.subtle=e,this.aesIV=i}return n(t,[{key:"decrypt",value:function(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)}}]),t}();i.default=a},{}],18:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=function(){function t(){r(this,t),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 n(t,[{key:"uint8ArrayToUint32Array_",value:function(t){for(var e=new DataView(t),i=new Uint32Array(4),r=0;r<4;r++)i[r]=e.getUint32(4*r);return i}},{key:"initTable",value:function(){var t=this.sBox,e=this.invSBox,i=this.subMix,r=i[0],n=i[1],a=i[2],o=i[3],s=this.invSubMix,l=s[0],u=s[1],d=s[2],c=s[3],f=new Uint32Array(256),h=0,p=0,g=0;for(g=0;g<256;g++)f[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){var y=p^p<<1^p<<2^p<<3^p<<4;y=y>>>8^255&y^99,t[h]=y,e[y]=h;var v=f[h],m=f[v],b=f[m],_=257*f[y]^16843008*y;r[h]=_<<24|_>>>8,n[h]=_<<16|_>>>16,a[h]=_<<8|_>>>24,o[h]=_,_=16843009*b^65537*m^257*v^16843008*h,l[y]=_<<24|_>>>8,u[y]=_<<16|_>>>16,d[y]=_<<8|_>>>24,c[y]=_,h?(h=v^f[f[f[b^v]]],p^=f[f[p]]):h=p=1}}},{key:"expandKey",value:function(t){for(var e=this.uint8ArrayToUint32Array_(t),i=!0,r=0;r<e.length&&i;)i=e[r]===this.key[r],r++;if(!i){this.key=e;var n=this.keySize=e.length;if(4!==n&&6!==n&&8!==n)throw new Error("Invalid aes key size="+n);var a=this.ksRows=4*(n+6+1),o=void 0,s=void 0,l=this.keySchedule=new Uint32Array(a),u=this.invKeySchedule=new Uint32Array(a),d=this.sBox,c=this.rcon,f=this.invSubMix,h=f[0],p=f[1],g=f[2],y=f[3],v=void 0,m=void 0;for(o=0;o<a;o++)o<n?v=l[o]=e[o]:(m=v,o%n==0?(m=m<<8|m>>>24,m=d[m>>>24]<<24|d[m>>>16&255]<<16|d[m>>>8&255]<<8|d[255&m],m^=c[o/n|0]<<24):n>6&&o%n==4&&(m=d[m>>>24]<<24|d[m>>>16&255]<<16|d[m>>>8&255]<<8|d[255&m]),l[o]=v=(l[o-n]^m)>>>0);for(s=0;s<a;s++)o=a-s,m=3&s?l[o]:l[o-4],u[s]=s<4||o<=4?m:h[d[m>>>24]]^p[d[m>>>16&255]]^g[d[m>>>8&255]]^y[d[255&m]],u[s]=u[s]>>>0}}},{key:"networkToHostOrderSwap",value:function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24}},{key:"decrypt",value:function(t,e,i){for(var r,n,a=this.keySize+6,o=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,u=l[0],d=l[1],c=l[2],f=l[3],h=this.uint8ArrayToUint32Array_(i),p=h[0],g=h[1],y=h[2],v=h[3],m=new Int32Array(t),b=new Int32Array(m.length),_=void 0,E=void 0,T=void 0,k=void 0,A=void 0,S=void 0,L=void 0,R=void 0,w=void 0,C=void 0,O=void 0,D=void 0,P=this.networkToHostOrderSwap;e<m.length;){for(w=P(m[e]),C=P(m[e+1]),O=P(m[e+2]),D=P(m[e+3]),A=w^o[0],S=D^o[1],L=O^o[2],R=C^o[3],r=4,n=1;n<a;n++)_=u[A>>>24]^d[S>>16&255]^c[L>>8&255]^f[255&R]^o[r],E=u[S>>>24]^d[L>>16&255]^c[R>>8&255]^f[255&A]^o[r+1],T=u[L>>>24]^d[R>>16&255]^c[A>>8&255]^f[255&S]^o[r+2],k=u[R>>>24]^d[A>>16&255]^c[S>>8&255]^f[255&L]^o[r+3],A=_,S=E,L=T,R=k,r+=4;_=s[A>>>24]<<24^s[S>>16&255]<<16^s[L>>8&255]<<8^s[255&R]^o[r],E=s[S>>>24]<<24^s[L>>16&255]<<16^s[R>>8&255]<<8^s[255&A]^o[r+1],T=s[L>>>24]<<24^s[R>>16&255]<<16^s[A>>8&255]<<8^s[255&S]^o[r+2],k=s[R>>>24]<<24^s[A>>16&255]<<16^s[S>>8&255]<<8^s[255&L]^o[r+3],r+=3,b[e]=P(_^p),b[e+1]=P(k^g),b[e+2]=P(T^y),b[e+3]=P(E^v),p=w,g=C,y=O,v=D,e+=4}return b.buffer}},{key:"destroy",value:function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0}}]),t}();i.default=a},{}],19:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),o=t(17),s=r(o),l=t(20),u=r(l),d=t(18),c=r(d),f=t(33),h=t(53),p=function(){function t(e,i){n(this,t),this.observer=e,this.config=i,this.logEnabled=!0;try{var r=crypto||self.crypto;this.subtle=r.subtle||r.webkitSubtle}catch(t){}this.disableWebCrypto=!this.subtle}return a(t,[{key:"isSync",value:function(){return this.disableWebCrypto&&this.config.enableSoftwareAES}},{key:"decrypt",value:function(t,e,i,r){var n=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(h.logger.log("JS AES decrypt"),this.logEnabled=!1);var a=this.decryptor;a||(this.decryptor=a=new c.default),a.expandKey(e),r(a.decrypt(t,0,i))}else{this.logEnabled&&(h.logger.log("WebCrypto AES decrypt"),this.logEnabled=!1);var o=this.subtle;this.key!==e&&(this.key=e,this.fastAesKey=new u.default(o,e)),this.fastAesKey.expandKey().then(function(a){new s.default(o,i).decrypt(t,a).catch(function(a){n.onWebCryptoError(a,t,e,i,r)}).then(function(t){r(t)})}).catch(function(a){n.onWebCryptoError(a,t,e,i,r)})}}},{key:"onWebCryptoError",value:function(t,e,i,r,n){this.config.enableSoftwareAES?(h.logger.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(e,i,r,n)):(h.logger.error("decrypting error : "+t.message),this.observer.trigger(Event.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_DECRYPT_ERROR,fatal:!0,reason:t.message}))}},{key:"destroy",value:function(){var t=this.decryptor;t&&(t.destroy(),this.decryptor=void 0)}}]),t}();i.default=p},{17:17,18:18,20:20,33:33,53:53}],20:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=function(){function t(e,i){r(this,t),this.subtle=e,this.key=i}return n(t,[{key:"expandKey",value:function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}]),t}();i.default=a},{}],21:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),o=t(22),s=r(o),l=t(53),u=t(27),d=r(u),c=function(){function t(e,i,r){n(this,t),this.observer=e,this.config=r,this.remuxer=i}return a(t,[{key:"resetInitSegment",value:function(t,e,i,r){this._audioTrack={container:"audio/adts",type:"audio",id:-1,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:e,duration:r,inputTimeScale:9e4}}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(t,e,i,r){var n,a,o,u,c,f,h,p,g,y,v=new d.default(t),m=90*v.timeStamp;for(n=this._audioTrack,f=v.length,g=t.length;f<g-1&&(255!==t[f]||240!=(246&t[f+1]));f++);for(n.samplerate||(a=s.default.getAudioConfig(this.observer,t,f,n.manifestCodec),n.config=a.config,n.samplerate=a.samplerate,n.channelCount=a.channelCount,n.codec=a.codec,l.logger.log("parsed codec:"+n.codec+",rate:"+a.samplerate+",nb channel:"+a.channelCount)),c=0,u=9216e4/n.samplerate;f+5<g&&(h=1&t[f+1]?7:9,o=(3&t[f+3])<<11|t[f+4]<<3|(224&t[f+5])>>>5,(o-=h)>0&&f+h+o<=g);)for(p=m+c*u,y={unit:t.subarray(f+h,f+h+o),pts:p,dts:p},n.samples.push(y),n.len+=o,f+=o+h,c++;f<g-1&&(255!==t[f]||240!=(246&t[f+1]));f++);this.remuxer.remux(n,{samples:[]},{samples:[{pts:m,dts:m,data:v.payload}],inputTimeScale:9e4},{samples:[]},e,i,r)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(t){var e,i,r=new d.default(t);if(r.hasTimeStamp)for(e=r.length,i=Math.min(t.length-1,e+100);e<i;e++)if(255===t[e]&&240==(246&t[e+1]))return!0;return!1}}]),t}();i.default=c},{22:22,27:27,53:53}],22:[function(t,e,i){"use strict";var r=t(53),n=t(33),a={getAudioConfig:function(t,e,i,a){var o,s,l,u,d,c=navigator.userAgent.toLowerCase(),f=a,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];return o=1+((192&e[i+2])>>>6),(s=(60&e[i+2])>>>2)>h.length-1?void t.trigger(Event.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+s}):(u=(1&e[i+2])<<2,u|=(192&e[i+3])>>>6,r.logger.log("manifest codec:"+a+",ADTS data:type:"+o+",sampleingIndex:"+s+"["+h[s]+"Hz],channelConfig:"+u),/firefox/i.test(c)?s>=6?(o=5,d=new Array(4),l=s-3):(o=2,d=new Array(2),l=s):-1!==c.indexOf("android")?(o=2,d=new Array(2),l=s):(o=5,d=new Array(4),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&s>=6?l=s-3:((a&&-1!==a.indexOf("mp4a.40.2")&&s>=6&&1===u||!a&&1===u)&&(o=2,d=new Array(2)),l=s)),d[0]=o<<3,d[0]|=(14&s)>>1,d[1]|=(1&s)<<7,d[1]|=u<<3,5===o&&(d[1]|=(14&l)>>1,d[2]=(1&l)<<7,d[2]|=8,d[3]=0),{config:d,samplerate:h[s],channelCount:u,codec:"mp4a.40."+o,manifestCodec:f})}};e.exports=a},{33:33,53:53}],23:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),o=t(35),s=r(o),l=t(33),u=t(19),d=r(u),c=t(21),f=r(c),h=t(29),p=r(h),g=t(32),y=r(g),v=t(28),m=r(v),b=t(45),_=r(b),E=t(46),T=r(E),k=function(){function t(e,i,r,a){n(this,t),this.observer=e,this.typeSupported=i,this.config=r,this.vendor=a}return a(t,[{key:"destroy",value:function(){var t=this.demuxer;t&&t.destroy()}},{key:"push",value:function(t,e,i,r,n,a,o,l,u,c,f,h){if(t.byteLength>0&&null!=e&&null!=e.key&&"AES-128"===e.method){var p=this.decrypter;null==p&&(p=this.decrypter=new d.default(this.observer,this.config));var g,y=this;try{g=performance.now()}catch(t){g=Date.now()}p.decrypt(t,e.key.buffer,e.iv.buffer,function(t){var d;try{d=performance.now()}catch(t){d=Date.now()}y.observer.trigger(s.default.FRAG_DECRYPTED,{stats:{tstart:g,tdecrypt:d}}),y.pushDecrypted(new Uint8Array(t),e,new Uint8Array(i),r,n,a,o,l,u,c,f,h)})}else this.pushDecrypted(new Uint8Array(t),e,new Uint8Array(i),r,n,a,o,l,u,c,f,h)}},{key:"pushDecrypted",value:function(t,e,i,r,n,a,o,u,d,c,h,g){var v=this.demuxer;if(!v||o&&!this.probe(t)){var b=this.observer,E=this.typeSupported,k=this.config,A=[{demux:y.default,remux:_.default},{demux:m.default,remux:_.default},{demux:f.default,remux:_.default},{demux:p.default,remux:T.default}];for(var S in A){var L=A[S],R=L.demux.probe;if(R(t)){var w=this.remuxer=new L.remux(b,k,E,this.vendor);v=new L.demux(b,w,k,E),this.probe=R;break}}if(!v)return void b.trigger(s.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=v}var C=this.remuxer;(o||u)&&(v.resetInitSegment(i,r,n,c),C.resetInitSegment()),o&&(v.resetTimeStamp(),C.resetTimeStamp(g)),"function"==typeof v.setDecryptData&&v.setDecryptData(e),v.append(t,a,d,h)}}]),t}();i.default=k},{19:19,21:21,28:28,29:29,32:32,33:33,35:35,45:45,46:46}],24:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(i,"__esModule",{value:!0});var n=t(23),a=r(n),o=t(35),s=r(o),l=t(53),u=t(1),d=r(u),c=function(t){var e=new d.default;e.trigger=function(t){for(var i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];e.emit.apply(e,[t,t].concat(r))},e.off=function(t){for(var i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];e.removeListener.apply(e,[t].concat(r))};var i=function(e,i){t.postMessage({event:e,data:i})};t.addEventListener("message",function(r){var n=r.data;switch(n.cmd){case"init":var o=JSON.parse(n.config);t.demuxer=new a.default(e,n.typeSupported,o,n.vendor);try{(0,l.enableLogs)(!0===o.debug)}catch(t){console.warn("demuxerWorker: unable to enable logs")}i("init",null);break;case"demux":t.demuxer.push(n.data,n.decryptdata,n.initSegment,n.audioCodec,n.videoCodec,n.timeOffset,n.discontinuity,n.trackSwitch,n.contiguous,n.duration,n.accurateTimeOffset,n.defaultInitPTS)}}),e.on(s.default.FRAG_DECRYPTED,i),e.on(s.default.FRAG_PARSING_INIT_SEGMENT,i),e.on(s.default.FRAG_PARSED,i),e.on(s.default.ERROR,i),e.on(s.default.FRAG_PARSING_METADATA,i),e.on(s.default.FRAG_PARSING_USERDATA,i),e.on(s.default.INIT_PTS_FOUND,i),e.on(s.default.FRAG_PARSING_DATA,function(e,i){var r=[],n={event:e,data:i};i.data1&&(n.data1=i.data1.buffer,r.push(i.data1.buffer),delete i.data1),i.data2&&(n.data2=i.data2.buffer,r.push(i.data2.buffer),delete i.data2),t.postMessage(n,r)})};i.default=c},{1:1,23:23,35:35,53:53}],25:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),o=t(35),s=r(o),l=t(23),u=r(l),d=t(24),c=r(d),f=t(53),h=t(33),p=t(1),g=r(p),y=function(){function e(i,r){n(this,e),this.hls=i,this.id=r;var a=this.observer=new g.default,o=i.config;a.trigger=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];a.emit.apply(a,[t,t].concat(i))},a.off=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];a.removeListener.apply(a,[t].concat(i))};var l=function(t,e){e=e||{},e.frag=this.frag,e.id=this.id,i.trigger(t,e)}.bind(this);a.on(s.default.FRAG_DECRYPTED,l),a.on(s.default.FRAG_PARSING_INIT_SEGMENT,l),a.on(s.default.FRAG_PARSING_DATA,l),a.on(s.default.FRAG_PARSED,l),a.on(s.default.ERROR,l),a.on(s.default.FRAG_PARSING_METADATA,l),a.on(s.default.FRAG_PARSING_USERDATA,l),a.on(s.default.INIT_PTS_FOUND,l);var d={mp4:MediaSource.isTypeSupported("video/mp4"),mpeg:MediaSource.isTypeSupported("audio/mpeg"),mp3:MediaSource.isTypeSupported('audio/mp4; codecs="mp3"')},p=navigator.vendor;if(o.enableWorker&&"undefined"!=typeof Worker){f.logger.log("demuxing in webworker");var y=void 0;try{var v=t(3);y=this.w=v(c.default),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(t){i.trigger(s.default.ERROR,{type:h.ErrorTypes.OTHER_ERROR,details:h.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:t.message+" ("+t.filename+":"+t.lineno+")"}})},y.postMessage({cmd:"init",typeSupported:d,vendor:p,id:r,config:JSON.stringify(o)})}catch(t){f.logger.error("error while initializing DemuxerWorker, fallback on DemuxerInline"),y&&URL.revokeObjectURL(y.objectURL),this.demuxer=new u.default(a,d,o,p),this.w=void 0}}else this.demuxer=new u.default(a,d,o,p)}return a(e,[{key:"destroy",value:function(){var t=this.w;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.w=null;else{var e=this.demuxer;e&&(e.destroy(),this.demuxer=null)}var i=this.observer;i&&(i.removeAllListeners(),this.observer=null)}},{key:"push",value:function(t,e,i,r,n,a,o,s){var l=this.w,u=isNaN(n.startDTS)?n.start:n.startDTS,d=n.decryptdata,c=this.frag,h=!(c&&n.cc===c.cc),p=!(c&&n.level===c.level),g=c&&n.sn===c.sn+1,y=!p&&g;if(h&&f.logger.log(this.id+":discontinuity detected"),p&&f.logger.log(this.id+":switch detected"),this.frag=n,l)l.postMessage({cmd:"demux",data:t,decryptdata:d,initSegment:e,audioCodec:i,videoCodec:r,timeOffset:u,discontinuity:h,trackSwitch:p,contiguous:y,duration:a,accurateTimeOffset:o,defaultInitPTS:s},[t]);else{var v=this.demuxer;v&&v.push(t,d,e,i,r,u,h,p,y,a,o,s)}}},{key:"onWorkerMessage",value:function(t){var e=t.data,i=this.hls;switch(e.event){case"init":URL.revokeObjectURL(this.w.objectURL);break;case s.default.FRAG_PARSING_DATA:e.data.data1=new Uint8Array(e.data1),e.data2&&(e.data.data2=new Uint8Array(e.data2));default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,i.trigger(e.event,e.data)}}}]),e}();i.default=y},{1:1,23:23,24:24,3:3,33:33,35:35,53:53}],26:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=t(53),o=function(){function t(e){r(this,t),this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}return n(t,[{key:"loadWord",value:function(){var t=this.data,e=this.bytesAvailable,i=t.byteLength-e,r=new Uint8Array(4),n=Math.min(4,e);if(0===n)throw new Error("no bytes available");r.set(t.subarray(i,i+n)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*n,this.bytesAvailable-=n}},{key:"skipBits",value:function(t){var e;this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,e=t>>3,t-=e>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)}},{key:"readBits",value:function(t){var e=Math.min(this.bitsAvailable,t),i=this.word>>>32-e;return t>32&&a.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),e=t-e,e>0&&this.bitsAvailable?i<<e|this.readBits(e):i}},{key:"skipLZ",value:function(){var t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var t=this.skipLZ();return this.readBits(t+1)-1}},{key:"readEG",value:function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}},{key:"skipScalingList",value:function(t){var e,i,r=8,n=8;for(e=0;e<t;e++)0!==n&&(i=this.readEG(),n=(r+i+256)%256),r=0===n?r:n}},{key:"readSPS",value:function(){var t,e,i,r,n,a,o,s=0,l=0,u=0,d=0,c=this.readUByte.bind(this),f=this.readBits.bind(this),h=this.readUEG.bind(this),p=this.readBoolean.bind(this),g=this.skipBits.bind(this),y=this.skipEG.bind(this),v=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);if(c(),t=c(),f(5),g(3),c(),v(),100===t||110===t||122===t||244===t||44===t||83===t||86===t||118===t||128===t){var b=h();if(3===b&&g(1),v(),v(),g(1),p())for(a=3!==b?8:12,o=0;o<a;o++)p()&&m(o<6?16:64)}v();var _=h();if(0===_)h();else if(1===_)for(g(1),y(),y(),e=h(),o=0;o<e;o++)y();v(),g(1),i=h(),r=h(),n=f(1),0===n&&g(1),g(1),p()&&(s=h(),l=h(),u=h(),d=h());var E=[1,1];if(p()&&p()){switch(c()){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:E=[c()<<8|c(),c()<<8|c()]}}return{width:Math.ceil(16*(i+1)-2*s-2*l),height:(2-n)*(r+1)*16-(n?2:4)*(u+d),pixelRatio:E}}},{key:"readSliceType",value:function(){return this.readUByte(),this.readUEG(),this.readUEG()}}]),t}();i.default=o},{53:53}],27:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=t(53),o=function(){function t(e){r(this,t),this._hasTimeStamp=!1,this._length=0;for(var i,n,o,s,l,u,d,c,f=0;;)if(d=this.readUTF(e,f,3),f+=3,"ID3"===d)f+=3,i=127&e[f++],n=127&e[f++],o=127&e[f++],s=127&e[f++],l=(i<<21)+(n<<14)+(o<<7)+s,u=f+l,this._parseID3Frames(e,f,u),f=u;else{if("3DI"!==d)return f-=3,void((c=f)&&(this.hasTimeStamp||a.logger.warn("ID3 tag found, but no timestamp"),this._length=c,this._payload=e.subarray(0,c)));f+=7,a.logger.log("3DI footer found, end: "+f)}}return n(t,[{key:"readUTF",value:function(t,e,i){var r="",n=e,a=e+i;do{r+=String.fromCharCode(t[n++])}while(n<a);return r}},{key:"_parseID3Frames",value:function(t,e,i){for(var r,n;e+8<=i;)switch(r=this.readUTF(t,e,4),e+=4,t[e++]<<24+t[e++]<<16+t[e++]<<8+t[e++],t[e++]<<8+t[e++],e,r){case"PRIV":if("com.apple.streaming.transportStreamTimestamp"===this.readUTF(t,e,44)){e+=44,e+=4;var o=1&t[e++];this._hasTimeStamp=!0,n=((t[e++]<<23)+(t[e++]<<15)+(t[e++]<<7)+t[e++])/45,o&&(n+=47721858.84),n=Math.round(n),a.logger.trace("ID3 timestamp found: "+n),this._timeStamp=n}}}},{key:"hasTimeStamp",get:function(){return this._hasTimeStamp}},{key:"timeStamp",get:function(){return this._timeStamp}},{key:"length",get:function(){return this._length}},{key:"payload",get:function(){return this._payload}}]),t}();i.default=o},{53:53}],28:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),o=t(27),s=r(o),l=t(30),u=r(l),d=function(){function t(e,i,r){n(this,t),this.observer=e,this.config=r,this.remuxer=i}return a(t,[{key:"resetInitSegment",value:function(t,e,i,r){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:e,duration:r,inputTimeScale:9e4}}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(t,e,i,r){var n,a,o=new s.default(t),l=90*o.timeStamp,d=o.length;for(n=d,a=t.length;n<a-1&&(255!==t[n]||224!=(224&t[n+1])||0==(6&t[n+1]));n++);u.default.parse(this._audioTrack,t,o.length,l),this.remuxer.remux(this._audioTrack,{samples:[]},{samples:[{pts:l,dts:l,data:o.payload}],inputTimeScale:9e4},{samples:[]},e,i,r)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(t){var e,i,r=new s.default(t);if(r.hasTimeStamp)for(e=r.length,i=Math.min(t.length-1,e+100);e<i;e++)if(255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1]))return!0;return!1}}]),t}();i.default=d},{27:27,30:30}],29:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=t(35),o=function(t){return t&&t.__esModule?t:{default:t}}(a),s=function(){function t(e,i){r(this,t),this.observer=e,this.remuxer=i}return n(t,[{key:"resetTimeStamp",value:function(){}},{key:"resetInitSegment",value:function(e,i,r,n){var a=this.initData=t.parseInitSegment(e),s={};a.audio&&(s.audio={container:"audio/mp4",codec:i,initSegment:e}),a.video&&(s.video={container:"video/mp4",codec:r,initSegment:e}),this.observer.trigger(o.default.FRAG_PARSING_INIT_SEGMENT,{tracks:s})}},{key:"append",value:function(e,i,r,n){var a=this.initData,o=t.startDTS(a,e);this.remuxer.remux(a.audio,a.video,null,null,o,r,n,e)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(e){if(e.length>=8){return["moof","ftyp","styp"].indexOf(t.bin2str(e.subarray(4,8)))>=0}return!1}},{key:"bin2str",value:function(t){return String.fromCharCode.apply(null,t)}},{key:"readUint32",value:function(t,e){var i=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return i<0?4294967296+i:i}},{key:"findBox",value:function(e,i){var r,n,a,o,s,l=[];if(!i.length)return null;for(r=0;r<e.byteLength;)n=t.readUint32(e,r),a=t.bin2str(e.subarray(r+4,r+8)),o=n>1?r+n:e.byteLength,a===i[0]&&(1===i.length?l.push(e.subarray(r+8,o)):(s=t.findBox(e.subarray(r+8,o),i.slice(1)),s.length&&(l=l.concat(s)))),r=o;return l}},{key:"parseInitSegment",value:function(e){var i=[];return t.findBox(e,["moov","trak"]).forEach(function(e){var r=t.findBox(e,["tkhd"])[0];if(r){var n=r[0],a=0===n?12:20,o=t.readUint32(r,a),s=t.findBox(e,["mdia","mdhd"])[0];if(s){n=s[0],a=0===n?12:20;var l=t.readUint32(s,a),u=t.findBox(e,["mdia","hdlr"])[0];if(u){var d=t.bin2str(u.subarray(8,12)),c={soun:"audio",vide:"video"}[d];c&&(i[o]={timescale:l,type:c},i[c]={timescale:l,id:o})}}}}),i}},{key:"startDTS",value:function(e,i){var r,n,a;return r=t.findBox(i,["moof","traf"]),n=[].concat.apply([],r.map(function(i){return t.findBox(i,["tfhd"]).map(function(r){var n,a,o;return n=t.readUint32(r,4),a=e[n].timescale||9e4,o=t.findBox(i,["tfdt"]).map(function(e){var i,r;return i=e[0],r=t.readUint32(e,4),1===i&&(r*=Math.pow(2,32),r+=t.readUint32(e,8)),r})[0],(o=o||1/0)/a})})),a=Math.min.apply(null,n),isFinite(a)?a:0}}]),t}();i.default=s},{35:35}],30:[function(t,e,i){"use strict";var r=t(53),n={onFrame:function(t,e,i,r,n,a,o){var s=10368e4/r,l=o+a*s;t.config=[],t.channelCount=n,t.samplerate=r,t.samples.push({unit:e,pts:l,dts:l}),t.len+=e.length},onNoise:function(t){r.logger.warn("mpeg audio has noise: "+t.length+" bytes")},parseFrames:function(t,e,i,r,n,a){var o=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],s=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3];if(i+2>r)return-1;if(255===e[i]||224==(224&e[i+1])){if(i+24>r)return-1;var l=e[i+1]>>3&3,u=e[i+1]>>1&3,d=e[i+2]>>4&15,c=e[i+2]>>2&3,f=!!(2&e[i+2]);if(1!==l&&0!==d&&15!==d&&3!==c){var h=3===l?3-u:3===u?3:4,p=1e3*o[14*h+d-1],g=3===l?0:2===l?1:2,y=s[3*g+c],v=f?1:0,m=e[i+3]>>6==3?1:2,b=3===u?(3===l?12:6)*p/y+v<<2:(3===l?144:72)*p/y+v|0;return i+b>r?-1:(this.onFrame(t,e.subarray(i,i+b),p,y,m,n,a),b)}}for(var _=i+2;_<r;){if(255===e[_-1]&&224==(224&e[_]))return this.onNoise(e.subarray(i,_-1)),_-i-1;_++}return-1},parse:function(t,e,i,r){for(var n,a=e.length,o=0;i<a&&(n=this.parseFrames(t,e,i,a,o++,r))>0;)i+=n}};e.exports=n},{53:53}],31:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=t(19),o=function(t){return t&&t.__esModule?t:{default:t}}(a),s=function(){function t(e,i,n,a){r(this,t),this.decryptdata=n,this.discardEPB=a,this.decrypter=new o.default(e,i)}return n(t,[{key:"decryptBuffer",value:function(t,e){this.decrypter.decrypt(t,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,e)}},{key:"decryptAacSample",value:function(t,e,i,r){var n=t[e].unit,a=n.subarray(16,n.length-n.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),s=this;this.decryptBuffer(o,function(a){a=new Uint8Array(a),n.set(a,16),r||s.decryptAacSamples(t,e+1,i)})}},{key:"decryptAacSamples",value:function(t,e,i){for(;;e++){if(e>=t.length)return void i();if(!(t[e].unit.length<32)){var r=this.decrypter.isSync();if(this.decryptAacSample(t,e,i,r),!r)return}}}},{key:"getAvcEncryptedData",value:function(t){for(var e=16*Math.floor((t.length-48)/160)+16,i=new Int8Array(e),r=0,n=32;n<=t.length-16;n+=160,r+=16)i.set(t.subarray(n,n+16),r);return i}},{key:"getAvcDecryptedUnit",value:function(t,e){e=new Uint8Array(e);for(var i=0,r=32;r<=t.length-16;r+=160,i+=16)t.set(e.subarray(i,i+16),r);return t}},{key:"decryptAvcSample",value:function(t,e,i,r,n,a){var o=this.discardEPB(n.data),s=this.getAvcEncryptedData(o),l=this;this.decryptBuffer(s.buffer,function(s){n.data=l.getAvcDecryptedUnit(o,s),a||l.decryptAvcSamples(t,e,i+1,r)})}},{key:"decryptAvcSamples",value:function(t,e,i,r){for(;;e++,i=0){if(e>=t.length)return void r();for(var n=t[e].units;!(i>=n.length);i++){var a=n[i];if(!(a.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(t,e,i,r,a,o),!o)return}}}}}]),t}();i.default=s},{19:19}],32:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),o=t(22),s=r(o),l=t(30),u=r(l),d=t(35),c=r(d),f=t(26),h=r(f),p=t(31),g=r(p),y=t(53),v=t(33),m=function(){function t(e,i,r,a){n(this,t),this.observer=e,this.config=r,this.typeSupported=a,this.remuxer=i,this.sampleAes=null}return a(t,[{key:"setDecryptData",value:function(t){null!=t&&null!=t.key&&"SAMPLE-AES"===t.method?this.sampleAes=new g.default(this.observer,this.config,t,this.discardEPB):this.sampleAes=null}},{key:"resetInitSegment",value:function(t,e,i,r){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack={container:"video/mp2t",type:"video",id:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:0},this._audioTrack={container:"video/mp2t",type:"audio",id:-1,inputTimeScale:9e4,duration:r,sequenceNumber:0,samples:[],len:0,isAAC:!0},this._id3Track={type:"id3",id:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0},this._txtTrack={type:"text",id:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0},this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=e,this.videoCodec=i,this._duration=r}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(t,e,i,r){var n,a,o,s,l,u=t.length,d=!1;this.contiguous=i;var f=this.pmtParsed,h=this._avcTrack,p=this._audioTrack,g=this._id3Track,m=h.id,b=p.id,_=g.id,E=this._pmtId,T=h.pesData,k=p.pesData,A=g.pesData,S=this._parsePAT,L=this._parsePMT,R=this._parsePES,w=this._parseAVCPES.bind(this),C=this._parseAACPES.bind(this),O=this._parseMPEGPES.bind(this),D=this._parseID3PES.bind(this);for(u-=u%188,n=0;n<u;n+=188)if(71===t[n]){if(a=!!(64&t[n+1]),o=((31&t[n+1])<<8)+t[n+2],(48&t[n+3])>>4>1){if((s=n+5+t[n+4])===n+188)continue}else s=n+4;switch(o){case m:a&&(T&&(l=R(T))&&w(l,!1),T={data:[],size:0}),T&&(T.data.push(t.subarray(s,n+188)),T.size+=n+188-s);break;case b:a&&(k&&(l=R(k))&&(p.isAAC?C(l):O(l)),k={data:[],size:0}),k&&(k.data.push(t.subarray(s,n+188)),k.size+=n+188-s);break;case _:a&&(A&&(l=R(A))&&D(l),A={data:[],size:0}),A&&(A.data.push(t.subarray(s,n+188)),A.size+=n+188-s);break;case 0:a&&(s+=t[s]+1),E=this._pmtId=S(t,s);break;case E:a&&(s+=t[s]+1);var P=L(t,s,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);m=P.avc,m>0&&(h.id=m),b=P.audio,b>0&&(p.id=b,p.isAAC=P.isAAC),_=P.id3,_>0&&(g.id=_),d&&!f&&(y.logger.log("reparse from beginning"),d=!1,n=-188),f=this.pmtParsed=!0;break;case 17:case 8191:break;default:d=!0}}else this.observer.trigger(c.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T&&(l=R(T))?(w(l,!0),h.pesData=null):h.pesData=T,k&&(l=R(k))?(p.isAAC?C(l):O(l),p.pesData=null):(k&&k.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=k),A&&(l=R(A))?(D(l),g.pesData=null):g.pesData=A,null==this.sampleAes?this.remuxer.remux(p,h,g,this._txtTrack,e,i,r):this.decryptAndRemux(p,h,g,this._txtTrack,e,i,r)}},{key:"decryptAndRemux",value:function(t,e,i,r,n,a,o){if(t.samples&&t.isAAC){var s=this;this.sampleAes.decryptAacSamples(t.samples,0,function(){s.decryptAndRemuxAvc(t,e,i,r,n,a,o)})}else this.decryptAndRemuxAvc(t,e,i,r,n,a,o)}},{key:"decryptAndRemuxAvc",value:function(t,e,i,r,n,a,o){if(e.samples){var s=this;this.sampleAes.decryptAvcSamples(e.samples,0,0,function(){s.remuxer.remux(t,e,i,r,n,a,o)})}else this.remuxer.remux(t,e,i,r,n,a,o)}},{key:"destroy",value:function(){this._initPTS=this._initDTS=void 0,this._duration=0}},{key:"_parsePAT",value:function(t,e){return(31&t[e+10])<<8|t[e+11]}},{key:"_parsePMT",value:function(t,e,i,r){var n,a,o,s,l={audio:-1,avc:-1,id3:-1,isAAC:!0};for(n=(15&t[e+1])<<8|t[e+2],a=e+3+n-4,o=(15&t[e+10])<<8|t[e+11],e+=12+o;e<a;){switch(s=(31&t[e+1])<<8|t[e+2],t[e]){case 207:if(!r){y.logger.log("unkown stream type:"+t[e]);break}case 15:-1===l.audio&&(l.audio=s);break;case 21:-1===l.id3&&(l.id3=s);break;case 219:if(!r){y.logger.log("unkown stream type:"+t[e]);break}case 27:-1===l.avc&&(l.avc=s);break;case 3:case 4:i?-1===l.audio&&(l.audio=s,l.isAAC=!1):y.logger.log("MPEG audio found, not supported in this browser for now");break;case 36:y.logger.warn("HEVC stream type found, not supported for now");break;default:y.logger.log("unkown stream type:"+t[e])}e+=5+((15&t[e+3])<<8|t[e+4])}return l}},{key:"_parsePES",value:function(t){var e,i,r,n,a,o,s,l,u=0,d=t.data;if(!t||0===t.size)return null;for(;d[0].length<19&&d.length>1;){var c=new Uint8Array(d[0].length+d[1].length);c.set(d[0]),c.set(d[1],d[0].length),d[0]=c,d.splice(1,1)}if(e=d[0],1===(e[0]<<16)+(e[1]<<8)+e[2]){if((r=(e[4]<<8)+e[5])&&r>t.size-6)return null;i=e[7],192&i&&(o=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,o>4294967295&&(o-=8589934592),64&i?(s=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2,s>4294967295&&(s-=8589934592),o-s>54e5&&(y.logger.warn(Math.round((o-s)/9e4)+"s delta between PTS and DTS, align them"),o=s)):s=o),n=e[8],l=n+9,t.size-=l,a=new Uint8Array(t.size);for(var f=0,h=d.length;f<h;f++){e=d[f];var p=e.byteLength;if(l){if(l>p){l-=p;continue}e=e.subarray(l),p-=l,l=0}a.set(e,u),u+=p}return r&&(r-=n+3),{data:a,pts:o,dts:s,len:r}}return null}},{key:"pushAccesUnit",value:function(t,e){if(t.units.length&&t.frame){var i=e.samples,r=i.length;!this.config.forceKeyFrameOnDiscontinuity||!0===t.key||e.sps&&(r||this.contiguous)?(t.id=r,i.push(t)):e.dropped++}t.debug.length&&y.logger.log(t.pts+"/"+t.dts+":"+t.debug)}},{key:"_parseAVCPES",value:function(t,e){var i,r,n,a=this,o=this._avcTrack,s=this._parseAVCNALu(t.data),l=this.avcSample;t.data=null,s.forEach(function(e){switch(e.type){case 1:r=!0,l.frame=!0;var s=e.data;if(s.length>4){var u=new h.default(s).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(l.key=!0)}break;case 5:r=!0,l||(l=a.avcSample=a._createAVCSample(!0,t.pts,t.dts,"")),l.key=!0,l.frame=!0;break;case 6:r=!0,i=new h.default(a.discardEPB(e.data)),i.readUByte();for(var d=0,c=0,f=!1,p=0;!f&&i.bytesAvailable>1;){d=0;do{p=i.readUByte(),d+=p}while(255===p);c=0;do{p=i.readUByte(),c+=p}while(255===p);if(4===d&&0!==i.bytesAvailable){f=!0;if(181===i.readUByte()){if(49===i.readUShort()){if(1195456820===i.readUInt()){if(3===i.readUByte()){var g=i.readUByte(),y=i.readUByte(),v=31&g,m=[g,y];for(n=0;n<v;n++)m.push(i.readUByte()),m.push(i.readUByte()),m.push(i.readUByte());a._insertSampleInOrder(a._txtTrack.samples,{type:3,pts:t.pts,bytes:m})}}}}}else if(c<i.bytesAvailable)for(n=0;n<c;n++)i.readUByte()}break;case 7:if(r=!0,!o.sps){i=new h.default(e.data);var b=i.readSPS();o.width=b.width,o.height=b.height,o.pixelRatio=b.pixelRatio,o.sps=[e.data],o.duration=a._duration;var _=e.data.subarray(1,4),E="avc1.";for(n=0;n<3;n++){var T=_[n].toString(16);T.length<2&&(T="0"+T),E+=T}o.codec=E}break;case 8:r=!0,o.pps||(o.pps=[e.data]);break;case 9:r=!1,l&&a.pushAccesUnit(l,o),l=a.avcSample=a._createAVCSample(!1,t.pts,t.dts,"");break;case 12:r=!1;break;default:r=!1,l&&(l.debug+="unknown NAL "+e.type+" ")}if(l&&r){l.units.push(e)}}),e&&l&&(this.pushAccesUnit(l,o),this.avcSample=null)}},{key:"_createAVCSample",value:function(t,e,i,r){return{key:t,pts:e,dts:i,units:[],debug:r}}},{key:"_insertSampleInOrder",value:function(t,e){var i=t.length;if(i>0){if(e.pts>=t[i-1].pts)t.push(e);else for(var r=i-1;r>=0;r--)if(e.pts<t[r].pts){t.splice(r,0,e);break}}else t.push(e)}},{key:"_getLastNalUnit",value:function(){var t=this.avcSample,e=void 0;if(!t||0===t.units.length){var i=this._avcTrack,r=i.samples;t=r[r.length-1]}if(t){var n=t.units;e=n[n.length-1]}return e}},{key:"_parseAVCNALu",value:function(t){var e,i,r,n,a,o=0,s=t.byteLength,l=this._avcTrack,u=l.naluState||0,d=u,c=[],f=-1;for(-1===u&&(f=0,a=31&t[0],u=0,o=1);o<s;)if(e=t[o++],u)if(1!==u)if(e)if(1===e){if(f>=0)r={data:t.subarray(f,o-u-1),type:a},c.push(r);else{var h=this._getLastNalUnit();if(h&&(d&&o<=4-d&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-d)),(i=o-u-1)>0)){var p=new Uint8Array(h.data.byteLength+i);p.set(h.data,0),p.set(t.subarray(0,i),h.data.byteLength),h.data=p}}o<s?(n=31&t[o],f=o,a=n,u=0):u=-1}else u=0;else u=3;else u=e?0:2;else u=e?0:1;if(f>=0&&u>=0&&(r={data:t.subarray(f,s),type:a,state:u},c.push(r)),0===c.length){var g=this._getLastNalUnit();if(g){var y=new Uint8Array(g.data.byteLength+t.byteLength);y.set(g.data,0),y.set(t,g.data.byteLength),g.data=y}}return l.naluState=u,c}},{key:"discardEPB",value:function(t){for(var e,i,r=t.byteLength,n=[],a=1;a<r-2;)0===t[a]&&0===t[a+1]&&3===t[a+2]?(n.push(a+2),a+=2):a++;if(0===n.length)return t;e=r-n.length,i=new Uint8Array(e);var o=0;for(a=0;a<e;o++,a++)o===n[0]&&(o++,n.shift()),i[a]=t[o];return i}},{key:"_parseAACPES",value:function(t){var e,i,r,n,a,o,l,u,d,f=this._audioTrack,h=t.data,p=t.pts,g=this.aacOverFlow,m=this.aacLastPTS;if(g){var b=new Uint8Array(g.byteLength+h.byteLength);b.set(g,0),b.set(h,g.byteLength),h=b}for(a=0,u=h.length;a<u-1&&(255!==h[a]||240!=(240&h[a+1]));a++);if(a){var _,E;if(a<u-1?(_="AAC PES did not start with ADTS header,offset:"+a,E=!1):(_="no ADTS header found in AAC PES",E=!0),y.logger.warn("parsing error:"+_),this.observer.trigger(c.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:E,reason:_}),E)return}if(!f.samplerate){var T=this.audioCodec;e=s.default.getAudioConfig(this.observer,h,a,T),f.config=e.config,f.samplerate=e.samplerate,f.channelCount=e.channelCount,f.codec=e.codec,f.manifestCodec=e.manifestCodec,y.logger.log("parsed codec:"+f.codec+",rate:"+e.samplerate+",nb channel:"+e.channelCount)}if(n=0,r=9216e4/f.samplerate,g&&m){var k=m+r;Math.abs(k-p)>1&&(y.logger.log("AAC: align PTS for overlapping frames by "+Math.round((k-p)/90)),p=k)}for(;a+5<u&&(o=1&h[a+1]?7:9,i=(3&h[a+3])<<11|h[a+4]<<3|(224&h[a+5])>>>5,(i-=o)>0&&a+o+i<=u);)for(l=p+n*r,d={unit:h.subarray(a+o,a+o+i),pts:l,dts:l},f.samples.push(d),f.len+=i,a+=i+o,n++;a<u-1&&(255!==h[a]||240!=(240&h[a+1]));a++);g=a<u?h.subarray(a,u):null,this.aacOverFlow=g,this.aacLastPTS=l}},{key:"_parseMPEGPES",value:function(t){u.default.parse(this._audioTrack,t.data,0,t.pts)}},{key:"_parseID3PES",value:function(t){this._id3Track.samples.push(t)}}],[{key:"probe",value:function(t){return t.length>=564&&71===t[0]&&71===t[188]&&71===t[376]}}]),t}();i.default=m},{22:22,26:26,30:30,31:31,33:33,35:35,53:53}],33:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},i.ErrorDetails={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_LOOP_LOADING_ERROR:"fragLoopLoadingError",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",WEBVTT_EXCEPTION:"webVTTException"}},{}],34:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),o=t(53),s=t(33),l=t(35),u=function(t){return t&&t.__esModule?t:{default:t}}(l),d=function(){function t(e){r(this,t),this.hls=e,this.onEvent=this.onEvent.bind(this);for(var i=arguments.length,n=Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];this.handledEvents=n,this.useGenericHandler=!0,this.registerListeners()}return a(t,[{key:"destroy",value:function(){this.unregisterListeners()}},{key:"isEventHandler",value:function(){return"object"===n(this.handledEvents)&&this.handledEvents.length&&"function"==typeof this.onEvent}},{key:"registerListeners",value:function(){this.isEventHandler()&&this.handledEvents.forEach(function(t){if("hlsEventGeneric"===t)throw new Error("Forbidden event name: "+t);this.hls.on(t,this.onEvent)}.bind(this))}},{key:"unregisterListeners",value:function(){this.isEventHandler()&&this.handledEvents.forEach(function(t){this.hls.off(t,this.onEvent)}.bind(this))}},{key:"onEvent",value:function(t,e){this.onEventGeneric(t,e)}},{key:"onEventGeneric",value:function(t,e){var i=function(t,e){var i="on"+t.replace("hls","");if("function"!=typeof this[i])throw new Error("Event "+t+" has no generic handler in this "+this.constructor.name+" class (tried "+i+")");return this[i].bind(this,e)};try{i.call(this,t,e).call()}catch(e){o.logger.error("internal error happened while processing "+t+":"+e.message),this.hls.trigger(u.default.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:t,err:e})}}}]),t}();i.default=d},{33:33,35:35,53:53}],35:[function(t,e,i){"use strict";e.exports={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_SWITCH:"hlsLevelSwitch",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_SWITCH:"hlsAudioTrackSwitch",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"}},{}],36:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=function(){function t(){r(this,t)}return n(t,null,[{key:"getSilentFrame",value:function(t,e){switch(t){case"mp4a.40.2":if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}}]),t}();i.default=a},{}],37:[function(t,e,i){"use strict";var r={isBuffered:function(t,e){if(t)for(var i=t.buffered,r=0;r<i.length;r++)if(e>=i.start(r)&&e<=i.end(r))return!0;return!1},bufferInfo:function(t,e,i){if(t){var r,n=t.buffered,a=[];for(r=0;r<n.length;r++)a.push({start:n.start(r),end:n.end(r)});return this.bufferedInfo(a,e,i)}return{len:0,start:e,end:e,nextStart:void 0}},bufferedInfo:function(t,e,i){var r,n,a,o,s,l=[];for(t.sort(function(t,e){var i=t.start-e.start;return i||e.end-t.end}),s=0;s<t.length;s++){var u=l.length;if(u){var d=l[u-1].end;t[s].start-d<i?t[s].end>d&&(l[u-1].end=t[s].end):l.push(t[s])}else l.push(t[s])}for(s=0,r=0,n=a=e;s<l.length;s++){var c=l[s].start,f=l[s].end;if(e+i>=c&&e<f)n=c,a=f,r=a-e;else if(e+i<c){o=c;break}}return{len:r,start:n,end:a,nextStart:o}}};e.exports=r},{}],38:[function(t,e,i){"use strict";var r=t(53),n={mergeDetails:function(t,e){var i,a=Math.max(t.startSN,e.startSN)-e.startSN,o=Math.min(t.endSN,e.endSN)-e.startSN,s=e.startSN-t.startSN,l=t.fragments,u=e.fragments,d=0;if(o<a)return void(e.PTSKnown=!1);for(var c=a;c<=o;c++){var f=l[s+c],h=u[c];h&&f&&(d=f.cc-h.cc,isNaN(f.startPTS)||(h.start=h.startPTS=f.startPTS,h.endPTS=f.endPTS,h.duration=f.duration,h.backtracked=f.backtracked,h.dropped=f.dropped,i=h))}if(d)for(r.logger.log("discontinuity sliding from playlist, take drift into account"),c=0;c<u.length;c++)u[c].cc+=d;if(i)n.updateFragPTSDTS(e,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS);else if(s>=0&&s<l.length){var p=l[s].start;for(c=0;c<u.length;c++)u[c].start+=p}e.PTSKnown=t.PTSKnown},updateFragPTSDTS:function(t,e,i,r,a,o){if(!isNaN(e.startPTS)){var s=Math.abs(e.startPTS-i);isNaN(e.deltaPTS)?e.deltaPTS=s:e.deltaPTS=Math.max(s,e.deltaPTS),i=Math.min(i,e.startPTS),r=Math.max(r,e.endPTS),a=Math.min(a,e.startDTS),o=Math.max(o,e.endDTS)}var l=i-e.start;e.start=e.startPTS=i,e.endPTS=r,e.startDTS=a,e.endDTS=o,e.duration=r-i;var u=e.sn;if(!t||u<t.startSN||u>t.endSN)return 0;var d,c,f;for(d=u-t.startSN,c=t.fragments,e=c[d],f=d;f>0;f--)n.updatePTS(c,f,f-1);for(f=d;f<c.length-1;f++)n.updatePTS(c,f,f+1);return t.PTSKnown=!0,l},updatePTS:function(t,e,i){var n=t[e],a=t[i],o=a.startPTS;isNaN(o)?a.start=i>e?n.start+n.duration:Math.max(n.start-a.duration,0):i>e?(n.duration=o-n.start,n.duration<0&&r.logger.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-o,a.duration<0&&r.logger.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!"))}};e.exports=n},{53:53}],39:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),o=t(2),s=r(o),l=t(35),u=r(l),d=t(33),c=t(43),f=r(c),h=t(41),p=r(h),g=t(42),y=r(g),v=t(13),m=r(v),b=t(12),_=r(b),E=t(11),T=r(E),k=t(53),A=t(1),S=r(A),L=t(4),R=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,t);var r=t.DefaultConfig;if((i.liveSyncDurationCount||i.liveMaxLatencyDurationCount)&&(i.liveSyncDuration||i.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var a in r)a in i||(i[a]=r[a]);if(void 0!==i.liveMaxLatencyDurationCount&&i.liveMaxLatencyDurationCount<=i.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==i.liveMaxLatencyDuration&&(i.liveMaxLatencyDuration<=i.liveSyncDuration||void 0===i.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');(0,k.enableLogs)(i.debug),this.config=i,this._autoLevelCapping=-1;var o=this.observer=new S.default;o.trigger=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];o.emit.apply(o,[t,t].concat(i))},o.off=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];o.removeListener.apply(o,[t].concat(i))},this.on=o.on.bind(o),this.off=o.off.bind(o),this.trigger=o.trigger.bind(o);var s=this.abrController=new i.abrController(this),l=new i.bufferController(this),u=new i.capLevelController(this),d=new i.fpsController(this),c=new f.default(this),h=new p.default(this),g=new y.default(this),v=new T.default(this),b=this.levelController=new _.default(this),E=this.streamController=new m.default(this),A=[b,E],L=i.audioStreamController;L&&A.push(new L(this)),this.networkControllers=A;var R=[c,h,g,s,l,u,d,v];if(L=i.audioTrackController){var w=new L(this);this.audioTrackController=w,R.push(w)}if(L=i.subtitleTrackController){var C=new L(this);this.subtitleTrackController=C,R.push(C)}[i.subtitleStreamController,i.timelineController].forEach(function(t){t&&R.push(new t(e))}),this.coreComponents=R}return a(t,null,[{key:"isSupported",value:function(){var t=window.MediaSource=window.MediaSource||window.WebKitMediaSource,e=window.SourceBuffer=window.SourceBuffer||window.WebKitSourceBuffer,i=t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove;return i&&r}},{key:"version",get:function(){return"0.7.9"}},{key:"Events",get:function(){return u.default}},{key:"ErrorTypes",get:function(){return d.ErrorTypes}},{key:"ErrorDetails",get:function(){return d.ErrorDetails}},{key:"DefaultConfig",get:function(){return t.defaultConfig?t.defaultConfig:L.hlsDefaultConfig},set:function(e){t.defaultConfig=e}}]),a(t,[{key:"destroy",value:function(){k.logger.log("destroy"),this.trigger(u.default.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach(function(t){t.destroy()}),this.url=null,this.observer.removeAllListeners(),this._autoLevelCapping=-1}},{key:"attachMedia",value:function(t){k.logger.log("attachMedia"),this.media=t,this.trigger(u.default.MEDIA_ATTACHING,{media:t})}},{key:"detachMedia",value:function(){k.logger.log("detachMedia"),this.trigger(u.default.MEDIA_DETACHING),this.media=null}},{key:"loadSource",value:function(t){t=s.default.buildAbsoluteURL(window.location.href,t,{alwaysNormalize:!0}),k.logger.log("loadSource:"+t),this.url=t,this.trigger(u.default.MANIFEST_LOADING,{url:t})}},{key:"startLoad",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;k.logger.log("startLoad("+t+")"),this.networkControllers.forEach(function(e){e.startLoad(t)})}},{key:"stopLoad",value:function(){k.logger.log("stopLoad"),this.networkControllers.forEach(function(t){t.stopLoad()})}},{key:"swapAudioCodec",value:function(){k.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){k.logger.log("recoverMediaError");var t=this.media;this.detachMedia(),this.attachMedia(t)}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(t){k.logger.log("set currentLevel:"+t),this.loadLevel=t,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(t){k.logger.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){k.logger.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){k.logger.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){k.logger.log("set startLevel:"+t);var e=this;-1!==t&&(t=Math.max(t,e.minAutoLevel)),e.levelController.startLevel=t}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(t){k.logger.log("set autoLevelCapping:"+t),this._autoLevelCapping=t}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var t=this,e=t.levels,i=t.config.minAutoBitrate,r=e?e.length:0,n=0;n<r;n++){if((e[n].realBitrate?Math.max(e[n].realBitrate,e[n].bitrate):e[n].bitrate)>i)return n}return 0}},{key:"maxAutoLevel",get:function(){var t=this,e=t.levels,i=t.autoLevelCapping;return-1===i&&e&&e.length?e.length-1:i}},{key:"nextAutoLevel",get:function(){var t=this;return Math.min(Math.max(t.abrController.nextAutoLevel,t.minAutoLevel),t.maxAutoLevel)},set:function(t){var e=this;e.abrController.nextAutoLevel=Math.max(e.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}}]),t}();i.default=R},{1:1,11:11,12:12,13:13,2:2,33:33,35:35,4:4,41:41,42:42,43:43,53:53}],40:[function(t,e,i){"use strict";e.exports=t(39).default},{39:39}],41:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(35),u=r(l),d=t(34),c=r(d),f=t(33),h=t(53),p=function(t){function e(t){n(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.default.FRAG_LOADING));return i.loaders={},i}return o(e,t),s(e,[{key:"destroy",value:function(){var t=this.loaders;for(var e in t){var i=t[e];i&&i.destroy()}this.loaders={},c.default.prototype.destroy.call(this)}},{key:"onFragLoading",value:function(t){var e=t.frag,i=e.type,r=this.loaders[i],n=this.hls.config;e.loaded=0,r&&(h.logger.warn("abort previous fragment loader for type:"+i),r.abort()),r=this.loaders[i]=e.loader=void 0!==n.fLoader?new n.fLoader(n):new n.loader(n);var a=void 0,o=void 0,s=void 0;a={url:e.url,frag:e,responseType:"arraybuffer",progressData:!1};var l=e.byteRangeStartOffset,u=e.byteRangeEndOffset;isNaN(l)||isNaN(u)||(a.rangeStart=l,a.rangeEnd=u),o={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout},s={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},r.load(a,o,s)}},{key:"loadsuccess",value:function(t,e,i){var r=t.data,n=i.frag;n.loader=void 0,this.loaders[n.type]=void 0,this.hls.trigger(u.default.FRAG_LOADED,{payload:r,frag:n,stats:e})}},{key:"loaderror",value:function(t,e){var i=e.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(u.default.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e.frag,response:t})}},{key:"loadtimeout",value:function(t,e){var i=e.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(u.default.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e.frag})}},{key:"loadprogress",value:function(t,e,i){var r=e.frag;r.loaded=t.loaded,this.hls.trigger(u.default.FRAG_LOAD_PROGRESS,{frag:r,stats:t})}}]),e}(c.default);i.default=p},{33:33,34:34,35:35,53:53}],42:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(35),u=r(l),d=t(34),c=r(d),f=t(33),h=t(53),p=function(t){function e(t){n(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.default.KEY_LOADING));return i.loaders={},i.decryptkey=null,i.decrypturl=null,i}return o(e,t),s(e,[{key:"destroy",value:function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={},c.default.prototype.destroy.call(this)}},{key:"onKeyLoading",value:function(t){var e=t.frag,i=e.type,r=this.loaders[i],n=e.decryptdata,a=n.uri;if(a!==this.decrypturl||null===this.decryptkey){var o=this.hls.config;r&&(h.logger.warn("abort previous key loader for type:"+i),r.abort()),e.loader=this.loaders[i]=new o.loader(o),this.decrypturl=a,this.decryptkey=null;var s=void 0,l=void 0,d=void 0;s={url:a,frag:e,responseType:"arraybuffer"},l={timeout:o.fragLoadingTimeOut,maxRetry:o.fragLoadingMaxRetry,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},e.loader.load(s,l,d)}else this.decryptkey&&(n.key=this.decryptkey,this.hls.trigger(u.default.KEY_LOADED,{frag:e}))}},{key:"loadsuccess",value:function(t,e,i){var r=i.frag;this.decryptkey=r.decryptdata.key=new Uint8Array(t.data),r.loader=void 0,this.loaders[r.type]=void 0,this.hls.trigger(u.default.KEY_LOADED,{frag:r})}},{key:"loaderror",value:function(t,e){var i=e.frag,r=i.loader;r&&r.abort(),this.loaders[e.type]=void 0,this.hls.trigger(u.default.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:i,response:t})}},{key:"loadtimeout",value:function(t,e){var i=e.frag,r=i.loader;r&&r.abort(),this.loaders[e.type]=void 0,this.hls.trigger(u.default.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:i})}}]),e}(c.default);i.default=p},{33:33,34:34,35:35,53:53}],43:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),l=t(2),u=r(l),d=t(35),c=r(d),f=t(34),h=r(f),p=t(33),g=t(47),y=r(g),v=t(53),m=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,b=/#EXT-X-MEDIA:(.*)/g,_=/#EXTINF:(\d*(?:\.\d+)?)(?:,(.*))?|(?!#)(\S.+)|#EXT-X-BYTERANGE: *(.+)|#EXT-X-PROGRAM-DATE-TIME:(.+)|#.*/g,E=/(?:(?:#(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?/,T=function(){function t(){o(this,t),this.method=null,this.key=null,this.iv=null,this._uri=null}return s(t,[{key:"uri",get:function(){return!this._uri&&this.reluri&&(this._uri=u.default.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri}}]),t}(),k=function(){function t(){o(this,t),this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[]}return s(t,[{key:"createInitializationVector",value:function(t){for(var e=new Uint8Array(16),i=12;i<16;i++)e[i]=t>>8*(15-i)&255;return e}},{key:"fragmentDecryptdataFromLevelkey",value:function(t,e){var i=t;return t&&t.method&&t.uri&&!t.iv&&(i=new T,i.method=t.method,i.baseuri=t.baseuri,i.reluri=t.reluri,i.iv=this.createInitializationVector(e)),i}},{key:"cloneObj",value:function(t){return JSON.parse(JSON.stringify(t))}},{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=u.default.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(t){this._url=t}},{key:"programDateTime",get:function(){return!this._programDateTime&&this.rawProgramDateTime&&(this._programDateTime=new Date(Date.parse(this.rawProgramDateTime))),this._programDateTime}},{key:"byteRange",get:function(){if(!this._byteRange){var t=this._byteRange=[];if(this.rawByteRange){var e=this.rawByteRange.split("@",2);if(1===e.length){var i=this.lastByteRangeEndOffset;t[0]=i||0}else t[0]=parseInt(e[1]);t[1]=parseInt(e[0])+t[0]}}return this._byteRange}},{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}}]),t}(),A=function(t){function e(t){o(this,e);var i=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,c.default.MANIFEST_LOADING,c.default.LEVEL_LOADING,c.default.AUDIO_TRACK_LOADING,c.default.SUBTITLE_TRACK_LOADING));return i.loaders={},i}return a(e,t),s(e,[{key:"destroy",value:function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={},h.default.prototype.destroy.call(this)}},{key:"onManifestLoading",value:function(t){this.load(t.url,{type:"manifest"})}},{key:"onLevelLoading",value:function(t){this.load(t.url,{type:"level",level:t.level,id:t.id})}},{key:"onAudioTrackLoading",value:function(t){this.load(t.url,{type:"audioTrack",id:t.id})}},{key:"onSubtitleTrackLoading",value:function(t){this.load(t.url,{type:"subtitleTrack",id:t.id})}},{key:"load",value:function(t,e){var i=this.loaders[e.type];if(i){var r=i.context;if(r&&r.url===t)return void v.logger.trace("playlist request ongoing");v.logger.warn("abort previous loader for type:"+e.type),i.abort()}var n=this.hls.config,a=void 0,o=void 0,s=void 0,l=void 0;"manifest"===e.type?(a=n.manifestLoadingMaxRetry,o=n.manifestLoadingTimeOut,s=n.manifestLoadingRetryDelay,l=n.manifestLoadingMaxRetryTimeout):(a=n.levelLoadingMaxRetry,o=n.levelLoadingTimeOut,s=n.levelLoadingRetryDelay,l=n.levelLoadingMaxRetryTimeout,v.logger.log("loading playlist for "+e.type+" "+(e.level||e.id))),i=this.loaders[e.type]=e.loader=void 0!==n.pLoader?new n.pLoader(n):new n.loader(n),e.url=t,e.responseType="";var u=void 0,d=void 0;u={timeout:o,maxRetry:a,retryDelay:s,maxRetryDelay:l},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},i.load(e,u,d)}},{key:"resolve",value:function(t,e){return u.default.buildAbsoluteURL(e,t,{alwaysNormalize:!0})}},{key:"parseMasterPlaylist",value:function(t,e){var i=[],r=void 0;for(m.lastIndex=0;null!=(r=m.exec(t));){var n={},a=n.attrs=new y.default(r[1]);n.url=this.resolve(r[2],e);var o=a.decimalResolution("RESOLUTION");o&&(n.width=o.width,n.height=o.height),n.bitrate=a.decimalInteger("AVERAGE-BANDWIDTH")||a.decimalInteger("BANDWIDTH"),n.name=a.NAME;var s=a.CODECS;if(s){s=s.split(/[ ,]+/);for(var l=0;l<s.length;l++){var u=s[l];-1!==u.indexOf("avc1")?n.videoCodec=this.avc1toavcoti(u):n.audioCodec=u}}i.push(n)}return i}},{key:"parseMasterPlaylistMedia",value:function(t,e,i){var r=void 0,n=[],a=0;for(b.lastIndex=0;null!=(r=b.exec(t));){var o={},s=new y.default(r[1]);s.TYPE===i&&(o.groupId=s["GROUP-ID"],o.name=s.NAME,o.type=i,o.default="YES"===s.DEFAULT,o.autoselect="YES"===s.AUTOSELECT,o.forced="YES"===s.FORCED,s.URI&&(o.url=this.resolve(s.URI,e)),o.lang=s.LANGUAGE,o.name||(o.name=o.lang),o.id=a++,n.push(o))}return n}},{key:"avc1toavcoti",value:function(t){var e,i=t.split(".");return i.length>2?(e=i.shift()+".",e+=parseInt(i.shift()).toString(16),e+=("000"+parseInt(i.shift()).toString(16)).substr(-4)):e=t,e}},{key:"parseLevelPlaylist",value:function(t,e,i,r){var n,a,o=0,s=0,l={type:null,version:null,url:e,fragments:[],live:!0,startSN:0},u=new T,d=0,c=null,f=new k;for(_.lastIndex=0;null!==(n=_.exec(t));){var h=n[1];if(h){f.duration=parseFloat(h);var p=(" "+n[2]).slice(1);f.title=p||null,f.tagList.push(p?["INF",h,p]:["INF",h])}else if(n[3]){if(!isNaN(f.duration)){var g=o++;f.type=r,f.start=s,f.levelkey=u,f.sn=g,f.level=i,f.cc=d,f.baseurl=e,f.relurl=(" "+n[3]).slice(1),l.fragments.push(f),c=f,s+=f.duration,f=new k}}else if(n[4]){if(f.rawByteRange=(" "+n[4]).slice(1),c){var m=c.byteRangeEndOffset;m&&(f.lastByteRangeEndOffset=m)}}else if(n[5])f.rawProgramDateTime=(" "+n[5]).slice(1),f.tagList.push(["PROGRAM-DATE-TIME",f.rawProgramDateTime]);else{for(n=n[0].match(E),a=1;a<n.length&&void 0===n[a];a++);var b=(" "+n[a+1]).slice(1),A=(" "+n[a+2]).slice(1);switch(n[a]){case"#":f.tagList.push(A?[b,A]:[b]);break;case"PLAYLIST-TYPE":l.type=b.toUpperCase();break;case"MEDIA-SEQUENCE":o=l.startSN=parseInt(b);break;case"TARGETDURATION":l.targetduration=parseFloat(b);break;case"VERSION":l.version=parseInt(b);break;case"EXTM3U":break;case"ENDLIST":l.live=!1;break;case"DIS":d++,f.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":d=parseInt(b);break;case"KEY":var S=b,L=new y.default(S),R=L.enumeratedString("METHOD"),w=L.URI,C=L.hexadecimalInteger("IV");R&&(u=new T,w&&["AES-128","SAMPLE-AES"].indexOf(R)>=0&&(u.method=R,u.baseuri=e,u.reluri=w,u.key=null,u.iv=C));break;case"START":var O=b,D=new y.default(O),P=D.decimalFloatingPoint("TIME-OFFSET");isNaN(P)||(l.startTimeOffset=P);break;case"MAP":var I=new y.default(b);f.relurl=I.URI,f.rawByteRange=I.BYTERANGE,f.baseurl=e,f.level=i,f.type=r,f.sn="initSegment",l.initSegment=f,f=new k;break;default:v.logger.warn("line parsed but not handled: "+n)}}}return f=c,f&&!f.relurl&&(l.fragments.pop(),s-=f.duration),l.totalduration=s,l.averagetargetduration=s/l.fragments.length,l.endSN=o-1,l}},{key:"loadsuccess",value:function(t,e,i){var r=t.data,n=t.url,a=i.type,o=i.id,s=i.level,l=this.hls;if(this.loaders[a]=void 0,void 0!==n&&0!==n.indexOf("data:")||(n=i.url),e.tload=performance.now(),0===r.indexOf("#EXTM3U"))if(r.indexOf("#EXTINF:")>0){var u="audioTrack"!==a&&"subtitleTrack"!==a,d=isNaN(s)?isNaN(o)?0:o:s,f=this.parseLevelPlaylist(r,n,d,"audioTrack"===a?"audio":"subtitleTrack"===a?"subtitle":"main");f.tload=e.tload,"manifest"===a&&l.trigger(c.default.MANIFEST_LOADED,{levels:[{url:n,details:f}],audioTracks:[],url:n,stats:e}),e.tparsed=performance.now(),f.targetduration?u?l.trigger(c.default.LEVEL_LOADED,{details:f,level:s||0,id:o||0,stats:e}):"audioTrack"===a?l.trigger(c.default.AUDIO_TRACK_LOADED,{details:f,id:o,stats:e}):"subtitleTrack"===a&&l.trigger(c.default.SUBTITLE_TRACK_LOADED,{details:f,id:o,stats:e}):l.trigger(c.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:n,reason:"invalid targetduration"})}else{var h=this.parseMasterPlaylist(r,n);if(h.length){var g=this.parseMasterPlaylistMedia(r,n,"AUDIO"),y=this.parseMasterPlaylistMedia(r,n,"SUBTITLES");if(g.length){var m=!1;g.forEach(function(t){t.url||(m=!0)}),!1===m&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(v.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main"}))}l.trigger(c.default.MANIFEST_LOADED,{levels:h,audioTracks:g,subtitles:y,url:n,stats:e})}else l.trigger(c.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:n,reason:"no level found in manifest"})}else l.trigger(c.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:n,reason:"no EXTM3U delimiter"})}},{key:"loaderror",value:function(t,e){var i,r,n=e.loader;switch(e.type){case"manifest":i=p.ErrorDetails.MANIFEST_LOAD_ERROR,r=!0;break;case"level":i=p.ErrorDetails.LEVEL_LOAD_ERROR,r=!1;break;case"audioTrack":i=p.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,r=!1}n&&(n.abort(),this.loaders[e.type]=void 0),this.hls.trigger(c.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:i,fatal:r,url:n.url,loader:n,response:t,context:e})}},{key:"loadtimeout",value:function(t,e){var i,r,n=e.loader;switch(e.type){case"manifest":i=p.ErrorDetails.MANIFEST_LOAD_TIMEOUT,r=!0;break;case"level":i=p.ErrorDetails.LEVEL_LOAD_TIMEOUT,r=!1;break;case"audioTrack":i=p.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT,r=!1}n&&(n.abort(),this.loaders[e.type]=void 0),this.hls.trigger(c.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:i,fatal:r,url:n.url,loader:n,context:e})}}]),e}(h.default);i.default=A},{2:2,33:33,34:34,35:35,47:47,53:53}],44:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=Math.pow(2,32)-1,o=function(){function t(){r(this,t)}return n(t,null,[{key:"init",value:function(){t.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var e;for(e in t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var i=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);t.HDLR_TYPES={video:i,audio:r};var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=a,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,o,l,o,s),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,n))}},{key:"box",value:function(t){for(var e,i=Array.prototype.slice.call(arguments,1),r=8,n=i.length,a=n;n--;)r+=i[n].byteLength;for(e=new Uint8Array(r),e[0]=r>>24&255,e[1]=r>>16&255,e[2]=r>>8&255,e[3]=255&r,e.set(t,4),n=0,r=8;n<a;n++)e.set(i[n],r),r+=i[n].byteLength;return e}},{key:"hdlr",value:function(e){return t.box(t.types.hdlr,t.HDLR_TYPES[e])}},{key:"mdat",value:function(e){return t.box(t.types.mdat,e)}},{key:"mdhd",value:function(e,i){i*=e;var r=Math.floor(i/(a+1)),n=Math.floor(i%(a+1));return t.box(t.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))}},{key:"mdia",value:function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))}},{key:"mfhd",value:function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}},{key:"minf",value:function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))}},{key:"moof",value:function(e,i,r){return t.box(t.types.moof,t.mfhd(e),t.traf(r,i))}},{key:"moov",value:function(e){for(var i=e.length,r=[];i--;)r[i]=t.trak(e[i]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(r).concat(t.mvex(e)))}},{key:"mvex",value:function(e){for(var i=e.length,r=[];i--;)r[i]=t.trex(e[i]);return t.box.apply(null,[t.types.mvex].concat(r))}},{key:"mvhd",value:function(e,i){i*=e;var r=Math.floor(i/(a+1)),n=Math.floor(i%(a+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,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 t.box(t.types.mvhd,o)}},{key:"sdtp",value:function(e){var i,r,n=e.samples||[],a=new Uint8Array(4+n.length);for(r=0;r<n.length;r++)i=n[r].flags,a[r+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return t.box(t.types.sdtp,a)}},{key:"stbl",value:function(e){return t.box(t.types.stbl,t.stsd(e),t.box(t.types.stts,t.STTS),t.box(t.types.stsc,t.STSC),t.box(t.types.stsz,t.STSZ),t.box(t.types.stco,t.STCO))}},{key:"avc1",value:function(e){var i,r,n,a=[],o=[];for(i=0;i<e.sps.length;i++)r=e.sps[i],n=r.byteLength,a.push(n>>>8&255),a.push(255&n),a=a.concat(Array.prototype.slice.call(r));for(i=0;i<e.pps.length;i++)r=e.pps[i],n=r.byteLength,o.push(n>>>8&255),o.push(255&n),o=o.concat(Array.prototype.slice.call(r));var s=t.box(t.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|e.sps.length].concat(a).concat([e.pps.length]).concat(o))),l=e.width,u=e.height,d=e.pixelRatio[0],c=e.pixelRatio[1];return t.box(t.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,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,c>>24,c>>16&255,c>>8&255,255&c])))}},{key:"esds",value:function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))}},{key:"mp4a",value:function(e){var i=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,i>>8&255,255&i,0,0]),t.box(t.types.esds,t.esds(e)))}},{key:"mp3",value:function(e){var i=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,i>>8&255,255&i,0,0]))}},{key:"stsd",value:function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))}},{key:"tkhd",value:function(e){var i=e.id,r=e.duration*e.timescale,n=e.width,o=e.height,s=Math.floor(r/(a+1)),l=Math.floor(r%(a+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,255&i,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,l>>24,l>>16&255,l>>8&255,255&l,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,n>>8&255,255&n,0,0,o>>8&255,255&o,0,0]))}},{key:"traf",value:function(e,i){var r=t.sdtp(e),n=e.id,o=Math.floor(i/(a+1)),s=Math.floor(i%(a+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s])),t.trun(e,r.length+16+20+8+16+8+8),r)}},{key:"trak",value:function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))}},{key:"trex",value:function(e){var i=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(e,i){var r,n,a,o,s,l,u=e.samples||[],d=u.length,c=12+16*d,f=new Uint8Array(c);for(i+=8+c,f.set([0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,255&d,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0),r=0;r<d;r++)n=u[r],a=n.duration,o=n.size,s=n.flags,l=n.cts,f.set([a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*r);return t.box(t.types.trun,f)}},{key:"initSegment",value:function(e){t.types||t.init();var i,r=t.moov(e);return i=new Uint8Array(t.FTYP.byteLength+r.byteLength),i.set(t.FTYP),i.set(r,t.FTYP.byteLength),i}}]),t}();i.default=o},{}],45:[function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),o=t(36),s=r(o),l=t(35),u=r(l),d=t(53),c=t(44),f=r(c),h=t(33),p=function(){function t(e,i,r,a){n(this,t),this.observer=e,this.config=i,this.typeSupported=r;var o=navigator.userAgent;this.isSafari=a&&a.indexOf("Apple")>-1&&o&&!o.match("CriOS"),this.ISGenerated=!1}return a(t,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(t){this._initPTS=this._initDTS=t}},{key:"resetInitSegment",value:function(){this.ISGenerated=!1}},{key:"remux",value:function(t,e,i,r,n,a,o){if(this.ISGenerated||this.generateIS(t,e,n),this.ISGenerated)if(t.samples.length){t.timescale||(d.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(t,e,n));var s=this.remuxAudio(t,n,a,o);if(e.samples.length){var l=void 0;s&&(l=s.endPTS-s.startPTS),e.timescale||(d.logger.warn("regenerate InitSegment as video detected"),this.generateIS(t,e,n)),this.remuxVideo(e,n,a,l,o)}}else{var c=void 0;e.samples.length&&(c=this.remuxVideo(e,n,a,o)),c&&t.codec&&this.remuxEmptyAudio(t,n,a,c)}i.samples.length&&this.remuxID3(i,n),r.samples.length&&this.remuxText(r,n),this.observer.trigger(u.default.FRAG_PARSED)}},{key:"generateIS",value:function(t,e,i){var r,n,a=this.observer,o=t.samples,s=e.samples,l=this.typeSupported,c="audio/mp4",p={},g={tracks:p},y=void 0===this._initPTS;if(y&&(r=n=1/0),t.config&&o.length&&(t.timescale=t.samplerate,d.logger.log("audio sampling rate : "+t.samplerate),t.isAAC||(l.mpeg?(c="audio/mpeg",t.codec=""):l.mp3&&(t.codec="mp3")),p.audio={container:c,codec:t.codec,initSegment:!t.isAAC&&l.mpeg?new Uint8Array:f.default.initSegment([t]),metadata:{channelCount:t.channelCount}},y&&(r=n=o[0].pts-t.inputTimeScale*i)),e.sps&&e.pps&&s.length){var v=e.inputTimeScale;e.timescale=v,p.video={container:"video/mp4",codec:e.codec,initSegment:f.default.initSegment([e]),metadata:{width:e.width,height:e.height}},y&&(r=Math.min(r,s[0].pts-v*i),n=Math.min(n,s[0].dts-v*i),this.observer.trigger(u.default.INIT_PTS_FOUND,{initPTS:r}))}Object.keys(p).length?(a.trigger(u.default.FRAG_PARSING_INIT_SEGMENT,g),this.ISGenerated=!0,y&&(this._initPTS=r,this._initDTS=n)):a.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})}},{key:"remuxVideo",value:function(t,e,i,r,n){var a,o,s,l,c,p,g,y=8,v=t.timescale,m=t.samples,b=[],_=m.length,E=this._PTSNormalize,T=this._initDTS,k=this.nextAvcDts,A=this.isSafari;A&&(i|=m.length&&k&&(n&&Math.abs(e-k/v)<.1||Math.abs(m[0].pts-k-T)<v/5)),i||(k=e*v),m.forEach(function(t){t.pts=E(t.pts-T,k),t.dts=E(t.dts-T,k)}),m.sort(function(t,e){var i=t.dts-e.dts,r=t.pts-e.pts;return i||(r||t.id-e.id)});var S=m.reduce(function(t,e){return Math.max(Math.min(t,e.pts-e.dts),-18e3)},0);if(S<0){d.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(S/90)+" ms to overcome this issue");for(var L=0;L<m.length;L++)m[L].dts+=S}var R=m[0];c=Math.max(R.dts,0),l=Math.max(R.pts,0);var w=Math.round((c-k)/90);i&&w&&(w>1?d.logger.log("AVC:"+w+" ms hole between fragments detected,filling it"):w<-1&&d.logger.log("AVC:"+-w+" ms overlapping between fragments detected"),c=k,m[0].dts=c,l=Math.max(l-w,k),m[0].pts=l,d.logger.log("Video/PTS/DTS adjusted: "+Math.round(l/90)+"/"+Math.round(c/90)+",delta:"+w+" ms")),R=m[m.length-1],g=Math.max(R.dts,0),p=Math.max(R.pts,0,g),A&&(a=Math.round((g-c)/(m.length-1)));for(var C=0,O=0,D=0;D<_;D++){for(var P=m[D],I=P.units,x=I.length,N=0,M=0;M<x;M++)N+=I[M].data.length;O+=N,C+=x,P.length=N,P.dts=A?c+D*a:Math.max(P.dts,c),P.pts=Math.max(P.pts,P.dts)}var F=O+4*C+8;try{o=new Uint8Array(F)}catch(t){return void this.observer.trigger(u.default.ERROR,{type:h.ErrorTypes.MUX_ERROR,details:h.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:F,reason:"fail allocating video mdat "+F})}var B=new DataView(o.buffer);B.setUint32(0,F),o.set(f.default.types.mdat,4);for(var U=0;U<_;U++){for(var G=m[U],j=G.units,V=0,K=void 0,Y=0,H=j.length;Y<H;Y++){var $=j[Y],z=$.data,W=$.data.byteLength;B.setUint32(y,W),y+=4,o.set(z,y),y+=W,V+=4+W}if(A)K=Math.max(0,a*Math.round((G.pts-G.dts)/a));else{if(U<_-1)a=m[U+1].dts-G.dts;else{var q=this.config,X=G.dts-m[U>0?U-1:U].dts;if(q.stretchShortVideoTrack){var Z=q.maxBufferHole,J=q.maxSeekHole,Q=Math.floor(Math.min(Z,J)*v),tt=(r?l+r*v:this.nextAudioPts)-G.pts;tt>Q?(a=tt-X,a<0&&(a=X),d.logger.log("It is approximately "+tt/90+" ms to the next segment; using duration "+a/90+" ms for the last video frame.")):a=X}else a=X}K=Math.round(G.pts-G.dts)}b.push({size:V,duration:a,cts:K,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:G.key?2:1,isNonSync:G.key?0:1}})}this.nextAvcDts=g+a;var et=t.dropped;if(t.len=0,t.nbNalu=0,t.dropped=0,b.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var it=b[0].flags;it.dependsOn=2,it.isNonSync=0}t.samples=b,s=f.default.moof(t.sequenceNumber++,c,t),t.samples=[];var rt={data1:s,data2:o,startPTS:l/v,endPTS:(p+a)/v,startDTS:c/v,endDTS:this.nextAvcDts/v,type:"video",nb:b.length,dropped:et};return this.observer.trigger(u.default.FRAG_PARSING_DATA,rt),rt}},{key:"remuxAudio",value:function(t,e,i,r){var n,a,o,l,c,p,g,y=t.inputTimeScale,v=t.timescale,m=y/v,b=t.isAAC?1024:1152,_=b*m,E=this._PTSNormalize,T=this._initDTS,k=!t.isAAC&&this.typeSupported.mpeg,A=t.samples,S=[],L=this.nextAudioPts;if(i|=A.length&&L&&(r&&Math.abs(e-L/y)<.1||Math.abs(A[0].pts-L-T)<20*_),i||(L=e*y),A.forEach(function(t){t.pts=t.dts=E(t.pts-T,L)}),A.sort(function(t,e){return t.pts-e.pts}),r&&t.isAAC)for(var R=0,w=L;R<A.length;){var C,O=A[R],D=O.pts;C=D-w;var P=Math.abs(1e3*C/y);if(C<=-_)d.logger.warn("Dropping 1 audio frame @ "+(w/y).toFixed(3)+"s due to "+P+" ms overlap."),A.splice(R,1),t.len-=O.unit.length;else if(C>=_&&P<1e4&&w){var I=Math.round(C/_);d.logger.warn("Injecting "+I+" audio frame @ "+(w/y).toFixed(3)+"s due to "+Math.round(1e3*C/y)+" ms gap.");for(var x=0;x<I;x++){var N=Math.max(w,0);o=s.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),o||(d.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),o=O.unit.subarray()),A.splice(R,0,{unit:o,pts:N,dts:N}),t.len+=o.length,w+=_,R++}O.pts=O.dts=w,w+=_,R++}else Math.abs(C),O.pts=O.dts=w,w+=_,R++}for(var M=0,F=A.length;M<F;M++){var B=A[M],U=B.unit,G=B.pts;if(void 0!==g)a.duration=Math.round((G-g)/m);else{var j=Math.round(1e3*(G-L)/y),V=0;if(i&&t.isAAC&&j){if(j>0&&j<1e4)V=Math.round((G-L)/_),d.logger.log(j+" ms hole between AAC samples detected,filling it"),V>0&&(o=s.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),o||(o=U.subarray()),t.len+=V*o.length);else if(j<-12){d.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(L/y).toFixed(3)+"s/"+(G/y).toFixed(3)+"s/"+-j+"ms"),t.len-=U.byteLength;continue}G=L}if(p=Math.max(0,G),!(t.len>0))return;var K=k?t.len:t.len+8;n=k?0:8;try{l=new Uint8Array(K)}catch(t){return void this.observer.trigger(u.default.ERROR,{type:h.ErrorTypes.MUX_ERROR,details:h.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:K,reason:"fail allocating audio mdat "+K})}if(!k){new DataView(l.buffer).setUint32(0,K),l.set(f.default.types.mdat,4)}for(var Y=0;Y<V;Y++)o=s.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),o||(d.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),o=U.subarray()),l.set(o,n),n+=o.byteLength,a={size:o.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(a)}l.set(U,n);var H=U.byteLength;n+=H,a={size:H,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(a),g=G}var $=0,z=S.length;if(z>=2&&($=S[z-2].duration,a.duration=$),z){this.nextAudioPts=L=g+m*$,t.len=0,t.samples=S,c=k?new Uint8Array:f.default.moof(t.sequenceNumber++,p/m,t),t.samples=[];var W=p/y,q=L/y,X={data1:c,data2:l,startPTS:W,endPTS:q,startDTS:W,endDTS:q,type:"audio",nb:z};return this.observer.trigger(u.default.FRAG_PARSING_DATA,X),X}return null}},{key:"remuxEmptyAudio",value:function(t,e,i,r){var n=t.inputTimeScale,a=t.samplerate?t.samplerate:n,o=n/a,l=this.nextAudioPts,u=(void 0!==l?l:r.startDTS*n)+this._initDTS,c=r.endDTS*n+this._initDTS,f=1024*o,h=Math.ceil((c-u)/f),p=s.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(d.logger.warn("remux empty Audio"),!p)return void d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var g=[],y=0;y<h;y++){var v=u+y*f;g.push({unit:p,pts:v,dts:v}),t.len+=p.length}t.samples=g,this.remuxAudio(t,e,i)}},{key:"remuxID3",value:function(t,e){var i,r=t.samples.length,n=t.inputTimeScale,a=this._initPTS,o=this._initDTS;if(r){for(var s=0;s<r;s++)i=t.samples[s],i.pts=(i.pts-a)/n,i.dts=(i.dts-o)/n;this.observer.trigger(u.default.FRAG_PARSING_METADATA,{samples:t.samples})}t.samples=[],e=e}},{key:"remuxText",value:function(t,e){t.samples.sort(function(t,e){return t.pts-e.pts});var i,r=t.samples.length,n=t.inputTimeScale,a=this._initPTS;if(r){for(var o=0;o<r;o++)i=t.samples[o],i.pts=(i.pts-a)/n;this.observer.trigger(u.default.FRAG_PARSING_USERDATA,{samples:t.samples})}t.samples=[],e=e}},{key:"_PTSNormalize",value:function(t,e){var i;if(void 0===e)return t;for(i=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=i;return t}}]),t}();i.default=p},{33:33,35:35,36:36,44:44,53:53}],46:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=t(35),o=function(t){return t&&t.__esModule?t:{default:t}}(a),s=function(){function t(e){r(this,t),this.observer=e}return n(t,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(){}},{key:"resetInitSegment",value:function(){}},{key:"remux",value:function(t,e,i,r,n,a,s,l){var u=this.observer,d="";t&&(d+="audio"),e&&(d+="video"),u.trigger(o.default.FRAG_PARSING_DATA,{data1:l,startPTS:n,startDTS:n,type:d,nb:1,dropped:0}),u.trigger(o.default.FRAG_PARSED)}}]),t}();i.default=s},{35:35}],47:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=/^(\d+)x(\d+)$/,o=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,s=function(){function t(e){r(this,t),"string"==typeof e&&(e=t.parseAttrList(e));for(var i in e)e.hasOwnProperty(i)&&(this[i]=e[i])}return n(t,[{key:"decimalInteger",value:function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e}},{key:"hexadecimalInteger",value:function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var i=new Uint8Array(e.length/2),r=0;r<e.length/2;r++)i[r]=parseInt(e.slice(2*r,2*r+2),16);return i}return null}},{key:"hexadecimalIntegerAsNumber",value:function(t){var e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e}},{key:"decimalFloatingPoint",value:function(t){return parseFloat(this[t])}},{key:"enumeratedString",value:function(t){return this[t]}},{key:"decimalResolution",value:function(t){var e=a.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}}}],[{key:"parseAttrList",value:function(t){var e,i={};for(o.lastIndex=0;null!==(e=o.exec(t));){var r=e[2];0===r.indexOf('"')&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1)),i[e[1]]=r}return i}}]),t}();i.default=s},{}],48:[function(t,e,i){"use strict";var r={search:function(t,e){for(var i=0,r=t.length-1,n=null,a=null;i<=r;){n=(i+r)/2|0,a=t[n];var o=e(a);if(o>0)i=n+1;else{if(!(o<0))return a;r=n-1}}return null}};e.exports=r},{}],49:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a={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},o=function(t){var e=t;return a.hasOwnProperty(t)&&(e=a[t]),String.fromCharCode(e)},s=15,l=100,u={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},d={17:2,18:4,21:6,22:8,23:10,19:13,20:15},c={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],p={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(t){this.time=t},log:function(t,e){var i=this.verboseFilter[t];this.verboseLevel>=i&&console.log(this.time+" ["+t+"] "+e)}},g=function(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i].toString(16));return e},y=function(){function t(e,i,n,a,o){r(this,t),this.foreground=e||"white",this.underline=i||!1,this.italics=n||!1,this.background=a||"black",this.flash=o||!1}return n(t,[{key:"reset",value:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}},{key:"setStyles",value:function(t){for(var e=["foreground","underline","italics","background","flash"],i=0;i<e.length;i++){var r=e[i];t.hasOwnProperty(r)&&(this[r]=t[r])}}},{key:"isDefault",value:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}},{key:"equals",value:function(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash}},{key:"copy",value:function(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash}},{key:"toString",value:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}]),t}(),v=function(){function t(e,i,n,a,o,s){r(this,t),this.uchar=e||" ",this.penState=new y(i,n,a,o,s)}return n(t,[{key:"reset",value:function(){this.uchar=" ",this.penState.reset()}},{key:"setChar",value:function(t,e){this.uchar=t,this.penState.copy(e)}},{key:"setPenState",value:function(t){this.penState.copy(t)}},{key:"equals",value:function(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)}},{key:"copy",value:function(t){this.uchar=t.uchar,this.penState.copy(t.penState)}},{key:"isEmpty",value:function(){return" "===this.uchar&&this.penState.isDefault()}}]),t}(),m=function(){function t(){r(this,t),this.chars=[];for(var e=0;e<l;e++)this.chars.push(new v);this.pos=0,this.currPenState=new y}return n(t,[{key:"equals",value:function(t){for(var e=!0,i=0;i<l;i++)if(!this.chars[i].equals(t.chars[i])){e=!1;break}return e}},{key:"copy",value:function(t){for(var e=0;e<l;e++)this.chars[e].copy(t.chars[e])}},{key:"isEmpty",value:function(){for(var t=!0,e=0;e<l;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t}},{key:"setCursor",value:function(t){this.pos!==t&&(this.pos=t),this.pos<0?(p.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>l&&(p.log("ERROR","Too large cursor position "+this.pos),this.pos=l)}},{key:"moveCursor",value:function(t){var e=this.pos+t;if(t>1)for(var i=this.pos+1;i<e+1;i++)this.chars[i].setPenState(this.currPenState);this.setCursor(e)}},{key:"backSpace",value:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}},{key:"insertChar",value:function(t){t>=144&&this.backSpace();var e=o(t);if(this.pos>=l)return void p.log("ERROR","Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!");this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1)}},{key:"clearFromPos",value:function(t){var e;for(e=t;e<l;e++)this.chars[e].reset()}},{key:"clear",value:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}},{key:"clearToEndOfRow",value:function(){this.clearFromPos(this.pos)}},{key:"getTextString",value:function(){for(var t=[],e=!0,i=0;i<l;i++){var r=this.chars[i].uchar;" "!==r&&(e=!1),t.push(r)}return e?"":t.join("")}},{key:"setPenStyles",value:function(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)}}]),t}(),b=function(){function t(){r(this,t),this.rows=[];for(var e=0;e<s;e++)this.rows.push(new m);this.currRow=s-1,this.nrRollUpRows=null,this.reset()}return n(t,[{key:"reset",value:function(){for(var t=0;t<s;t++)this.rows[t].clear();this.currRow=s-1}},{key:"equals",value:function(t){for(var e=!0,i=0;i<s;i++)if(!this.rows[i].equals(t.rows[i])){e=!1;break}return e}},{key:"copy",value:function(t){for(var e=0;e<s;e++)this.rows[e].copy(t.rows[e])}},{key:"isEmpty",value:function(){for(var t=!0,e=0;e<s;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t}},{key:"backSpace",value:function(){this.rows[this.currRow].backSpace()}},{key:"clearToEndOfRow",value:function(){this.rows[this.currRow].clearToEndOfRow()}},{key:"insertChar",value:function(t){this.rows[this.currRow].insertChar(t)}},{key:"setPen",value:function(t){this.rows[this.currRow].setPenStyles(t)}},{key:"moveCursor",value:function(t){this.rows[this.currRow].moveCursor(t)}},{key:"setCursor",value:function(t){p.log("INFO","setCursor: "+t),this.rows[this.currRow].setCursor(t)}},{key:"setPAC",value:function(t){p.log("INFO","pacData = "+JSON.stringify(t));var e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(var i=0;i<s;i++)this.rows[i].clear();var r=this.currRow+1-this.nrRollUpRows,n=this.lastOutputScreen;if(n){var a=n.rows[r].cueStartTime;if(a&&a<p.time)for(var o=0;o<this.nrRollUpRows;o++)this.rows[e-this.nrRollUpRows+o+1].copy(n.rows[r+o])}}this.currRow=e;var l=this.rows[this.currRow];if(null!==t.indent){var u=t.indent,d=Math.max(u-1,0);l.setCursor(t.indent),t.color=l.chars[d].penState.foreground}var c={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(c)}},{key:"setBkgData",value:function(t){p.log("INFO","bkgData = "+JSON.stringify(t)),this.backSpace(),this.setPen(t),this.insertChar(32)}},{key:"setRollUpRows",value:function(t){this.nrRollUpRows=t}},{key:"rollUp",value:function(){if(null===this.nrRollUpRows)return void p.log("DEBUG","roll_up but nrRollUpRows not set yet");p.log("TEXT",this.getDisplayText());var t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),p.log("INFO","Rolling up")}},{key:"getDisplayText",value:function(t){t=t||!1;for(var e=[],i="",r=-1,n=0;n<s;n++){var a=this.rows[n].getTextString();a&&(r=n+1,t?e.push("Row "+r+": '"+a+"'"):e.push(a.trim()))}return e.length>0&&(i=t?"["+e.join(" | ")+"]":e.join("\n")),i}},{key:"getTextAndFormat",value:function(){return this.rows}}]),t}(),_=function(){function t(e,i){r(this,t),this.chNr=e,this.outputFilter=i,this.mode=null,this.verbose=0,this.displayedMemory=new b,this.nonDisplayedMemory=new b,this.lastOutputScreen=new b,this.currRollUpRow=this.displayedMemory.rows[s-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return n(t,[{key:"reset",value:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[s-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null}},{key:"getHandler",value:function(){return this.outputFilter}},{key:"setHandler",value:function(t){this.outputFilter=t}},{key:"setPAC",value:function(t){this.writeScreen.setPAC(t)}},{key:"setBkgData",value:function(t){this.writeScreen.setBkgData(t)}},{key:"setMode",value:function(t){t!==this.mode&&(this.mode=t,p.log("INFO","MODE="+t),"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=t)}},{key:"insertChars",value:function(t){for(var e=0;e<t.length;e++)this.writeScreen.insertChar(t[e]);var i=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";p.log("INFO",i+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(p.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}},{key:"ccRCL",value:function(){p.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}},{key:"ccBS",value:function(){p.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}},{key:"ccAOF",value:function(){}},{key:"ccAON",value:function(){}},{key:"ccDER",value:function(){p.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}},{key:"ccRU",value:function(t){p.log("INFO","RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)}},{key:"ccFON",value:function(){p.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})}},{key:"ccRDC",value:function(){p.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}},{key:"ccTR",value:function(){p.log("INFO","TR"),this.setMode("MODE_TEXT")}},{key:"ccRTD",value:function(){p.log("INFO","RTD"),this.setMode("MODE_TEXT")}},{key:"ccEDM",value:function(){p.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()}},{key:"ccCR",value:function(){p.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()}},{key:"ccENM",value:function(){p.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}},{key:"ccEOC",value:function(){if(p.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,p.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()}},{key:"ccTO",value:function(t){p.log("INFO","TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)}},{key:"ccMIDROW",value:function(t){var e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{var i=Math.floor(t/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=r[i]}p.log("INFO","MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)}},{key:"outputDataUpdate",value:function(){var t=p.time;null!==t&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(t,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}},{key:"cueSplitAtTime",value:function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))}}]),t}(),E=function(){function t(e,i,n){r(this,t),this.field=e||1,this.outputs=[i,n],this.channels=[new _(1,i),new _(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 n(t,[{key:"getHandler",value:function(t){return this.channels[t].getHandler()}},{key:"setHandler",value:function(t,e){this.channels[t].setHandler(e)}},{key:"addData",value:function(t,e){var i,r,n,a=!1;this.lastTime=t,p.setTime(t);for(var o=0;o<e.length;o+=2)if(r=127&e[o],n=127&e[o+1],0!==r||0!==n){if(p.log("DATA","["+g([e[o],e[o+1]])+"] -> ("+g([r,n])+")"),i=this.parseCmd(r,n),i||(i=this.parseMidrow(r,n)),i||(i=this.parsePAC(r,n)),i||(i=this.parseBackgroundAttributes(r,n)),!i&&(a=this.parseChars(r,n)))if(this.currChNr&&this.currChNr>=0){var s=this.channels[this.currChNr-1];s.insertChars(a)}else p.log("WARNING","No channel found yet. TEXT-MODE?");i?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,p.log("WARNING","Couldn't parse cleaned data "+g([r,n])+" orig: "+g([e[o],e[o+1]])))}else this.dataCounters.padding+=2}},{key:"parseCmd",value:function(t,e){var i=null,r=(20===t||28===t)&&32<=e&&e<=47,n=(23===t||31===t)&&33<=e&&e<=35;if(!r&&!n)return!1;if(t===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,p.log("DEBUG","Repeated command ("+g([t,e])+") is dropped"),!0;i=20===t||23===t?1:2;var a=this.channels[i-1];return 20===t||28===t?32===e?a.ccRCL():33===e?a.ccBS():34===e?a.ccAOF():35===e?a.ccAON():36===e?a.ccDER():37===e?a.ccRU(2):38===e?a.ccRU(3):39===e?a.ccRU(4):40===e?a.ccFON():41===e?a.ccRDC():42===e?a.ccTR():43===e?a.ccRTD():44===e?a.ccEDM():45===e?a.ccCR():46===e?a.ccENM():47===e&&a.ccEOC():a.ccTO(e-32),this.lastCmdA=t,this.lastCmdB=e,this.currChNr=i,!0}},{key:"parseMidrow",value:function(t,e){var i=null;if((17===t||25===t)&&32<=e&&e<=47){if((i=17===t?1:2)!==this.currChNr)return p.log("ERROR","Mismatch channel in midrow parsing"),!1;return this.channels[i-1].ccMIDROW(e),p.log("DEBUG","MIDROW ("+g([t,e])+")"),!0}return!1}},{key:"parsePAC",value:function(t,e){var i=null,r=null,n=(17<=t&&t<=23||25<=t&&t<=31)&&64<=e&&e<=127,a=(16===t||24===t)&&64<=e&&e<=95;if(!n&&!a)return!1;if(t===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;i=t<=23?1:2,r=64<=e&&e<=95?1===i?u[t]:c[t]:1===i?d[t]:f[t];var o=this.interpretPAC(r,e);return this.channels[i-1].setPAC(o),this.lastCmdA=t,this.lastCmdB=e,this.currChNr=i,!0}},{key:"interpretPAC",value:function(t,e){var i=e,r={color:null,italics:!1,indent:null,underline:!1,row:t};return i=e>95?e-96:e-64,r.underline=1==(1&i),i<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((i-16)/2),r}},{key:"parseChars",value:function(t,e){var i=null,r=null,n=null;if(t>=25?(i=2,n=t-8):(i=1,n=t),17<=n&&n<=19){var a=e;a=17===n?e+80:18===n?e+112:e+144,p.log("INFO","Special char '"+o(a)+"' in channel "+i),r=[a]}else 32<=t&&t<=127&&(r=0===e?[t]:[t,e]);if(r){var s=g(r);p.log("DEBUG","Char codes = "+s.join(",")),this.lastCmdA=null,this.lastCmdB=null}return r}},{key:"parseBackgroundAttributes",value:function(t,e){var i,r,n,a,o=(16===t||24===t)&&32<=e&&e<=47,s=(23===t||31===t)&&45<=e&&e<=47;return!(!o&&!s)&&(i={},16===t||24===t?(r=Math.floor((e-32)/2),i.background=h[r],e%2==1&&(i.background=i.background+"_semi")):45===e?i.background="transparent":(i.foreground="black",47===e&&(i.underline=!0)),n=t<24?1:2,a=this.channels[n-1],a.setBkgData(i),this.lastCmdA=null,this.lastCmdB=null,!0)}},{key:"reset",value:function(){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].reset();this.lastCmdA=null,this.lastCmdB=null}},{key:"cueSplitAtTime",value:function(t){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].cueSplitAtTime(t)}}]),t}();i.default=E},{}],50:[function(t,e,i){"use strict";var r=t(56),n={newCue:function(t,e,i,n){for(var a,o,s,l,u,d=window.VTTCue||window.TextTrackCue,c=0;c<n.rows.length;c++)if(a=n.rows[c],s=!0,l=0,u="",!a.isEmpty()){for(var f=0;f<a.chars.length;f++)a.chars[f].uchar.match(/\s/)&&s?l++:(u+=a.chars[f].uchar,s=!1);a.cueStartTime=e,e===i&&(i+=1e-4),o=new d(e,i,(0,r.fixLineBreaks)(u.trim())),l>=16?l--:l++,navigator.userAgent.match(/Firefox\//)?o.line=c+1:o.line=c>7?c-2:c+1,o.align="left",o.position=Math.max(0,Math.min(100,l/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),t.addCue(o)}}};e.exports=n},{56:56}],51:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=t(52),o=function(t){return t&&t.__esModule?t:{default:t}}(a),s=function(){function t(e,i,n,a){r(this,t),this.hls=e,this.defaultEstimate_=a,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new o.default(i),this.fast_=new o.default(n)}return n(t,[{key:"sample",value:function(t,e){t=Math.max(t,this.minDelayMs_);var i=8e3*e/t,r=t/1e3;this.fast_.sample(r,i),this.slow_.sample(r,i)}},{key:"canEstimate",value:function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"destroy",value:function(){}}]),t}();i.default=s},{52:52}],52:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=function(){function t(e){r(this,t),this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=0,this.totalWeight_=0}return n(t,[{key:"sample",value:function(t,e){var i=Math.pow(this.alpha_,t);this.estimate_=e*(1-i)+i*this.estimate_,this.totalWeight_+=t}},{key:"getTotalWeight",value:function(){return this.totalWeight_}},{key:"getEstimate",value:function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/t}return this.estimate_}}]),t}();i.default=a},{}],53:[function(t,e,i){"use strict";function r(){}function n(t,e){return e="["+t+"] > "+e}function a(t){var e=self.console[t];return e?function(){for(var i=arguments.length,r=Array(i),a=0;a<i;a++)r[a]=arguments[a];r[0]&&(r[0]=n(t,r[0])),e.apply(self.console,r)}:r}function o(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];i.forEach(function(e){u[e]=t[e]?t[e].bind(t):a(e)})}Object.defineProperty(i,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l={trace:r,debug:r,log:r,warn:r,info:r,error:r},u=l;i.enableLogs=function(t){if(!0===t||"object"===(void 0===t?"undefined":s(t))){o(t,"debug","log","info","warn","error");try{u.log()}catch(t){u=l}}else u=l},i.logger=u},{}],54:[function(t,e,i){"use strict";var r={toString:function(t){for(var e="",i=t.length,r=0;r<i;r++)e+="["+t.start(r).toFixed(3)+","+t.end(r).toFixed(3)+"]";return e}};e.exports=r},{}],55:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(){function t(t){return"string"==typeof t&&(!!a[t.toLowerCase()]&&t.toLowerCase())}function e(t){return"string"==typeof t&&(!!o[t.toLowerCase()]&&t.toLowerCase())}function i(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)t[r]=i[r]}return t}function r(r,a,o){var s=this,l=function(){if("undefined"!=typeof navigator)return/MSIE\s8\.0/.test(navigator.userAgent)}(),u={};l?s=document.createElement("custom"):u.enumerable=!0,s.hasBeenReset=!1;var d="",c=!1,f=r,h=a,p=o,g=null,y="",v=!0,m="auto",b="start",_=50,E="middle",T=50,k="middle";if(Object.defineProperty(s,"id",i({},u,{get:function(){return d},set:function(t){d=""+t}})),Object.defineProperty(s,"pauseOnExit",i({},u,{get:function(){return c},set:function(t){c=!!t}})),Object.defineProperty(s,"startTime",i({},u,{get:function(){return f},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");f=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"endTime",i({},u,{get:function(){return h},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");h=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"text",i({},u,{get:function(){return p},set:function(t){p=""+t,this.hasBeenReset=!0}})),Object.defineProperty(s,"region",i({},u,{get:function(){return g},set:function(t){g=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"vertical",i({},u,{get:function(){return y},set:function(e){var i=t(e);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");y=i,this.hasBeenReset=!0}})),Object.defineProperty(s,"snapToLines",i({},u,{get:function(){return v},set:function(t){v=!!t,this.hasBeenReset=!0}})),Object.defineProperty(s,"line",i({},u,{get:function(){return m},set:function(t){if("number"!=typeof t&&t!==n)throw new SyntaxError("An invalid number or illegal string was specified.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"lineAlign",i({},u,{get:function(){return b},set:function(t){var i=e(t);if(!i)throw new SyntaxError("An invalid or illegal string was specified.");b=i,this.hasBeenReset=!0}})),Object.defineProperty(s,"position",i({},u,{get:function(){return _},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",i({},u,{get:function(){return E},set:function(t){var i=e(t);if(!i)throw new SyntaxError("An invalid or illegal string was specified.");E=i,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",i({},u,{get:function(){return T},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",i({},u,{get:function(){return k},set:function(t){var i=e(t);if(!i)throw new SyntaxError("An invalid or illegal string was specified.");k=i,this.hasBeenReset=!0}})),s.displayState=void 0,l)return s}if("undefined"!=typeof window&&window.VTTCue)return window.VTTCue;var n="auto",a={"":!0,lr:!0,rl:!0},o={start:!0,middle:!0,end:!0,left:!0,right:!0};return r.prototype.getCueAsHTML=function(){return window.WebVTT.convertCueToDOMTree(window,this.text)},r}()},{}],56:[function(t,e,i){"use strict";function r(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new c,this.regionList=[]}function n(t){function e(t,e,i,r){return 3600*(0|t)+60*(0|e)+(0|i)+(0|r)/1e3}var i=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?e(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?e(i[1],i[2],0,i[4]):e(0,i[1],i[2],i[4]):null}function a(){this.values=Object.create(null)}function o(t,e,i,r){var n=r?t.split(r):[t];for(var a in n)if("string"==typeof n[a]){var o=n[a].split(i);if(2===o.length){var s=o[0],l=o[1];e(s,l)}}}function s(t,e,i){function r(){var e=n(t);if(null===e)throw new Error("Malformed timestamp: "+l);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function s(){t=t.replace(/^\s+/,"")}var l=t;if(s(),e.startTime=r(),s(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+l);t=t.substr(3),s(),e.endTime=r(),s(),function(t,e){var r=new a;o(t,function(t,e){switch(t){case"region":for(var n=i.length-1;n>=0;n--)if(i[n].id===e){r.set(t,i[n].region);break}break;case"vertical":r.alt(t,e,["rl","lr"]);break;case"line":var a=e.split(","),o=a[0];r.integer(t,o),r.percent(t,o)&&r.set("snapToLines",!1),r.alt(t,o,["auto"]),2===a.length&&r.alt("lineAlign",a[1],["start",h,"end"]);break;case"position":a=e.split(","),r.percent(t,a[0]),2===a.length&&r.alt("positionAlign",a[1],["start",h,"end","line-left","line-right","auto"]);break;case"size":r.percent(t,e);break;case"align":r.alt(t,e,["start",h,"end","left","right"])}},/:/,/\s/),e.region=r.get("region",null),e.vertical=r.get("vertical","");var n=r.get("line","auto");"auto"===n&&-1===f.line&&(n=-1),e.line=n,e.lineAlign=r.get("lineAlign","start"),e.snapToLines=r.get("snapToLines",!0),e.size=r.get("size",100),e.align=r.get("align",h);var s=r.get("position","auto");"auto"===s&&50===f.position&&(s="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=s}(t,e)}function l(t){return t.replace(/<br(?: \/)?>/gi,"\n")}Object.defineProperty(i,"__esModule",{value:!0}),i.fixLineBreaks=void 0;var u=t(55),d=function(t){return t&&t.__esModule?t:{default:t}}(u),c=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}};a.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,i){return i?this.has(t)?this.values[t]:e[i]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,i){for(var r=0;r<i.length;++r)if(e===i[r]){this.set(t,e);break}},integer:function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},percent:function(t,e){return!!(e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e))>=0&&e<=100)&&(this.set(t,e),!0)}};var f=new d.default(0,0,0),h="middle"===f.align?"middle":"center";r.prototype={parse:function(t){function e(){var t=i.buffer,e=0;for(t=l(t);e<t.length&&"\r"!==t[e]&&"\n"!==t[e];)++e;var r=t.substr(0,e);return"\r"===t[e]&&++e,"\n"===t[e]&&++e,i.buffer=t.substr(e),r}var i=this;t&&(i.buffer+=i.decoder.decode(t,{stream:!0}));try{var r;if("INITIAL"===i.state){if(!/\r\n|\n/.test(i.buffer))return this;r=e();var n=r.match(/^WEBVTT([ \t].*)?$/);if(!n||!n[0])throw new Error("Malformed WebVTT signature.");i.state="HEADER"}for(var a=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(a?a=!1:r=e(),i.state){case"HEADER":/:/.test(r)?function(t){o(t,function(t,e){switch(t){case"Region":console.log("parse region",e)}},/:/)}(r):r||(i.state="ID");continue;case"NOTE":r||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){i.state="NOTE";break}if(!r)continue;if(i.cue=new d.default(0,0,""),i.state="CUE",-1===r.indexOf("--\x3e")){i.cue.id=r;continue}case"CUE":try{s(r,i.cue,i.regionList)}catch(t){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var u=-1!==r.indexOf("--\x3e");if(!r||u&&(a=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+="\n"),i.cue.text+=r;continue;case"BADCUE":r||(i.state="ID");continue}}}catch(t){"CUETEXT"===i.state&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state="INITIAL"===i.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),(t.cue||"HEADER"===t.state)&&(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state)throw new Error("Malformed WebVTT signature.")}catch(t){throw t}return t.onflush&&t.onflush(),this}},i.fixLineBreaks=l,i.default=r},{55:55}],57:[function(t,e,i){"use strict";var r=t(56),n=function(t){return t&&t.__esModule?t:{default:t}}(r),a=function(t,e,i){return t.substr(i||0,e.length)===e},o=function(t){var e=parseInt(t.substr(-3)),i=parseInt(t.substr(-6,2)),r=parseInt(t.substr(-9,2)),n=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;return isNaN(e)||isNaN(i)||isNaN(r)||isNaN(n)?-1:(e+=1e3*i,e+=6e4*r,e+=36e5*n)},s=function(t){for(var e=5381,i=t.length;i;)e=33*e^t.charCodeAt(--i);return(e>>>0).toString()},l=function(t,e,i){var r=t[e],n=t[r.prevCC];if(!n||!n.new&&r.new)return t.ccOffset=t.presentationOffset=r.start,void(r.new=!1);for(;n&&n.new;)t.ccOffset+=r.start-n.start,r.new=!1,r=n,n=t[r.prevCC];t.presentationOffset=i},u={parse:function(t,e,i,r,u,d){var c=/\r\n|\n\r|\n|\r/g,f=String.fromCharCode.apply(null,new Uint8Array(t)).trim().replace(c,"\n").split("\n"),h="00:00.000",p=0,g=0,y=0,v=[],m=void 0,b=!0,_=new n.default;_.oncue=function(t){var e=i[r],n=i.ccOffset;e&&e.new&&(void 0!==g?n=i.ccOffset=e.start:l(i,r,y)),y&&(n=y+i.ccOffset-i.presentationOffset),t.startTime+=n-g,t.endTime+=n-g,t.id=s(t.startTime)+s(t.endTime)+s(t.text),t.text=decodeURIComponent(escape(t.text)),t.endTime>0&&v.push(t)},_.onparsingerror=function(t){m=t},_.onflush=function(){if(m&&d)return void d(m);u(v)},f.forEach(function(t){if(b){if(a(t,"X-TIMESTAMP-MAP=")){b=!1,t.substr(16).split(",").forEach(function(t){a(t,"LOCAL:")?h=t.substr(6):a(t,"MPEGTS:")&&(p=parseInt(t.substr(7)))});try{e=e<0?e+8589934592:e,p-=e,g=o(h)/1e3,y=p/9e4,-1===g&&(m=new Error("Malformed X-TIMESTAMP-MAP: "+t))}catch(e){m=new Error("Malformed X-TIMESTAMP-MAP: "+t)}return}""===t&&(b=!1)}_.parse(t+"\n")}),_.flush()}};e.exports=u},{56:56}],58:[function(t,e,i){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),a=t(53),o=function(){function t(e){r(this,t),e&&e.xhrSetup&&(this.xhrSetup=e.xhrSetup)}return n(t,[{key:"destroy",value:function(){this.abort(),this.loader=null}},{key:"abort",value:function(){var t=this.loader;t&&4!==t.readyState&&(this.stats.aborted=!0,t.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null}},{key:"load",value:function(t,e,i){this.context=t,this.config=e,this.callbacks=i,this.stats={trequest:performance.now(),retry:0},this.retryDelay=e.retryDelay,this.loadInternal()}},{key:"loadInternal",value:function(){var t,e=this.context;t="undefined"!=typeof XDomainRequest?this.loader=new XDomainRequest:this.loader=new XMLHttpRequest;var i=this.stats;i.tfirst=0,i.loaded=0;var r=this.xhrSetup;try{if(r)try{r(t,e.url)}catch(i){t.open("GET",e.url,!0),r(t,e.url)}t.readyState||t.open("GET",e.url,!0)}catch(i){return void this.callbacks.onError({code:t.status,text:i.message},e)}e.rangeEnd&&t.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),t.send()}},{key:"readystatechange",value:function(t){var e=t.currentTarget,i=e.readyState,r=this.stats,n=this.context,o=this.config;if(!r.aborted&&i>=2)if(window.clearTimeout(this.requestTimeout),0===r.tfirst&&(r.tfirst=Math.max(performance.now(),r.trequest)),4===i){var s=e.status;if(s>=200&&s<300){r.tload=Math.max(r.tfirst,performance.now());var l=void 0,u=void 0;"arraybuffer"===n.responseType?(l=e.response,u=l.byteLength):(l=e.responseText,u=l.length),r.loaded=r.total=u;var d={url:e.responseURL,data:l};this.callbacks.onSuccess(d,r,n)}else r.retry>=o.maxRetry||s>=400&&s<499?(a.logger.error(s+" while loading "+n.url),this.callbacks.onError({code:s,text:e.statusText},n)):(a.logger.warn(s+" while loading "+n.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),r.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),o.timeout)}},{key:"loadtimeout",value:function(){a.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context)}},{key:"loadprogress",value:function(t){var e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total);var i=this.callbacks.onProgress;i&&i(e,this.context,null)}}]),t}();i.default=o},{53:53}]},{},[40])(40)})},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(9),h=r(f),p=i(7),g=r(p),y=i(175),v=r(y),m=i(4),b=r(m),_=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r.el.src=i.src,r}return(0,c.default)(e,t),e.prototype.getPlaybackType=function(){return h.default.NO_OP},(0,u.default)(e,[{key:"name",get:function(){return"html_img"}},{key:"tagName",get:function(){return"img"}},{key:"attributes",get:function(){return{"data-html-img":""}}},{key:"events",get:function(){return{load:"_onLoad",abort:"_onError",error:"_onError"}}}]),e.prototype.render=function(){var t=g.default.getStyleFor(v.default);return this.$el.append(t),this.trigger(b.default.PLAYBACK_READY,this.name),this},e.prototype._onLoad=function(){this.trigger(b.default.PLAYBACK_ENDED,this.name)},e.prototype._onError=function(t){var e="error"===t.type?"load error":"loading aborted";this.trigger(b.default.PLAYBACK_ERROR,{message:e},this.name)},e}(h.default);e.default=_,_.canPlay=function(t){return/\.(png|jpg|jpeg|gif|bmp|tiff|pgm|pnm|webp)(|\?.*)$/i.test(t)},t.exports=e.default},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,"[data-html-img]{max-width:100%;max-height:100%}",""])},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(5),h=i(9),p=r(h),g=i(8),y=r(g),v=i(7),m=r(v),b=i(4),_=r(b),E=i(177),T=r(E),k=i(178),A=r(k),S=function(t){function e(){(0,a.default)(this,e);for(var i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];var o=(0,s.default)(this,t.call.apply(t,[this].concat(r)));return o._noiseFrameNum=-1,o._started=!1,o}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"no_op"}},{key:"template",get:function(){return(0,y.default)(A.default)}},{key:"attributes",get:function(){return{"data-no-op":""}}}]),e.prototype.render=function(){var t=m.default.getStyleFor(T.default),e=this.options.playbackNotSupportedMessage||this.i18n.t("playback_not_supported");this.$el.html(this.template({message:e})),this.$el.append(t),this.trigger(_.default.PLAYBACK_READY,this.name);var i=!(!this.options.poster||!this.options.poster.showForNoOp);return!this.options.autoPlay&&i||this.play(),this},e.prototype.play=function(){this._started||(this._started=!0,this.trigger(_.default.PLAYBACK_PLAY),this._animate())},e.prototype._noise=function(){if(this._noiseFrameNum=(this._noiseFrameNum+1)%5,!this._noiseFrameNum){var t=this.context.createImageData(this.context.canvas.width,this.context.canvas.height),e=void 0;try{e=new Uint32Array(t.data.buffer)}catch(n){e=new Uint32Array(this.context.canvas.width*this.context.canvas.height*4);for(var i=t.data,r=0;r<i.length;r++)e[r]=i[r]}for(var n=e.length,a=6*Math.random()+4,o=0,s=0,l=0;l<n;){if(o<0){o=a*Math.random();s=255*Math.pow(Math.random(),.4)<<24}o-=1,e[l++]=s}this.context.putImageData(t,0,0)}},e.prototype._loop=function(){var t=this;this._stop||(this._noise(),this._animationHandle=(0,f.requestAnimationFrame)(function(){return t._loop()}))},e.prototype.destroy=function(){this._animationHandle&&((0,f.cancelAnimationFrame)(this._animationHandle),this._stop=!0)},e.prototype._animate=function(){this.canvas=this.$el.find("canvas[data-no-op-canvas]")[0],this.context=this.canvas.getContext("2d"),this._loop()},e}(p.default);e.default=S,S.canPlay=function(t){return!0},t.exports=e.default},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,"[data-no-op]{position:absolute;height:100%;width:100%;text-align:center}[data-no-op] p[data-no-op-msg]{position:absolute;text-align:center;font-size:25px;left:0;right:0;color:#fff;padding:10px;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%);max-height:100%;overflow:auto}[data-no-op] canvas[data-no-op-canvas]{background-color:#777;height:100%;width:100%}",""])},function(t,e){t.exports="<canvas data-no-op-canvas></canvas>\n<p data-no-op-msg><%=message%><p>\n"},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(180),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(36),h=r(f),p=i(4),g=r(p),y=i(7),v=r(y),m=i(8),b=r(m),_=i(181),E=r(_),T=i(182),k=r(T),A=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r.template=(0,b.default)(E.default),r.showTimeout=null,r.listenTo(r.container,g.default.CONTAINER_STATE_BUFFERING,r.onBuffering),r.listenTo(r.container,g.default.CONTAINER_STATE_BUFFERFULL,r.onBufferFull),r.listenTo(r.container,g.default.CONTAINER_STOP,r.onStop),r.listenTo(r.container,g.default.CONTAINER_ENDED,r.onStop),r.listenTo(r.container,g.default.CONTAINER_ERROR,r.onStop),r.render(),r}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"spinner"}},{key:"attributes",get:function(){return{"data-spinner":"",class:"spinner-three-bounce"}}}]),e.prototype.onBuffering=function(){this.show()},e.prototype.onBufferFull=function(){this.hide()},e.prototype.onStop=function(){this.hide()},e.prototype.show=function(){var t=this;null===this.showTimeout&&(this.showTimeout=setTimeout(function(){return t.$el.show()},300))},e.prototype.hide=function(){null!==this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null),this.$el.hide()},e.prototype.render=function(){this.$el.html(this.template());var t=v.default.getStyleFor(k.default);return this.container.$el.append(t),this.container.$el.append(this.$el),this.$el.hide(),this.container.buffering&&this.onBuffering(),this},e}(h.default);e.default=A,t.exports=e.default},function(t,e){t.exports="<div data-bounce1></div><div data-bounce2></div><div data-bounce3></div>\n"},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,".spinner-three-bounce[data-spinner]{position:absolute;margin:0 auto;width:70px;text-align:center;z-index:999;left:0;right:0;margin-left:auto;margin-right:auto;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%)}.spinner-three-bounce[data-spinner]>div{width:18px;height:18px;background-color:#fff;border-radius:100%;display:inline-block;-webkit-animation:bouncedelay 1.4s infinite ease-in-out;-moz-animation:bouncedelay 1.4s infinite ease-in-out;animation:bouncedelay 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;animation-fill-mode:both}.spinner-three-bounce[data-spinner] [data-bounce1]{-webkit-animation-delay:-.32s;-moz-animation-delay:-.32s;animation-delay:-.32s}.spinner-three-bounce[data-spinner] [data-bounce2]{-webkit-animation-delay:-.16s;-moz-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@-moz-keyframes bouncedelay{0%,80%,to{-moz-transform:scale(0)}40%{-moz-transform:scale(1)}}@keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0);-moz-transform:scale(0);-ms-transform:scale(0);-o-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1)}}",""])},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(184),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(37),h=r(f),p=i(4),g=r(p),y=i(6),v=r(y),m=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r.setInitialAttrs(),r.reportInterval=r.options.reportInterval||5e3,r.state="IDLE",r}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"stats"}}]),e.prototype.bindEvents=function(){this.listenTo(this.container.playback,g.default.PLAYBACK_PLAY,this.onPlay),this.listenTo(this.container,g.default.CONTAINER_STOP,this.onStop),this.listenTo(this.container,g.default.CONTAINER_ENDED,this.onStop),this.listenTo(this.container,g.default.CONTAINER_DESTROYED,this.onStop),this.listenTo(this.container,g.default.CONTAINER_STATE_BUFFERING,this.onBuffering),this.listenTo(this.container,g.default.CONTAINER_STATE_BUFFERFULL,this.onBufferFull),this.listenTo(this.container,g.default.CONTAINER_STATS_ADD,this.onStatsAdd),this.listenTo(this.container,g.default.CONTAINER_BITRATE,this.onStatsAdd),this.listenTo(this.container.playback,g.default.PLAYBACK_STATS_ADD,this.onStatsAdd)},e.prototype.setInitialAttrs=function(){this.firstPlay=!0,this.startupTime=0,this.rebufferingTime=0,this.watchingTime=0,this.rebuffers=0,this.externalMetrics={}},e.prototype.onPlay=function(){this.state="PLAYING",this.watchingTimeInit=Date.now(),this.intervalId||(this.intervalId=setInterval(this.report.bind(this),this.reportInterval))},e.prototype.onStop=function(){clearInterval(this.intervalId),this.report(),this.intervalId=void 0,this.state="STOPPED"},e.prototype.onBuffering=function(){this.firstPlay?this.startupTimeInit=Date.now():this.rebufferingTimeInit=Date.now(),this.state="BUFFERING",this.rebuffers++},e.prototype.onBufferFull=function(){this.firstPlay&&this.startupTimeInit?(this.firstPlay=!1,this.startupTime=Date.now()-this.startupTimeInit,this.watchingTimeInit=Date.now()):this.rebufferingTimeInit&&(this.rebufferingTime+=this.getRebufferingTime()),this.rebufferingTimeInit=void 0,this.state="PLAYING"},e.prototype.getRebufferingTime=function(){return Date.now()-this.rebufferingTimeInit},e.prototype.getWatchingTime=function(){return Date.now()-this.watchingTimeInit-this.rebufferingTime},e.prototype.isRebuffering=function(){return!!this.rebufferingTimeInit},e.prototype.onStatsAdd=function(t){v.default.extend(this.externalMetrics,t)},e.prototype.getStats=function(){var t={startupTime:this.startupTime,rebuffers:this.rebuffers,rebufferingTime:this.isRebuffering()?this.rebufferingTime+this.getRebufferingTime():this.rebufferingTime,watchingTime:this.isRebuffering()?this.getWatchingTime()-this.getRebufferingTime():this.getWatchingTime()};return v.default.extend(t,this.externalMetrics),t},e.prototype.report=function(){this.container.statsReport(this.getStats())},e}(h.default);e.default=m,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(186),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(36),h=r(f),p=i(4),g=r(p),y=i(7),v=r(y),m=i(8),b=r(m),_=i(187),E=r(_),T=i(188),k=r(T),A=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r.configure(),r}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"watermark"}},{key:"template",get:function(){return(0,b.default)(k.default)}}]),e.prototype.bindEvents=function(){this.listenTo(this.container,g.default.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,g.default.CONTAINER_STOP,this.onStop),this.listenTo(this.container,g.default.CONTAINER_OPTIONS_CHANGE,this.configure)},e.prototype.configure=function(){this.position=this.options.position||"bottom-right",this.options.watermark?(this.imageUrl=this.options.watermark,this.imageLink=this.options.watermarkLink,this.render()):this.$el.remove()},e.prototype.onPlay=function(){this.hidden||this.$el.show()},e.prototype.onStop=function(){this.$el.hide()},e.prototype.render=function(){this.$el.hide();var t={position:this.position,imageUrl:this.imageUrl,imageLink:this.imageLink};this.$el.html(this.template(t));var e=v.default.getStyleFor(E.default);return this.container.$el.append(e),this.container.$el.append(this.$el),this},e}(h.default);e.default=A,t.exports=e.default},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,"[data-watermark]{position:absolute;min-width:70px;max-width:200px;width:12%;text-align:center;z-index:10}[data-watermark] a{outline:none;cursor:pointer}[data-watermark] img{max-width:100%}[data-watermark-bottom-left]{bottom:10px;left:10px}[data-watermark-bottom-right]{bottom:10px;right:42px}[data-watermark-top-left]{top:10px;left:10px}[data-watermark-top-right]{top:10px;right:37px}",""])},function(t,e){t.exports="<div data-watermark data-watermark-<%=position %>>\n<% if(typeof imageLink !== 'undefined') { %>\n<a target=_blank href=\"<%= imageLink %>\">\n<% } %>\n<img src=\"<%= imageUrl %>\">\n<% if(typeof imageLink !== 'undefined') { %>\n</a>\n<% } %>\n</div>\n"},function(t,e,i){"use strict";(function(r){function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=i(0),o=n(a),s=i(1),l=n(s),u=i(3),d=n(u),c=i(2),f=n(c),h=i(36),p=n(h),g=i(4),y=n(g),v=i(7),m=n(v),b=i(8),_=n(b),E=i(9),T=n(E),k=i(190),A=n(k),S=i(191),L=n(S),R=i(58),w=n(R),C=function(t){function e(i){(0,o.default)(this,e);var n=(0,l.default)(this,t.call(this,i));return n.hasStartedPlaying=!1,n.playRequested=!1,n.render(),r.nextTick(function(){return n.update()}),n}return(0,f.default)(e,t),(0,d.default)(e,[{key:"name",get:function(){return"poster"}},{key:"template",get:function(){return(0,_.default)(L.default)}},{key:"shouldRender",get:function(){var t=!(!this.options.poster||!this.options.poster.showForNoOp);return"html_img"!==this.container.playback.name&&(this.container.playback.getPlaybackType()!==T.default.NO_OP||t)}},{key:"attributes",get:function(){return{class:"player-poster","data-poster":""}}},{key:"events",get:function(){return{click:"clicked"}}},{key:"showOnVideoEnd",get:function(){return!this.options.poster||this.options.poster.showOnVideoEnd||void 0===this.options.poster.showOnVideoEnd}}]),e.prototype.bindEvents=function(){this.listenTo(this.container,y.default.CONTAINER_STOP,this.onStop),this.listenTo(this.container,y.default.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,y.default.CONTAINER_STATE_BUFFERING,this.update),this.listenTo(this.container,y.default.CONTAINER_STATE_BUFFERFULL,this.update),this.listenTo(this.container,y.default.CONTAINER_OPTIONS_CHANGE,this.render),this.showOnVideoEnd&&this.listenTo(this.container,y.default.CONTAINER_ENDED,this.onStop)},e.prototype.stopListening=function(){t.prototype.stopListening.call(this)},e.prototype.onPlay=function(){this.hasStartedPlaying=!0,this.update()},e.prototype.onStop=function(){this.hasStartedPlaying=!1,this.playRequested=!1,this.update()},e.prototype.showPlayButton=function(t){!t||this.options.chromeless&&!this.options.allowUserInteraction?(this.$playButton.hide(),this.$el.removeClass("clickable")):(this.$playButton.show(),this.$el.addClass("clickable"))},e.prototype.clicked=function(){return this.options.chromeless&&!this.options.allowUserInteraction||(this.playRequested=!0,this.update(),this.container.play()),!1},e.prototype.shouldHideOnPlay=function(){return!this.container.playback.isAudioOnly},e.prototype.update=function(){if(this.shouldRender){var t=!this.playRequested&&!this.hasStartedPlaying&&!this.container.buffering;this.showPlayButton(t),this.hasStartedPlaying?(this.container.enableMediaControl(),this.shouldHideOnPlay()&&this.$el.hide()):(this.container.disableMediaControl(),this.$el.show())}},e.prototype.render=function(){if(this.shouldRender){var t=m.default.getStyleFor(A.default,{baseUrl:this.options.baseUrl});this.$el.html(this.template()),this.$el.append(t);if(this.options.poster&&void 0==this.options.poster.custom){var e=this.options.poster.url||this.options.poster;this.$el.css({"background-image":"url("+e+")"})}else this.options.poster&&this.$el.css({background:this.options.poster.custom});this.container.$el.append(this.el),this.$playWrapper=this.$el.find(".play-wrapper"),this.$playWrapper.append(w.default),this.$playButton=this.$playWrapper.find("svg"),this.$playButton.addClass("poster-icon"),this.$playButton.attr("data-poster","");var i=this.options.mediacontrol&&this.options.mediacontrol.buttons;return i&&this.$el.find("svg path").css("fill",i),this.options.mediacontrol&&this.options.mediacontrol.buttons&&(i=this.options.mediacontrol.buttons,this.$playButton.css("color",i)),this.update(),this}},e}(p.default);e.default=C,t.exports=e.default}).call(e,i(57))},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,".player-poster[data-poster]{display:-webkit-box;display:-moz-box;display:box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-moz-box-pack:center;box-pack:center;-webkit-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-ms-flex-pack:center;-webkit-box-align:center;-moz-box-align:center;box-align:center;-webkit-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-ms-flex-align:center;position:absolute;height:100%;width:100%;z-index:998;top:0;left:0;background-color:#000;background-size:cover;background-repeat:no-repeat;background-position:50% 50%}.player-poster[data-poster].clickable{cursor:pointer}.player-poster[data-poster]:hover .play-wrapper[data-poster]{opacity:1}.player-poster[data-poster] .play-wrapper[data-poster]{width:100%;height:25%;margin:0 auto;opacity:.75;-webkit-transition:opacity .1s ease;-moz-transition:opacity .1s ease;transition:opacity .1s ease}.player-poster[data-poster] .play-wrapper[data-poster] svg{height:100%}.player-poster[data-poster] .play-wrapper[data-poster] svg path{fill:#fff}",""])},function(t,e){t.exports='<div class="play-wrapper" data-poster></div>\n'},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(193),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(37),h=r(f),p=i(4),g=r(p),y=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r.container.options.gaAccount&&(r.account=r.container.options.gaAccount,r.trackerName=r.container.options.gaTrackerName?r.container.options.gaTrackerName+".":"Clappr.",r.domainName=r.container.options.gaDomainName,r.currentHDState=void 0,r.embedScript()),r}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"google_analytics"}}]),e.prototype.embedScript=function(){var t=this;if(window._gat)this.addEventListeners();else{var e=document.createElement("script");e.setAttribute("type","text/javascript"),e.setAttribute("async","async"),e.setAttribute("src","//www.google-analytics.com/ga.js"),e.onload=function(){return t.addEventListeners()},document.body.appendChild(e)}},e.prototype.addEventListeners=function(){var t=this;this.container&&(this.listenTo(this.container,g.default.CONTAINER_READY,this.onReady),this.listenTo(this.container,g.default.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,g.default.CONTAINER_STOP,this.onStop),this.listenTo(this.container,g.default.CONTAINER_PAUSE,this.onPause),this.listenTo(this.container,g.default.CONTAINER_ENDED,this.onEnded),this.listenTo(this.container,g.default.CONTAINER_STATE_BUFFERING,this.onBuffering),this.listenTo(this.container,g.default.CONTAINER_STATE_BUFFERFULL,this.onBufferFull),this.listenTo(this.container,g.default.CONTAINER_ERROR,this.onError),this.listenTo(this.container,g.default.CONTAINER_PLAYBACKSTATE,this.onPlaybackChanged),this.listenTo(this.container,g.default.CONTAINER_VOLUME,function(e){return t.onVolumeChanged(e)}),this.listenTo(this.container,g.default.CONTAINER_SEEK,function(e){return t.onSeek(e)}),this.listenTo(this.container,g.default.CONTAINER_FULL_SCREEN,this.onFullscreen),this.listenTo(this.container,g.default.CONTAINER_HIGHDEFINITIONUPDATE,this.onHD),this.listenTo(this.container,g.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.onDVR)),_gaq.push([this.trackerName+"_setAccount",this.account]),this.domainName&&_gaq.push([this.trackerName+"_setDomainName",this.domainName])},e.prototype.onReady=function(){this.push(["Video","Playback",this.container.playback.name])},e.prototype.onPlay=function(){this.push(["Video","Play",this.container.playback.src])},e.prototype.onStop=function(){this.push(["Video","Stop",this.container.playback.src])},e.prototype.onEnded=function(){this.push(["Video","Ended",this.container.playback.src])},e.prototype.onBuffering=function(){this.push(["Video","Buffering",this.container.playback.src])},e.prototype.onBufferFull=function(){this.push(["Video","Bufferfull",this.container.playback.src])},e.prototype.onError=function(){this.push(["Video","Error",this.container.playback.src])},e.prototype.onHD=function(t){var e=t?"ON":"OFF";e!==this.currentHDState&&(this.currentHDState=e,this.push(["Video","HD - "+e,this.container.playback.src]))},e.prototype.onPlaybackChanged=function(t){null!==t.type&&this.push(["Video","Playback Type - "+t.type,this.container.playback.src])},e.prototype.onDVR=function(t){var e=t?"ON":"OFF";this.push(["Interaction","DVR - "+e,this.container.playback.src])},e.prototype.onPause=function(){this.push(["Video","Pause",this.container.playback.src])},e.prototype.onSeek=function(){this.push(["Video","Seek",this.container.playback.src])},e.prototype.onVolumeChanged=function(){this.push(["Interaction","Volume",this.container.playback.src])},e.prototype.onFullscreen=function(){this.push(["Interaction","Fullscreen",this.container.playback.src])},e.prototype.push=function(t){var e=[this.trackerName+"_trackEvent"].concat(t);_gaq.push(e)},e}(h.default);e.default=y,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(195),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(37),h=r(f),p=i(4),g=r(p),y=i(9),v=r(y),m=function(t){function e(i){return(0,a.default)(this,e),(0,s.default)(this,t.call(this,i))}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"click_to_pause"}}]),e.prototype.bindEvents=function(){this.listenTo(this.container,g.default.CONTAINER_CLICK,this.click),this.listenTo(this.container,g.default.CONTAINER_SETTINGSUPDATE,this.settingsUpdate)},e.prototype.click=function(){(this.container.getPlaybackType()!==v.default.LIVE||this.container.isDvrEnabled())&&(this.container.isPlaying()?this.container.pause():this.container.play())},e.prototype.settingsUpdate=function(){this.container.$el.removeClass("pointer-enabled"),(this.container.getPlaybackType()!==v.default.LIVE||this.container.isDvrEnabled())&&this.container.$el.addClass("pointer-enabled")},e}(h.default);e.default=m,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(197),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(38),h=r(f),p=i(8),g=r(p),y=i(9),v=r(y),m=i(7),b=r(m),_=i(4),E=r(_),T=i(198),k=r(T),A=i(199),S=r(A),L=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r.settingsUpdate(),r}return(0,c.default)(e,t),(0,u.default)(e,[{key:"template",get:function(){return(0,g.default)(S.default)}},{key:"name",get:function(){return"dvr_controls"}},{key:"events",get:function(){return{"click .live-button":"click"}}},{key:"attributes",get:function(){return{class:"dvr-controls","data-dvr-controls":""}}}]),e.prototype.bindEvents=function(){this.listenTo(this.core.mediaControl,E.default.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged),this.listenTo(this.core.mediaControl,E.default.MEDIACONTROL_RENDERED,this.settingsUpdate),this.listenTo(this.core,E.default.CORE_OPTIONS_CHANGE,this.render),this.core.getCurrentContainer()&&(this.listenToOnce(this.core.getCurrentContainer(),E.default.CONTAINER_TIMEUPDATE,this.render),this.listenTo(this.core.getCurrentContainer(),E.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.dvrChanged))},e.prototype.containerChanged=function(){this.stopListening(),this.bindEvents()},e.prototype.dvrChanged=function(t){this.settingsUpdate(),this.core.mediaControl.$el.addClass("live"),t?(this.core.mediaControl.$el.addClass("dvr"),this.core.mediaControl.$el.find(".media-control-indicator[data-position], .media-control-indicator[data-duration]").hide()):this.core.mediaControl.$el.removeClass("dvr")},e.prototype.click=function(){var t=this.core.mediaControl,e=t.container;e.isPlaying()||e.play(),t.$el.hasClass("dvr")&&e.seek(e.getDuration())},e.prototype.settingsUpdate=function(){var t=this;this.stopListening(),this.shouldRender()&&(this.render(),this.$el.click(function(){return t.click()})),this.bindEvents()},e.prototype.shouldRender=function(){return(void 0===this.core.options.useDvrControls||!!this.core.options.useDvrControls)&&this.core.getPlaybackType()===v.default.LIVE},e.prototype.render=function(){return this.style=this.style||b.default.getStyleFor(k.default,{baseUrl:this.core.options.baseUrl}),this.$el.html(this.template({live:this.core.i18n.t("live"),backToLive:this.core.i18n.t("back_to_live")})),this.$el.append(this.style),this.shouldRender()&&(this.core.mediaControl.$el.addClass("live"),this.core.mediaControl.$(".media-control-left-panel[data-media-control]").append(this.$el)),this},e}(h.default);e.default=L,t.exports=e.default},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,'.dvr-controls[data-dvr-controls]{display:inline-block;float:left;color:#fff;line-height:32px;font-size:10px;font-weight:700;margin-left:6px}.dvr-controls[data-dvr-controls] .live-info{cursor:default;font-family:Roboto,Open Sans,Arial,sans-serif;text-transform:uppercase}.dvr-controls[data-dvr-controls] .live-info:before{content:"";display:inline-block;position:relative;width:7px;height:7px;border-radius:3.5px;margin-right:3.5px;background-color:#ff0101}.dvr-controls[data-dvr-controls] .live-info.disabled{opacity:.3}.dvr-controls[data-dvr-controls] .live-info.disabled:before{background-color:#fff}.dvr-controls[data-dvr-controls] .live-button{cursor:pointer;outline:none;display:none;border:0;color:#fff;background-color:transparent;height:32px;padding:0;opacity:.7;font-family:Roboto,Open Sans,Arial,sans-serif;text-transform:uppercase;-webkit-transition:all .1s ease;-moz-transition:all .1s ease;transition:all .1s ease}.dvr-controls[data-dvr-controls] .live-button:before{content:"";display:inline-block;position:relative;width:7px;height:7px;border-radius:3.5px;margin-right:3.5px;background-color:#fff}.dvr-controls[data-dvr-controls] .live-button:hover{opacity:1;text-shadow:hsla(0,0%,100%,.75) 0 0 5px}.dvr .dvr-controls[data-dvr-controls] .live-info{display:none}.dvr .dvr-controls[data-dvr-controls] .live-button{display:block}.dvr.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{background-color:#005aff}.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{background-color:#ff0101}',""])},function(t,e){t.exports='<div class="live-info"><%= live %></div>\n<button type="button" class="live-button" aria-label="<%= backToLive %>"><%= backToLive %></button>\n'},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(201),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(38),h=r(f),p=i(8),g=r(p),y=i(7),v=r(y),m=i(4),b=r(m),_=i(202),E=r(_),T=i(203),k=r(T),A=i(204),S=r(A),L=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i)),n=i.options.closedCaptionsConfig;return r._title=n&&n.title?n.title:null,r._ariaLabel=n&&n.ariaLabel?n.ariaLabel:"cc-button",r._labelCb=n&&n.labelCallback&&"function"==typeof n.labelCallback?n.labelCallback:function(t){return t.name},r}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"closed_captions"}},{key:"template",get:function(){return(0,g.default)(S.default)}},{key:"events",get:function(){return{"click [data-cc-button]":"toggleContextMenu","click [data-cc-select]":"onTrackSelect"}}},{key:"attributes",get:function(){return{class:"cc-controls","data-cc-controls":""}}}]),e.prototype.bindEvents=function(){this.listenTo(this.core.mediaControl,b.default.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged),this.listenTo(this.core.mediaControl,b.default.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.core.mediaControl,b.default.MEDIACONTROL_HIDE,this.hideContextMenu),this.container=this.core.getCurrentContainer(),this.container&&(this.listenTo(this.container,b.default.CONTAINER_SUBTITLE_AVAILABLE,this.onSubtitleAvailable),this.listenTo(this.container,b.default.CONTAINER_SUBTITLE_CHANGED,this.onSubtitleChanged),this.listenTo(this.container,b.default.CONTAINER_STOP,this.onContainerStop))},e.prototype.onContainerStop=function(){this.ccAvailable(!1)},e.prototype.containerChanged=function(){this.ccAvailable(!1),this.stopListening(),this.bindEvents()},e.prototype.onSubtitleAvailable=function(){this.renderCcButton(),this.ccAvailable(!0)},e.prototype.onSubtitleChanged=function(t){this.setCurrentContextMenuElement(t.id)},e.prototype.onTrackSelect=function(t){var e=parseInt(t.target.dataset.ccSelect,10);return this.container.closedCaptionsTrackId=e,this.hideContextMenu(),t.stopPropagation(),!1},e.prototype.ccAvailable=function(t){var e=t?"addClass":"removeClass";this.$el[e]("available")},e.prototype.toggleContextMenu=function(){this.$el.find("ul").toggle()},e.prototype.hideContextMenu=function(){this.$el.find("ul").hide()},e.prototype.contextMenuElement=function(t){return this.$el.find("ul a"+(isNaN(t)?"":'[data-cc-select="'+t+'"]')).parent()},e.prototype.setCurrentContextMenuElement=function(t){if(this._trackId!==t){this.contextMenuElement().removeClass("current"),this.contextMenuElement(t).addClass("current");var e=t>-1?"addClass":"removeClass";this.$ccButton[e]("enabled"),this._trackId=t}},e.prototype.renderCcButton=function(){for(var t=this.container?this.container.closedCaptionsTracks:[],e=0;e<t.length;e++)t[e].label=this._labelCb(t[e]);this.$el.html(this.template({ariaLabel:this._ariaLabel,disabledLabel:this.core.i18n.t("disabled"),title:this._title,tracks:t})),this.$ccButton=this.$el.find("button.cc-button[data-cc-button]"),this.$ccButton.append(E.default),this.$el.append(this.style)},e.prototype.render=function(){this.style||(this.style=v.default.getStyleFor(k.default,{baseUrl:this.core.options.baseUrl})),this.renderCcButton();var t=this.core.mediaControl.$el.find("button[data-fullscreen]");return t[0]?this.$el.insertAfter(t):this.core.mediaControl.$el.find(".media-control-right-panel[data-media-control]").prepend(this.$el),this},e}(h.default);e.default=L,t.exports=e.default},function(t,e){t.exports='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 49 41.8" style="enable-background:new 0 0 49 41.8;" xml:space="preserve"><path d="M47.1,0H3.2C1.6,0,0,1.2,0,2.8v31.5C0,35.9,1.6,37,3.2,37h11.9l3.2,1.9l4.7,2.7c0.9,0.5,2-0.1,2-1.1V37h22.1 c1.6,0,1.9-1.1,1.9-2.7V2.8C49,1.2,48.7,0,47.1,0z M7.2,18.6c0-4.8,3.5-9.3,9.9-9.3c4.8,0,7.1,2.7,7.1,2.7l-2.5,4 c0,0-1.7-1.7-4.2-1.7c-2.8,0-4.3,2.1-4.3,4.3c0,2.1,1.5,4.4,4.5,4.4c2.5,0,4.9-2.1,4.9-2.1l2.2,4.2c0,0-2.7,2.9-7.6,2.9 C10.8,27.9,7.2,23.5,7.2,18.6z M36.9,27.9c-6.4,0-9.9-4.4-9.9-9.3c0-4.8,3.5-9.3,9.9-9.3C41.7,9.3,44,12,44,12l-2.5,4 c0,0-1.7-1.7-4.2-1.7c-2.8,0-4.3,2.1-4.3,4.3c0,2.1,1.5,4.4,4.5,4.4c2.5,0,4.9-2.1,4.9-2.1l2.2,4.2C44.5,25,41.9,27.9,36.9,27.9z"></path></svg>'},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,".cc-controls[data-cc-controls]{float:right;position:relative;display:none}.cc-controls[data-cc-controls].available{display:block}.cc-controls[data-cc-controls] .cc-button{padding:6px!important}.cc-controls[data-cc-controls] .cc-button.enabled{display:block;opacity:1}.cc-controls[data-cc-controls] .cc-button.enabled:hover{opacity:1;text-shadow:none}.cc-controls[data-cc-controls]>ul{list-style-type:none;position:absolute;bottom:25px;border:1px solid #000;display:none;background-color:#e6e6e6}.cc-controls[data-cc-controls] li{font-size:10px}.cc-controls[data-cc-controls] li[data-title]{background-color:#c3c2c2;padding:5px}.cc-controls[data-cc-controls] li a{color:#444;padding:2px 10px;display:block;text-decoration:none}.cc-controls[data-cc-controls] li a:hover{background-color:#555;color:#fff}.cc-controls[data-cc-controls] li a:hover a{color:#fff;text-decoration:none}.cc-controls[data-cc-controls] li.current a{color:red}",""])},function(t,e){t.exports='<button type="button" class="cc-button media-control-button media-control-icon" data-cc-button aria-label="<%= ariaLabel %>"></button>\n<ul>\n <% if (title) { %>\n <li data-title><%= title %></li>\n <% }; %>\n <li><a href="#" data-cc-select="-1"><%= disabledLabel %></a></li>\n <% for (var i = 0; i < tracks.length; i++) { %>\n <li><a href="#" data-cc-select="<%= tracks[i].id %>"><%= tracks[i].label %></a></li>\n <% }; %>\n</ul>\n'},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(206),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(30),h=r(f),p=i(4),g=r(p),y=i(6),v=r(y),m=i(58),b=r(m),_=i(76),E=r(_),T=(0,v.default)('link[rel="shortcut icon"]'),k=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r._container=null,r.configure(),r}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"favicon"}},{key:"oldIcon",get:function(){return T}}]),e.prototype.configure=function(){this.core.options.changeFavicon?this.enabled||(this.stopListening(this.core,g.default.CORE_OPTIONS_CHANGE),this.enable()):this.enabled&&(this.disable(),this.listenTo(this.core,g.default.CORE_OPTIONS_CHANGE,this.configure))},e.prototype.bindEvents=function(){this.listenTo(this.core,g.default.CORE_OPTIONS_CHANGE,this.configure),this.listenTo(this.core.mediaControl,g.default.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged),this.core.mediaControl.container&&this.containerChanged()},e.prototype.containerChanged=function(){this._container&&this.stopListening(this._container),this._container=this.core.mediaControl.container,this.listenTo(this._container,g.default.CONTAINER_PLAY,this.setPlayIcon),this.listenTo(this._container,g.default.CONTAINER_PAUSE,this.setPauseIcon),this.listenTo(this._container,g.default.CONTAINER_STOP,this.resetIcon),this.listenTo(this._container,g.default.CONTAINER_ENDED,this.resetIcon),this.listenTo(this._container,g.default.CONTAINER_ERROR,this.resetIcon),this.resetIcon()},e.prototype.disable=function(){t.prototype.disable.call(this),this.resetIcon()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.resetIcon()},e.prototype.createIcon=function(t){var e=(0,v.default)("<canvas/>");e[0].width=16,e[0].height=16;var i=e[0].getContext("2d");i.fillStyle="#000";var r=(0,v.default)(t).find("path").attr("d"),n=new Path2D(r);i.fill(n);var a=(0,v.default)('<link rel="shortcut icon" type="image/png"/>');return a.attr("href",e[0].toDataURL("image/png")),a},e.prototype.setPlayIcon=function(){this.playIcon||(this.playIcon=this.createIcon(b.default)),this.changeIcon(this.playIcon)},e.prototype.setPauseIcon=function(){this.pauseIcon||(this.pauseIcon=this.createIcon(E.default)),this.changeIcon(this.pauseIcon)},e.prototype.resetIcon=function(){(0,v.default)('link[rel="shortcut icon"]').remove(),(0,v.default)("head").append(this.oldIcon)},e.prototype.changeIcon=function(t){t&&((0,v.default)('link[rel="shortcut icon"]').remove(),(0,v.default)("head").append(t))},e}(h.default);e.default=k,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(208),n=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=n.default,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(1),s=r(o),l=i(3),u=r(l),d=i(2),c=r(d),f=i(5),h=i(38),p=r(h),g=i(7),y=r(g),v=i(8),m=r(v),b=i(4),_=r(b),E=i(9),T=r(E),k=i(209),A=r(k),S=i(210),L=r(S),R=function(t){function e(i){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r.hoveringOverSeekBar=!1,r.hoverPosition=null,r.duration=null,r.actualLiveTime=!!r.mediaControl.options.actualLiveTime,r.actualLiveTime&&(r.mediaControl.options.actualLiveServerTime?r.actualLiveServerTimeDiff=(new Date).getTime()-new Date(r.mediaControl.options.actualLiveServerTime).getTime():r.actualLiveServerTimeDiff=0),r}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"seek_time"}},{key:"template",get:function(){return(0,m.default)(L.default)}},{key:"attributes",get:function(){return{class:"seek-time","data-seek-time":""}}},{key:"mediaControl",get:function(){return this.core.mediaControl}},{key:"mediaControlContainer",get:function(){return this.mediaControl.container}},{key:"isLiveStreamWithDvr",get:function(){return this.mediaControlContainer&&this.mediaControlContainer.getPlaybackType()===T.default.LIVE&&this.mediaControlContainer.isDvrEnabled()}},{key:"durationShown",get:function(){return this.isLiveStreamWithDvr&&!this.useActualLiveTime}},{key:"useActualLiveTime",get:function(){return this.actualLiveTime&&this.isLiveStreamWithDvr}}]),e.prototype.bindEvents=function(){this.listenTo(this.mediaControl,_.default.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.mediaControl,_.default.MEDIACONTROL_MOUSEMOVE_SEEKBAR,this.showTime),this.listenTo(this.mediaControl,_.default.MEDIACONTROL_MOUSELEAVE_SEEKBAR,this.hideTime),this.listenTo(this.mediaControl,_.default.MEDIACONTROL_CONTAINERCHANGED,this.onContainerChanged),this.mediaControlContainer&&(this.listenTo(this.mediaControlContainer,_.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.update),this.listenTo(this.mediaControlContainer,_.default.CONTAINER_TIMEUPDATE,this.updateDuration))},e.prototype.onContainerChanged=function(){this.stopListening(),this.bindEvents()},e.prototype.updateDuration=function(t){this.duration=t.total,this.update()},e.prototype.showTime=function(t){this.hoveringOverSeekBar=!0,this.calculateHoverPosition(t),this.update()},e.prototype.hideTime=function(){this.hoveringOverSeekBar=!1,this.update()},e.prototype.calculateHoverPosition=function(t){var e=t.pageX-this.mediaControl.$seekBarContainer.offset().left;this.hoverPosition=Math.min(1,Math.max(e/this.mediaControl.$seekBarContainer.width(),0))},e.prototype.getSeekTime=function(){var t=void 0,e=void 0;if(this.useActualLiveTime){var i=new Date((new Date).getTime()-this.actualLiveServerTimeDiff);e=(new Date(i)-i.setHours(0,0,0,0))/1e3,t=e-this.duration+this.hoverPosition*this.duration,t<0&&(t+=86400)}else t=this.hoverPosition*this.duration;return{seekTime:t,secondsSinceMidnight:e}},e.prototype.update=function(){if(this.rendered)if(this.shouldBeVisible()){var t=this.getSeekTime(),e=(0,f.formatTime)(t.seekTime,this.useActualLiveTime);if(e!==this.displayedSeekTime&&(this.$seekTimeEl.text(e),this.displayedSeekTime=e),this.durationShown){this.$durationEl.show();var i=(0,f.formatTime)(this.actualLiveTime?t.secondsSinceMidnight:this.duration,this.actualLiveTime);i!==this.displayedDuration&&(this.$durationEl.text(i),this.displayedDuration=i)}else this.$durationEl.hide();this.$el.show();var r=this.mediaControl.$seekBarContainer.width(),n=this.$el.width(),a=this.hoverPosition*r;a-=n/2,a=Math.max(0,Math.min(a,r-n)),this.$el.css("left",a)}else this.$el.hide(),this.$el.css("left","-100%")},e.prototype.shouldBeVisible=function(){return this.mediaControlContainer&&this.mediaControlContainer.settings.seekEnabled&&this.hoveringOverSeekBar&&null!==this.hoverPosition&&null!==this.duration},e.prototype.render=function(){this.rendered=!0,this.displayedDuration=null,this.displayedSeekTime=null;var t=y.default.getStyleFor(A.default);this.$el.html(this.template()),this.$el.append(t),this.$el.hide(),this.mediaControl.$el.append(this.el),this.$seekTimeEl=this.$el.find("[data-seek-time]"),this.$durationEl=this.$el.find("[data-duration]"),this.$durationEl.hide(),this.update()},e}(p.default);e.default=R,t.exports=e.default},function(t,e,i){e=t.exports=i(10)(void 0),e.push([t.i,'.seek-time[data-seek-time]{position:absolute;white-space:nowrap;height:20px;line-height:20px;font-size:0;left:-100%;bottom:55px;background-color:rgba(2,2,2,.5);z-index:9999;-webkit-transition:opacity .1s ease;-moz-transition:opacity .1s ease;transition:opacity .1s ease}.seek-time[data-seek-time].hidden[data-seek-time]{opacity:0}.seek-time[data-seek-time] [data-seek-time]{display:inline-block;color:#fff;font-size:10px;padding-left:7px;padding-right:7px;vertical-align:top}.seek-time[data-seek-time] [data-duration]{display:inline-block;color:hsla(0,0%,100%,.5);font-size:10px;padding-right:7px;vertical-align:top}.seek-time[data-seek-time] [data-duration]:before{content:"|";margin-right:7px}',""])},function(t,e){t.exports="<span data-seek-time></span>\n<span data-duration></span>\n"},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(3),s=r(o),l=i(1),u=r(l),d=i(2),c=r(d),f=i(30),h=r(f),p=i(4),g=r(p),y=function(t){function e(){return(0,a.default)(this,e),(0,u.default)(this,t.apply(this,arguments))}return(0,c.default)(e,t),e.prototype.bindEvents=function(){this.listenTo(this.core,g.default.CORE_CONTAINERS_CREATED,this.onContainersCreated)},e.prototype.onContainersCreated=function(){var t=this.core.containers.filter(function(t){return"no_op"!==t.playback.name})[0]||this.core.containers[0];t&&this.core.containers.forEach(function(e){e!==t&&e.destroy()})},(0,s.default)(e,[{key:"name",get:function(){return"sources"}}]),e}(h.default);e.default=y,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=r(n),o=i(3),s=r(o),l=i(1),u=r(l),d=i(2),c=r(d),f=i(4),h=r(f),p=i(30),g=r(p),y=i(5),v=function(t){function e(){return(0,a.default)(this,e),(0,u.default)(this,t.apply(this,arguments))}return(0,c.default)(e,t),e.prototype.bindEvents=function(){this.listenTo(this.core.mediaControl,h.default.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged);var t=this.core.getCurrentContainer();t&&(this.listenTo(t,h.default.CONTAINER_ENDED,this.ended),this.listenTo(t,h.default.CONTAINER_STOP,this.ended))},e.prototype.containerChanged=function(){this.stopListening(),this.bindEvents()},e.prototype.ended=function(){(void 0===this.core.options.exitFullscreenOnEnd||this.core.options.exitFullscreenOnEnd)&&y.Fullscreen.isFullscreen()&&this.core.toggleFullscreen()},(0,s.default)(e,[{key:"name",get:function(){return"end_video"}}]),e}(g.default);e.default=v,t.exports=e.default},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(31),a=r(n),o=i(0),s=r(o),l=i(1),u=r(l),d=i(3),c=r(d),f=i(2),h=r(f),p=i(5),g=i(6),y=r(g),v=i(30),m=r(v),b=function(t){function e(i){(0,s.default)(this,e);var r=(0,u.default)(this,t.call(this,i));return r._initializeMessages(),r}return(0,h.default)(e,t),(0,c.default)(e,[{key:"name",get:function(){return"strings"}}]),e.prototype.t=function(t){var e=this._language();return(e&&this._messages[e]||this._messages.en)[t]||t},e.prototype._language=function(){return this.core.options.language||(0,p.getBrowserLanguage)()},e.prototype._initializeMessages=function(){var t={en:{live:"live",back_to_live:"back to live",disabled:"Disabled",playback_not_supported:"Your browser does not support the playback of this video. Please try using a different browser."},pt:{live:"ao vivo",back_to_live:"voltar para o ao vivo",disabled:"Desativado",playback_not_supported:"Seu navegador não supporta a reprodução deste video. Por favor, tente usar um navegador diferente."},es:{live:"vivo",back_to_live:"volver en vivo",disabled:"Discapacitado",playback_not_supported:"Su navegador no soporta la reproducción de un video. Por favor, trate de usar un navegador diferente."},ru:{live:"прямой эфир",back_to_live:"к прямому эфиру",disabled:"Отключено",playback_not_supported:"Ваш браузер не поддерживает воспроизведение этого видео. Пожалуйста, попробуйте другой браузер."},fr:{live:"en direct",disabled:"Désactivé",back_to_live:"retour au direct",playback_not_supported:"Votre navigateur ne supporte pas la lecture de cette vidéo. Merci de tenter sur un autre navigateur."},tr:{live:"canlı",back_to_live:"canlı yayına dön",disabled:"Engelli",playback_not_supported:"Tarayıcınız bu videoyu oynatma desteğine sahip değil. Lütfen farklı bir tarayıcı ile deneyin."}},e=this.core.options.strings||{};this._messages=(0,a.default)(t).reduce(function(i,r){return i[r]=y.default.extend({},t[r],e[r]),i},{}),this._messages["pt-BR"]=this._messages.pt,this._messages["en-US"]=this._messages.en,this._messages["es-419"]=this._messages.es,this._messages["fr-FR"]=this._messages.fr,this._messages["tr-TR"]=this._messages.tr},e}(m.default);e.default=b,t.exports=e.default}])}); \ No newline at end of file
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Clappr=e():t.Clappr=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=88)}([function(t,e,i){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,i){"use strict";e.__esModule=!0;var n=i(33),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,r.default)(e))&&"function"!=typeof e?t:e}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=i(120),a=n(r),o=i(71),s=n(o),l=i(33),u=n(l);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,u.default)(e)));t.prototype=(0,s.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(a.default?(0,a.default)(t,e):t.__proto__=e)}},function(t,e,i){"use strict";e.__esModule=!0;var n=i(70),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,r.default)(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}()},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(31),a=n(r),o=i(0),s=n(o),l=i(33),u=n(l),c=i(55),d=n(c),h=i(5),f=Array.prototype.slice,p=/\s+/,g=function(t,e,i,n){if(!i)return!0;if("object"===(void 0===i?"undefined":(0,u.default)(i))){for(var r in i)t[e].apply(t,[r,i[r]].concat(n));return!1}if(p.test(i)){for(var a=i.split(p),o=0,s=a.length;o<s;o++)t[e].apply(t,[a[o]].concat(n));return!1}return!0},y=function(t,e,i,n){function r(){try{switch(e.length){case 0:for(;++o<s;)(a=t[o]).callback.call(a.ctx);return;case 1:for(;++o<s;)(a=t[o]).callback.call(a.ctx,l);return;case 2:for(;++o<s;)(a=t[o]).callback.call(a.ctx,l,u);return;case 3:for(;++o<s;)(a=t[o]).callback.call(a.ctx,l,u,c);return;default:for(;++o<s;)(a=t[o]).callback.apply(a.ctx,e);return}}catch(t){d.default.error.apply(d.default,[i,"error on event",n,"trigger","-",t]),r()}}var a=void 0,o=-1,s=t.length,l=e[0],u=e[1],c=e[2];r()},m=function(){function t(){(0,s.default)(this,t)}return t.prototype.on=function(t,e,i){return g(this,"on",t,[e,i])&&e?(this._events||(this._events={}),(this._events[t]||(this._events[t]=[])).push({callback:e,context:i,ctx:i||this}),this):this},t.prototype.once=function(t,e,i){var n=this,r=void 0;if(!g(this,"once",t,[e,i])||!e)return this;var a=function(){return n.off(t,r)};return r=function(){a(),e.apply(this,arguments)},this.on(t,r,i)},t.prototype.off=function(t,e,i){var n=void 0,r=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=void 0,d=void 0;if(!this._events||!g(this,"off",t,[e,i]))return this;if(!t&&!e&&!i)return this._events=void 0,this;for(s=t?[t]:(0,a.default)(this._events),l=0,u=s.length;l<u;l++)if(t=s[l],o=this._events[t]){if(this._events[t]=n=[],e||i)for(c=0,d=o.length;c<d;c++)r=o[c],(e&&e!==r.callback&&e!==r.callback._callback||i&&i!==r.context)&&n.push(r);n.length||delete this._events[t]}return this},t.prototype.trigger=function(t){var e=this.name||this.constructor.name;if(d.default.debug.apply(d.default,[e].concat(Array.prototype.slice.call(arguments))),!this._events)return this;var i=f.call(arguments,1);if(!g(this,"trigger",t,i))return this;var n=this._events[t],r=this._events.all;return n&&y(n,i,e,t),r&&y(r,arguments,e,t),this},t.prototype.stopListening=function(t,e,i){var n=this._listeningTo;if(!n)return this;var r=!e&&!i;i||"object"!==(void 0===e?"undefined":(0,u.default)(e))||(i=this),t&&((n={})[t._listenId]=t);for(var o in n)t=n[o],t.off(e,i,this),(r||0===(0,a.default)(t._events).length)&&delete this._listeningTo[o];return this},t.register=function(e){t.Custom||(t.Custom={});var i="string"==typeof e&&e.toUpperCase().trim();i&&!t.Custom[i]?t.Custom[i]=i.toLowerCase().split("_").map(function(t,e){return 0===e?t:t=t[0].toUpperCase()+t.slice(1)}).join(""):d.default.error("Events","Error when register event: "+e)},t.listAvailableCustomEvents=function(){return t.Custom||(t.Custom={}),(0,a.default)(t.Custom).filter(function(e){return"string"==typeof t.Custom[e]})},t}();e.default=m;var v={listenTo:"on",listenToOnce:"once"};(0,a.default)(v).forEach(function(t){m.prototype[t]=function(e,i,n){return(this._listeningTo||(this._listeningTo={}))[e._listenId||(e._listenId=(0,h.uniqueId)("l"))]=e,n||"object"!==(void 0===i?"undefined":(0,u.default)(i))||(n=this),e[v[t]](i,n,this),this}}),m.PLAYER_READY="ready",m.PLAYER_RESIZE="resize",m.PLAYER_FULLSCREEN="fullscreen",m.PLAYER_PLAY="play",m.PLAYER_PAUSE="pause",m.PLAYER_STOP="stop",m.PLAYER_ENDED="ended",m.PLAYER_SEEK="seek",m.PLAYER_ERROR="error",m.PLAYER_TIMEUPDATE="timeupdate",m.PLAYER_VOLUMEUPDATE="volumeupdate",m.PLAYER_SUBTITLE_AVAILABLE="subtitleavailable",m.PLAYBACK_PROGRESS="playback:progress",m.PLAYBACK_TIMEUPDATE="playback:timeupdate",m.PLAYBACK_READY="playback:ready",m.PLAYBACK_BUFFERING="playback:buffering",m.PLAYBACK_BUFFERFULL="playback:bufferfull",m.PLAYBACK_SETTINGSUPDATE="playback:settingsupdate",m.PLAYBACK_LOADEDMETADATA="playback:loadedmetadata",m.PLAYBACK_HIGHDEFINITIONUPDATE="playback:highdefinitionupdate",m.PLAYBACK_BITRATE="playback:bitrate",m.PLAYBACK_LEVELS_AVAILABLE="playback:levels:available",m.PLAYBACK_LEVEL_SWITCH_START="playback:levels:switch:start",m.PLAYBACK_LEVEL_SWITCH_END="playback:levels:switch:end",m.PLAYBACK_PLAYBACKSTATE="playback:playbackstate",m.PLAYBACK_DVR="playback:dvr",m.PLAYBACK_MEDIACONTROL_DISABLE="playback:mediacontrol:disable",m.PLAYBACK_MEDIACONTROL_ENABLE="playback:mediacontrol:enable",m.PLAYBACK_ENDED="playback:ended",m.PLAYBACK_PLAY_INTENT="playback:play:intent",m.PLAYBACK_PLAY="playback:play",m.PLAYBACK_PAUSE="playback:pause",m.PLAYBACK_SEEKED="playback:seeked",m.PLAYBACK_STOP="playback:stop",m.PLAYBACK_ERROR="playback:error",m.PLAYBACK_STATS_ADD="playback:stats:add",m.PLAYBACK_FRAGMENT_LOADED="playback:fragment:loaded",m.PLAYBACK_LEVEL_SWITCH="playback:level:switch",m.PLAYBACK_SUBTITLE_AVAILABLE="playback:subtitle:available",m.PLAYBACK_SUBTITLE_CHANGED="playback:subtitle:changed",m.CORE_CONTAINERS_CREATED="core:containers:created",m.CORE_OPTIONS_CHANGE="core:options:change",m.CORE_READY="core:ready",m.CORE_FULLSCREEN="core:fullscreen",m.CORE_SCREEN_ORIENTATION_CHANGED="core:screen:orientation:changed",m.CONTAINER_PLAYBACKSTATE="container:playbackstate",m.CONTAINER_PLAYBACKDVRSTATECHANGED="container:dvr",m.CONTAINER_BITRATE="container:bitrate",m.CONTAINER_STATS_REPORT="container:stats:report",m.CONTAINER_DESTROYED="container:destroyed",m.CONTAINER_READY="container:ready",m.CONTAINER_ERROR="container:error",m.CONTAINER_LOADEDMETADATA="container:loadedmetadata",m.CONTAINER_SUBTITLE_AVAILABLE="container:subtitle:available",m.CONTAINER_SUBTITLE_CHANGED="container:subtitle:changed",m.CONTAINER_TIMEUPDATE="container:timeupdate",m.CONTAINER_PROGRESS="container:progress",m.CONTAINER_PLAY="container:play",m.CONTAINER_STOP="container:stop",m.CONTAINER_PAUSE="container:pause",m.CONTAINER_ENDED="container:ended",m.CONTAINER_CLICK="container:click",m.CONTAINER_DBLCLICK="container:dblclick",m.CONTAINER_CONTEXTMENU="container:contextmenu",m.CONTAINER_MOUSE_ENTER="container:mouseenter",m.CONTAINER_MOUSE_LEAVE="container:mouseleave",m.CONTAINER_SEEK="container:seek",m.CONTAINER_SEEKED="container:seeked",m.CONTAINER_VOLUME="container:volume",m.CONTAINER_FULLSCREEN="container:fullscreen",m.CONTAINER_STATE_BUFFERING="container:state:buffering",m.CONTAINER_STATE_BUFFERFULL="container:state:bufferfull",m.CONTAINER_SETTINGSUPDATE="container:settingsupdate",m.CONTAINER_HIGHDEFINITIONUPDATE="container:highdefinitionupdate",m.CONTAINER_MEDIACONTROL_SHOW="container:mediacontrol:show",m.CONTAINER_MEDIACONTROL_HIDE="container:mediacontrol:hide",m.CONTAINER_MEDIACONTROL_DISABLE="container:mediacontrol:disable",m.CONTAINER_MEDIACONTROL_ENABLE="container:mediacontrol:enable",m.CONTAINER_STATS_ADD="container:stats:add",m.CONTAINER_OPTIONS_CHANGE="container:options:change",m.MEDIACONTROL_RENDERED="mediacontrol:rendered",m.MEDIACONTROL_FULLSCREEN="mediacontrol:fullscreen",m.MEDIACONTROL_SHOW="mediacontrol:show",m.MEDIACONTROL_HIDE="mediacontrol:hide",m.MEDIACONTROL_MOUSEMOVE_SEEKBAR="mediacontrol:mousemove:seekbar",m.MEDIACONTROL_MOUSELEAVE_SEEKBAR="mediacontrol:mouseleave:seekbar",m.MEDIACONTROL_PLAYING="mediacontrol:playing",m.MEDIACONTROL_NOTPLAYING="mediacontrol:notplaying",m.MEDIACONTROL_CONTAINERCHANGED="mediacontrol:containerchanged",t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(e)for(var i in e){var n=(0,L.default)(e,i);n?(0,A.default)(t,i,n):t[i]=e[i]}return t}function a(t,e){var i=function(t){function i(){(0,m.default)(this,i);for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];var o=(0,b.default)(this,t.call.apply(t,[this].concat(r)));return e.initialize&&e.initialize.apply(o,r),o}return(0,E.default)(i,t),i}(t);return r(i.prototype,e),i}function o(t,e){if(!isFinite(t))return"--:--";t*=1e3,t=parseInt(t/1e3);var i=t%60;t=parseInt(t/60);var n=t%60;t=parseInt(t/60);var r=t%24,a=parseInt(t/24),o="";return a&&a>0&&(o+=a+":",r<1&&(o+="00:")),(r&&r>0||e)&&(o+=("0"+r).slice(-2)+":"),o+=("0"+n).slice(-2)+":",o+=("0"+i).slice(-2),o.trim()}function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"t",e=0,i=O.params[t]||O.hashParams[t]||"",n=i.match(/[0-9]+[hms]+/g)||[];return n.length>0?function(){var t={h:3600,m:60,s:1};n.forEach(function(i){if(i){var n=i[i.length-1],r=parseInt(i.slice(0,i.length-1),10);e+=r*t[n]}})}():i&&(e=parseInt(i,10)),e}function l(t){return P[t]||(P[t]=0),t+ ++P[t]}function u(t){return t-parseFloat(t)+1>=0}function c(){var t=document.getElementsByTagName("script");return t.length?t[t.length-1].src:""}function d(){return window.navigator&&window.navigator.language}function h(){return window.performance&&window.performance.now?performance.now():Date.now()}function f(t,e){var i=t.indexOf(e);i>=0&&t.splice(i,1)}Object.defineProperty(e,"__esModule",{value:!0}),e.DomRecycler=e.cancelAnimationFrame=e.requestAnimationFrame=e.QueryString=e.Config=e.Fullscreen=void 0;var p=i(3),g=n(p),y=i(0),m=n(y),v=i(1),b=n(v),_=i(2),E=n(_),T=i(70),A=n(T),S=i(126),L=n(S);e.extend=a,e.formatTime=o,e.seekStringToSeconds=s,e.uniqueId=l,e.isNumber=u,e.currentScriptUrl=c,e.getBrowserLanguage=d,e.now=h,e.removeArrayItem=f,i(129);var R=i(13),k=n(R),w=i(6),C=n(w),I=e.Fullscreen={isFullscreen:function(){return!!(document.webkitFullscreenElement||document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)},requestFullscreen:function(t){t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen?t.msRequestFullscreen():t.querySelector&&t.querySelector("video")&&t.querySelector("video").webkitEnterFullScreen?t.querySelector("video").webkitEnterFullScreen():t.webkitEnterFullScreen&&t.webkitEnterFullScreen()},cancelFullscreen:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;t.exitFullscreen?t.exitFullscreen():t.webkitCancelFullScreen?t.webkitCancelFullScreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen()},fullscreenEnabled:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},D=e.Config=function(){function t(){(0,m.default)(this,t)}return t._defaultConfig=function(){return{volume:{value:100,parse:parseInt}}},t._defaultValueFor=function(t){try{return this._defaultConfig()[t].parse(this._defaultConfig()[t].value)}catch(t){return}},t._createKeyspace=function(t){return"clappr."+document.domain+"."+t},t.restore=function(t){return k.default.hasLocalstorage&&localStorage[this._createKeyspace(t)]?this._defaultConfig()[t].parse(localStorage[this._createKeyspace(t)]):this._defaultValueFor(t)},t.persist=function(t,e){if(k.default.hasLocalstorage)try{return localStorage[this._createKeyspace(t)]=e,!0}catch(t){return!1}},t}(),O=e.QueryString=function(){function t(){(0,m.default)(this,t)}return t.parse=function(t){for(var e=void 0,i=/\+/g,n=/([^&=]+)=?([^&]*)/g,r=function(t){return decodeURIComponent(t.replace(i," "))},a={};e=n.exec(t);)a[r(e[1]).toLowerCase()]=r(e[2]);return a},(0,g.default)(t,null,[{key:"params",get:function(){var t=window.location.search.substring(1);return t!==this.query&&(this._urlParams=this.parse(t),this.query=t),this._urlParams}},{key:"hashParams",get:function(){var t=window.location.hash.substring(1);return t!==this.hash&&(this._hashParams=this.parse(t),this.hash=t),this._hashParams}}]),t}(),P={},x=e.requestAnimationFrame=(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}).bind(window),N=e.cancelAnimationFrame=(window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout).bind(window),M=[],F=e.DomRecycler=function(){function t(){(0,m.default)(this,t)}return t.configure=function(t){this.options=C.default.extend(this.options,t)},t.create=function(t){return this.options.recycleVideo&&"video"===t&&M.length>0?M.shift():(0,C.default)("<"+t+">")},t.garbage=function(t){this.options.recycleVideo&&"VIDEO"===t[0].tagName.toUpperCase()&&(t.children().remove(),M.push(t))},t}();F.options={recycleVideo:!1},e.default={Config:D,Fullscreen:I,QueryString:O,DomRecycler:F,extend:a,formatTime:o,seekStringToSeconds:s,uniqueId:l,currentScriptUrl:c,isNumber:u,requestAnimationFrame:x,cancelAnimationFrame:N,getBrowserLanguage:d,now:h,removeArrayItem:f}},function(t,e){var i=function(){function t(t){return null==t?String(t):W[q.call(t)]||"object"}function e(e){return"function"==t(e)}function i(t){return null!=t&&t==t.window}function n(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function r(e){return"object"==t(e)}function a(t){return r(t)&&!i(t)&&Object.getPrototypeOf(t)==Object.prototype}function o(t){var e=!!t&&"length"in t&&t.length,n=S.type(t);return"function"!=n&&!i(t)&&("array"==n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function s(t){return I.call(t,function(t){return null!=t})}function l(t){return t.length>0?S.fn.concat.apply([],t):t}function u(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function c(t){return t in x?x[t]:x[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function d(t,e){return"number"!=typeof e||N[u(t)]?e:e+"px"}function h(t){var e,i;return P[t]||(e=O.createElement(t),O.body.appendChild(e),i=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==i&&(i="block"),P[t]=i),P[t]}function f(t){return"children"in t?D.call(t.children):S.map(t.childNodes,function(t){if(1==t.nodeType)return t})}function p(t,e){var i,n=t?t.length:0;for(i=0;i<n;i++)this[i]=t[i];this.length=n,this.selector=e||""}function g(t,e,i){for(A in e)i&&(a(e[A])||Q(e[A]))?(a(e[A])&&!a(t[A])&&(t[A]={}),Q(e[A])&&!Q(t[A])&&(t[A]=[]),g(t[A],e[A],i)):e[A]!==T&&(t[A]=e[A])}function y(t,e){return null==e?S(t):S(t).filter(e)}function m(t,i,n,r){return e(i)?i.call(t,n,r):i}function v(t,e,i){null==i?t.removeAttribute(e):t.setAttribute(e,i)}function b(t,e){var i=t.className||"",n=i&&i.baseVal!==T;if(e===T)return n?i.baseVal:i;n?i.baseVal=e:t.className=e}function _(t){try{return t?"true"==t||"false"!=t&&("null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?S.parseJSON(t):t):t}catch(e){return t}}function E(t,e){e(t);for(var i=0,n=t.childNodes.length;i<n;i++)E(t.childNodes[i],e)}var T,A,S,L,R,k,w=[],C=w.concat,I=w.filter,D=w.slice,O=window.document,P={},x={},N={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},M=/^\s*<(\w+|!)[^>]*>/,F=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,B=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,U=/^(?:body|html)$/i,G=/([A-Z])/g,K=["val","css","html","text","data","width","height","offset"],V=["after","prepend","before","append"],j=O.createElement("table"),Y=O.createElement("tr"),H={tr:O.createElement("tbody"),tbody:j,thead:j,tfoot:j,td:Y,th:Y,"*":O.createElement("div")},$=/complete|loaded|interactive/,z=/^[\w-]*$/,W={},q=W.toString,X={},Z=O.createElement("div"),J={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Q=Array.isArray||function(t){return t instanceof Array};return X.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var i=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(i)return i.call(t,e);var n,r=t.parentNode,a=!r;return a&&(r=Z).appendChild(t),n=~X.qsa(r,e).indexOf(t),a&&Z.removeChild(t),n},R=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},k=function(t){return I.call(t,function(e,i){return t.indexOf(e)==i})},X.fragment=function(t,e,i){var n,r,o;return F.test(t)&&(n=S(O.createElement(RegExp.$1))),n||(t.replace&&(t=t.replace(B,"<$1></$2>")),e===T&&(e=M.test(t)&&RegExp.$1),e in H||(e="*"),o=H[e],o.innerHTML=""+t,n=S.each(D.call(o.childNodes),function(){o.removeChild(this)})),a(i)&&(r=S(n),S.each(i,function(t,e){K.indexOf(t)>-1?r[t](e):r.attr(t,e)})),n},X.Z=function(t,e){return new p(t,e)},X.isZ=function(t){return t instanceof X.Z},X.init=function(t,i){var n;if(!t)return X.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&M.test(t))n=X.fragment(t,RegExp.$1,i),t=null;else{if(i!==T)return S(i).find(t);n=X.qsa(O,t)}else{if(e(t))return S(O).ready(t);if(X.isZ(t))return t;if(Q(t))n=s(t);else if(r(t))n=[t],t=null;else if(M.test(t))n=X.fragment(t.trim(),RegExp.$1,i),t=null;else{if(i!==T)return S(i).find(t);n=X.qsa(O,t)}}return X.Z(n,t)},S=function(t,e){return X.init(t,e)},S.extend=function(t){var e,i=D.call(arguments,1);return"boolean"==typeof t&&(e=t,t=i.shift()),i.forEach(function(i){g(t,i,e)}),t},X.qsa=function(t,e){var i,n="#"==e[0],r=!n&&"."==e[0],a=n||r?e.slice(1):e,o=z.test(a);return t.getElementById&&o&&n?(i=t.getElementById(a))?[i]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:D.call(o&&!n&&t.getElementsByClassName?r?t.getElementsByClassName(a):t.getElementsByTagName(e):t.querySelectorAll(e))},S.contains=O.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},S.type=t,S.isFunction=e,S.isWindow=i,S.isArray=Q,S.isPlainObject=a,S.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},S.isNumeric=function(t){var e=Number(t),i=typeof t;return null!=t&&"boolean"!=i&&("string"!=i||t.length)&&!isNaN(e)&&isFinite(e)||!1},S.inArray=function(t,e,i){return w.indexOf.call(e,t,i)},S.camelCase=R,S.trim=function(t){return null==t?"":String.prototype.trim.call(t)},S.uuid=0,S.support={},S.expr={},S.noop=function(){},S.map=function(t,e){var i,n,r,a=[];if(o(t))for(n=0;n<t.length;n++)null!=(i=e(t[n],n))&&a.push(i);else for(r in t)null!=(i=e(t[r],r))&&a.push(i);return l(a)},S.each=function(t,e){var i,n;if(o(t)){for(i=0;i<t.length;i++)if(!1===e.call(t[i],i,t[i]))return t}else for(n in t)if(!1===e.call(t[n],n,t[n]))return t;return t},S.grep=function(t,e){return I.call(t,e)},window.JSON&&(S.parseJSON=JSON.parse),S.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){W["[object "+e+"]"]=e.toLowerCase()}),S.fn={constructor:X.Z,length:0,forEach:w.forEach,reduce:w.reduce,push:w.push,sort:w.sort,splice:w.splice,indexOf:w.indexOf,concat:function(){var t,e,i=[];for(t=0;t<arguments.length;t++)e=arguments[t],i[t]=X.isZ(e)?e.toArray():e;return C.apply(X.isZ(this)?this.toArray():this,i)},map:function(t){return S(S.map(this,function(e,i){return t.call(e,i,e)}))},slice:function(){return S(D.apply(this,arguments))},ready:function(t){return $.test(O.readyState)&&O.body?t(S):O.addEventListener("DOMContentLoaded",function(){t(S)},!1),this},get:function(t){return t===T?D.call(this):this[t>=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return w.every.call(this,function(e,i){return!1!==t.call(e,i,e)}),this},filter:function(t){return e(t)?this.not(this.not(t)):S(I.call(this,function(e){return X.matches(e,t)}))},add:function(t,e){return S(k(this.concat(S(t,e))))},is:function(t){return this.length>0&&X.matches(this[0],t)},not:function(t){var i=[];if(e(t)&&t.call!==T)this.each(function(e){t.call(this,e)||i.push(this)});else{var n="string"==typeof t?this.filter(t):o(t)&&e(t.item)?D.call(t):S(t);this.forEach(function(t){n.indexOf(t)<0&&i.push(t)})}return S(i)},has:function(t){return this.filter(function(){return r(t)?S.contains(this,t):S(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!r(t)?t:S(t)},last:function(){var t=this[this.length-1];return t&&!r(t)?t:S(t)},find:function(t){var e=this;return t?"object"==typeof t?S(t).filter(function(){var t=this;return w.some.call(e,function(e){return S.contains(e,t)})}):1==this.length?S(X.qsa(this[0],t)):this.map(function(){return X.qsa(this,t)}):S()},closest:function(t,e){var i=[],r="object"==typeof t&&S(t);return this.each(function(a,o){for(;o&&!(r?r.indexOf(o)>=0:X.matches(o,t));)o=o!==e&&!n(o)&&o.parentNode;o&&i.indexOf(o)<0&&i.push(o)}),S(i)},parents:function(t){for(var e=[],i=this;i.length>0;)i=S.map(i,function(t){if((t=t.parentNode)&&!n(t)&&e.indexOf(t)<0)return e.push(t),t});return y(e,t)},parent:function(t){return y(k(this.pluck("parentNode")),t)},children:function(t){return y(this.map(function(){return f(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||D.call(this.childNodes)})},siblings:function(t){return y(this.map(function(t,e){return I.call(f(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return S.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=h(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var i=e(t);if(this[0]&&!i)var n=S(t).get(0),r=n.parentNode||this.length>1;return this.each(function(e){S(this).wrapAll(i?t.call(this,e):r?n.cloneNode(!0):n)})},wrapAll:function(t){if(this[0]){S(this[0]).before(t=S(t));for(var e;(e=t.children()).length;)t=e.first();S(t).append(this)}return this},wrapInner:function(t){var i=e(t);return this.each(function(e){var n=S(this),r=n.contents(),a=i?t.call(this,e):t;r.length?r.wrapAll(a):n.append(a)})},unwrap:function(){return this.parent().each(function(){S(this).replaceWith(S(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=S(this);(t===T?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return S(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return S(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var i=this.innerHTML;S(this).empty().append(m(this,t,e,i))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var i=m(this,t,e,this.textContent);this.textContent=null==i?"":""+i}):0 in this?this.pluck("textContent").join(""):null},attr:function(t,e){var i;return"string"!=typeof t||1 in arguments?this.each(function(i){if(1===this.nodeType)if(r(t))for(A in t)v(this,A,t[A]);else v(this,t,m(this,e,i,this.getAttribute(t)))}):0 in this&&1==this[0].nodeType&&null!=(i=this[0].getAttribute(t))?i:T},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){v(this,t)},this)})},prop:function(t,e){return t=J[t]||t,1 in arguments?this.each(function(i){this[t]=m(this,e,i,this[t])}):this[0]&&this[0][t]},removeProp:function(t){return t=J[t]||t,this.each(function(){delete this[t]})},data:function(t,e){var i="data-"+t.replace(G,"-$1").toLowerCase(),n=1 in arguments?this.attr(i,e):this.attr(i);return null!==n?_(n):T},val:function(t){return 0 in arguments?(null==t&&(t=""),this.each(function(e){this.value=m(this,t,e,this.value)})):this[0]&&(this[0].multiple?S(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var i=S(this),n=m(this,t,e,i.offset()),r=i.offsetParent().offset(),a={top:n.top-r.top,left:n.left-r.left};"static"==i.css("position")&&(a.position="relative"),i.css(a)});if(!this.length)return null;if(O.documentElement!==this[0]&&!S.contains(O.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,i){if(arguments.length<2){var n=this[0];if("string"==typeof e){if(!n)return;return n.style[R(e)]||getComputedStyle(n,"").getPropertyValue(e)}if(Q(e)){if(!n)return;var r={},a=getComputedStyle(n,"");return S.each(e,function(t,e){r[e]=n.style[R(e)]||a.getPropertyValue(e)}),r}}var o="";if("string"==t(e))i||0===i?o=u(e)+":"+d(e,i):this.each(function(){this.style.removeProperty(u(e))});else for(A in e)e[A]||0===e[A]?o+=u(A)+":"+d(A,e[A])+";":this.each(function(){this.style.removeProperty(u(A))});return this.each(function(){this.style.cssText+=";"+o})},index:function(t){return t?this.indexOf(S(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return!!t&&w.some.call(this,function(t){return this.test(b(t))},c(t))},addClass:function(t){return t?this.each(function(e){if("className"in this){L=[];var i=b(this);m(this,t,e,i).split(/\s+/g).forEach(function(t){S(this).hasClass(t)||L.push(t)},this),L.length&&b(this,i+(i?" ":"")+L.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===T)return b(this,"");L=b(this),m(this,t,e,L).split(/\s+/g).forEach(function(t){L=L.replace(c(t)," ")}),b(this,L.trim())}})},toggleClass:function(t,e){return t?this.each(function(i){var n=S(this);m(this,t,i,b(this)).split(/\s+/g).forEach(function(t){(e===T?!n.hasClass(t):e)?n.addClass(t):n.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===T?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===T?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),i=this.offset(),n=U.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat(S(t).css("margin-top"))||0,i.left-=parseFloat(S(t).css("margin-left"))||0,n.top+=parseFloat(S(e[0]).css("border-top-width"))||0,n.left+=parseFloat(S(e[0]).css("border-left-width"))||0,{top:i.top-n.top,left:i.left-n.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||O.body;t&&!U.test(t.nodeName)&&"static"==S(t).css("position");)t=t.offsetParent;return t})}},S.fn.detach=S.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});S.fn[t]=function(r){var a,o=this[0];return r===T?i(o)?o["inner"+e]:n(o)?o.documentElement["scroll"+e]:(a=this.offset())&&a[t]:this.each(function(e){o=S(this),o.css(t,m(this,r,e,o[t]()))})}}),V.forEach(function(e,i){var n=i%2;S.fn[e]=function(){var e,r,a=S.map(arguments,function(i){var n=[];return e=t(i),"array"==e?(i.forEach(function(t){return t.nodeType!==T?n.push(t):S.zepto.isZ(t)?n=n.concat(t.get()):void(n=n.concat(X.fragment(t)))}),n):"object"==e||null==i?i:X.fragment(i)}),o=this.length>1;return a.length<1?this:this.each(function(t,e){r=n?e:e.parentNode,e=0==i?e.nextSibling:1==i?e.firstChild:2==i?e:null;var s=S.contains(O.documentElement,r);a.forEach(function(t){if(o)t=t.cloneNode(!0);else if(!r)return S(t).remove();r.insertBefore(t,e),s&&E(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var e=t.ownerDocument?t.ownerDocument.defaultView:window;e.eval.call(e,t.innerHTML)}})})})},S.fn[n?e+"To":"insert"+(i?"Before":"After")]=function(t){return S(t)[e](this),this}}),X.Z.prototype=p.prototype=S.fn,X.uniq=k,X.deserializeValue=_,S.zepto=X,S}();window.Zepto=i,void 0===window.$&&(window.$=i),function(t){function e(e,i,n){var r=t.Event(i);return t(e).trigger(r,n),!r.isDefaultPrevented()}function i(t,i,n,r){if(t.global)return e(i||b,n,r)}function n(e){e.global&&0==t.active++&&i(e,null,"ajaxStart")}function r(e){e.global&&!--t.active&&i(e,null,"ajaxStop")}function a(t,e){var n=e.context;if(!1===e.beforeSend.call(n,t,e)||!1===i(e,n,"ajaxBeforeSend",[t,e]))return!1;i(e,n,"ajaxSend",[t,e])}function o(t,e,n,r){var a=n.context;n.success.call(a,t,"success",e),r&&r.resolveWith(a,[t,"success",e]),i(n,a,"ajaxSuccess",[e,n,t]),l("success",e,n)}function s(t,e,n,r,a){var o=r.context;r.error.call(o,n,e,t),a&&a.rejectWith(o,[n,e,t]),i(r,o,"ajaxError",[n,r,t||e]),l(e,n,r)}function l(t,e,n){var a=n.context;n.complete.call(a,e,t),i(n,a,"ajaxComplete",[e,n]),r(n)}function u(t,e,i){if(i.dataFilter==c)return t;var n=i.context;return i.dataFilter.call(n,t,e)}function c(){}function d(t){return t&&(t=t.split(";",2)[0]),t&&(t==S?"html":t==A?"json":E.test(t)?"script":T.test(t)&&"xml")||"text"}function h(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function f(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()&&"jsonp"!=e.dataType||(e.url=h(e.url,e.data),e.data=void 0)}function p(e,i,n,r){return t.isFunction(i)&&(r=n,n=i,i=void 0),t.isFunction(n)||(r=n,n=void 0),{url:e,data:i,success:n,dataType:r}}function g(e,i,n,r){var a,o=t.isArray(i),s=t.isPlainObject(i);t.each(i,function(i,l){a=t.type(l),r&&(i=n?r:r+"["+(s||"object"==a||"array"==a?i:"")+"]"),!r&&o?e.add(l.name,l.value):"array"==a||!n&&"object"==a?g(e,l,n,i):e.add(i,l)})}var y,m,v=+new Date,b=window.document,_=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,E=/^(?:text|application)\/javascript/i,T=/^(?:text|application)\/xml/i,A="application/json",S="text/html",L=/^\s*$/,R=b.createElement("a");R.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,i){if(!("type"in e))return t.ajax(e);var n,r,l=e.jsonpCallback,u=(t.isFunction(l)?l():l)||"Zepto"+v++,c=b.createElement("script"),d=window[u],h=function(e){t(c).triggerHandler("error",e||"abort")},f={abort:h};return i&&i.promise(f),t(c).on("load error",function(a,l){clearTimeout(r),t(c).off().remove(),"error"!=a.type&&n?o(n[0],f,e,i):s(null,l||"error",f,e,i),window[u]=d,n&&t.isFunction(d)&&d(n[0]),d=n=void 0}),!1===a(f,e)?(h("abort"),f):(window[u]=function(){n=arguments},c.src=e.url.replace(/\?(.+)=\?/,"?$1="+u),b.head.appendChild(c),e.timeout>0&&(r=setTimeout(function(){h("timeout")},e.timeout)),f)},t.ajaxSettings={type:"GET",beforeSend:c,success:c,error:c,complete:c,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:A,xml:"application/xml, text/xml",html:S,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:c},t.ajax=function(e){var i,r,l=t.extend({},e||{}),p=t.Deferred&&t.Deferred();for(y in t.ajaxSettings)void 0===l[y]&&(l[y]=t.ajaxSettings[y]);n(l),l.crossDomain||(i=b.createElement("a"),i.href=l.url,i.href=i.href,l.crossDomain=R.protocol+"//"+R.host!=i.protocol+"//"+i.host),l.url||(l.url=window.location.toString()),(r=l.url.indexOf("#"))>-1&&(l.url=l.url.slice(0,r)),f(l);var g=l.dataType,v=/\?.+=\?/.test(l.url);if(v&&(g="jsonp"),!1!==l.cache&&(e&&!0===e.cache||"script"!=g&&"jsonp"!=g)||(l.url=h(l.url,"_="+Date.now())),"jsonp"==g)return v||(l.url=h(l.url,l.jsonp?l.jsonp+"=?":!1===l.jsonp?"":"callback=?")),t.ajaxJSONP(l,p);var _,E=l.accepts[g],T={},A=function(t,e){T[t.toLowerCase()]=[t,e]},S=/^([\w-]+:)\/\//.test(l.url)?RegExp.$1:window.location.protocol,k=l.xhr(),w=k.setRequestHeader;if(p&&p.promise(k),l.crossDomain||A("X-Requested-With","XMLHttpRequest"),A("Accept",E||"*/*"),(E=l.mimeType||E)&&(E.indexOf(",")>-1&&(E=E.split(",",2)[0]),k.overrideMimeType&&k.overrideMimeType(E)),(l.contentType||!1!==l.contentType&&l.data&&"GET"!=l.type.toUpperCase())&&A("Content-Type",l.contentType||"application/x-www-form-urlencoded"),l.headers)for(m in l.headers)A(m,l.headers[m]);if(k.setRequestHeader=A,k.onreadystatechange=function(){if(4==k.readyState){k.onreadystatechange=c,clearTimeout(_);var e,i=!1;if(k.status>=200&&k.status<300||304==k.status||0==k.status&&"file:"==S){if(g=g||d(l.mimeType||k.getResponseHeader("content-type")),"arraybuffer"==k.responseType||"blob"==k.responseType)e=k.response;else{e=k.responseText;try{e=u(e,g,l),"script"==g?(0,eval)(e):"xml"==g?e=k.responseXML:"json"==g&&(e=L.test(e)?null:t.parseJSON(e))}catch(t){i=t}if(i)return s(i,"parsererror",k,l,p)}o(e,k,l,p)}else s(k.statusText||null,k.status?"error":"abort",k,l,p)}},!1===a(k,l))return k.abort(),s(null,"abort",k,l,p),k;var C=!("async"in l)||l.async;if(k.open(l.type,l.url,C,l.username,l.password),l.xhrFields)for(m in l.xhrFields)k[m]=l.xhrFields[m];for(m in T)w.apply(k,T[m]);return l.timeout>0&&(_=setTimeout(function(){k.onreadystatechange=c,k.abort(),s(null,"timeout",k,l,p)},l.timeout)),k.send(l.data?l.data:null),k},t.get=function(){return t.ajax(p.apply(null,arguments))},t.post=function(){var e=p.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=p.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,i,n){if(!this.length)return this;var r,a=this,o=e.split(/\s/),s=p(e,i,n),l=s.success;return o.length>1&&(s.url=o[0],r=o[1]),s.success=function(e){a.html(r?t("<div>").html(e.replace(_,"")).find(r):e),l&&l.apply(a,arguments)},t.ajax(s),this};var k=encodeURIComponent;t.param=function(e,i){var n=[];return n.add=function(e,i){t.isFunction(i)&&(i=i()),null==i&&(i=""),this.push(k(e)+"="+k(i))},g(n,e,i),n.join("&").replace(/%20/g,"+")}}(i),function(t){t.Callbacks=function(e){e=t.extend({},e);var i,n,r,a,o,s,l=[],u=!e.once&&[],c=function(t){for(i=e.memory&&t,n=!0,s=a||0,a=0,o=l.length,r=!0;l&&s<o;++s)if(!1===l[s].apply(t[0],t[1])&&e.stopOnFalse){i=!1;break}r=!1,l&&(u?u.length&&c(u.shift()):i?l.length=0:d.disable())},d={add:function(){if(l){var n=l.length,s=function(i){t.each(i,function(t,i){"function"==typeof i?e.unique&&d.has(i)||l.push(i):i&&i.length&&"string"!=typeof i&&s(i)})};s(arguments),r?o=l.length:i&&(a=n,c(i))}return this},remove:function(){return l&&t.each(arguments,function(e,i){for(var n;(n=t.inArray(i,l,n))>-1;)l.splice(n,1),r&&(n<=o&&--o,n<=s&&--s)}),this},has:function(e){return!(!l||!(e?t.inArray(e,l)>-1:l.length))},empty:function(){return o=l.length=0,this},disable:function(){return l=u=i=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,i||d.disable(),this},locked:function(){return!u},fireWith:function(t,e){return!l||n&&!u||(e=e||[],e=[t,e.slice?e.slice():e],r?u.push(e):c(e)),this},fire:function(){return d.fireWith(this,arguments)},fired:function(){return!!n}};return d}}(i),function(t){function e(i){var n=[["resolve","done",t.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",t.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",t.Callbacks({memory:1})]],r="pending",a={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var i=arguments;return e(function(e){t.each(n,function(n,r){var s=t.isFunction(i[n])&&i[n];o[r[1]](function(){var i=s&&s.apply(this,arguments);if(i&&t.isFunction(i.promise))i.promise().done(e.resolve).fail(e.reject).progress(e.notify);else{var n=this===a?e.promise():this,o=s?[i]:arguments;e[r[0]+"With"](n,o)}})}),i=null}).promise()},promise:function(e){return null!=e?t.extend(e,a):a}},o={};return t.each(n,function(t,e){var i=e[2],s=e[3];a[e[1]]=i.add,s&&i.add(function(){r=s},n[1^t][2].disable,n[2][2].lock),o[e[0]]=function(){return o[e[0]+"With"](this===o?a:this,arguments),this},o[e[0]+"With"]=i.fireWith}),a.promise(o),i&&i.call(o,o),o}var i=Array.prototype.slice;t.when=function(n){var r,a,o,s=i.call(arguments),l=s.length,u=0,c=1!==l||n&&t.isFunction(n.promise)?l:0,d=1===c?n:e(),h=function(t,e,n){return function(a){e[t]=this,n[t]=arguments.length>1?i.call(arguments):a,n===r?d.notifyWith(e,n):--c||d.resolveWith(e,n)}};if(l>1)for(r=new Array(l),a=new Array(l),o=new Array(l);u<l;++u)s[u]&&t.isFunction(s[u].promise)?s[u].promise().done(h(u,o,s)).fail(d.reject).progress(h(u,a,r)):--c;return c||d.resolveWith(o,s),d.promise()},t.Deferred=e}(i),function(t){function e(t){return t._zid||(t._zid=h++)}function i(t,i,a,o){if(i=n(i),i.ns)var s=r(i.ns);return(y[e(t)]||[]).filter(function(t){return t&&(!i.e||t.e==i.e)&&(!i.ns||s.test(t.ns))&&(!a||e(t.fn)===e(a))&&(!o||t.sel==o)})}function n(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function r(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function a(t,e){return t.del&&!v&&t.e in b||!!e}function o(t){return _[t]||v&&b[t]||t}function s(i,r,s,l,c,h,f){var p=e(i),g=y[p]||(y[p]=[]);r.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var r=n(e);r.fn=s,r.sel=c,r.e in _&&(s=function(e){var i=e.relatedTarget;if(!i||i!==this&&!t.contains(this,i))return r.fn.apply(this,arguments)}),r.del=h;var p=h||s;r.proxy=function(t){if(t=u(t),!t.isImmediatePropagationStopped()){t.data=l;var e=p.apply(i,t._args==d?[t]:[t].concat(t._args));return!1===e&&(t.preventDefault(),t.stopPropagation()),e}},r.i=g.length,g.push(r),"addEventListener"in i&&i.addEventListener(o(r.e),r.proxy,a(r,f))})}function l(t,n,r,s,l){var u=e(t);(n||"").split(/\s/).forEach(function(e){i(t,e,r,s).forEach(function(e){delete y[u][e.i],"removeEventListener"in t&&t.removeEventListener(o(e.e),e.proxy,a(e,l))})})}function u(e,i){return!i&&e.isDefaultPrevented||(i||(i=e),t.each(S,function(t,n){var r=i[t];e[t]=function(){return this[n]=E,r&&r.apply(i,arguments)},e[n]=T}),e.timeStamp||(e.timeStamp=Date.now()),(i.defaultPrevented!==d?i.defaultPrevented:"returnValue"in i?!1===i.returnValue:i.getPreventDefault&&i.getPreventDefault())&&(e.isDefaultPrevented=E)),e}function c(t){var e,i={originalEvent:t};for(e in t)A.test(e)||t[e]===d||(i[e]=t[e]);return u(i,t)}var d,h=1,f=Array.prototype.slice,p=t.isFunction,g=function(t){return"string"==typeof t},y={},m={},v="onfocusin"in window,b={focus:"focusin",blur:"focusout"},_={mouseenter:"mouseover",mouseleave:"mouseout"};m.click=m.mousedown=m.mouseup=m.mousemove="MouseEvents",t.event={add:s,remove:l},t.proxy=function(i,n){var r=2 in arguments&&f.call(arguments,2);if(p(i)){var a=function(){return i.apply(n,r?r.concat(f.call(arguments)):arguments)};return a._zid=e(i),a}if(g(n))return r?(r.unshift(i[n],i),t.proxy.apply(null,r)):t.proxy(i[n],i);throw new TypeError("expected function")},t.fn.bind=function(t,e,i){return this.on(t,e,i)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,i,n){return this.on(t,e,i,n,1)};var E=function(){return!0},T=function(){return!1},A=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,S={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,i){return this.on(e,t,i)},t.fn.undelegate=function(t,e,i){return this.off(e,t,i)},t.fn.live=function(e,i){return t(document.body).delegate(this.selector,e,i),this},t.fn.die=function(e,i){return t(document.body).undelegate(this.selector,e,i),this},t.fn.on=function(e,i,n,r,a){var o,u,h=this;return e&&!g(e)?(t.each(e,function(t,e){h.on(t,i,n,e,a)}),h):(g(i)||p(r)||!1===r||(r=n,n=i,i=d),r!==d&&!1!==n||(r=n,n=d),!1===r&&(r=T),h.each(function(d,h){a&&(o=function(t){return l(h,t.type,r),r.apply(this,arguments)}),i&&(u=function(e){var n,a=t(e.target).closest(i,h).get(0);if(a&&a!==h)return n=t.extend(c(e),{currentTarget:a,liveFired:h}),(o||r).apply(a,[n].concat(f.call(arguments,1)))}),s(h,e,r,n,i,u||o)}))},t.fn.off=function(e,i,n){var r=this;return e&&!g(e)?(t.each(e,function(t,e){r.off(t,i,e)}),r):(g(i)||p(n)||!1===n||(n=i,i=d),!1===n&&(n=T),r.each(function(){l(this,e,n,i)}))},t.fn.trigger=function(e,i){return e=g(e)||t.isPlainObject(e)?t.Event(e):u(e),e._args=i,this.each(function(){e.type in b&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,i)})},t.fn.triggerHandler=function(e,n){var r,a;return this.each(function(o,s){r=c(g(e)?t.Event(e):e),r._args=n,r.target=s,t.each(i(s,e.type||e),function(t,e){if(a=e.proxy(r),r.isImmediatePropagationStopped())return!1})}),a},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){g(t)||(e=t,t=e.type);var i=document.createEvent(m[t]||"Events"),n=!0;if(e)for(var r in e)"bubbles"==r?n=!!e[r]:i[r]=e[r];return i.initEvent(t,n,!0),u(i)}}(i),function(){try{getComputedStyle(void 0)}catch(e){var t=getComputedStyle;window.getComputedStyle=function(e,i){try{return t(e,i)}catch(t){return null}}}}(),function(t){function e(e){return e=t(e),!(!e.width()&&!e.height())&&"none"!==e.css("display")}function i(t,e){t=t.replace(/=#\]/g,'="#"]');var i,n,r=s.exec(t);if(r&&r[2]in o&&(i=o[r[2]],n=r[3],t=r[1],n)){var a=Number(n);n=isNaN(a)?n.replace(/^["']|["']$/g,""):a}return e(t,i,n)}var n=t.zepto,r=n.qsa,a=n.matches,o=t.expr[":"]={visible:function(){if(e(this))return this},hidden:function(){if(!e(this))return this},selected:function(){if(this.selected)return this},checked:function(){if(this.checked)return this},parent:function(){return this.parentNode},first:function(t){if(0===t)return this},last:function(t,e){if(t===e.length-1)return this},eq:function(t,e,i){if(t===i)return this},contains:function(e,i,n){if(t(this).text().indexOf(n)>-1)return this},has:function(t,e,i){if(n.qsa(this,i).length)return this}},s=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*"),l=/^\s*>/,u="Zepto"+ +new Date;n.qsa=function(e,a){return i(a,function(i,o,s){try{var c;!i&&o?i="*":l.test(i)&&(c=t(e).addClass(u),i="."+u+" "+i);var d=r(e,i)}catch(t){throw console.error("error performing selector: %o",a),t}finally{c&&c.removeClass(u)}return o?n.uniq(t.map(d,function(t,e){return o.call(t,e,d,s)})):d})},n.matches=function(t,e){return i(e,function(e,i,n){return(!e||a(t,e))&&(!i||i.call(t,null,n)===t)})}}(i),t.exports=i},function(t,e){function i(t,e){var i=t[1]||"",r=t[3];if(!r)return i;if(e&&"function"==typeof btoa){var a=n(r);return[i].concat(r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"})).concat([a]).join("\n")}return[i].join("\n")}function n(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=i(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,i){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},r=0;r<this.length;r++){var a=this[r][0];"number"==typeof a&&(n[a]=!0)}for(r=0;r<t.length;r++){var o=t[r];"number"==typeof o[0]&&n[o[0]]||(i&&!o[2]?o[2]=i:i&&(o[2]="("+o[2]+") and ("+i+")"),e.push(o))}},e}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},r=/(.)^/,a={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},o=/\\|'|\r|\n|\t|\u2028|\u2029/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},l=new RegExp("[&<>\"']","g"),u=function(t){return null===t?"":(""+t).replace(l,function(t){return s[t]})},c=0,d=function(t,e){var i,s=new RegExp([(n.escape||r).source,(n.interpolate||r).source,(n.evaluate||r).source].join("|")+"|$","g"),l=0,d="__p+='";t.replace(s,function(e,i,n,r,s){return d+=t.slice(l,s).replace(o,function(t){return"\\"+a[t]}),i&&(d+="'+\n((__t=("+i+"))==null?'':escapeExpr(__t))+\n'"),n&&(d+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),r&&(d+="';\n"+r+"\n__p+='"),l=s+e.length,e}),d+="';\n",n.variable||(d="with(obj||{}){\n"+d+"}\n"),d="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+d+"return __p;\n//# sourceURL=/microtemplates/source["+c+++"]";try{i=new Function(n.variable||"obj","escapeExpr",d)}catch(t){throw t.source=d,t}if(e)return i(e,u);var h=function(t){return i.call(this,t,u)};return h.source="function("+(n.variable||"obj")+"){\n"+d+"}",h};d.settings=n,e.default=d,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(5),f=i(21),p=n(f),g=function(t){function e(i,n){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r.settings={},r._i18n=n,r}return(0,d.default)(e,t),(0,u.default)(e,[{key:"isAudioOnly",get:function(){return!1}},{key:"ended",get:function(){return!1}},{key:"i18n",get:function(){return this._i18n}},{key:"buffering",get:function(){return!1}}]),e.prototype.consent=function(){},e.prototype.play=function(){},e.prototype.pause=function(){},e.prototype.stop=function(){},e.prototype.seek=function(t){},e.prototype.seekPercentage=function(t){},e.prototype.getStartTimeOffset=function(){return 0},e.prototype.getDuration=function(){return 0},e.prototype.isPlaying=function(){return!1},e.prototype.getPlaybackType=function(){return e.NO_OP},e.prototype.isHighDefinitionInUse=function(){return!1},e.prototype.volume=function(t){},e.prototype.destroy=function(){this.$el.remove()},(0,u.default)(e,[{key:"isReady",get:function(){return!1}},{key:"hasClosedCaptionsTracks",get:function(){return this.closedCaptionsTracks.length>0}},{key:"closedCaptionsTracks",get:function(){return[]}},{key:"closedCaptionsTrackId",get:function(){return-1},set:function(t){}}]),e}(p.default);e.default=g,g.extend=function(t){return(0,h.extend)(g,t)},g.canPlay=function(t,e){return!1},g.VOD="vod",g.AOD="aod",g.LIVE="live",g.NO_OP="no_op",g.type="playback",t.exports=e.default},function(t,e,i){function n(t,e){for(var i=0;i<t.length;i++){var n=t[i],r=p[n.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](n.parts[a]);for(;a<n.parts.length;a++)r.parts.push(c(n.parts[a],e))}else{for(var o=[],a=0;a<n.parts.length;a++)o.push(c(n.parts[a],e));p[n.id]={id:n.id,refs:1,parts:o}}}}function r(t,e){for(var i=[],n={},r=0;r<t.length;r++){var a=t[r],o=e.base?a[0]+e.base:a[0],s=a[1],l=a[2],u=a[3],c={css:s,media:l,sourceMap:u};n[o]?n[o].parts.push(c):i.push(n[o]={id:o,parts:[c]})}return i}function a(t,e){var i=y(t.insertInto);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=b[b.length-1];if("top"===t.insertAt)n?n.nextSibling?i.insertBefore(e,n.nextSibling):i.appendChild(e):i.insertBefore(e,i.firstChild),b.push(e);else if("bottom"===t.insertAt)i.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=y(t.insertInto+" "+t.insertAt.before);i.insertBefore(e,r)}}function o(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=b.indexOf(t);e>=0&&b.splice(e,1)}function s(t){var e=document.createElement("style");return t.attrs.type="text/css",u(e,t.attrs),a(t,e),e}function l(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",u(e,t.attrs),a(t,e),e}function u(t,e){Object.keys(e).forEach(function(i){t.setAttribute(i,e[i])})}function c(t,e){var i,n,r,a;if(e.transform&&t.css){if(!(a=e.transform(t.css)))return function(){};t.css=a}if(e.singleton){var u=v++;i=m||(m=s(e)),n=d.bind(null,i,u,!1),r=d.bind(null,i,u,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(i=l(e),n=f.bind(null,i,e),r=function(){o(i),i.href&&URL.revokeObjectURL(i.href)}):(i=s(e),n=h.bind(null,i),r=function(){o(i)});return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else r()}}function d(t,e,i,n){var r=i?"":n.css;if(t.styleSheet)t.styleSheet.cssText=E(e,r);else{var a=document.createTextNode(r),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(a,o[e]):t.appendChild(a)}}function h(t,e){var i=e.css,n=e.media;if(n&&t.setAttribute("media",n),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}function f(t,e,i){var n=i.css,r=i.sourceMap,a=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||a)&&(n=_(n)),r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([n],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}var p={},g=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),y=function(t){var e={};return function(i){if(void 0===e[i]){var n=t.call(this,i);if(n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[i]=n}return e[i]}}(function(t){return document.querySelector(t)}),m=null,v=0,b=[],_=i(140);t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");e=e||{},e.attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||(e.singleton=g()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var i=r(t,e);return n(i,e),function(t){for(var a=[],o=0;o<i.length;o++){var s=i[o],l=p[s.id];l.refs--,a.push(l)}if(t){n(r(t,e),e)}for(var o=0;o<a.length;o++){var l=a[o];if(0===l.refs){for(var u=0;u<l.parts.length;u++)l.parts[u]();delete p[l.id]}}}};var E=function(){var t=[];return function(e,i){return t[e]=i,t.filter(Boolean).join("\n")}}()},function(t,e){var i=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=i)},function(t,e,i){var n=i(44)("wks"),r=i(32),a=i(15).Symbol,o="function"==typeof a;(t.exports=function(t){return n[t]||(n[t]=o&&a[t]||(o?a:r)("Symbol."+t))}).store=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={},r=e.getBrowserInfo=function(t){var e=t.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[],i=void 0;if(/trident/i.test(e[1]))return i=/\brv[ :]+(\d+)/g.exec(t)||[],{name:"IE",version:parseInt(i[1]||"")};if("Chrome"===e[1]){if(null!=(i=t.match(/\bOPR\/(\d+)/)))return{name:"Opera",version:parseInt(i[1])};if(null!=(i=t.match(/\bEdge\/(\d+)/)))return{name:"Edge",version:parseInt(i[1])}}else/android/i.test(t)&&(i=t.match(/version\/(\d+)/i))&&(e.splice(1,1,"Android WebView"),e.splice(2,1,i[1]));return e=e[2]?[e[1],e[2]]:[navigator.appName,navigator.appVersion,"-?"],{name:e[0],version:parseInt(e[1])}},a=r(navigator.userAgent);n.isEdge=/edge/i.test(navigator.userAgent),n.isChrome=/chrome|CriOS/i.test(navigator.userAgent)&&!n.isEdge,n.isSafari=/safari/i.test(navigator.userAgent)&&!n.isChrome&&!n.isEdge,n.isFirefox=/firefox/i.test(navigator.userAgent),n.isLegacyIE=!!window.ActiveXObject,n.isIE=n.isLegacyIE||/trident.*rv:1\d/i.test(navigator.userAgent),n.isIE11=/trident.*rv:11/i.test(navigator.userAgent),n.isChromecast=n.isChrome&&/CrKey/i.test(navigator.userAgent),n.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone|IEMobile|Mobile Safari|Opera Mini/i.test(navigator.userAgent),n.isiOS=/iPad|iPhone|iPod/i.test(navigator.userAgent),n.isAndroid=/Android/i.test(navigator.userAgent),n.isWindowsPhone=/Windows Phone/i.test(navigator.userAgent),n.isWin8App=/MSAppHost/i.test(navigator.userAgent),n.isWiiU=/WiiU/i.test(navigator.userAgent),n.isPS4=/PlayStation 4/i.test(navigator.userAgent),n.hasLocalstorage=function(){try{return localStorage.setItem("clappr","clappr"),localStorage.removeItem("clappr"),!0}catch(t){return!1}}(),n.hasFlash=function(){try{return!!new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){return!(!navigator.mimeTypes||void 0===navigator.mimeTypes["application/x-shockwave-flash"]||!navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)}}(),n.name=a.name,n.version=a.version,e.default=n},function(t,e,i){var n=i(92),r=i(40);t.exports=function(t){return n(r(t))}},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e,i){var n=i(23),r=i(63),a=i(47),o=Object.defineProperty;e.f=i(20)?Object.defineProperty:function(t,e,i){if(n(t),e=a(e,!0),n(i),r)try{return o(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(5),f=i(4),p=n(f),g=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n._options=i,n.uniqueId=(0,h.uniqueId)("o"),n}return(0,d.default)(e,t),(0,u.default)(e,[{key:"options",get:function(){return this._options}}]),e}(p.default);e.default=g,t.exports=e.default},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var n=i(15),r=i(11),a=i(46),o=i(22),s=function(t,e,i){var l,u,c,d=t&s.F,h=t&s.G,f=t&s.S,p=t&s.P,g=t&s.B,y=t&s.W,m=h?r:r[e]||(r[e]={}),v=m.prototype,b=h?n:f?n[e]:(n[e]||{}).prototype;h&&(i=e);for(l in i)(u=!d&&b&&void 0!==b[l])&&l in m||(c=u?b[l]:i[l],m[l]=h&&"function"!=typeof b[l]?i[l]:g&&u?a(c,n):y&&b[l]==c?function(t){var e=function(e,i,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(c):p&&"function"==typeof c?a(Function.call,c):c,p&&((m.virtual||(m.virtual={}))[l]=c,t&s.R&&v&&!v[l]&&o(v,l,c)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e,i){t.exports=!i(27)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(6),f=n(h),p=i(5),g=i(17),y=n(g),m=/^(\S+)\s*(.*)$/,v=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n.cid=(0,p.uniqueId)("c"),n._ensureElement(),n.delegateEvents(),n}return(0,d.default)(e,t),(0,u.default)(e,[{key:"tagName",get:function(){return"div"}},{key:"events",get:function(){return{}}},{key:"attributes",get:function(){return{}}}]),e.prototype.$=function(t){return this.$el.find(t)},e.prototype.render=function(){return this},e.prototype.remove=function(){return this.$el.remove(),this.stopListening(),this.undelegateEvents(),this},e.prototype.setElement=function(t,e){return this.$el&&this.undelegateEvents(),this.$el=f.default.zepto.isZ(t)?t:(0,f.default)(t),this.el=this.$el[0],!1!==e&&this.delegateEvents(),this},e.prototype.delegateEvents=function(t){if(!t&&!(t=this.events))return this;this.undelegateEvents();for(var e in t){var i=t[e];if(i&&i.constructor!==Function&&(i=this[t[e]]),i){var n=e.match(m),r=n[1],a=n[2];r+=".delegateEvents"+this.cid,""===a?this.$el.on(r,i.bind(this)):this.$el.on(r,a,i.bind(this))}}return this},e.prototype.undelegateEvents=function(){return this.$el.off(".delegateEvents"+this.cid),this},e.prototype._ensureElement=function(){if(this.el)this.setElement(this.el,!1);else{var t=f.default.extend({},this.attributes);this.id&&(t.id=this.id),this.className&&(t.class=this.className);var e=p.DomRecycler.create(this.tagName).attr(t);this.setElement(e,!1)}},e}(y.default);e.default=v,t.exports=e.default},function(t,e,i){var n=i(16),r=i(28);t.exports=i(20)?function(t,e,i){return n.f(t,e,r(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var n=i(26);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(4),s=n(o),l=new s.default,u=function t(){(0,a.default)(this,t)};e.default=u,u.on=function(t,e,i){l.on(t,e,i)},u.once=function(t,e,i){l.once(t,e,i)},u.off=function(t,e,i){l.off(t,e,i)},u.trigger=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];l.trigger.apply(l,[t].concat(i))},u.stopListening=function(t,e,i){l.stopListening(t,e,i)},t.exports=e.default},function(t,e,i){var n=i(60),r=i(45);t.exports=Object.keys||function(t){return n(t,r)}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports={}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(2),u=n(l),c=i(5),d=i(17),h=n(d),f=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i.options));return n.core=i,n.enabled=!0,n.bindEvents(),n}return(0,u.default)(e,t),e.prototype.bindEvents=function(){},e.prototype.enable=function(){this.enabled||(this.bindEvents(),this.enabled=!0)},e.prototype.disable=function(){this.enabled&&(this.stopListening(),this.enabled=!1)},e.prototype.getExternalInterface=function(){return{}},e.prototype.destroy=function(){this.stopListening()},e}(h.default);e.default=f,f.extend=function(t){return(0,c.extend)(f,t)},f.type="core",t.exports=e.default},function(t,e,i){t.exports={default:i(90),__esModule:!0}},function(t,e){var i=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+n).toString(36))}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=i(96),a=n(r),o=i(107),s=n(o),l="function"==typeof s.default&&"symbol"==typeof a.default?function(t){return typeof t}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":typeof t};e.default="function"==typeof s.default&&"symbol"===l(a.default)?function(t){return void 0===t?"undefined":l(t)}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":void 0===t?"undefined":l(t)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),r=function(t){return t&&t.__esModule?t:{default:t}}(n),a=function t(){(0,r.default)(this,t),this.options={},this.playbackPlugins=[],this.currentSize={width:0,height:0}};a._players={},a.getInstance=function(t){return a._players[t]||(a._players[t]=new a)},e.default=a,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(158),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(2),u=n(l),c=i(5),d=i(21),h=n(d),f=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i.options));return n.container=i,n.enabled=!0,n.bindEvents(),n}return(0,u.default)(e,t),e.prototype.enable=function(){this.enabled||(this.bindEvents(),this.$el.show(),this.enabled=!0)},e.prototype.disable=function(){this.stopListening(),this.$el.hide(),this.enabled=!1},e.prototype.bindEvents=function(){},e.prototype.destroy=function(){this.remove()},e}(h.default);e.default=f,f.extend=function(t){return(0,c.extend)(f,t)},f.type="container",t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(2),u=n(l),c=i(17),d=n(c),h=i(5),f=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i.options));return n.container=i,n.enabled=!0,n.bindEvents(),n}return(0,u.default)(e,t),e.prototype.enable=function(){this.enabled||(this.bindEvents(),this.enabled=!0)},e.prototype.disable=function(){this.enabled&&(this.stopListening(),this.enabled=!1)},e.prototype.bindEvents=function(){},e.prototype.destroy=function(){this.stopListening()},e}(d.default);e.default=f,f.extend=function(t){return(0,h.extend)(f,t)},f.type="container",t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(2),u=n(l),c=i(5),d=i(21),h=n(d),f=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i.options));return n.core=i,n.enabled=!0,n.bindEvents(),n.render(),n}return(0,u.default)(e,t),e.prototype.bindEvents=function(){},e.prototype.getExternalInterface=function(){return{}},e.prototype.enable=function(){this.enabled||(this.bindEvents(),this.$el.show(),this.enabled=!0)},e.prototype.disable=function(){this.stopListening(),this.$el.hide(),this.enabled=!1},e.prototype.destroy=function(){this.remove()},e.prototype.render=function(){return this},e}(h.default);e.default=f,f.extend=function(t){return(0,c.extend)(f,t)},f.type="core",t.exports=e.default},function(t,e,i){var n=i(40);t.exports=function(t){return Object(n(t))}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e){var i=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:i)(t)}},function(t,e,i){var n=i(44)("keys"),r=i(32);t.exports=function(t){return n[t]||(n[t]=r(t))}},function(t,e,i){var n=i(15),r=n["__core-js_shared__"]||(n["__core-js_shared__"]={});t.exports=function(t){return r[t]||(r[t]={})}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var n=i(95);t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,r){return t.call(e,i,n,r)}}return function(){return t.apply(e,arguments)}}},function(t,e,i){var n=i(26);t.exports=function(t,e){if(!n(t))return t;var i,r;if(e&&"function"==typeof(i=t.toString)&&!n(r=i.call(t)))return r;if("function"==typeof(i=t.valueOf)&&!n(r=i.call(t)))return r;if(!e&&"function"==typeof(i=t.toString)&&!n(r=i.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=!0},function(t,e,i){var n=i(23),r=i(100),a=i(45),o=i(43)("IE_PROTO"),s=function(){},l=function(){var t,e=i(64)("iframe"),n=a.length;for(e.style.display="none",i(101).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;n--;)delete l.prototype[a[n]];return l()};t.exports=Object.create||function(t,e){var i;return null!==t?(s.prototype=n(t),i=new s,s.prototype=null,i[o]=t):i=l(),void 0===e?i:r(i,e)}},function(t,e,i){var n=i(16).f,r=i(18),a=i(12)("toStringTag");t.exports=function(t,e,i){t&&!r(t=i?t:t.prototype,a)&&n(t,a,{configurable:!0,value:e})}},function(t,e,i){e.f=i(12)},function(t,e,i){var n=i(15),r=i(11),a=i(48),o=i(51),s=i(16).f;t.exports=function(t){var e=r.Symbol||(r.Symbol=a?{}:n.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:o.f(t)})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var n=i(53),r=i(28),a=i(14),o=i(47),s=i(18),l=i(63),u=Object.getOwnPropertyDescriptor;e.f=i(20)?u:function(t,e){if(t=a(t),e=o(e,!0),l)try{return u(t,e)}catch(t){}if(s(t,e))return r(!n.f.call(t,e),t[e])}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(130),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(131),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default={Kibo:r.default},t.exports=e.default},function(t,e){function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function r(t){if(c===setTimeout)return setTimeout(t,0);if((c===i||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function a(t){if(d===clearTimeout)return clearTimeout(t);if((d===n||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(e){try{return d.call(null,t)}catch(e){return d.call(this,t)}}}function o(){g&&f&&(g=!1,f.length?p=f.concat(p):y=-1,p.length&&s())}function s(){if(!g){var t=r(o);g=!0;for(var e=p.length;e;){for(f=p,p=[];++y<e;)f&&f[y].run();y=-1,e=p.length}f=null,g=!1,a(t)}}function l(t,e){this.fun=t,this.array=e}function u(){}var c,d,h=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:i}catch(t){c=i}try{d="function"==typeof clearTimeout?clearTimeout:n}catch(t){d=n}}();var f,p=[],g=!1,y=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];p.push(new l(t,e)),1!==p.length||g||r(s)},l.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=u,h.addListener=u,h.once=u,h.off=u,h.removeListener=u,h.removeAllListeners=u,h.emit=u,h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#010101" d="M1.425.35L14.575 8l-13.15 7.65V.35z"></path></svg>'},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=i(171),t.exports=e.default},function(t,e,i){var n=i(18),r=i(14),a=i(93)(!1),o=i(43)("IE_PROTO");t.exports=function(t,e){var i,s=r(t),l=0,u=[];for(i in s)i!=o&&n(s,i)&&u.push(i);for(;e.length>l;)n(s,i=e[l++])&&(~a(u,i)||u.push(i));return u}},function(t,e,i){var n=i(42),r=Math.min;t.exports=function(t){return t>0?r(n(t),9007199254740991):0}},function(t,e,i){var n=i(19),r=i(11),a=i(27);t.exports=function(t,e){var i=(r.Object||{})[t]||Object[t],o={};o[t]=e(i),n(n.S+n.F*a(function(){i(1)}),"Object",o)}},function(t,e,i){t.exports=!i(20)&&!i(27)(function(){return 7!=Object.defineProperty(i(64)("div"),"a",{get:function(){return 7}}).a})},function(t,e,i){var n=i(26),r=i(15).document,a=n(r)&&n(r.createElement);t.exports=function(t){return a?r.createElement(t):{}}},function(t,e,i){"use strict";var n=i(98)(!0);i(66)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=n(e,i),this._i+=t.length,{value:t,done:!1})})},function(t,e,i){"use strict";var n=i(48),r=i(19),a=i(67),o=i(22),s=i(18),l=i(29),u=i(99),c=i(50),d=i(102),h=i(12)("iterator"),f=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,i,g,y,m,v){u(i,e,g);var b,_,E,T=function(t){if(!f&&t in R)return R[t];switch(t){case"keys":case"values":return function(){return new i(this,t)}}return function(){return new i(this,t)}},A=e+" Iterator",S="values"==y,L=!1,R=t.prototype,k=R[h]||R["@@iterator"]||y&&R[y],w=k||T(y),C=y?S?T("entries"):w:void 0,I="Array"==e?R.entries||k:k;if(I&&(E=d(I.call(new t)))!==Object.prototype&&(c(E,A,!0),n||s(E,h)||o(E,h,p)),S&&k&&"values"!==k.name&&(L=!0,w=function(){return k.call(this)}),n&&!v||!f&&!L&&R[h]||o(R,h,w),l[e]=w,l[A]=p,y)if(b={values:S?w:T("values"),keys:m?w:T("keys"),entries:C},v)for(_ in b)_ in R||a(R,_,b[_]);else r(r.P+r.F*(f||L),e,b);return b}},function(t,e,i){t.exports=i(22)},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,i){var n=i(60),r=i(45).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,r)}},function(t,e,i){t.exports={default:i(118),__esModule:!0}},function(t,e,i){t.exports={default:i(124),__esModule:!0}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(134),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(137),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(141),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e){t.exports="<%=baseUrl%>/a8c874b93b3d848f39a71260c57e3863.cur"},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M1.712 14.76H6.43V1.24H1.71v13.52zm7.86-13.52v13.52h4.716V1.24H9.573z"></path></svg>'},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(6),a=n(r),o=i(8),s=n(o),l={getStyleFor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{baseUrl:""};return(0,a.default)('<style class="clappr-style"></style>').html((0,s.default)(t.toString())(e))}};e.default=l,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(157),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){t.exports={default:i(159),__esModule:!0}},function(t,e,i){"use strict";e.__esModule=!0;var n=i(79),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return(0,r.default)(t)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(170),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(176),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(177),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(180),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(182),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(185),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(201),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(89),a=n(r),o=i(5),s=n(o),l=i(4),u=n(l),c=i(9),d=n(c),h=i(37),f=n(h),p=i(30),g=n(p),y=i(38),m=n(y),v=i(36),b=n(v),_=i(17),E=n(_),T=i(21),A=n(T),S=i(13),L=n(S),R=i(73),k=n(R),w=i(72),C=n(w),I=i(78),D=n(I),O=i(24),P=n(O),x=i(74),N=n(x),M=i(34),F=n(M),B=i(59),U=n(B),G=i(81),K=n(G),V=i(83),j=n(V),Y=i(84),H=n(Y),$=i(82),z=n($),W=i(35),q=n(W),X=i(85),Z=n(X),J=i(86),Q=n(J),tt=i(87),et=n(tt),it=i(55),nt=n(it),rt=i(77),at=n(rt),ot=i(56),st=n(ot),lt=i(8),ut=n(lt),ct=i(6),dt=n(ct);e.default={Player:a.default,Mediator:P.default,Events:u.default,Browser:L.default,PlayerInfo:F.default,MediaControl:N.default,ContainerPlugin:f.default,UIContainerPlugin:b.default,CorePlugin:g.default,UICorePlugin:m.default,Playback:d.default,Container:k.default,Core:C.default,Loader:D.default,BaseObject:E.default,UIObject:A.default,Utils:s.default,BaseFlashPlayback:U.default,Flash:K.default,FlasHLS:j.default,HLS:H.default,HTML5Audio:z.default,HTML5Video:q.default,HTMLImg:Z.default,NoOp:Q.default,Poster:et.default,Log:nt.default,Styler:at.default,Vendor:st.default,version:"0.2.80",template:ut.default,$:dt.default},t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(31),a=n(r),o=i(0),s=n(o),l=i(1),u=n(l),c=i(3),d=n(c),h=i(2),f=n(h),p=i(5),g=i(17),y=n(g),m=i(4),v=n(m),b=i(13),_=n(b),E=i(132),T=n(E),A=i(78),S=n(A),L=i(34),R=n(L),k=i(6),w=n(k),C=(0,p.currentScriptUrl)().replace(/\/[^\/]+$/,""),I=function(t){function e(i){(0,s.default)(this,e);var n=(0,u.default)(this,t.call(this,i)),r={playerId:(0,p.uniqueId)(""),persistConfig:!0,width:640,height:360,baseUrl:C,allowUserInteraction:_.default.isMobile};return n._options=w.default.extend(r,i),n.options.sources=n._normalizeSources(i),n.options.chromeless||(n.options.allowUserInteraction=!0),n.options.allowUserInteraction||(n.options.disableKeyboardShortcuts=!0),n._registerOptionEventListeners(),n._coreFactory=new T.default(n),n.playerInfo=R.default.getInstance(n.options.playerId),n.playerInfo.currentSize={width:i.width,height:i.height},n.playerInfo.options=n.options,n.options.parentId?n.setParentId(n.options.parentId):n.options.parent&&n.attachTo(n.options.parent),n}return(0,f.default)(e,t),(0,d.default)(e,[{key:"loader",set:function(t){this._loader=t},get:function(){return this._loader||(this._loader=new S.default(this.options.plugins||{},this.options.playerId)),this._loader}},{key:"ended",get:function(){return this.core.mediaControl.container.ended}},{key:"buffering",get:function(){return this.core.mediaControl.container.buffering}},{key:"isReady",get:function(){return!!this._ready}},{key:"eventsMapping",get:function(){return{onReady:v.default.PLAYER_READY,onResize:v.default.PLAYER_RESIZE,onPlay:v.default.PLAYER_PLAY,onPause:v.default.PLAYER_PAUSE,onStop:v.default.PLAYER_STOP,onEnded:v.default.PLAYER_ENDED,onSeek:v.default.PLAYER_SEEK,onError:v.default.PLAYER_ERROR,onTimeUpdate:v.default.PLAYER_TIMEUPDATE,onVolumeUpdate:v.default.PLAYER_VOLUMEUPDATE,onSubtitleAvailable:v.default.PLAYER_SUBTITLE_AVAILABLE}}}]),e.prototype.setParentId=function(t){var e=document.querySelector(t);return e&&this.attachTo(e),this},e.prototype.attachTo=function(t){return this.options.parentElement=t,this.core=this._coreFactory.create(),this._addEventListeners(),this},e.prototype._addEventListeners=function(){return this.core.isReady?this._onReady():this.listenToOnce(this.core,v.default.CORE_READY,this._onReady),this.listenTo(this.core.mediaControl,v.default.MEDIACONTROL_CONTAINERCHANGED,this._containerChanged),this.listenTo(this.core,v.default.CORE_FULLSCREEN,this._onFullscreenChange),this},e.prototype._addContainerEventListeners=function(){var t=this.core.mediaControl.container;return t&&(this.listenTo(t,v.default.CONTAINER_PLAY,this._onPlay),this.listenTo(t,v.default.CONTAINER_PAUSE,this._onPause),this.listenTo(t,v.default.CONTAINER_STOP,this._onStop),this.listenTo(t,v.default.CONTAINER_ENDED,this._onEnded),this.listenTo(t,v.default.CONTAINER_SEEK,this._onSeek),this.listenTo(t,v.default.CONTAINER_ERROR,this._onError),this.listenTo(t,v.default.CONTAINER_TIMEUPDATE,this._onTimeUpdate),this.listenTo(t,v.default.CONTAINER_VOLUME,this._onVolumeUpdate),this.listenTo(t,v.default.CONTAINER_SUBTITLE_AVAILABLE,this._onSubtitleAvailable)),this},e.prototype._registerOptionEventListeners=function(){var t=this,e=this.options.events||{};return(0,a.default)(e).forEach(function(i){var n=t.eventsMapping[i];if(n){var r=e[i];r="function"==typeof r&&r,r&&t.on(n,r)}}),this},e.prototype._containerChanged=function(){this.stopListening(),this._addEventListeners()},e.prototype._onReady=function(){this._ready=!0,this._addContainerEventListeners(),this.trigger(v.default.PLAYER_READY)},e.prototype._onFullscreenChange=function(t){this.trigger(v.default.PLAYER_FULLSCREEN,t)},e.prototype._onVolumeUpdate=function(t){this.trigger(v.default.PLAYER_VOLUMEUPDATE,t)},e.prototype._onSubtitleAvailable=function(){this.trigger(v.default.PLAYER_SUBTITLE_AVAILABLE)},e.prototype._onPlay=function(){this.trigger(v.default.PLAYER_PLAY)},e.prototype._onPause=function(){this.trigger(v.default.PLAYER_PAUSE)},e.prototype._onStop=function(){this.trigger(v.default.PLAYER_STOP,this.getCurrentTime())},e.prototype._onEnded=function(){this.trigger(v.default.PLAYER_ENDED)},e.prototype._onSeek=function(t){this.trigger(v.default.PLAYER_SEEK,t)},e.prototype._onTimeUpdate=function(t){this.trigger(v.default.PLAYER_TIMEUPDATE,t)},e.prototype._onError=function(t){this.trigger(v.default.PLAYER_ERROR,t)},e.prototype._normalizeSources=function(t){var e=t.sources||(void 0!==t.source?[t.source]:[]);return 0===e.length?[{source:"",mimeType:""}]:e},e.prototype.resize=function(t){return this.core.resize(t),this},e.prototype.load=function(t,e,i){return void 0!==i&&this.configure({autoPlay:!!i}),this.core.load(t,e),this},e.prototype.destroy=function(){return this.core.destroy(),this},e.prototype.consent=function(){return this.core.getCurrentPlayback().consent(),this},e.prototype.play=function(){return this.core.mediaControl.container.play(),this},e.prototype.pause=function(){return this.core.mediaControl.container.pause(),this},e.prototype.stop=function(){return this.core.mediaControl.container.stop(),this},e.prototype.seek=function(t){return this.core.mediaControl.container.seek(t),this},e.prototype.seekPercentage=function(t){return this.core.mediaControl.container.seekPercentage(t),this},e.prototype.setVolume=function(t){return this.core&&this.core.mediaControl&&this.core.mediaControl.setVolume(t),this},e.prototype.getVolume=function(){return this.core&&this.core.mediaControl?this.core.mediaControl.volume:0},e.prototype.mute=function(){return this._mutedVolume=this.getVolume(),this.setVolume(0),this},e.prototype.unmute=function(){return this.setVolume("number"==typeof this._mutedVolume?this._mutedVolume:100),this._mutedVolume=null,this},e.prototype.isPlaying=function(){return this.core.mediaControl.container.isPlaying()},e.prototype.isDvrEnabled=function(){return this.core.mediaControl.container.isDvrEnabled()},e.prototype.isDvrInUse=function(){return this.core.mediaControl.container.isDvrInUse()},e.prototype.configure=function(t){return this.core.configure(t),this},e.prototype.getPlugin=function(t){return this.core.plugins.concat(this.core.mediaControl.container.plugins).filter(function(e){return e.name===t})[0]},e.prototype.getCurrentTime=function(){return this.core.mediaControl.container.getCurrentTime()},e.prototype.getStartTimeOffset=function(){return this.core.mediaControl.container.getStartTimeOffset()},e.prototype.getDuration=function(){return this.core.mediaControl.container.getDuration()},e}(y.default);e.default=I,t.exports=e.default},function(t,e,i){i(91),t.exports=i(11).Object.keys},function(t,e,i){var n=i(39),r=i(25);i(62)("keys",function(){return function(t){return r(n(t))}})},function(t,e,i){var n=i(41);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e,i){var n=i(14),r=i(61),a=i(94);t.exports=function(t){return function(e,i,o){var s,l=n(e),u=r(l.length),c=a(o,u);if(t&&i!=i){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===i)return t||c||0;return!t&&-1}}},function(t,e,i){var n=i(42),r=Math.max,a=Math.min;t.exports=function(t,e){return t=n(t),t<0?r(t+e,0):a(t,e)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){t.exports={default:i(97),__esModule:!0}},function(t,e,i){i(65),i(103),t.exports=i(51).f("iterator")},function(t,e,i){var n=i(42),r=i(40);t.exports=function(t){return function(e,i){var a,o,s=String(r(e)),l=n(i),u=s.length;return l<0||l>=u?t?"":void 0:(a=s.charCodeAt(l),a<55296||a>56319||l+1===u||(o=s.charCodeAt(l+1))<56320||o>57343?t?s.charAt(l):a:t?s.slice(l,l+2):o-56320+(a-55296<<10)+65536)}}},function(t,e,i){"use strict";var n=i(49),r=i(28),a=i(50),o={};i(22)(o,i(12)("iterator"),function(){return this}),t.exports=function(t,e,i){t.prototype=n(o,{next:r(1,i)}),a(t,e+" Iterator")}},function(t,e,i){var n=i(16),r=i(23),a=i(25);t.exports=i(20)?Object.defineProperties:function(t,e){r(t);for(var i,o=a(e),s=o.length,l=0;s>l;)n.f(t,i=o[l++],e[i]);return t}},function(t,e,i){t.exports=i(15).document&&document.documentElement},function(t,e,i){var n=i(18),r=i(39),a=i(43)("IE_PROTO"),o=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),n(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}},function(t,e,i){i(104);for(var n=i(15),r=i(22),a=i(29),o=i(12)("toStringTag"),s=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],l=0;l<5;l++){var u=s[l],c=n[u],d=c&&c.prototype;d&&!d[o]&&r(d,o,u),a[u]=a.Array}},function(t,e,i){"use strict";var n=i(105),r=i(106),a=i(29),o=i(14);t.exports=i(66)(Array,"Array",function(t,e){this._t=o(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,i=this._i++;return!t||i>=t.length?(this._t=void 0,r(1)):"keys"==e?r(0,i):"values"==e?r(0,t[i]):r(0,[i,t[i]])},"values"),a.Arguments=a.Array,n("keys"),n("values"),n("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,i){t.exports={default:i(108),__esModule:!0}},function(t,e,i){i(109),i(115),i(116),i(117),t.exports=i(11).Symbol},function(t,e,i){"use strict";var n=i(15),r=i(18),a=i(20),o=i(19),s=i(67),l=i(110).KEY,u=i(27),c=i(44),d=i(50),h=i(32),f=i(12),p=i(51),g=i(52),y=i(111),m=i(112),v=i(113),b=i(23),_=i(14),E=i(47),T=i(28),A=i(49),S=i(114),L=i(54),R=i(16),k=i(25),w=L.f,C=R.f,I=S.f,D=n.Symbol,O=n.JSON,P=O&&O.stringify,x=f("_hidden"),N=f("toPrimitive"),M={}.propertyIsEnumerable,F=c("symbol-registry"),B=c("symbols"),U=c("op-symbols"),G=Object.prototype,K="function"==typeof D,V=n.QObject,j=!V||!V.prototype||!V.prototype.findChild,Y=a&&u(function(){return 7!=A(C({},"a",{get:function(){return C(this,"a",{value:7}).a}})).a})?function(t,e,i){var n=w(G,e);n&&delete G[e],C(t,e,i),n&&t!==G&&C(G,e,n)}:C,H=function(t){var e=B[t]=A(D.prototype);return e._k=t,e},$=K&&"symbol"==typeof D.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof D},z=function(t,e,i){return t===G&&z(U,e,i),b(t),e=E(e,!0),b(i),r(B,e)?(i.enumerable?(r(t,x)&&t[x][e]&&(t[x][e]=!1),i=A(i,{enumerable:T(0,!1)})):(r(t,x)||C(t,x,T(1,{})),t[x][e]=!0),Y(t,e,i)):C(t,e,i)},W=function(t,e){b(t);for(var i,n=m(e=_(e)),r=0,a=n.length;a>r;)z(t,i=n[r++],e[i]);return t},q=function(t,e){return void 0===e?A(t):W(A(t),e)},X=function(t){var e=M.call(this,t=E(t,!0));return!(this===G&&r(B,t)&&!r(U,t))&&(!(e||!r(this,t)||!r(B,t)||r(this,x)&&this[x][t])||e)},Z=function(t,e){if(t=_(t),e=E(e,!0),t!==G||!r(B,e)||r(U,e)){var i=w(t,e);return!i||!r(B,e)||r(t,x)&&t[x][e]||(i.enumerable=!0),i}},J=function(t){for(var e,i=I(_(t)),n=[],a=0;i.length>a;)r(B,e=i[a++])||e==x||e==l||n.push(e);return n},Q=function(t){for(var e,i=t===G,n=I(i?U:_(t)),a=[],o=0;n.length>o;)!r(B,e=n[o++])||i&&!r(G,e)||a.push(B[e]);return a};K||(D=function(){if(this instanceof D)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),e=function(i){this===G&&e.call(U,i),r(this,x)&&r(this[x],t)&&(this[x][t]=!1),Y(this,t,T(1,i))};return a&&j&&Y(G,t,{configurable:!0,set:e}),H(t)},s(D.prototype,"toString",function(){return this._k}),L.f=Z,R.f=z,i(69).f=S.f=J,i(53).f=X,i(68).f=Q,a&&!i(48)&&s(G,"propertyIsEnumerable",X,!0),p.f=function(t){return H(f(t))}),o(o.G+o.W+o.F*!K,{Symbol:D});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;tt.length>et;)f(tt[et++]);for(var tt=k(f.store),et=0;tt.length>et;)g(tt[et++]);o(o.S+o.F*!K,"Symbol",{for:function(t){return r(F,t+="")?F[t]:F[t]=D(t)},keyFor:function(t){if($(t))return y(F,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){j=!0},useSimple:function(){j=!1}}),o(o.S+o.F*!K,"Object",{create:q,defineProperty:z,defineProperties:W,getOwnPropertyDescriptor:Z,getOwnPropertyNames:J,getOwnPropertySymbols:Q}),O&&o(o.S+o.F*(!K||u(function(){var t=D();return"[null]"!=P([t])||"{}"!=P({a:t})||"{}"!=P(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!$(t)){for(var e,i,n=[t],r=1;arguments.length>r;)n.push(arguments[r++]);return e=n[1],"function"==typeof e&&(i=e),!i&&v(e)||(e=function(t,e){if(i&&(e=i.call(this,t,e)),!$(e))return e}),n[1]=e,P.apply(O,n)}}}),D.prototype[N]||i(22)(D.prototype,N,D.prototype.valueOf),d(D,"Symbol"),d(Math,"Math",!0),d(n.JSON,"JSON",!0)},function(t,e,i){var n=i(32)("meta"),r=i(26),a=i(18),o=i(16).f,s=0,l=Object.isExtensible||function(){return!0},u=!i(27)(function(){return l(Object.preventExtensions({}))}),c=function(t){o(t,n,{value:{i:"O"+ ++s,w:{}}})},d=function(t,e){if(!r(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!a(t,n)){if(!l(t))return"F";if(!e)return"E";c(t)}return t[n].i},h=function(t,e){if(!a(t,n)){if(!l(t))return!0;if(!e)return!1;c(t)}return t[n].w},f=function(t){return u&&p.NEED&&l(t)&&!a(t,n)&&c(t),t},p=t.exports={KEY:n,NEED:!1,fastKey:d,getWeak:h,onFreeze:f}},function(t,e,i){var n=i(25),r=i(14);t.exports=function(t,e){for(var i,a=r(t),o=n(a),s=o.length,l=0;s>l;)if(a[i=o[l++]]===e)return i}},function(t,e,i){var n=i(25),r=i(68),a=i(53);t.exports=function(t){var e=n(t),i=r.f;if(i)for(var o,s=i(t),l=a.f,u=0;s.length>u;)l.call(t,o=s[u++])&&e.push(o);return e}},function(t,e,i){var n=i(41);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,i){var n=i(14),r=i(69).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return r(t)}catch(t){return o.slice()}};t.exports.f=function(t){return o&&"[object Window]"==a.call(t)?s(t):r(n(t))}},function(t,e){},function(t,e,i){i(52)("asyncIterator")},function(t,e,i){i(52)("observable")},function(t,e,i){i(119);var n=i(11).Object;t.exports=function(t,e,i){return n.defineProperty(t,e,i)}},function(t,e,i){var n=i(19);n(n.S+n.F*!i(20),"Object",{defineProperty:i(16).f})},function(t,e,i){t.exports={default:i(121),__esModule:!0}},function(t,e,i){i(122),t.exports=i(11).Object.setPrototypeOf},function(t,e,i){var n=i(19);n(n.S,"Object",{setPrototypeOf:i(123).set})},function(t,e,i){var n=i(26),r=i(23),a=function(t,e){if(r(t),!n(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{n=i(46)(Function.call,i(54).f(Object.prototype,"__proto__").set,2),n(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,i){return a(t,i),e?t.__proto__=i:n(t,i),t}}({},!1):void 0),check:a}},function(t,e,i){i(125);var n=i(11).Object;t.exports=function(t,e){return n.create(t,e)}},function(t,e,i){var n=i(19);n(n.S,"Object",{create:i(49)})},function(t,e,i){t.exports={default:i(127),__esModule:!0}},function(t,e,i){i(128);var n=i(11).Object;t.exports=function(t,e){return n.getOwnPropertyDescriptor(t,e)}},function(t,e,i){var n=i(14),r=i(54).f;i(62)("getOwnPropertyDescriptor",function(){return function(t,e){return r(n(t),e)}})},function(t,e,i){"use strict";Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n=arguments[1],r=0;r<i;){var a=e[r];if(t.call(n,a,r,e))return a;r++}}})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),r=function(t){return t&&t.__esModule?t:{default:t}}(n),a=i(56),o="font-weight: bold; font-size: 13px;",s="color: #ff8000;"+o,l="color: #ff0000;"+o,u=1,c=3,d=["color: #0000ff;font-weight: bold; font-size: 13px;","color: #006600;font-weight: bold; font-size: 13px;",s,l,l],h=["debug","info","warn","error","disabled"],f=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;(0,r.default)(this,t),this.kibo=new a.Kibo,this.kibo.down(["ctrl shift d"],function(){return e.onOff()}),this.BLACKLIST=["timeupdate","playback:timeupdate","playback:progress","container:hover","container:timeupdate","container:progress"],this.level=i,this.offLevel=n}return t.prototype.debug=function(t){this.log(t,0,Array.prototype.slice.call(arguments,1))},t.prototype.info=function(t){this.log(t,u,Array.prototype.slice.call(arguments,1))},t.prototype.warn=function(t){this.log(t,2,Array.prototype.slice.call(arguments,1))},t.prototype.error=function(t){this.log(t,3,Array.prototype.slice.call(arguments,1))},t.prototype.onOff=function(){this.level===this.offLevel?this.level=this.previousLevel:(this.previousLevel=this.level,this.level=this.offLevel),window.console&&window.console.log&&window.console.log("%c[Clappr.Log] set log level to "+h[this.level],s)},t.prototype.level=function(t){this.level=t},t.prototype.log=function(t,e,i){if(!(this.BLACKLIST.indexOf(i[0])>=0||e<this.level)){i||(i=t,t=null);var n=d[e],r="";t&&(r="["+t+"]"),window.console&&window.console.log&&window.console.log.apply(console,["%c["+h[e]+"]"+r,n].concat(i))}},t}();e.default=f,f.LEVEL_DEBUG=0,f.LEVEL_INFO=u,f.LEVEL_WARN=2,f.LEVEL_ERROR=3,f.getInstance=function(){return void 0===this._instance&&(this._instance=new this,this._instance.previousLevel=this._instance.level,this._instance.level=this._instance.offLevel),this._instance},f.setLevel=function(t){this.getInstance().level=t},f.debug=function(){this.getInstance().debug.apply(this.getInstance(),arguments)},f.info=function(){this.getInstance().info.apply(this.getInstance(),arguments)},f.warn=function(){this.getInstance().warn.apply(this.getInstance(),arguments)},f.error=function(){this.getInstance().error.apply(this.getInstance(),arguments)},t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){this.element=t||window.document,this.initialize()};n.KEY_NAMES_BY_CODE={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"caps_lock",27:"esc",32:"space",37:"left",38:"up",39:"right",40:"down",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},n.KEY_CODES_BY_NAME={},function(){for(var t in n.KEY_NAMES_BY_CODE)Object.prototype.hasOwnProperty.call(n.KEY_NAMES_BY_CODE,t)&&(n.KEY_CODES_BY_NAME[n.KEY_NAMES_BY_CODE[t]]=+t)}(),n.MODIFIERS=["shift","ctrl","alt"],n.registerEvent=function(){return document.addEventListener?function(t,e,i){t.addEventListener(e,i,!1)}:document.attachEvent?function(t,e,i){t.attachEvent("on"+e,i)}:void 0}(),n.unregisterEvent=function(){return document.removeEventListener?function(t,e,i){t.removeEventListener(e,i,!1)}:document.detachEvent?function(t,e,i){t.detachEvent("on"+e,i)}:void 0}(),n.stringContains=function(t,e){return-1!==t.indexOf(e)},n.neatString=function(t){return t.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")},n.capitalize=function(t){return t.toLowerCase().replace(/^./,function(t){return t.toUpperCase()})},n.isString=function(t){return n.stringContains(Object.prototype.toString.call(t),"String")},n.arrayIncludes=function(){return Array.prototype.indexOf?function(t,e){return-1!==t.indexOf(e)}:function(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return!0;return!1}}(),n.extractModifiers=function(t){var e,i;for(e=[],i=0;i<n.MODIFIERS.length;i++)n.stringContains(t,n.MODIFIERS[i])&&e.push(n.MODIFIERS[i]);return e},n.extractKey=function(t){var e,i;for(e=n.neatString(t).split(" "),i=0;i<e.length;i++)if(!n.arrayIncludes(n.MODIFIERS,e[i]))return e[i]},n.modifiersAndKey=function(t){var e,i;return n.stringContains(t,"any")?n.neatString(t).split(" ").slice(0,2).join(" "):(e=n.extractModifiers(t),i=n.extractKey(t),i&&!n.arrayIncludes(n.MODIFIERS,i)&&e.push(i),e.join(" "))},n.keyName=function(t){return n.KEY_NAMES_BY_CODE[t+""]},n.keyCode=function(t){return+n.KEY_CODES_BY_NAME[t]},n.prototype.initialize=function(){var t,e=this;for(this.lastKeyCode=-1,this.lastModifiers={},t=0;t<n.MODIFIERS.length;t++)this.lastModifiers[n.MODIFIERS[t]]=!1;this.keysDown={any:[]},this.keysUp={any:[]},this.downHandler=this.handler("down"),this.upHandler=this.handler("up"),n.registerEvent(this.element,"keydown",this.downHandler),n.registerEvent(this.element,"keyup",this.upHandler),n.registerEvent(window,"unload",function t(){n.unregisterEvent(e.element,"keydown",e.downHandler),n.unregisterEvent(e.element,"keyup",e.upHandler),n.unregisterEvent(window,"unload",t)})},n.prototype.handler=function(t){var e=this;return function(i){var r,a,o;for(i=i||window.event,e.lastKeyCode=i.keyCode,r=0;r<n.MODIFIERS.length;r++)e.lastModifiers[n.MODIFIERS[r]]=i[n.MODIFIERS[r]+"Key"];for(n.arrayIncludes(n.MODIFIERS,n.keyName(e.lastKeyCode))&&(e.lastModifiers[n.keyName(e.lastKeyCode)]=!0),a=e["keys"+n.capitalize(t)],r=0;r<a.any.length;r++)!1===a.any[r](i)&&i.preventDefault&&i.preventDefault();if(o=e.lastModifiersAndKey(),a[o])for(r=0;r<a[o].length;r++)!1===a[o][r](i)&&i.preventDefault&&i.preventDefault()}},n.prototype.registerKeys=function(t,e,i){var r,a,o=this["keys"+n.capitalize(t)];for(n.isString(e)&&(e=[e]),r=0;r<e.length;r++)a=e[r],a=n.modifiersAndKey(a+""),o[a]?o[a].push(i):o[a]=[i];return this},n.prototype.unregisterKeys=function(t,e,i){var r,a,o,s=this["keys"+n.capitalize(t)];for(n.isString(e)&&(e=[e]),r=0;r<e.length;r++)if(o=e[r],o=n.modifiersAndKey(o+""),null===i)delete s[o];else if(s[o])for(a=0;a<s[o].length;a++)if(String(s[o][a])===String(i)){s[o].splice(a,1);break}return this},n.prototype.off=function(t){return this.unregisterKeys("down",t,null)},n.prototype.delegate=function(t,e,i){return null!==i||void 0!==i?this.registerKeys(t,e,i):this.unregisterKeys(t,e,i)},n.prototype.down=function(t,e){return this.delegate("down",t,e)},n.prototype.up=function(t,e){return this.delegate("up",t,e)},n.prototype.lastKey=function(t){return t?this.lastModifiers[t]:n.keyName(this.lastKeyCode)},n.prototype.lastModifiersAndKey=function(){var t,e;for(t=[],e=0;e<n.MODIFIERS.length;e++)this.lastKey(n.MODIFIERS[e])&&t.push(n.MODIFIERS[e]);return n.arrayIncludes(t,this.lastKey())||t.push(this.lastKey()),t.join(" ")},e.default=n,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(133),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(17),f=n(h),p=i(72),g=n(p),y=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this));return n.player=i,n._options=i.options,n}return(0,d.default)(e,t),(0,u.default)(e,[{key:"loader",get:function(){return this.player.loader}}]),e.prototype.create=function(){return this.options.loader=this.loader,this.core=new g.default(this.options),this.addCorePlugins(),this.core.createContainers(this.options),this.core},e.prototype.addCorePlugins=function(){var t=this;return this.loader.corePlugins.forEach(function(e){var i=new e(t.core);t.core.addPlugin(i),t.setupExternalInterface(i)}),this.core},e.prototype.setupExternalInterface=function(t){var e=t.getExternalInterface();for(var i in e)this.player[i]=e[i].bind(t)},e}(f.default);e.default=y,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(5),f=i(4),p=n(f),g=i(21),y=n(g),m=i(13),v=n(m),b=i(135),_=n(b),E=i(74),T=n(E),A=i(24),S=n(A),L=i(34),R=n(L),k=i(77),w=n(k),C=i(6),I=n(C);i(153);var D=i(155),O=n(D),P=void 0,x=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n.configureDomRecycler(),n.playerInfo=R.default.getInstance(i.playerId),n.firstResize=!0,n.plugins=[],n.containers=[],n.setupMediaControl(null),n._boundFullscreenHandler=function(){return n.handleFullscreenChange()},(0,I.default)(document).bind("fullscreenchange",n._boundFullscreenHandler),(0,I.default)(document).bind("MSFullscreenChange",n._boundFullscreenHandler),(0,I.default)(document).bind("mozfullscreenchange",n._boundFullscreenHandler),v.default.isMobile&&(0,I.default)(window).bind("resize",function(t){n.handleWindowResize(t)}),n}return(0,d.default)(e,t),(0,u.default)(e,[{key:"events",get:function(){return{webkitfullscreenchange:"handleFullscreenChange",mousemove:"showMediaControl",mouseleave:"hideMediaControl"}}},{key:"attributes",get:function(){return{"data-player":"",tabindex:9999}}},{key:"isReady",get:function(){return!!this.ready}},{key:"i18n",get:function(){return this.getPlugin("strings")||{t:function(t){return t}}}}]),e.prototype.configureDomRecycler=function(){var t=!!(this.options&&this.options.playback&&this.options.playback.recycleVideo);h.DomRecycler.configure({recycleVideo:t})},e.prototype.createContainers=function(t){var e=this;this.defer=I.default.Deferred(),this.defer.promise(this),this.containerFactory=new _.default(t,t.loader,this.i18n),this.containerFactory.createContainers().then(function(t){return e.setupContainers(t)}).then(function(t){return e.resolveOnContainersReady(t)})},e.prototype.updateSize=function(){h.Fullscreen.isFullscreen()?this.setFullscreen():this.setPlayerSize()},e.prototype.setFullscreen=function(){v.default.isiOS||(this.$el.addClass("fullscreen"),this.$el.removeAttr("style"),this.playerInfo.previousSize={width:this.options.width,height:this.options.height},this.playerInfo.currentSize={width:(0,I.default)(window).width(),height:(0,I.default)(window).height()})},e.prototype.setPlayerSize=function(){this.$el.removeClass("fullscreen"),this.playerInfo.currentSize=this.playerInfo.previousSize,this.playerInfo.previousSize={width:(0,I.default)(window).width(),height:(0,I.default)(window).height()},this.resize(this.playerInfo.currentSize)},e.prototype.resize=function(t){(0,h.isNumber)(t.height)||(0,h.isNumber)(t.width)?(this.el.style.height=t.height+"px",this.el.style.width=t.width+"px"):(this.el.style.height=""+t.height,this.el.style.width=""+t.width),this.playerInfo.previousSize={width:this.options.width,height:this.options.height},this.options.width=t.width,this.options.height=t.height,this.playerInfo.currentSize=t,this.triggerResize(this.playerInfo.currentSize)},e.prototype.enableResizeObserver=function(){var t=this,e=function(){t.playerInfo.computedSize.width===t.el.clientWidth&&t.playerInfo.computedSize.height===t.el.clientHeight||(t.playerInfo.computedSize={width:t.el.clientWidth,height:t.el.clientHeight},t.triggerResize(t.playerInfo.computedSize))};this.resizeObserverInterval=setInterval(e,500)},e.prototype.triggerResize=function(t){(this.firstResize||this.oldHeight!==t.height||this.oldWidth!==t.width)&&(S.default.trigger(this.options.playerId+":"+p.default.PLAYER_RESIZE,t),this.oldHeight=t.height,this.oldWidth=t.width,this.firstResize=!1)},e.prototype.disableResizeObserver=function(){this.resizeObserverInterval&&clearInterval(this.resizeObserverInterval)},e.prototype.resolveOnContainersReady=function(t){var e=this;I.default.when.apply(I.default,t).done(function(){e.defer.resolve(e),e.ready=!0,e.trigger(p.default.CORE_READY)})},e.prototype.addPlugin=function(t){this.plugins.push(t)},e.prototype.hasPlugin=function(t){return!!this.getPlugin(t)},e.prototype.getPlugin=function(t){return this.plugins.filter(function(e){return e.name===t})[0]},e.prototype.load=function(t,e){var i=this;this.options.mimeType=e,t=t&&t.constructor===Array?t:[t],this.containers.forEach(function(t){return t.destroy()}),this.mediaControl.container=null,this.containerFactory.options=I.default.extend(this.options,{sources:t}),this.containerFactory.createContainers().then(function(t){i.setupContainers(t)})},e.prototype.destroy=function(){this.disableResizeObserver(),this.containers.forEach(function(t){return t.destroy()}),this.plugins.forEach(function(t){return t.destroy()}),this.$el.remove(),this.mediaControl.destroy(),(0,I.default)(document).unbind("fullscreenchange",this._boundFullscreenHandler),(0,I.default)(document).unbind("MSFullscreenChange",this._boundFullscreenHandler),(0,I.default)(document).unbind("mozfullscreenchange",this._boundFullscreenHandler)},e.prototype.handleFullscreenChange=function(){this.trigger(p.default.CORE_FULLSCREEN,h.Fullscreen.isFullscreen()),this.updateSize(),this.mediaControl.show()},e.prototype.handleWindowResize=function(t){var e=(0,I.default)(window).width()>(0,I.default)(window).height()?"landscape":"portrait";this._screenOrientation!==e&&(this._screenOrientation=e,this.trigger(p.default.CORE_SCREEN_ORIENTATION_CHANGED,{event:t,orientation:this._screenOrientation}))},e.prototype.setMediaControlContainer=function(t){this.mediaControl.setContainer(t),this.mediaControl.render()},e.prototype.disableMediaControl=function(){this.mediaControl.disable(),this.$el.removeClass("nocursor")},e.prototype.enableMediaControl=function(){this.mediaControl.enable()},e.prototype.removeContainer=function(t){this.stopListening(t),this.containers=this.containers.filter(function(e){return e!==t})},e.prototype.appendContainer=function(t){this.listenTo(t,p.default.CONTAINER_DESTROYED,this.removeContainer),this.containers.push(t)},e.prototype.setupContainers=function(t){return t.map(this.appendContainer.bind(this)),this.trigger(p.default.CORE_CONTAINERS_CREATED),this.renderContainers(),this.setupMediaControl(this.getCurrentContainer()),this.render(),this.appendToParent(),this.containers},e.prototype.renderContainers=function(){var t=this;this.containers.map(function(e){return t.el.appendChild(e.render().el)})},e.prototype.createContainer=function(t,e){var i=this.containerFactory.createContainer(t,e);return this.appendContainer(i),this.el.appendChild(i.render().el),i},e.prototype.setupMediaControl=function(t){this.mediaControl?this.mediaControl.setContainer(t):(this.mediaControl=this.createMediaControl(I.default.extend({container:t,focusElement:this.el},this.options)),this.listenTo(this.mediaControl,p.default.MEDIACONTROL_FULLSCREEN,this.toggleFullscreen),this.listenTo(this.mediaControl,p.default.MEDIACONTROL_SHOW,this.onMediaControlShow.bind(this,!0)),this.listenTo(this.mediaControl,p.default.MEDIACONTROL_HIDE,this.onMediaControlShow.bind(this,!1)))},e.prototype.createMediaControl=function(t){return t.mediacontrol&&t.mediacontrol.external?new t.mediacontrol.external(t).render():new T.default(t).render()},e.prototype.getCurrentContainer=function(){return this.mediaControl&&this.mediaControl.container?this.mediaControl.container:this.containers[0]},e.prototype.getCurrentPlayback=function(){var t=this.getCurrentContainer();return t&&t.playback},e.prototype.getPlaybackType=function(){var t=this.getCurrentContainer();return t&&t.getPlaybackType()},e.prototype.toggleFullscreen=function(){h.Fullscreen.isFullscreen()?(h.Fullscreen.cancelFullscreen(),v.default.isiOS||this.$el.removeClass("fullscreen nocursor")):(h.Fullscreen.requestFullscreen(this.el),v.default.isiOS||this.$el.addClass("fullscreen")),this.mediaControl.show()},e.prototype.showMediaControl=function(t){this.mediaControl.show(t)},e.prototype.hideMediaControl=function(){this.mediaControl.hide(this.options.hideMediaControlDelay)},e.prototype.onMediaControlShow=function(t){this.getCurrentContainer().trigger(t?p.default.CONTAINER_MEDIACONTROL_SHOW:p.default.CONTAINER_MEDIACONTROL_HIDE),t?this.$el.removeClass("nocursor"):h.Fullscreen.isFullscreen()&&this.$el.addClass("nocursor")},e.prototype.configure=function(t){var e=this;this._options=I.default.extend(this._options,t),this.configureDomRecycler();var i=t.source||t.sources;i?this.load(i,t.mimeType||this.options.mimeType):(this.trigger(p.default.CORE_OPTIONS_CHANGE),this.containers.forEach(function(t){t.configure(e.options)}))},e.prototype.appendToParent=function(){!(this.$el.parent()&&this.$el.parent().length)&&this.$el.appendTo(this.options.parentElement)},e.prototype.render=function(){this.$el.append(this.mediaControl.render().el),P||(P=w.default.getStyleFor(O.default,{baseUrl:this.options.baseUrl})),(0,I.default)("head").append(P),this.options.width=this.options.width||this.$el.width(),this.options.height=this.options.height||this.$el.height();var t={width:this.options.width,height:this.options.height};return this.playerInfo.previousSize=this.playerInfo.currentSize=this.playerInfo.computedSize=t,this.updateSize(),this.previousSize={width:this.$el.width(),height:this.$el.height()},this.enableResizeObserver(),this},e}(y.default);e.default=x,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(136),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(33),a=n(r),o=i(0),s=n(o),l=i(1),u=n(l),c=i(3),d=n(c),h=i(2),f=n(h),p=i(17),g=n(p),y=i(4),m=n(y),v=i(73),b=n(v),_=i(6),E=n(_),T=function(t){function e(i,n,r){(0,s.default)(this,e);var a=(0,u.default)(this,t.call(this,i));return a._i18n=r,a.loader=n,a}return(0,f.default)(e,t),(0,d.default)(e,[{key:"options",get:function(){return this._options},set:function(t){this._options=t}}]),e.prototype.createContainers=function(){var t=this;return E.default.Deferred(function(e){e.resolve(t.options.sources.map(function(e){return t.createContainer(e)}))})},e.prototype.findPlaybackPlugin=function(t,e){return this.loader.playbackPlugins.filter(function(i){return i.canPlay(t,e)})[0]},e.prototype.createContainer=function(t){var e=null,i=this.options.mimeType;"object"===(void 0===t?"undefined":(0,a.default)(t))?(e=t.source.toString(),t.mimeType&&(i=t.mimeType)):e=t.toString(),e.match(/^\/\//)&&(e=window.location.protocol+e);var n=E.default.extend({},this.options,{src:e,mimeType:i}),r=this.findPlaybackPlugin(e,i),o=new r(n,this._i18n);n=E.default.extend({},n,{playback:o});var s=new b.default(n,this._i18n),l=E.default.Deferred();return l.promise(s),this.addContainerPlugins(s),this.listenToOnce(s,m.default.CONTAINER_READY,function(){return l.resolve(s)}),s},e.prototype.addContainerPlugins=function(t){this.loader.containerPlugins.forEach(function(e){t.addPlugin(new e(t))})},e}(g.default);e.default=T,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(4),f=n(h),p=i(21),g=n(p);i(138);var y=i(6),m=n(y),v=function(t){function e(i,n){(0,a.default)(this,e);var r=(0,s.default)(this,t.call(this,i));return r._i18n=n,r.currentTime=0,r.volume=100,r.playback=i.playback,r.settings=m.default.extend({},r.playback.settings),r.isReady=!1,r.mediaControlDisabled=!1,r.plugins=[r.playback],r.bindEvents(),r}return(0,d.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"Container"}},{key:"attributes",get:function(){return{class:"container","data-container":""}}},{key:"events",get:function(){return{click:"clicked",dblclick:"dblClicked",doubleTap:"dblClicked",contextmenu:"onContextMenu",mouseenter:"mouseEnter",mouseleave:"mouseLeave"}}},{key:"ended",get:function(){return this.playback.ended}},{key:"buffering",get:function(){return this.playback.buffering}},{key:"i18n",get:function(){return this._i18n}},{key:"hasClosedCaptionsTracks",get:function(){return this.playback.hasClosedCaptionsTracks}},{key:"closedCaptionsTracks",get:function(){return this.playback.closedCaptionsTracks}},{key:"closedCaptionsTrackId",get:function(){return this.playback.closedCaptionsTrackId},set:function(t){this.playback.closedCaptionsTrackId=t}}]),e.prototype.bindEvents=function(){this.listenTo(this.playback,f.default.PLAYBACK_PROGRESS,this.progress),this.listenTo(this.playback,f.default.PLAYBACK_TIMEUPDATE,this.timeUpdated),this.listenTo(this.playback,f.default.PLAYBACK_READY,this.ready),this.listenTo(this.playback,f.default.PLAYBACK_BUFFERING,this.onBuffering),this.listenTo(this.playback,f.default.PLAYBACK_BUFFERFULL,this.bufferfull),this.listenTo(this.playback,f.default.PLAYBACK_SETTINGSUPDATE,this.settingsUpdate),this.listenTo(this.playback,f.default.PLAYBACK_LOADEDMETADATA,this.loadedMetadata),this.listenTo(this.playback,f.default.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinitionUpdate),this.listenTo(this.playback,f.default.PLAYBACK_BITRATE,this.updateBitrate),this.listenTo(this.playback,f.default.PLAYBACK_PLAYBACKSTATE,this.playbackStateChanged),this.listenTo(this.playback,f.default.PLAYBACK_DVR,this.playbackDvrStateChanged),this.listenTo(this.playback,f.default.PLAYBACK_MEDIACONTROL_DISABLE,this.disableMediaControl),this.listenTo(this.playback,f.default.PLAYBACK_MEDIACONTROL_ENABLE,this.enableMediaControl),this.listenTo(this.playback,f.default.PLAYBACK_SEEKED,this.onSeeked),this.listenTo(this.playback,f.default.PLAYBACK_ENDED,this.onEnded),this.listenTo(this.playback,f.default.PLAYBACK_PLAY,this.playing),this.listenTo(this.playback,f.default.PLAYBACK_PAUSE,this.paused),this.listenTo(this.playback,f.default.PLAYBACK_STOP,this.stopped),this.listenTo(this.playback,f.default.PLAYBACK_ERROR,this.error),this.listenTo(this.playback,f.default.PLAYBACK_SUBTITLE_AVAILABLE,this.subtitleAvailable),this.listenTo(this.playback,f.default.PLAYBACK_SUBTITLE_CHANGED,this.subtitleChanged)},e.prototype.subtitleAvailable=function(){this.trigger(f.default.CONTAINER_SUBTITLE_AVAILABLE)},e.prototype.subtitleChanged=function(t){this.trigger(f.default.CONTAINER_SUBTITLE_CHANGED,t)},e.prototype.playbackStateChanged=function(t){this.trigger(f.default.CONTAINER_PLAYBACKSTATE,t)},e.prototype.playbackDvrStateChanged=function(t){this.settings=this.playback.settings,this.dvrInUse=t,this.trigger(f.default.CONTAINER_PLAYBACKDVRSTATECHANGED,t)},e.prototype.updateBitrate=function(t){this.trigger(f.default.CONTAINER_BITRATE,t)},e.prototype.statsReport=function(t){this.trigger(f.default.CONTAINER_STATS_REPORT,t)},e.prototype.getPlaybackType=function(){return this.playback.getPlaybackType()},e.prototype.isDvrEnabled=function(){return!!this.playback.dvrEnabled},e.prototype.isDvrInUse=function(){return!!this.dvrInUse},e.prototype.destroy=function(){this.trigger(f.default.CONTAINER_DESTROYED,this,this.name),this.stopListening(),this.plugins.forEach(function(t){return t.destroy()}),this.$el.remove()},e.prototype.setStyle=function(t){this.$el.css(t)},e.prototype.animate=function(t,e){return this.$el.animate(t,e).promise()},e.prototype.ready=function(){this.isReady=!0,this.trigger(f.default.CONTAINER_READY,this.name)},e.prototype.isPlaying=function(){return this.playback.isPlaying()},e.prototype.getStartTimeOffset=function(){return this.playback.getStartTimeOffset()},e.prototype.getCurrentTime=function(){return this.currentTime},e.prototype.getDuration=function(){return this.playback.getDuration()},e.prototype.error=function(t){this.isReady||this.ready(),this.trigger(f.default.CONTAINER_ERROR,{error:t,container:this},this.name)},e.prototype.loadedMetadata=function(t){this.trigger(f.default.CONTAINER_LOADEDMETADATA,t)},e.prototype.timeUpdated=function(t){this.currentTime=t.current,this.trigger(f.default.CONTAINER_TIMEUPDATE,t,this.name)},e.prototype.progress=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];this.trigger.apply(this,[f.default.CONTAINER_PROGRESS].concat(e,[this.name]))},e.prototype.playing=function(){this.trigger(f.default.CONTAINER_PLAY,this.name)},e.prototype.paused=function(){this.trigger(f.default.CONTAINER_PAUSE,this.name)},e.prototype.play=function(){this.playback.play()},e.prototype.stop=function(){this.playback.stop(),this.currentTime=0},e.prototype.pause=function(){this.playback.pause()},e.prototype.onEnded=function(){this.trigger(f.default.CONTAINER_ENDED,this,this.name),this.currentTime=0},e.prototype.stopped=function(){this.trigger(f.default.CONTAINER_STOP)},e.prototype.clicked=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(f.default.CONTAINER_CLICK,this,this.name)},e.prototype.dblClicked=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(f.default.CONTAINER_DBLCLICK,this,this.name)},e.prototype.onContextMenu=function(t){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(f.default.CONTAINER_CONTEXTMENU,t,this.name)},e.prototype.seek=function(t){this.trigger(f.default.CONTAINER_SEEK,t,this.name),this.playback.seek(t)},e.prototype.onSeeked=function(){this.trigger(f.default.CONTAINER_SEEKED,this.name)},e.prototype.seekPercentage=function(t){var e=this.getDuration();if(t>=0&&t<=100){var i=e*(t/100);this.seek(i)}},e.prototype.setVolume=function(t){this.volume=parseInt(t,10),this.trigger(f.default.CONTAINER_VOLUME,t,this.name),this.playback.volume(t)},e.prototype.fullscreen=function(){this.trigger(f.default.CONTAINER_FULLSCREEN,this.name)},e.prototype.onBuffering=function(){this.trigger(f.default.CONTAINER_STATE_BUFFERING,this.name)},e.prototype.bufferfull=function(){this.trigger(f.default.CONTAINER_STATE_BUFFERFULL,this.name)},e.prototype.addPlugin=function(t){this.plugins.push(t)},e.prototype.hasPlugin=function(t){return!!this.getPlugin(t)},e.prototype.getPlugin=function(t){return this.plugins.filter(function(e){return e.name===t})[0]},e.prototype.mouseEnter=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(f.default.CONTAINER_MOUSE_ENTER)},e.prototype.mouseLeave=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(f.default.CONTAINER_MOUSE_LEAVE)},e.prototype.settingsUpdate=function(){this.settings=this.playback.settings,this.trigger(f.default.CONTAINER_SETTINGSUPDATE)},e.prototype.highDefinitionUpdate=function(t){this.trigger(f.default.CONTAINER_HIGHDEFINITIONUPDATE,t)},e.prototype.isHighDefinitionInUse=function(){return this.playback.isHighDefinitionInUse()},e.prototype.disableMediaControl=function(){this.mediaControlDisabled||(this.mediaControlDisabled=!0,this.trigger(f.default.CONTAINER_MEDIACONTROL_DISABLE))},e.prototype.enableMediaControl=function(){this.mediaControlDisabled&&(this.mediaControlDisabled=!1,this.trigger(f.default.CONTAINER_MEDIACONTROL_ENABLE))},e.prototype.updateStyle=function(){!this.options.chromeless||this.options.allowUserInteraction?this.$el.removeClass("chromeless"):this.$el.addClass("chromeless")},e.prototype.configure=function(t){this._options=m.default.extend(this._options,t),this.updateStyle(),this.trigger(f.default.CONTAINER_OPTIONS_CHANGE)},e.prototype.render=function(){return this.$el.append(this.playback.render().el),this.updateStyle(),this},e}(g.default);e.default=v,t.exports=e.default},function(t,e,i){var n=i(139);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,".container[data-container]{position:absolute;background-color:#000;height:100%;width:100%}.container[data-container] .chromeless{cursor:default}[data-player]:not(.nocursor) .container[data-container]:not(.chromeless).pointer-enabled{cursor:pointer}",""])},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var i=e.protocol+"//"+e.host,n=i+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(r))return t;var a;return a=0===r.indexOf("//")?r:0===r.indexOf("/")?i+r:n+r.replace(/^\.\//,""),"url("+JSON.stringify(a)+")"})}},function(t,e,i){"use strict";(function(n){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=i(142),o=r(a),s=i(0),l=r(s),u=i(1),c=r(u),d=i(3),h=r(d),f=i(2),p=r(f),g=i(5),y=i(56),m=i(4),v=r(m),b=i(21),_=r(b),E=i(13),T=r(E),A=i(24),S=r(A),L=i(8),R=r(L),k=i(9),w=r(k),C=i(6),I=r(C);i(144);var D=i(146),O=r(D),P=i(58),x=r(P),N=i(76),M=r(N),F=i(147),B=r(F),U=i(148),G=r(U),K=i(149),V=r(K),j=i(150),Y=r(j),H=i(151),$=r(H),z=i(152),W=r(z),q=function(t){function e(i){(0,l.default)(this,e);var n=(0,c.default)(this,t.call(this,i));n.persistConfig=n.options.persistConfig,n.container=i.container,n.currentPositionValue=null,n.currentDurationValue=null;var r=n.persistConfig?g.Config.restore("volume"):100;return n.setVolume(n.options.mute?0:r),n.keepVisible=!1,n.fullScreenOnVideoTagSupported=null,n.addEventListeners(),n.settings={left:["play","stop","pause"],right:["volume"],default:["position","seekbar","duration"]},n.container?I.default.isEmptyObject(n.container.settings)||(n.settings=I.default.extend({},n.container.settings)):n.settings={},n.userDisabled=!1,(n.container&&n.container.mediaControlDisabled||n.options.chromeless)&&n.disable(),n.stopDragHandler=function(t){return n.stopDrag(t)},n.updateDragHandler=function(t){return n.updateDrag(t)},(0,I.default)(document).bind("mouseup",n.stopDragHandler),(0,I.default)(document).bind("mousemove",n.updateDragHandler),n}return(0,p.default)(e,t),(0,h.default)(e,[{key:"name",get:function(){return"MediaControl"}},{key:"disabled",get:function(){return this.userDisabled||this.container&&this.container.getPlaybackType()===w.default.NO_OP}},{key:"attributes",get:function(){return{class:"media-control","data-media-control":""}}},{key:"events",get:function(){return{"click [data-play]":"play","click [data-pause]":"pause","click [data-playpause]":"togglePlayPause","click [data-stop]":"stop","click [data-playstop]":"togglePlayStop","click [data-fullscreen]":"toggleFullscreen","click .bar-container[data-seekbar]":"seek","click .bar-container[data-volume]":"onVolumeClick","click .drawer-icon[data-volume]":"toggleMute","mouseenter .drawer-container[data-volume]":"showVolumeBar","mouseleave .drawer-container[data-volume]":"hideVolumeBar","mousedown .bar-container[data-volume]":"startVolumeDrag","mousemove .bar-container[data-volume]":"mousemoveOnVolumeBar","mousedown .bar-scrubber[data-seekbar]":"startSeekDrag","mousemove .bar-container[data-seekbar]":"mousemoveOnSeekBar","mouseleave .bar-container[data-seekbar]":"mouseleaveOnSeekBar","mouseenter .media-control-layer[data-controls]":"setUserKeepVisible","mouseleave .media-control-layer[data-controls]":"resetUserKeepVisible"}}},{key:"template",get:function(){return(0,R.default)(O.default)}},{key:"volume",get:function(){return this.container&&this.container.isReady?this.container.volume:this.intendedVolume}},{key:"muted",get:function(){return 0===this.volume}}]),e.prototype.addEventListeners=function(){this.container&&(S.default.on(this.options.playerId+":"+v.default.PLAYER_RESIZE,this.playerResize,this),this.listenTo(this.container,v.default.CONTAINER_PLAY,this.changeTogglePlay),this.listenTo(this.container,v.default.CONTAINER_PAUSE,this.changeTogglePlay),this.listenTo(this.container,v.default.CONTAINER_STOP,this.changeTogglePlay),this.listenTo(this.container,v.default.CONTAINER_DBLCLICK,this.toggleFullscreen),this.listenTo(this.container,v.default.CONTAINER_TIMEUPDATE,this.onTimeUpdate),this.listenTo(this.container,v.default.CONTAINER_PROGRESS,this.updateProgressBar),this.listenTo(this.container,v.default.CONTAINER_SETTINGSUPDATE,this.settingsUpdate),this.listenTo(this.container,v.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.settingsUpdate),this.listenTo(this.container,v.default.CONTAINER_HIGHDEFINITIONUPDATE,this.highDefinitionUpdate),this.listenTo(this.container,v.default.CONTAINER_MEDIACONTROL_DISABLE,this.disable),this.listenTo(this.container,v.default.CONTAINER_MEDIACONTROL_ENABLE,this.enable),this.listenTo(this.container,v.default.CONTAINER_ENDED,this.ended),this.listenTo(this.container,v.default.CONTAINER_VOLUME,this.onVolumeChanged),"video"===this.container.playback.el.nodeName.toLowerCase()&&this.listenToOnce(this.container,v.default.CONTAINER_LOADEDMETADATA,this.onLoadedMetadataOnVideoTag))},e.prototype.disable=function(){this.userDisabled=!0,this.hide(),this.$el.hide()},e.prototype.enable=function(){this.options.chromeless||(this.userDisabled=!1,this.show())},e.prototype.play=function(){this.container.play()},e.prototype.pause=function(){this.container.pause()},e.prototype.stop=function(){this.container.stop()},e.prototype.onVolumeChanged=function(){this.updateVolumeUI()},e.prototype.onLoadedMetadataOnVideoTag=function(){var t=this.container.playback.el;!g.Fullscreen.fullscreenEnabled()&&t.webkitSupportsFullscreen&&(this.fullScreenOnVideoTagSupported=!0,this.settingsUpdate())},e.prototype.updateVolumeUI=function(){if(this.rendered){this.$volumeBarContainer.find(".bar-fill-2").css({});var t=this.$volumeBarContainer.width(),e=this.$volumeBarBackground.width(),i=(t-e)/2,n=e*this.volume/100+i;this.$volumeBarFill.css({width:this.volume+"%"}),this.$volumeBarScrubber.css({left:n}),this.$volumeBarContainer.find(".segmented-bar-element").removeClass("fill");var r=Math.ceil(this.volume/10);this.$volumeBarContainer.find(".segmented-bar-element").slice(0,r).addClass("fill"),this.$volumeIcon.html(""),this.$volumeIcon.removeClass("muted"),this.muted?(this.$volumeIcon.append(V.default),this.$volumeIcon.addClass("muted")):this.$volumeIcon.append(G.default),this.applyButtonStyle(this.$volumeIcon)}},e.prototype.changeTogglePlay=function(){this.$playPauseToggle.html(""),this.$playStopToggle.html(""),this.container&&this.container.isPlaying()?(this.$playPauseToggle.append(M.default),this.$playStopToggle.append(B.default),this.trigger(v.default.MEDIACONTROL_PLAYING)):(this.$playPauseToggle.append(x.default),this.$playStopToggle.append(x.default),this.trigger(v.default.MEDIACONTROL_NOTPLAYING),T.default.isMobile&&this.show()),this.applyButtonStyle(this.$playPauseToggle),this.applyButtonStyle(this.$playStopToggle)},e.prototype.mousemoveOnSeekBar=function(t){if(this.settings.seekEnabled){var e=t.pageX-this.$seekBarContainer.offset().left-this.$seekBarHover.width()/2;this.$seekBarHover.css({left:e})}this.trigger(v.default.MEDIACONTROL_MOUSEMOVE_SEEKBAR,t)},e.prototype.mouseleaveOnSeekBar=function(t){this.trigger(v.default.MEDIACONTROL_MOUSELEAVE_SEEKBAR,t)},e.prototype.onVolumeClick=function(t){this.setVolume(this.getVolumeFromUIEvent(t))},e.prototype.mousemoveOnVolumeBar=function(t){this.draggingVolumeBar&&this.setVolume(this.getVolumeFromUIEvent(t))},e.prototype.playerResize=function(t){this.$fullscreenToggle.html(""),g.Fullscreen.isFullscreen()?this.$fullscreenToggle.append($.default):this.$fullscreenToggle.append(Y.default),this.applyButtonStyle(this.$fullscreenToggle),this.$el.removeClass("w320"),(t.width<=320||this.options.hideVolumeBar)&&this.$el.addClass("w320")},e.prototype.togglePlayPause=function(){return this.container.isPlaying()?this.container.pause():this.container.play(),!1},e.prototype.togglePlayStop=function(){this.container.isPlaying()?this.container.stop():this.container.play()},e.prototype.startSeekDrag=function(t){this.settings.seekEnabled&&(this.draggingSeekBar=!0,this.$el.addClass("dragging"),this.$seekBarLoaded.addClass("media-control-notransition"),this.$seekBarPosition.addClass("media-control-notransition"),this.$seekBarScrubber.addClass("media-control-notransition"),t&&t.preventDefault())},e.prototype.startVolumeDrag=function(t){this.draggingVolumeBar=!0,this.$el.addClass("dragging"),t&&t.preventDefault()},e.prototype.stopDrag=function(t){this.draggingSeekBar&&this.seek(t),this.$el.removeClass("dragging"),this.$seekBarLoaded.removeClass("media-control-notransition"),this.$seekBarPosition.removeClass("media-control-notransition"),this.$seekBarScrubber.removeClass("media-control-notransition dragging"),this.draggingSeekBar=!1,this.draggingVolumeBar=!1},e.prototype.updateDrag=function(t){if(this.draggingSeekBar){t.preventDefault();var e=t.pageX-this.$seekBarContainer.offset().left,i=e/this.$seekBarContainer.width()*100;i=Math.min(100,Math.max(i,0)),this.setSeekPercentage(i)}else this.draggingVolumeBar&&(t.preventDefault(),this.setVolume(this.getVolumeFromUIEvent(t)))},e.prototype.getVolumeFromUIEvent=function(t){return(t.pageX-this.$volumeBarContainer.offset().left)/this.$volumeBarContainer.width()*100},e.prototype.toggleMute=function(){this.setVolume(this.muted?100:0)},e.prototype.setVolume=function(t){var e=this;t=Math.min(100,Math.max(t,0)),this.intendedVolume=t,this.persistConfig&&g.Config.persist("volume",t);var i=function(){e.container.isReady?e.container.setVolume(t):e.listenToOnce(e.container,v.default.CONTAINER_READY,function(){e.container.setVolume(t)})};this.container?i():this.listenToOnce(this,v.default.MEDIACONTROL_CONTAINERCHANGED,function(){i()})},e.prototype.toggleFullscreen=function(){this.trigger(v.default.MEDIACONTROL_FULLSCREEN,this.name),this.container.fullscreen(),this.resetUserKeepVisible()},e.prototype.setContainer=function(t){this.container&&(this.stopListening(this.container),this.fullScreenOnVideoTagSupported=null),S.default.off(this.options.playerId+":"+v.default.PLAYER_RESIZE,this.playerResize,this),this.container=t,this.setVolume(this.intendedVolume),this.changeTogglePlay(),this.addEventListeners(),this.settingsUpdate(),this.container.trigger(v.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.container.isDvrInUse()),this.container.mediaControlDisabled&&this.disable(),this.trigger(v.default.MEDIACONTROL_CONTAINERCHANGED)},e.prototype.showVolumeBar=function(){this.hideVolumeId&&clearTimeout(this.hideVolumeId),this.$volumeBarContainer.removeClass("volume-bar-hide")},e.prototype.hideVolumeBar=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:400;this.$volumeBarContainer&&(this.draggingVolumeBar?this.hideVolumeId=setTimeout(function(){return t.hideVolumeBar()},e):(this.hideVolumeId&&clearTimeout(this.hideVolumeId),this.hideVolumeId=setTimeout(function(){return t.$volumeBarContainer.addClass("volume-bar-hide")},e)))},e.prototype.ended=function(){this.changeTogglePlay()},e.prototype.updateProgressBar=function(t){var e=t.start/t.total*100,i=t.current/t.total*100;this.$seekBarLoaded.css({left:e+"%",width:i-e+"%"})},e.prototype.onTimeUpdate=function(t){if(!this.draggingSeekBar){var e=t.current<0?t.total:t.current;this.currentPositionValue=e,this.currentDurationValue=t.total,this.renderSeekBar()}},e.prototype.renderSeekBar=function(){if(null!==this.currentPositionValue&&null!==this.currentDurationValue){this.currentSeekBarPercentage=100,(this.container.getPlaybackType()!==w.default.LIVE||this.container.isDvrInUse())&&(this.currentSeekBarPercentage=this.currentPositionValue/this.currentDurationValue*100),this.setSeekPercentage(this.currentSeekBarPercentage);var t=(0,g.formatTime)(this.currentPositionValue),e=(0,g.formatTime)(this.currentDurationValue);t!==this.displayedPosition&&(this.$position.text(t),this.displayedPosition=t),e!==this.displayedDuration&&(this.$duration.text(e),this.displayedDuration=e)}},e.prototype.seek=function(t){if(this.settings.seekEnabled){var e=t.pageX-this.$seekBarContainer.offset().left,i=e/this.$seekBarContainer.width()*100;return i=Math.min(100,Math.max(i,0)),this.container.seekPercentage(i),this.setSeekPercentage(i),!1}},e.prototype.setKeepVisible=function(){this.keepVisible=!0},e.prototype.resetKeepVisible=function(){this.keepVisible=!1},e.prototype.setUserKeepVisible=function(){this.userKeepVisible=!0},e.prototype.resetUserKeepVisible=function(){this.userKeepVisible=!1},e.prototype.isVisible=function(){return!this.$el.hasClass("media-control-hide")},e.prototype.show=function(t){var e=this;if(!this.disabled){(!t||t.clientX!==this.lastMouseX&&t.clientY!==this.lastMouseY||navigator.userAgent.match(/firefox/i))&&(clearTimeout(this.hideId),this.$el.show(),this.trigger(v.default.MEDIACONTROL_SHOW,this.name),this.$el.removeClass("media-control-hide"),this.hideId=setTimeout(function(){return e.hide()},2e3),t&&(this.lastMouseX=t.clientX,this.lastMouseY=t.clientY))}},e.prototype.hide=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.isVisible()&&(!T.default.isMobile||this.container.isPlaying())){var i=e||2e3;clearTimeout(this.hideId),(this.disabled||!1!==this.options.hideMediaControl)&&(!this.disabled&&(e||this.userKeepVisible||this.keepVisible||this.draggingSeekBar||this.draggingVolumeBar)?this.hideId=setTimeout(function(){return t.hide()},i):(this.trigger(v.default.MEDIACONTROL_HIDE,this.name),this.$el.addClass("media-control-hide"),this.hideVolumeBar(0)))}},e.prototype.settingsUpdate=function(){var t=this.getSettings();!t||this.fullScreenOnVideoTagSupported||g.Fullscreen.fullscreenEnabled()||(t.default&&(0,g.removeArrayItem)(t.default,"fullscreen"),t.left&&(0,g.removeArrayItem)(t.left,"fullscreen"),t.right&&(0,g.removeArrayItem)(t.right,"fullscreen")),(0,o.default)(this.settings)!==(0,o.default)(t)&&(this.settings=t,this.render())},e.prototype.getSettings=function(){return I.default.extend(!0,{},this.container.settings)},e.prototype.highDefinitionUpdate=function(t){var e=t?"addClass":"removeClass";this.$hdIndicator[e]("enabled")},e.prototype.createCachedElements=function(){var t=this.$el.find(".media-control-layer");this.$duration=t.find(".media-control-indicator[data-duration]"),this.$fullscreenToggle=t.find("button.media-control-button[data-fullscreen]"),this.$playPauseToggle=t.find("button.media-control-button[data-playpause]"),this.$playStopToggle=t.find("button.media-control-button[data-playstop]"),this.$position=t.find(".media-control-indicator[data-position]"),this.$seekBarContainer=t.find(".bar-container[data-seekbar]"),this.$seekBarHover=t.find(".bar-hover[data-seekbar]"),this.$seekBarLoaded=t.find(".bar-fill-1[data-seekbar]"),this.$seekBarPosition=t.find(".bar-fill-2[data-seekbar]"),this.$seekBarScrubber=t.find(".bar-scrubber[data-seekbar]"),this.$volumeBarContainer=t.find(".bar-container[data-volume]"),this.$volumeContainer=t.find(".drawer-container[data-volume]"),this.$volumeIcon=t.find(".drawer-icon[data-volume]"),this.$volumeBarBackground=this.$el.find(".bar-background[data-volume]"),this.$volumeBarFill=this.$el.find(".bar-fill-1[data-volume]"),this.$volumeBarScrubber=this.$el.find(".bar-scrubber[data-volume]"),this.$hdIndicator=this.$el.find("button.media-control-button[data-hd-indicator]"),this.resetIndicators(),this.initializeIcons()},e.prototype.resetIndicators=function(){this.displayedPosition=this.$position.text(),this.displayedDuration=this.$duration.text()},e.prototype.initializeIcons=function(){var t=this.$el.find(".media-control-layer");t.find("button.media-control-button[data-play]").append(x.default),t.find("button.media-control-button[data-pause]").append(M.default),t.find("button.media-control-button[data-stop]").append(B.default),this.$playPauseToggle.append(x.default),this.$playStopToggle.append(x.default),this.$volumeIcon.append(G.default),this.$fullscreenToggle.append(Y.default),this.$hdIndicator.append(W.default)},e.prototype.setSeekPercentage=function(t){t=Math.max(Math.min(t,100),0),this.displayedSeekBarPercentage!==t&&(this.displayedSeekBarPercentage=t,this.$seekBarPosition.removeClass("media-control-notransition"),this.$seekBarScrubber.removeClass("media-control-notransition"),this.$seekBarPosition.css({width:t+"%"}),this.$seekBarScrubber.css({left:t+"%"}))},e.prototype.seekRelative=function(t){if(this.settings.seekEnabled){var e=this.container.getCurrentTime(),i=this.container.getDuration(),n=Math.min(Math.max(e+t,0),i);n=Math.min(100*n/i,100),this.container.seekPercentage(n)}},e.prototype.bindKeyAndShow=function(t,e){var i=this;this.kibo.down(t,function(){return i.show(),e()})},e.prototype.bindKeyEvents=function(){var t=this;this.unbindKeyEvents(),this.kibo=new y.Kibo(this.options.focusElement),this.bindKeyAndShow("space",function(){return t.togglePlayPause()}),this.bindKeyAndShow("left",function(){return t.seekRelative(-5)}),this.bindKeyAndShow("right",function(){return t.seekRelative(5)}),this.bindKeyAndShow("shift left",function(){return t.seekRelative(-10)}),this.bindKeyAndShow("shift right",function(){return t.seekRelative(10)}),this.bindKeyAndShow("shift ctrl left",function(){return t.seekRelative(-15)}),this.bindKeyAndShow("shift ctrl right",function(){return t.seekRelative(15)}),["1","2","3","4","5","6","7","8","9","0"].forEach(function(e){t.bindKeyAndShow(e,function(){return t.settings.seekEnabled&&t.container.seekPercentage(10*e)})})},e.prototype.unbindKeyEvents=function(){this.kibo&&(this.kibo.off("space"),this.kibo.off("left"),this.kibo.off("right"),this.kibo.off("shift left"),this.kibo.off("shift right"),this.kibo.off("shift ctrl left"),this.kibo.off("shift ctrl right"),this.kibo.off(["1","2","3","4","5","6","7","8","9","0"]))},e.prototype.parseColors=function(){if(this.options.mediacontrol){this.buttonsColor=this.options.mediacontrol.buttons;var t=this.options.mediacontrol.seekbar;this.$el.find(".bar-fill-2[data-seekbar]").css("background-color",t),this.$el.find(".media-control-icon svg path").css("fill",this.buttonsColor),this.$el.find(".segmented-bar-element[data-volume]").css("boxShadow","inset 2px 0 0 "+this.buttonsColor)}},e.prototype.applyButtonStyle=function(t){this.buttonsColor&&t&&(0,I.default)(t).find("svg path").css("fill",this.buttonsColor)},e.prototype.destroy=function(){this.remove(),(0,I.default)(document).unbind("mouseup",this.stopDragHandler),(0,I.default)(document).unbind("mousemove",this.updateDragHandler),this.unbindKeyEvents()},e.prototype.render=function(){var t=this;this.$el.html(this.template({settings:this.settings})),this.createCachedElements(),this.$playPauseToggle.addClass("paused"),this.$playStopToggle.addClass("stopped"),this.changeTogglePlay(),this.hideId=setTimeout(function(){return t.hide()},1e3),this.disabled&&this.hide(),T.default.isSafari&&T.default.isMobile&&(T.default.version<10?this.$volumeContainer.css("display","none"):this.$volumeBarContainer.css("display","none")),this.$seekBarPosition.addClass("media-control-notransition"),this.$seekBarScrubber.addClass("media-control-notransition");var e=0;return this.displayedSeekBarPercentage&&(e=this.displayedSeekBarPercentage),this.displayedSeekBarPercentage=null,this.setSeekPercentage(e),n.nextTick(function(){t.settings.seekEnabled||t.$seekBarContainer.addClass("seek-disabled"),T.default.isMobile||t.options.disableKeyboardShortcuts||t.bindKeyEvents(),t.playerResize({width:t.options.width,height:t.options.height}),t.hideVolumeBar(0)}),this.parseColors(),this.highDefinitionUpdate(),this.rendered=!0,this.updateVolumeUI(),this.trigger(v.default.MEDIACONTROL_RENDERED),this},e}(_.default);e.default=q,q.extend=function(t){return(0,g.extend)(q,t)},t.exports=e.default}).call(e,i(57))},function(t,e,i){t.exports={default:i(143),__esModule:!0}},function(t,e,i){var n=i(11),r=n.JSON||(n.JSON={stringify:JSON.stringify});t.exports=function(t){return r.stringify.apply(r,arguments)}},function(t,e,i){var n=i(145);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,".media-control-notransition{transition:none!important}.media-control[data-media-control]{position:absolute;width:100%;height:100%;z-index:9999;pointer-events:none}.media-control[data-media-control].dragging{pointer-events:auto;cursor:-webkit-grabbing!important;cursor:grabbing!important;cursor:url("+i(75)+"),move}.media-control[data-media-control].dragging *{cursor:-webkit-grabbing!important;cursor:grabbing!important;cursor:url("+i(75)+'),move}.media-control[data-media-control] .media-control-background[data-background]{position:absolute;height:40%;width:100%;bottom:0;background:linear-gradient(transparent,rgba(0,0,0,.9));transition:opacity .6s ease-out}.media-control[data-media-control] .media-control-icon{line-height:0;letter-spacing:0;speak:none;color:#fff;opacity:.5;vertical-align:middle;text-align:left;transition:all .1s ease}.media-control[data-media-control] .media-control-icon:hover{color:#fff;opacity:.75;text-shadow:hsla(0,0%,100%,.8) 0 0 5px}.media-control[data-media-control].media-control-hide .media-control-background[data-background]{opacity:0}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls]{bottom:-50px}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls]{position:absolute;bottom:7px;width:100%;height:32px;font-size:0;vertical-align:middle;pointer-events:auto;transition:bottom .4s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control]{position:absolute;top:0;left:4px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control]{height:100%;text-align:center;line-height:32px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control]{position:absolute;top:0;right:4px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button{background-color:transparent;border:0;margin:0 6px;padding:0;cursor:pointer;display:inline-block;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg{width:100%;height:22px}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg path{fill:#fff}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus{outline:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop]{float:left;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen]{float:right;background-color:transparent;border:0;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator]{background-color:transparent;border:0;cursor:default;display:none;float:right;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled{display:block;opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled:hover{opacity:1;text-shadow:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop]{float:left}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration],.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{display:inline-block;font-size:10px;color:#fff;cursor:default;line-height:32px;position:relative}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{margin:0 6px 0 7px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]{color:hsla(0,0%,100%,.5);margin-right:6px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before{content:"|";margin-right:7px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]{position:absolute;top:-20px;left:0;display:inline-block;vertical-align:middle;width:100%;height:25px;cursor:pointer}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar]{width:100%;height:1px;position:relative;top:12px;background-color:#666}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#c2c2c2;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#005aff;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:0;position:absolute;top:-3px;width:5px;height:7px;background-color:hsla(0,0%,100%,.5);transition:opacity .1s ease}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]:hover .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled{cursor:default}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled:hover .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);top:2px;left:0;width:20px;height:20px;opacity:1;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar]{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:10px;box-shadow:0 0 0 6px hsla(0,0%,100%,.2);background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume]{float:right;display:inline-block;height:32px;cursor:pointer;margin:0 6px;box-sizing:border-box}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume]{float:left;bottom:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]{background-color:transparent;border:0;box-sizing:content-box;width:32px;height:32px;opacity:.5}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:hover{opacity:.75}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg{height:24px;position:relative;top:3px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg path{fill:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted svg{margin-left:2px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume]{float:left;position:relative;overflow:hidden;top:6px;width:42px;height:18px;padding:3px 0;transition:width .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume]{height:1px;position:relative;top:7px;margin:0 3px;background-color:#666}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#c2c2c2;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-2[data-volume]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#005aff;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-hover[data-volume]{opacity:0;position:absolute;top:-3px;width:5px;height:7px;background-color:hsla(0,0%,100%,.5);transition:opacity .1s ease}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume]{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);top:0;left:0;width:20px;height:20px;opacity:1;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume]{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:10px;box-shadow:0 0 0 6px hsla(0,0%,100%,.2);background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]{float:left;width:4px;padding-left:2px;height:12px;opacity:.5;box-shadow:inset 2px 0 0 #fff;transition:-webkit-transform .2s ease-out;transition:transform .2s ease-out;transition:transform .2s ease-out,-webkit-transform .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume].fill{box-shadow:inset 2px 0 0 #fff;opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:first-of-type{padding-left:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:hover{-webkit-transform:scaleY(1.5);transform:scaleY(1.5)}.media-control[data-media-control].w320 .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide{width:0;height:12px;top:9px;padding:0}',""])},function(t,e){t.exports='<div class="media-control-background" data-background></div>\n<div class="media-control-layer" data-controls>\n <% var renderBar = function(name) { %>\n <div class="bar-container" data-<%= name %>>\n <div class="bar-background" data-<%= name %>>\n <div class="bar-fill-1" data-<%= name %>></div>\n <div class="bar-fill-2" data-<%= name %>></div>\n <div class="bar-hover" data-<%= name %>></div>\n </div>\n <div class="bar-scrubber" data-<%= name %>>\n <div class="bar-scrubber-icon" data-<%= name %>></div>\n </div>\n </div>\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n <div class="bar-container" data-<%= name %>>\n <% for (var i = 0; i < segments; i++) { %>\n <div class="segmented-bar-element" data-<%= name %>></div>\n <% } %>\n </div>\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n <div class="drawer-container" data-<%= name %>>\n <div class="drawer-icon-container" data-<%= name %>>\n <div class="drawer-icon media-control-icon" data-<%= name %>></div>\n <span class="drawer-text" data-<%= name %>></span>\n </div>\n <% renderContent(name); %>\n </div>\n <% }; %>\n <% var renderIndicator = function(name) { %>\n <div class="media-control-indicator" data-<%= name %>></div>\n <% }; %>\n <% var renderButton = function(name) { %>\n <button type="button" class="media-control-button media-control-icon" data-<%= name %> aria-label="<%= name %>"></button>\n <% }; %>\n <% var templates = {\n bar: renderBar,\n segmentedBar: renderSegmentedBar,\n };\n var render = function(settingsList) {\n settingsList.forEach(function(setting) {\n if(setting === "seekbar") {\n renderBar(setting);\n } else if (setting === "volume") {\n renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function(name) { return renderSegmentedBar(name); });\n } else if (setting === "duration" || setting === "position") {\n renderIndicator(setting);\n } else {\n renderButton(setting);\n }\n });\n }; %>\n <% if (settings.default && settings.default.length) { %>\n <div class="media-control-center-panel" data-media-control>\n <% render(settings.default); %>\n </div>\n <% } %>\n <% if (settings.left && settings.left.length) { %>\n <div class="media-control-left-panel" data-media-control>\n <% render(settings.left); %>\n </div>\n <% } %>\n <% if (settings.right && settings.right.length) { %>\n <div class="media-control-right-panel" data-media-control>\n <% render(settings.right); %>\n </div>\n <% } %>\n</div>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M1.712 1.24h12.6v13.52h-12.6z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M11.5 11h-.002v1.502L7.798 10H4.5V6h3.297l3.7-2.502V4.5h.003V11zM11 4.49L7.953 6.5H5v3h2.953L11 11.51V4.49z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M9.75 11.51L6.7 9.5H3.75v-3H6.7L9.75 4.49v.664l.497.498V3.498L6.547 6H3.248v4h3.296l3.7 2.502v-2.154l-.497.5v.662zm3-5.165L12.404 6l-1.655 1.653L9.093 6l-.346.345L10.402 8 8.747 9.654l.346.347 1.655-1.653L12.403 10l.348-.346L11.097 8l1.655-1.655z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#010101" d="M7.156 8L4 11.156V8.5H3V13h4.5v-1H4.844L8 8.844 7.156 8zM8.5 3v1h2.657L8 7.157 8.846 8 12 4.844V7.5h1V3H8.5z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#010101" d="M13.5 3.344l-.844-.844L9.5 5.656V3h-1v4.5H13v-1h-2.656L13.5 3.344zM3 9.5h2.656L2.5 12.656l.844.844L6.5 10.344V13h1V8.5H3v1z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#010101" d="M5.375 7.062H2.637V4.26H.502v7.488h2.135V8.9h2.738v2.848h2.133V4.26H5.375v2.802zm5.97-2.81h-2.84v7.496h2.798c2.65 0 4.195-1.607 4.195-3.77v-.022c0-2.162-1.523-3.704-4.154-3.704zm2.06 3.758c0 1.21-.81 1.896-2.03 1.896h-.83V6.093h.83c1.22 0 2.03.696 2.03 1.896v.02z"></path></svg>'},function(t,e,i){var n=i(154);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,'[data-player]{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-transform:translateZ(0);transform:translateZ(0);position:relative;margin:0;padding:0;border:0;font-style:normal;font-weight:400;text-align:center;overflow:hidden;font-size:100%;font-family:Roboto,Open Sans,Arial,sans-serif;text-shadow:0 0 0;box-sizing:border-box}[data-player] a,[data-player] abbr,[data-player] acronym,[data-player] address,[data-player] applet,[data-player] article,[data-player] aside,[data-player] audio,[data-player] b,[data-player] big,[data-player] blockquote,[data-player] canvas,[data-player] caption,[data-player] center,[data-player] cite,[data-player] code,[data-player] dd,[data-player] del,[data-player] details,[data-player] dfn,[data-player] div,[data-player] dl,[data-player] dt,[data-player] em,[data-player] embed,[data-player] fieldset,[data-player] figcaption,[data-player] figure,[data-player] footer,[data-player] form,[data-player] h1,[data-player] h2,[data-player] h3,[data-player] h4,[data-player] h5,[data-player] h6,[data-player] header,[data-player] hgroup,[data-player] i,[data-player] iframe,[data-player] img,[data-player] ins,[data-player] kbd,[data-player] label,[data-player] legend,[data-player] li,[data-player] mark,[data-player] menu,[data-player] nav,[data-player] object,[data-player] ol,[data-player] output,[data-player] p,[data-player] pre,[data-player] q,[data-player] ruby,[data-player] s,[data-player] samp,[data-player] section,[data-player] small,[data-player] span,[data-player] strike,[data-player] strong,[data-player] sub,[data-player] summary,[data-player] sup,[data-player] table,[data-player] tbody,[data-player] td,[data-player] tfoot,[data-player] th,[data-player] thead,[data-player] time,[data-player] tr,[data-player] tt,[data-player] u,[data-player] ul,[data-player] var,[data-player] video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}[data-player] table{border-collapse:collapse;border-spacing:0}[data-player] caption,[data-player] td,[data-player] th{text-align:left;font-weight:400;vertical-align:middle}[data-player] blockquote,[data-player] q{quotes:none}[data-player] blockquote:after,[data-player] blockquote:before,[data-player] q:after,[data-player] q:before{content:"";content:none}[data-player] a img{border:none}[data-player]:focus{outline:0}[data-player] *{max-width:none;box-sizing:inherit;float:none}[data-player] div{display:block}[data-player].fullscreen{width:100%!important;height:100%!important;top:0;left:0}[data-player].nocursor{cursor:none}.clappr-style{display:none!important}',""])},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,'@font-face{font-family:Roboto;font-style:normal;font-weight:400;src:local("Roboto"),local("Roboto-Regular"),url('+i(156)+') format("truetype")}',""])},function(t,e){t.exports="<%=baseUrl%>/38861cba61c66739c1452c3a71e39852.ttf"},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(71),a=n(r),o=i(0),s=n(o),l=i(1),u=n(l),c=i(2),d=n(c),h=i(17),f=n(h),p=i(34),g=n(p),y=i(35),m=n(y),v=i(81),b=n(v),_=i(82),E=n(_),T=i(83),A=n(T),S=i(84),L=n(S),R=i(85),k=n(R),w=i(86),C=n(w),I=i(189),D=n(I),O=i(194),P=n(O),x=i(196),N=n(x),M=i(87),F=n(M),B=i(205),U=n(B),G=i(207),K=n(G),V=i(209),j=n(V),Y=i(214),H=n(Y),$=i(220),z=n($),W=i(222),q=n(W),X=i(227),Z=n(X),J=i(228),Q=n(J),tt=i(229),et=n(tt),it=function(t){function e(i,n){(0,s.default)(this,e);var r=(0,u.default)(this,t.call(this));return r.playerId=n,r.playbackPlugins=[L.default,m.default,E.default,b.default,A.default,k.default,C.default],r.containerPlugins=[D.default,N.default,F.default,P.default,U.default,K.default],r.corePlugins=[j.default,H.default,z.default,q.default,Z.default,Q.default,et.default],i&&(Array.isArray(i)||r.validateExternalPluginsType(i),r.addExternalPlugins(i)),r}return(0,d.default)(e,t),e.prototype.groupPluginsByType=function(t){return Array.isArray(t)&&(t=t.reduce(function(t,e){return t[e.type]||(t[e.type]=[]),t[e.type].push(e),t},{})),t},e.prototype.removeDups=function(t){var e=function(t,e){return t[e.prototype.name]&&delete t[e.prototype.name],t[e.prototype.name]=e,t},i=t.reduceRight(e,(0,a.default)(null)),n=[];for(var r in i)n.unshift(i[r]);return n},e.prototype.addExternalPlugins=function(t){t=this.groupPluginsByType(t),t.playback&&(this.playbackPlugins=this.removeDups(t.playback.concat(this.playbackPlugins))),t.container&&(this.containerPlugins=this.removeDups(t.container.concat(this.containerPlugins))),t.core&&(this.corePlugins=this.removeDups(t.core.concat(this.corePlugins))),g.default.getInstance(this.playerId).playbackPlugins=this.playbackPlugins},e.prototype.validateExternalPluginsType=function(t){["playback","container","core"].forEach(function(e){(t[e]||[]).forEach(function(t){var i="external "+t.type+" plugin on "+e+" array";if(t.type!==e)throw new ReferenceError(i)})})},e}(f.default);e.default=it,t.exports=e.default},function(t,e,i){"use strict";(function(n){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=i(79),o=r(a),s=i(0),l=r(s),u=i(1),c=r(u),d=i(3),h=r(d),f=i(2),p=r(f),g=i(80),y=r(g),m=i(31),v=r(m),b=i(5),_=i(9),E=r(_),T=i(13),A=r(T),S=i(4),L=r(S),R=i(6),k=r(R),w=i(8),C=r(w),I=i(167),D=r(I);i(168);var O={mp4:["avc1.42E01E","avc1.58A01E","avc1.4D401E","avc1.64001E","mp4v.20.8","mp4v.20.240","mp4a.40.2"].map(function(t){return'video/mp4; codecs="'+t+', mp4a.40.2"'}),ogg:['video/ogg; codecs="theora, vorbis"','video/ogg; codecs="dirac"','video/ogg; codecs="theora, speex"'],"3gpp":['video/3gpp; codecs="mp4v.20.8, samr"'],webm:['video/webm; codecs="vp8, vorbis"'],mkv:['video/x-matroska; codecs="theora, vorbis"'],m3u8:["application/x-mpegurl"]};O.ogv=O.ogg,O["3gp"]=O["3gpp"];var P={wav:["audio/wav"],mp3:["audio/mp3",'audio/mpeg;codecs="mp3"'],aac:['audio/mp4;codecs="mp4a.40.5"'],oga:["audio/ogg"]},x=(0,v.default)(P).reduce(function(t,e){return[].concat((0,y.default)(t),(0,y.default)(P[e]))},[]),N=function(t){function e(){(0,l.default)(this,e);for(var i=arguments.length,r=Array(i),a=0;a<i;a++)r[a]=arguments[a];var o=(0,c.default)(this,t.call.apply(t,[this].concat(r)));o._destroyed=!1,o._loadStarted=!1,o._isBuffering=!1,o._playheadMoving=!1,o._playheadMovingTimer=null,o._stopped=!1,o._ccTrackId=-1,o._setupSrc(o.options.src),o.options.playback||(o.options.playback=o.options||{}),o.options.playback.disableContextMenu=o.options.playback.disableContextMenu||o.options.disableVideoTagContextMenu;var s=o.options.playback,u=s.preload||(A.default.isSafari?"auto":o.options.preload),d=void 0;return o.options.poster&&("string"==typeof o.options.poster?d=o.options.poster:"string"==typeof o.options.poster.url&&(d=o.options.poster.url)),k.default.extend(o.el,{muted:o.options.mute,defaultMuted:o.options.mute,loop:o.options.loop,poster:d,preload:u||"metadata",controls:(s.controls||o.options.useVideoTagDefaultControls)&&"controls",crossOrigin:s.crossOrigin,"x-webkit-playsinline":s.playInline}),s.playInline&&o.$el.attr({playsinline:"playsinline"}),s.crossOrigin&&o.$el.attr({crossorigin:s.crossOrigin}),o.settings={default:["seekbar"]},o.settings.left=["playpause","position","duration"],o.settings.right=["fullscreen","volume","hd-indicator"],s.externalTracks&&o._setupExternalTracks(s.externalTracks),o.options.autoPlay&&n.nextTick(function(){return!o._destroyed&&o.play()}),o}return(0,p.default)(e,t),(0,h.default)(e,[{key:"name",get:function(){return"html5_video"}},{key:"tagName",get:function(){return this.isAudioOnly?"audio":"video"}},{key:"isAudioOnly",get:function(){var t=this.options.src,i=e._mimeTypesForUrl(t,P,this.options.mimeType);return this.options.playback&&this.options.playback.audioOnly||this.options.audioOnly||x.indexOf(i[0])>=0}},{key:"attributes",get:function(){return{"data-html5-video":""}}},{key:"events",get:function(){return{canplay:"_onCanPlay",canplaythrough:"_handleBufferingEvents",durationchange:"_onDurationChange",ended:"_onEnded",error:"_onError",loadeddata:"_onLoadedData",loadedmetadata:"_onLoadedMetadata",pause:"_onPause",playing:"_onPlaying",progress:"_onProgress",seeking:"_handleBufferingEvents",seeked:"_onSeeked",stalled:"_handleBufferingEvents",timeupdate:"_onTimeUpdate",waiting:"_onWaiting"}}},{key:"ended",get:function(){return this.el.ended}},{key:"buffering",get:function(){return this._isBuffering}}]),e.prototype._setupExternalTracks=function(t){this._externalTracks=t.map(function(t){return{kind:t.kind||"subtitles",label:t.label,lang:t.lang,src:t.src}})},e.prototype._setupSrc=function(t){this.el.src!==t&&(this._ccIsSetup=!1,this.el.src=t,this._src=this.el.src)},e.prototype._onLoadedMetadata=function(t){this._handleBufferingEvents(),this.trigger(L.default.PLAYBACK_LOADEDMETADATA,{duration:t.target.duration,data:t}),this._updateSettings();var e=void 0===this._options.autoSeekFromUrl||this._options.autoSeekFromUrl;this.getPlaybackType()!==E.default.LIVE&&e&&this._checkInitialSeek()},e.prototype._onDurationChange=function(){this._updateSettings(),this._onTimeUpdate(),this._onProgress()},e.prototype._updateSettings=function(){this.getPlaybackType()===E.default.VOD||this.getPlaybackType()===E.default.AOD?this.settings.left=["playpause","position","duration"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(L.default.PLAYBACK_SETTINGSUPDATE)},e.prototype.isSeekEnabled=function(){return isFinite(this.getDuration())},e.prototype.getPlaybackType=function(){var t="audio"===this.tagName?E.default.AOD:E.default.VOD;return[0,void 0,1/0].indexOf(this.el.duration)>=0?E.default.LIVE:t},e.prototype.isHighDefinitionInUse=function(){return!1},e.prototype.consent=function(){!this.isPlaying()&&this.el.load()},e.prototype.play=function(){this.trigger(L.default.PLAYBACK_PLAY_INTENT),this._stopped=!1,this._setupSrc(this._src),this._handleBufferingEvents();var t=this.el.play();t&&t.catch&&t.catch(function(){})},e.prototype.pause=function(){this.el.pause()},e.prototype.stop=function(){this.pause(),this._stopped=!0,this.el.removeAttribute("src"),this._stopPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(L.default.PLAYBACK_STOP)},e.prototype.volume=function(t){0===t?(this.$el.attr({muted:"true"}),this.el.muted=!0):(this.$el.attr({muted:null}),this.el.muted=!1),this.el.volume=t/100},e.prototype.mute=function(){this.el.muted=!0},e.prototype.unmute=function(){this.el.muted=!1},e.prototype.isMuted=function(){return!!this.el.volume},e.prototype.isPlaying=function(){return!this.el.paused&&!this.el.ended},e.prototype._startPlayheadMovingChecks=function(){null===this._playheadMovingTimer&&(this._playheadMovingTimeOnCheck=null,this._determineIfPlayheadMoving(),this._playheadMovingTimer=setInterval(this._determineIfPlayheadMoving.bind(this),500))},e.prototype._stopPlayheadMovingChecks=function(){null!==this._playheadMovingTimer&&(clearInterval(this._playheadMovingTimer),this._playheadMovingTimer=null,this._playheadMoving=!1)},e.prototype._determineIfPlayheadMoving=function(){var t=this._playheadMovingTimeOnCheck,e=this.el.currentTime;this._playheadMoving=t!==e,this._playheadMovingTimeOnCheck=e,this._handleBufferingEvents()},e.prototype._onWaiting=function(){this._loadStarted=!0,this._handleBufferingEvents()},e.prototype._onLoadedData=function(){this._loadStarted=!0,this._handleBufferingEvents()},e.prototype._onCanPlay=function(){this._handleBufferingEvents()},e.prototype._onPlaying=function(){this._checkForClosedCaptions(),this._startPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(L.default.PLAYBACK_PLAY)},e.prototype._onPause=function(){this._stopPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(L.default.PLAYBACK_PAUSE)},e.prototype._onSeeked=function(){this._handleBufferingEvents(),this.trigger(L.default.PLAYBACK_SEEKED)},e.prototype._onEnded=function(){this._handleBufferingEvents(),this.trigger(L.default.PLAYBACK_ENDED,this.name)},e.prototype._handleBufferingEvents=function(){var t=!this.el.ended&&!this.el.paused,e=this._loadStarted&&!this.el.ended&&!this._stopped&&(t&&!this._playheadMoving||this.el.readyState<this.el.HAVE_FUTURE_DATA);this._isBuffering!==e&&(this._isBuffering=e,e?this.trigger(L.default.PLAYBACK_BUFFERING,this.name):this.trigger(L.default.PLAYBACK_BUFFERFULL,this.name))},e.prototype._onError=function(){this.trigger(L.default.PLAYBACK_ERROR,this.el.error,this.name)},e.prototype.destroy=function(){this._destroyed=!0,this.handleTextTrackChange&&this.el.textTracks.removeEventListener("change",this.handleTextTrackChange),this.$el.remove(),this.el.src="",this._src=null,b.DomRecycler.garbage(this.$el)},e.prototype.seek=function(t){this.el.currentTime=t},e.prototype.seekPercentage=function(t){var e=this.el.duration*(t/100);this.seek(e)},e.prototype._checkInitialSeek=function(){var t=(0,b.seekStringToSeconds)();0!==t&&this.seek(t)},e.prototype.getCurrentTime=function(){return this.el.currentTime},e.prototype.getDuration=function(){return this.el.duration},e.prototype._onTimeUpdate=function(){this.getPlaybackType()===E.default.LIVE?this.trigger(L.default.PLAYBACK_TIMEUPDATE,{current:1,total:1},this.name):this.trigger(L.default.PLAYBACK_TIMEUPDATE,{current:this.el.currentTime,total:this.el.duration},this.name)},e.prototype._onProgress=function(){if(this.el.buffered.length){for(var t=[],e=0,i=0;i<this.el.buffered.length;i++)t=[].concat((0,y.default)(t),[{start:this.el.buffered.start(i),end:this.el.buffered.end(i)}]),this.el.currentTime>=t[i].start&&this.el.currentTime<=t[i].end&&(e=i);var n={start:t[e].start,current:t[e].end,total:this.el.duration};this.trigger(L.default.PLAYBACK_PROGRESS,n,t)}},e.prototype._typeFor=function(t){var i=e._mimeTypesForUrl(t,O,this.options.mimeType);return 0===i.length&&(i=e._mimeTypesForUrl(t,P,this.options.mimeType)),(i[0]||"").split(";")[0]},e.prototype._ready=function(){this._isReadyState||(this._isReadyState=!0,this.trigger(L.default.PLAYBACK_READY,this.name))},e.prototype._checkForClosedCaptions=function(){if(this.isHTML5Video&&!this._ccIsSetup){if(this.hasClosedCaptionsTracks){this.trigger(L.default.PLAYBACK_SUBTITLE_AVAILABLE);var t=this.closedCaptionsTrackId;this.closedCaptionsTrackId=t,this.handleTextTrackChange=this._handleTextTrackChange.bind(this),this.el.textTracks.addEventListener("change",this.handleTextTrackChange)}this._ccIsSetup=!0}},e.prototype._handleTextTrackChange=function(){var t=this.closedCaptionsTracks,e=t.find(function(t){return"showing"===t.track.mode})||{id:-1};this._ccTrackId!==e.id&&(this._ccTrackId=e.id,this.trigger(L.default.PLAYBACK_SUBTITLE_CHANGED,{id:e.id}))},e.prototype.render=function(){return this.options.playback.disableContextMenu&&this.$el.on("contextmenu",function(){return!1}),this._externalTracks&&this._externalTracks.length>0&&this.$el.html(this.template({tracks:this._externalTracks})),this._ready(),this},(0,h.default)(e,[{key:"isReady",get:function(){return this._isReadyState}},{key:"isHTML5Video",get:function(){return this.name===e.prototype.name}},{key:"closedCaptionsTracks",get:function(){var t=0,e=function(){return t++};return(this.el.textTracks?(0,o.default)(this.el.textTracks):[]).filter(function(t){return"subtitles"===t.kind||"captions"===t.kind}).map(function(t){return{id:e(),name:t.label,track:t}})}},{key:"closedCaptionsTrackId",get:function(){return this._ccTrackId},set:function(t){if((0,b.isNumber)(t)){var e=this.closedCaptionsTracks,i=void 0;if(-1!==t){if(!(i=e.find(function(e){return e.id===t})))return;if("showing"===i.track.mode)return}e.filter(function(t){return"hidden"!==t.track.mode}).forEach(function(t){return t.track.mode="hidden"}),i&&(i.track.mode="showing"),this._ccTrackId=t,this.trigger(L.default.PLAYBACK_SUBTITLE_CHANGED,{id:t})}}},{key:"template",get:function(){return(0,C.default)(D.default)}}]),e}(E.default);e.default=N,N._mimeTypesForUrl=function(t,e,i){var n=(t.split("?")[0].match(/.*\.(.*)$/)||[])[1],r=i||n&&e[n.toLowerCase()]||[];return r.constructor===Array?r:[r]},N._canPlay=function(t,e,i,n){var r=N._mimeTypesForUrl(i,e,n),a=document.createElement(t);return!!r.filter(function(t){return!!a.canPlayType(t).replace(/no/,"")})[0]},N.canPlay=function(t,e){return N._canPlay("audio",P,t,e)||N._canPlay("video",O,t,e)},t.exports=e.default}).call(e,i(57))},function(t,e,i){i(65),i(160),t.exports=i(11).Array.from},function(t,e,i){"use strict";var n=i(46),r=i(19),a=i(39),o=i(161),s=i(162),l=i(61),u=i(163),c=i(164);r(r.S+r.F*!i(166)(function(t){Array.from(t)}),"Array",{from:function(t){var e,i,r,d,h=a(t),f="function"==typeof this?this:Array,p=arguments.length,g=p>1?arguments[1]:void 0,y=void 0!==g,m=0,v=c(h);if(y&&(g=n(g,p>2?arguments[2]:void 0,2)),void 0==v||f==Array&&s(v))for(e=l(h.length),i=new f(e);e>m;m++)u(i,m,y?g(h[m],m):h[m]);else for(d=v.call(h),i=new f;!(r=d.next()).done;m++)u(i,m,y?o(d,g,[r.value,m],!0):r.value);return i.length=m,i}})},function(t,e,i){var n=i(23);t.exports=function(t,e,i,r){try{return r?e(n(i)[0],i[1]):e(i)}catch(e){var a=t.return;throw void 0!==a&&n(a.call(t)),e}}},function(t,e,i){var n=i(29),r=i(12)("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||a[r]===t)}},function(t,e,i){"use strict";var n=i(16),r=i(28);t.exports=function(t,e,i){e in t?n.f(t,e,r(0,i)):t[e]=i}},function(t,e,i){var n=i(165),r=i(12)("iterator"),a=i(29);t.exports=i(11).getIteratorMethod=function(t){if(void 0!=t)return t[r]||t["@@iterator"]||a[n(t)]}},function(t,e,i){var n=i(41),r=i(12)("toStringTag"),a="Arguments"==n(function(){return arguments}()),o=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,i,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=o(e=Object(t),r))?i:a?n(e):"Object"==(s=n(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,i){var n=i(12)("iterator"),r=!1;try{var a=[7][n]();a.return=function(){r=!0},Array.from(a,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!r)return!1;var i=!1;try{var a=[7],o=a[n]();o.next=function(){return{done:i=!0}},a[n]=function(){return o},t(a)}catch(t){}return i}},function(t,e){t.exports='<% for (var i = 0; i < tracks.length; i++) { %>\n <track data-html5-video-track="<%= i %>" kind="<%= tracks[i].kind %>" label="<%= tracks[i].label %>" srclang="<%= tracks[i].lang %>" src="<%= tracks[i].src %>" />\n<% }; %>\n'},function(t,e,i){var n=i(169);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,"[data-html5-video]{position:absolute;height:100%;width:100%;display:block}",""])},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(5),f=i(59),p=n(f),g=i(13),y=n(g),m=i(24),v=n(m),b=i(8),_=n(b),E=i(6),T=n(E),A=i(4),S=n(A),L=i(9),R=n(L),k=i(175),w=n(k),C=function(t){function e(){(0,a.default)(this,e);for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];var o=(0,s.default)(this,t.call.apply(t,[this].concat(n)));return o._src=o.options.src,o._baseUrl=o.options.baseUrl,o._autoPlay=o.options.autoPlay,o.settings={default:["seekbar"]},o.settings.left=["playpause","position","duration"],o.settings.right=["fullscreen","volume"],o.settings.seekEnabled=!0,o._isReadyState=!1,o._addListeners(),o}return(0,d.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"flash"}},{key:"swfPath",get:function(){return(0,_.default)(w.default)({baseUrl:this._baseUrl})}},{key:"ended",get:function(){return"ENDED"===this._currentState}},{key:"buffering",get:function(){return!!this._bufferingState&&"ENDED"!==this._currentState}}]),e.prototype._bootstrap=function(){var t=this;this.el.playerPlay?(this.el.width="100%",this.el.height="100%","PLAYING"===this._currentState?this._firstPlay():(this._currentState="IDLE",this._autoPlay&&this.play()),(0,T.default)('<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%" />').insertAfter(this.$el),this.getDuration()>0?this._metadataLoaded():v.default.once(this.uniqueId+":timeupdate",this._metadataLoaded,this)):(this._attempts=this._attempts||0,++this._attempts<=60?setTimeout(function(){return t._bootstrap()},50):this.trigger(S.default.PLAYBACK_ERROR,{message:"Max number of attempts reached"},this.name))},e.prototype._metadataLoaded=function(){this._isReadyState=!0,this.trigger(S.default.PLAYBACK_READY,this.name),this.trigger(S.default.PLAYBACK_SETTINGSUPDATE,this.name)},e.prototype.getPlaybackType=function(){return R.default.VOD},e.prototype.isHighDefinitionInUse=function(){return!1},e.prototype._updateTime=function(){this.trigger(S.default.PLAYBACK_TIMEUPDATE,{current:this.el.getPosition(),total:this.el.getDuration()},this.name)},e.prototype._addListeners=function(){v.default.on(this.uniqueId+":progress",this._progress,this),v.default.on(this.uniqueId+":timeupdate",this._updateTime,this),v.default.on(this.uniqueId+":statechanged",this._checkState,this),v.default.on(this.uniqueId+":flashready",this._bootstrap,this)},e.prototype.stopListening=function(){t.prototype.stopListening.call(this),v.default.off(this.uniqueId+":progress"),v.default.off(this.uniqueId+":timeupdate"),v.default.off(this.uniqueId+":statechanged"),v.default.off(this.uniqueId+":flashready")},e.prototype._checkState=function(){this._isIdle||"PAUSED"===this._currentState||("PLAYING_BUFFERING"!==this._currentState&&"PLAYING_BUFFERING"===this.el.getState()?(this._bufferingState=!0,this.trigger(S.default.PLAYBACK_BUFFERING,this.name),this._currentState="PLAYING_BUFFERING"):"PLAYING"===this.el.getState()?(this._bufferingState=!1,this.trigger(S.default.PLAYBACK_BUFFERFULL,this.name),this._currentState="PLAYING"):"IDLE"===this.el.getState()?this._currentState="IDLE":"ENDED"===this.el.getState()&&(this.trigger(S.default.PLAYBACK_ENDED,this.name),this.trigger(S.default.PLAYBACK_TIMEUPDATE,{current:0,total:this.el.getDuration()},this.name),this._currentState="ENDED",this._isIdle=!0))},e.prototype._progress=function(){"IDLE"!==this._currentState&&"ENDED"!==this._currentState&&this.trigger(S.default.PLAYBACK_PROGRESS,{start:0,current:this.el.getBytesLoaded(),total:this.el.getBytesTotal()})},e.prototype._firstPlay=function(){var t=this;this.el.playerPlay?(this._isIdle=!1,this.el.playerPlay(this._src),this.listenToOnce(this,S.default.PLAYBACK_BUFFERFULL,function(){return t._checkInitialSeek()}),this._currentState="PLAYING"):this.listenToOnce(this,S.default.PLAYBACK_READY,this._firstPlay)},e.prototype._checkInitialSeek=function(){var t=(0,h.seekStringToSeconds)(window.location.href);0!==t&&this.seekSeconds(t)},e.prototype.play=function(){this.trigger(S.default.PLAYBACK_PLAY_INTENT),"PAUSED"===this._currentState||"PLAYING_BUFFERING"===this._currentState?(this._currentState="PLAYING",this.el.playerResume(),this.trigger(S.default.PLAYBACK_PLAY,this.name)):"PLAYING"!==this._currentState&&(this._firstPlay(),this.trigger(S.default.PLAYBACK_PLAY,this.name))},e.prototype.volume=function(t){var e=this;this.isReady?this.el.playerVolume(t):this.listenToOnce(this,S.default.PLAYBACK_BUFFERFULL,function(){return e.volume(t)})},e.prototype.pause=function(){this._currentState="PAUSED",this.el.playerPause(),this.trigger(S.default.PLAYBACK_PAUSE,this.name)},e.prototype.stop=function(){this.el.playerStop(),this.trigger(S.default.PLAYBACK_STOP),this.trigger(S.default.PLAYBACK_TIMEUPDATE,{current:0,total:0},this.name)},e.prototype.isPlaying=function(){return!!(this.isReady&&this._currentState.indexOf("PLAYING")>-1)},e.prototype.getDuration=function(){return this.el.getDuration()},e.prototype.seekPercentage=function(t){var e=this;if(this.el.getDuration()>0){var i=this.el.getDuration()*(t/100);this.seek(i)}else this.listenToOnce(this,S.default.PLAYBACK_BUFFERFULL,function(){return e.seekPercentage(t)})},e.prototype.seek=function(t){var e=this;this.isReady&&this.el.playerSeek?(this.el.playerSeek(t),this.trigger(S.default.PLAYBACK_TIMEUPDATE,{current:t,total:this.el.getDuration()},this.name),"PAUSED"===this._currentState&&this.el.playerPause()):this.listenToOnce(this,S.default.PLAYBACK_BUFFERFULL,function(){return e.seek(t)})},e.prototype.destroy=function(){clearInterval(this.bootstrapId),t.prototype.stopListening.call(this),this.$el.remove()},(0,u.default)(e,[{key:"isReady",get:function(){return this._isReadyState}}]),e}(p.default);e.default=C,C.canPlay=function(t){if(y.default.hasFlash&&t&&t.constructor===String){var e=t.split("?")[0].match(/.*\.(.*)$/)||[];return e.length>1&&!y.default.isMobile&&e[1].toLowerCase().match(/^(mp4|mov|f4v|3gpp|3gp)$/)}return!1},t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(3),s=n(o),l=i(1),u=n(l),c=i(2),d=n(c),h=i(9),f=n(h),p=i(8),g=n(p),y=i(13),m=n(y),v=i(172),b=n(v);i(173);var _=function(t){function e(){return(0,a.default)(this,e),(0,u.default)(this,t.apply(this,arguments))}return(0,d.default)(e,t),e.prototype.setElement=function(t){this.$el=t,this.el=t[0]},e.prototype.render=function(){return this.$el.attr("data",this.swfPath),this.$el.html(this.template({cid:this.cid,swfPath:this.swfPath,baseUrl:this.baseUrl,playbackId:this.uniqueId,wmode:this.wmode,callbackName:"window.Clappr.flashlsCallbacks."+this.cid})),m.default.isIE&&(this.$("embed").remove(),m.default.isLegacyIE&&this.$el.attr("classid","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000")),this.el.id=this.cid,this},(0,s.default)(e,[{key:"tagName",get:function(){return"object"}},{key:"swfPath",get:function(){return""}},{key:"wmode",get:function(){return"transparent"}},{key:"template",get:function(){return(0,g.default)(b.default)}},{key:"attributes",get:function(){var t="application/x-shockwave-flash";return m.default.isLegacyIE&&(t=""),{class:"clappr-flash-playback",type:t,width:"100%",height:"100%",data:this.swfPath,"data-flash-playback":this.name}}}]),e}(f.default);e.default=_,t.exports=e.default},function(t,e){t.exports='<param name="movie" value="<%= swfPath %>">\n<param name="quality" value="autohigh">\n<param name="swliveconnect" value="true">\n<param name="allowScriptAccess" value="always">\n<param name="bgcolor" value="#000000">\n<param name="allowFullScreen" value="false">\n<param name="wmode" value="<%= wmode %>">\n<param name="tabindex" value="1">\n<param name="FlashVars" value="playbackId=<%= playbackId %>&callback=<%= callbackName %>">\n<embed\n name="<%= cid %>"\n type="application/x-shockwave-flash"\n disabled="disabled"\n tabindex="-1"\n enablecontextmenu="false"\n allowScriptAccess="always"\n quality="autohigh"\n pluginspage="http://www.macromedia.com/go/getflashplayer"\n wmode="<%= wmode %>"\n swliveconnect="true"\n allowfullscreen="false"\n bgcolor="#000000"\n FlashVars="playbackId=<%= playbackId %>&callback=<%= callbackName %>"\n data="<%= swfPath %>"\n src="<%= swfPath %>"\n width="100%"\n height="100%">\n</embed>\n'},function(t,e,i){var n=i(174);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,".clappr-flash-playback[data-flash-playback]{display:block;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none}",""])},function(t,e){t.exports="<%=baseUrl%>/4b76590b32dab62bc95c1b7951efae78.swf"},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(3),s=n(o),l=i(1),u=n(l),c=i(2),d=n(c),h=i(4),f=n(h),p=i(9),g=n(p),y=i(35),m=n(y),v=function(t){function e(){return(0,a.default)(this,e),(0,u.default)(this,t.apply(this,arguments))}return(0,d.default)(e,t),e.prototype.updateSettings=function(){this.settings.left=["playpause","position","duration"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(f.default.PLAYBACK_SETTINGSUPDATE)},e.prototype.getPlaybackType=function(){return g.default.AOD},(0,s.default)(e,[{key:"name",get:function(){return"html5_audio"}},{key:"tagName",get:function(){return"audio"}},{key:"isAudioOnly",get:function(){return!0}}]),e}(m.default);e.default=v,v.canPlay=function(t,e){var i={wav:["audio/wav"],mp3:["audio/mp3",'audio/mpeg;codecs="mp3"'],aac:['audio/mp4;codecs="mp4a.40.5"'],oga:["audio/ogg"]};return m.default._canPlay("audio",i,t,e)},t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(59),f=n(h),p=i(4),g=n(p),y=i(8),m=n(y),v=i(9),b=n(v),_=i(24),E=n(_),T=i(13),A=n(T),S=i(178),L=n(S),R=i(179),k=n(R),w=i(6),C=n(w),I=function(t){function e(){(0,a.default)(this,e);for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];var o=(0,s.default)(this,t.call.apply(t,[this].concat(n)));return o._src=o.options.src,o._baseUrl=o.options.baseUrl,o._initHlsParameters(o.options),o.highDefinition=!1,o._autoPlay=o.options.autoPlay,o._loop=o.options.loop,o._defaultSettings={left:["playstop"],default:["seekbar"],right:["fullscreen","volume","hd-indicator"],seekEnabled:!1},o.settings=C.default.extend({},o._defaultSettings),o._playbackType=b.default.LIVE,o._hasEnded=!1,o._addListeners(),o}return(0,d.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"flashls"}},{key:"swfPath",get:function(){return(0,m.default)(k.default)({baseUrl:this._baseUrl})}},{key:"levels",get:function(){return this._levels||[]}},{key:"currentLevel",get:function(){return null===this._currentLevel||void 0===this._currentLevel?-1:this._currentLevel},set:function(t){this._currentLevel=t,this.trigger(g.default.PLAYBACK_LEVEL_SWITCH_START),this.el.playerSetCurrentLevel(t)}},{key:"ended",get:function(){return this._hasEnded}},{key:"buffering",get:function(){return!!this._bufferingState&&!this._hasEnded}}]),e.prototype._initHlsParameters=function(t){this._autoStartLoad=void 0===t.autoStartLoad||t.autoStartLoad,this._capLevelToStage=void 0!==t.capLevelToStage&&t.capLevelToStage,this._maxLevelCappingMode=void 0===t.maxLevelCappingMode?"downscale":t.maxLevelCappingMode,this._minBufferLength=void 0===t.minBufferLength?-1:t.minBufferLength,this._minBufferLengthCapping=void 0===t.minBufferLengthCapping?-1:t.minBufferLengthCapping,this._maxBufferLength=void 0===t.maxBufferLength?120:t.maxBufferLength,this._maxBackBufferLength=void 0===t.maxBackBufferLength?30:t.maxBackBufferLength,this._lowBufferLength=void 0===t.lowBufferLength?3:t.lowBufferLength,this._mediaTimePeriod=void 0===t.mediaTimePeriod?100:t.mediaTimePeriod,this._fpsDroppedMonitoringPeriod=void 0===t.fpsDroppedMonitoringPeriod?5e3:t.fpsDroppedMonitoringPeriod,this._fpsDroppedMonitoringThreshold=void 0===t.fpsDroppedMonitoringThreshold?.2:t.fpsDroppedMonitoringThreshold,this._capLevelonFPSDrop=void 0!==t.capLevelonFPSDrop&&t.capLevelonFPSDrop,this._smoothAutoSwitchonFPSDrop=void 0===t.smoothAutoSwitchonFPSDrop?this.capLevelonFPSDrop:t.smoothAutoSwitchonFPSDrop,this._switchDownOnLevelError=void 0===t.switchDownOnLevelError||t.switchDownOnLevelError,this._seekMode=void 0===t.seekMode?"ACCURATE":t.seekMode,this._keyLoadMaxRetry=void 0===t.keyLoadMaxRetry?3:t.keyLoadMaxRetry,this._keyLoadMaxRetryTimeout=void 0===t.keyLoadMaxRetryTimeout?64e3:t.keyLoadMaxRetryTimeout,this._fragmentLoadMaxRetry=void 0===t.fragmentLoadMaxRetry?3:t.fragmentLoadMaxRetry,this._fragmentLoadMaxRetryTimeout=void 0===t.fragmentLoadMaxRetryTimeout?4e3:t.fragmentLoadMaxRetryTimeout,this._fragmentLoadSkipAfterMaxRetry=void 0===t.fragmentLoadSkipAfterMaxRetry||t.fragmentLoadSkipAfterMaxRetry,this._maxSkippedFragments=void 0===t.maxSkippedFragments?5:t.maxSkippedFragments,this._flushLiveURLCache=void 0!==t.flushLiveURLCache&&t.flushLiveURLCache,this._initialLiveManifestSize=void 0===t.initialLiveManifestSize?1:t.initialLiveManifestSize,this._manifestLoadMaxRetry=void 0===t.manifestLoadMaxRetry?3:t.manifestLoadMaxRetry,this._manifestLoadMaxRetryTimeout=void 0===t.manifestLoadMaxRetryTimeout?64e3:t.manifestLoadMaxRetryTimeout,this._manifestRedundantLoadmaxRetry=void 0===t.manifestRedundantLoadmaxRetry?3:t.manifestRedundantLoadmaxRetry,this._startFromBitrate=void 0===t.startFromBitrate?-1:t.startFromBitrate,this._startFromLevel=void 0===t.startFromLevel?-1:t.startFromLevel,this._autoStartMaxDuration=void 0===t.autoStartMaxDuration?-1:t.autoStartMaxDuration,this._seekFromLevel=void 0===t.seekFromLevel?-1:t.seekFromLevel,this._useHardwareVideoDecoder=void 0!==t.useHardwareVideoDecoder&&t.useHardwareVideoDecoder,this._hlsLogEnabled=void 0===t.hlsLogEnabled||t.hlsLogEnabled,this._logDebug=void 0!==t.logDebug&&t.logDebug,this._logDebug2=void 0!==t.logDebug2&&t.logDebug2,this._logWarn=void 0===t.logWarn||t.logWarn,this._logError=void 0===t.logError||t.logError,this._hlsMinimumDvrSize=void 0===t.hlsMinimumDvrSize?60:t.hlsMinimumDvrSize},e.prototype._addListeners=function(){var t=this;E.default.on(this.cid+":flashready",function(){return t._bootstrap()}),E.default.on(this.cid+":timeupdate",function(e){return t._updateTime(e)}),E.default.on(this.cid+":playbackstate",function(e){return t._setPlaybackState(e)}),E.default.on(this.cid+":levelchanged",function(e){return t._levelChanged(e)}),E.default.on(this.cid+":error",function(e,i,n){return t._flashPlaybackError(e,i,n)}),E.default.on(this.cid+":fragmentloaded",function(e){return t._onFragmentLoaded(e)}),E.default.on(this.cid+":levelendlist",function(e){return t._onLevelEndlist(e)})},e.prototype.stopListening=function(){t.prototype.stopListening.call(this),E.default.off(this.cid+":flashready"),E.default.off(this.cid+":timeupdate"),E.default.off(this.cid+":playbackstate"),E.default.off(this.cid+":levelchanged"),E.default.off(this.cid+":playbackerror"),E.default.off(this.cid+":fragmentloaded"),E.default.off(this.cid+":manifestloaded"),E.default.off(this.cid+":levelendlist")},e.prototype._bootstrap=function(){var t=this;this.el.playerLoad?(this.el.width="100%",this.el.height="100%",this._isReadyState=!0,this._srcLoaded=!1,this._currentState="IDLE",this._setFlashSettings(),this._updatePlaybackType(),(this._autoPlay||this._shouldPlayOnManifestLoaded)&&this.play(),this.trigger(g.default.PLAYBACK_READY,this.name)):(this._bootstrapAttempts=this._bootstrapAttempts||0,++this._bootstrapAttempts<=60?setTimeout(function(){return t._bootstrap()},50):this.trigger(g.default.PLAYBACK_ERROR,{message:"Max number of attempts reached"},this.name))},e.prototype._setFlashSettings=function(){this.el.playerSetAutoStartLoad(this._autoStartLoad),this.el.playerSetCapLevelToStage(this._capLevelToStage),this.el.playerSetMaxLevelCappingMode(this._maxLevelCappingMode),this.el.playerSetMinBufferLength(this._minBufferLength),this.el.playerSetMinBufferLengthCapping(this._minBufferLengthCapping),this.el.playerSetMaxBufferLength(this._maxBufferLength),this.el.playerSetMaxBackBufferLength(this._maxBackBufferLength),this.el.playerSetLowBufferLength(this._lowBufferLength),this.el.playerSetMediaTimePeriod(this._mediaTimePeriod),this.el.playerSetFpsDroppedMonitoringPeriod(this._fpsDroppedMonitoringPeriod),this.el.playerSetFpsDroppedMonitoringThreshold(this._fpsDroppedMonitoringThreshold),this.el.playerSetCapLevelonFPSDrop(this._capLevelonFPSDrop),this.el.playerSetSmoothAutoSwitchonFPSDrop(this._smoothAutoSwitchonFPSDrop),this.el.playerSetSwitchDownOnLevelError(this._switchDownOnLevelError),this.el.playerSetSeekMode(this._seekMode),this.el.playerSetKeyLoadMaxRetry(this._keyLoadMaxRetry),this.el.playerSetKeyLoadMaxRetryTimeout(this._keyLoadMaxRetryTimeout),this.el.playerSetFragmentLoadMaxRetry(this._fragmentLoadMaxRetry),this.el.playerSetFragmentLoadMaxRetryTimeout(this._fragmentLoadMaxRetryTimeout),this.el.playerSetFragmentLoadSkipAfterMaxRetry(this._fragmentLoadSkipAfterMaxRetry),this.el.playerSetMaxSkippedFragments(this._maxSkippedFragments),this.el.playerSetFlushLiveURLCache(this._flushLiveURLCache),this.el.playerSetInitialLiveManifestSize(this._initialLiveManifestSize),this.el.playerSetManifestLoadMaxRetry(this._manifestLoadMaxRetry),this.el.playerSetManifestLoadMaxRetryTimeout(this._manifestLoadMaxRetryTimeout),this.el.playerSetManifestRedundantLoadmaxRetry(this._manifestRedundantLoadmaxRetry),this.el.playerSetStartFromBitrate(this._startFromBitrate),this.el.playerSetStartFromLevel(this._startFromLevel),this.el.playerSetAutoStartMaxDuration(this._autoStartMaxDuration),this.el.playerSetSeekFromLevel(this._seekFromLevel),this.el.playerSetUseHardwareVideoDecoder(this._useHardwareVideoDecoder),this.el.playerSetLogInfo(this._hlsLogEnabled),this.el.playerSetLogDebug(this._logDebug),this.el.playerSetLogDebug2(this._logDebug2),this.el.playerSetLogWarn(this._logWarn),this.el.playerSetLogError(this._logError)},e.prototype.setAutoStartLoad=function(t){this._autoStartLoad=t,this.el.playerSetAutoStartLoad(this._autoStartLoad)},e.prototype.setCapLevelToStage=function(t){this._capLevelToStage=t,this.el.playerSetCapLevelToStage(this._capLevelToStage)},e.prototype.setMaxLevelCappingMode=function(t){this._maxLevelCappingMode=t,this.el.playerSetMaxLevelCappingMode(this._maxLevelCappingMode)},e.prototype.setSetMinBufferLength=function(t){this._minBufferLength=t,this.el.playerSetMinBufferLength(this._minBufferLength)},e.prototype.setMinBufferLengthCapping=function(t){this._minBufferLengthCapping=t,this.el.playerSetMinBufferLengthCapping(this._minBufferLengthCapping)},e.prototype.setMaxBufferLength=function(t){this._maxBufferLength=t,this.el.playerSetMaxBufferLength(this._maxBufferLength)},e.prototype.setMaxBackBufferLength=function(t){this._maxBackBufferLength=t,this.el.playerSetMaxBackBufferLength(this._maxBackBufferLength)},e.prototype.setLowBufferLength=function(t){this._lowBufferLength=t,this.el.playerSetLowBufferLength(this._lowBufferLength)},e.prototype.setMediaTimePeriod=function(t){this._mediaTimePeriod=t,this.el.playerSetMediaTimePeriod(this._mediaTimePeriod)},e.prototype.setFpsDroppedMonitoringPeriod=function(t){this._fpsDroppedMonitoringPeriod=t,this.el.playerSetFpsDroppedMonitoringPeriod(this._fpsDroppedMonitoringPeriod)},e.prototype.setFpsDroppedMonitoringThreshold=function(t){this._fpsDroppedMonitoringThreshold=t,this.el.playerSetFpsDroppedMonitoringThreshold(this._fpsDroppedMonitoringThreshold)},e.prototype.setCapLevelonFPSDrop=function(t){this._capLevelonFPSDrop=t,this.el.playerSetCapLevelonFPSDrop(this._capLevelonFPSDrop)},e.prototype.setSmoothAutoSwitchonFPSDrop=function(t){this._smoothAutoSwitchonFPSDrop=t,this.el.playerSetSmoothAutoSwitchonFPSDrop(this._smoothAutoSwitchonFPSDrop)},e.prototype.setSwitchDownOnLevelError=function(t){this._switchDownOnLevelError=t,this.el.playerSetSwitchDownOnLevelError(this._switchDownOnLevelError)},e.prototype.setSeekMode=function(t){this._seekMode=t,this.el.playerSetSeekMode(this._seekMode)},e.prototype.setKeyLoadMaxRetry=function(t){this._keyLoadMaxRetry=t,this.el.playerSetKeyLoadMaxRetry(this._keyLoadMaxRetry)},e.prototype.setKeyLoadMaxRetryTimeout=function(t){this._keyLoadMaxRetryTimeout=t,this.el.playerSetKeyLoadMaxRetryTimeout(this._keyLoadMaxRetryTimeout)},e.prototype.setFragmentLoadMaxRetry=function(t){this._fragmentLoadMaxRetry=t,this.el.playerSetFragmentLoadMaxRetry(this._fragmentLoadMaxRetry)},e.prototype.setFragmentLoadMaxRetryTimeout=function(t){this._fragmentLoadMaxRetryTimeout=t,this.el.playerSetFragmentLoadMaxRetryTimeout(this._fragmentLoadMaxRetryTimeout)},e.prototype.setFragmentLoadSkipAfterMaxRetry=function(t){this._fragmentLoadSkipAfterMaxRetry=t,this.el.playerSetFragmentLoadSkipAfterMaxRetry(this._fragmentLoadSkipAfterMaxRetry)},e.prototype.setMaxSkippedFragments=function(t){this._maxSkippedFragments=t,this.el.playerSetMaxSkippedFragments(this._maxSkippedFragments)},e.prototype.setFlushLiveURLCache=function(t){this._flushLiveURLCache=t,this.el.playerSetFlushLiveURLCache(this._flushLiveURLCache)},e.prototype.setInitialLiveManifestSize=function(t){this._initialLiveManifestSize=t,this.el.playerSetInitialLiveManifestSize(this._initialLiveManifestSize)},e.prototype.setManifestLoadMaxRetry=function(t){this._manifestLoadMaxRetry=t,this.el.playerSetManifestLoadMaxRetry(this._manifestLoadMaxRetry)},e.prototype.setManifestLoadMaxRetryTimeout=function(t){this._manifestLoadMaxRetryTimeout=t,this.el.playerSetManifestLoadMaxRetryTimeout(this._manifestLoadMaxRetryTimeout)},e.prototype.setManifestRedundantLoadmaxRetry=function(t){this._manifestRedundantLoadmaxRetry=t,this.el.playerSetManifestRedundantLoadmaxRetry(this._manifestRedundantLoadmaxRetry)},e.prototype.setStartFromBitrate=function(t){this._startFromBitrate=t,this.el.playerSetStartFromBitrate(this._startFromBitrate)},e.prototype.setStartFromLevel=function(t){this._startFromLevel=t,this.el.playerSetStartFromLevel(this._startFromLevel)},e.prototype.setAutoStartMaxDuration=function(t){this._autoStartMaxDuration=t,this.el.playerSetAutoStartMaxDuration(this._autoStartMaxDuration)},e.prototype.setSeekFromLevel=function(t){this._seekFromLevel=t,this.el.playerSetSeekFromLevel(this._seekFromLevel)},e.prototype.setUseHardwareVideoDecoder=function(t){this._useHardwareVideoDecoder=t,this.el.playerSetUseHardwareVideoDecoder(this._useHardwareVideoDecoder)},e.prototype.setSetLogInfo=function(t){this._hlsLogEnabled=t,this.el.playerSetLogInfo(this._hlsLogEnabled)},e.prototype.setLogDebug=function(t){this._logDebug=t,this.el.playerSetLogDebug(this._logDebug)},e.prototype.setLogDebug2=function(t){this._logDebug2=t,this.el.playerSetLogDebug2(this._logDebug2)},e.prototype.setLogWarn=function(t){this._logWarn=t,this.el.playerSetLogWarn(this._logWarn)},e.prototype.setLogError=function(t){this._logError=t,this.el.playerSetLogError(this._logError)},e.prototype._levelChanged=function(t){var e=this.el.getLevels()[t];e&&(this.highDefinition=e.height>=720||e.bitrate/1e3>=2e3,this.trigger(g.default.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this._levels&&0!==this._levels.length||this._fillLevels(),this.trigger(g.default.PLAYBACK_BITRATE,{height:e.height,width:e.width,bandwidth:e.bitrate,bitrate:e.bitrate,level:t}),this.trigger(g.default.PLAYBACK_LEVEL_SWITCH_END))},e.prototype._updateTime=function(t){if("IDLE"!==this._currentState){var e=this._normalizeDuration(t.duration),i=Math.min(Math.max(t.position,0),e),n=this._dvrEnabled,r=this._playbackType===b.default.LIVE;this._dvrEnabled=r&&e>this._hlsMinimumDvrSize,100!==e&&void 0!==r&&(this._dvrEnabled!==n&&(this._updateSettings(),this.trigger(g.default.PLAYBACK_SETTINGSUPDATE,this.name)),!r||this._dvrEnabled&&this._dvrInUse||(i=e),this.trigger(g.default.PLAYBACK_TIMEUPDATE,{current:i,total:e},this.name))}},e.prototype.play=function(){this.trigger(g.default.PLAYBACK_PLAY_INTENT),"PAUSED"===this._currentState?this.el.playerResume():this._srcLoaded||"PLAYING"===this._currentState?this.el.playerPlay():this._firstPlay()},e.prototype.getPlaybackType=function(){return this._playbackType?this._playbackType:null},e.prototype.getCurrentTime=function(){return this.el.getPosition()},e.prototype.getCurrentLevelIndex=function(){return this._currentLevel},e.prototype.getCurrentLevel=function(){return this.levels[this.currentLevel]},e.prototype.getCurrentBitrate=function(){return this.levels[this.currentLevel].bitrate},e.prototype.setCurrentLevel=function(t){this.currentLevel=t},e.prototype.isHighDefinitionInUse=function(){return this.highDefinition},e.prototype.getLevels=function(){return this.levels},e.prototype._setPlaybackState=function(t){["PLAYING_BUFFERING","PAUSED_BUFFERING"].indexOf(t)>=0?(this._bufferingState=!0,this.trigger(g.default.PLAYBACK_BUFFERING,this.name),this._updateCurrentState(t)):["PLAYING","PAUSED"].indexOf(t)>=0?(["PLAYING_BUFFERING","PAUSED_BUFFERING","IDLE"].indexOf(this._currentState)>=0&&(this._bufferingState=!1,this.trigger(g.default.PLAYBACK_BUFFERFULL,this.name)),this._updateCurrentState(t)):"IDLE"===t&&(this._srcLoaded=!1,this._loop&&["PLAYING_BUFFERING","PLAYING"].indexOf(this._currentState)>=0?(this.play(),this.seek(0)):(this._updateCurrentState(t),this._hasEnded=!0,this.trigger(g.default.PLAYBACK_TIMEUPDATE,{current:0,total:this.getDuration()},this.name),this.trigger(g.default.PLAYBACK_ENDED,this.name)))},e.prototype._updateCurrentState=function(t){this._currentState=t,"IDLE"!==t&&(this._hasEnded=!1),this._updatePlaybackType(),"PLAYING"===t?this.trigger(g.default.PLAYBACK_PLAY,this.name):"PAUSED"===t&&this.trigger(g.default.PLAYBACK_PAUSE,this.name)},e.prototype._updatePlaybackType=function(){this._playbackType=this.el.getType(),this._playbackType&&(this._playbackType=this._playbackType.toLowerCase(),this._playbackType===b.default.VOD?this._startReportingProgress():this._stopReportingProgress()),this.trigger(g.default.PLAYBACK_PLAYBACKSTATE,{type:this._playbackType})},e.prototype._startReportingProgress=function(){this._reportingProgress||(this._reportingProgress=!0)},e.prototype._stopReportingProgress=function(){this._reportingProgress=!1},e.prototype._onFragmentLoaded=function(t){if(this.trigger(g.default.PLAYBACK_FRAGMENT_LOADED,t),this._reportingProgress&&this.getCurrentTime()){var e=this.getCurrentTime()+this.el.getbufferLength();this.trigger(g.default.PLAYBACK_PROGRESS,{start:this.getCurrentTime(),current:e,total:this.el.getDuration()})}},e.prototype._onLevelEndlist=function(){this._updatePlaybackType()},e.prototype._firstPlay=function(){var t=this;this._shouldPlayOnManifestLoaded=!0,this.el.playerLoad&&(E.default.once(this.cid+":manifestloaded",function(e,i){return t._manifestLoaded(e,i)}),this._setFlashSettings(),this.el.playerLoad(this._src),this._srcLoaded=!0)},e.prototype.volume=function(t){var e=this;this.isReady?this.el.playerVolume(t):this.listenToOnce(this,g.default.PLAYBACK_BUFFERFULL,function(){return e.volume(t)})},e.prototype.pause=function(){(this._playbackType!==b.default.LIVE||this._dvrEnabled)&&(this.el.playerPause(),this._playbackType===b.default.LIVE&&this._dvrEnabled&&this._updateDvr(!0))},e.prototype.stop=function(){this._srcLoaded=!1,this.el.playerStop(),this.trigger(g.default.PLAYBACK_STOP),this.trigger(g.default.PLAYBACK_TIMEUPDATE,{current:0,total:0},this.name)},e.prototype.isPlaying=function(){return!!this._currentState&&!!this._currentState.match(/playing/i)},e.prototype.getDuration=function(){return this._normalizeDuration(this.el.getDuration())},e.prototype._normalizeDuration=function(t){return this._playbackType===b.default.LIVE&&(t=Math.max(0,t-10)),t},e.prototype.seekPercentage=function(t){var e=this.el.getDuration(),i=0;t>0&&(i=e*t/100),this.seek(i)},e.prototype.seek=function(t){var e=this.getDuration();if(this._playbackType===b.default.LIVE){var i=e-t>3;this._updateDvr(i)}this.el.playerSeek(t),this.trigger(g.default.PLAYBACK_TIMEUPDATE,{current:t,total:e},this.name)},e.prototype._updateDvr=function(t){var e=!!this._dvrInUse;this._dvrInUse=t,this._dvrInUse!==e&&(this._updateSettings(),this.trigger(g.default.PLAYBACK_DVR,this._dvrInUse),this.trigger(g.default.PLAYBACK_STATS_ADD,{dvr:this._dvrInUse}))},e.prototype._flashPlaybackError=function(t,e,i){this.trigger(g.default.PLAYBACK_ERROR,{code:t,url:e,message:i}),this.trigger(g.default.PLAYBACK_STOP)},e.prototype._manifestLoaded=function(t,e){this._shouldPlayOnManifestLoaded&&(this._shouldPlayOnManifestLoaded=!1,this.el.playerPlay()),this._fillLevels(),this.trigger(g.default.PLAYBACK_LOADEDMETADATA,{duration:t,data:e})},e.prototype._fillLevels=function(){var t=this.el.getLevels(),e=t.length;this._levels=[];for(var i=0;i<e;i++)this._levels.push({id:i,label:t[i].height+"p",level:t[i]});this.trigger(g.default.PLAYBACK_LEVELS_AVAILABLE,this._levels)},e.prototype.destroy=function(){this.stopListening(),this.$el.remove()},e.prototype._updateSettings=function(){this.settings=C.default.extend({},this._defaultSettings),this._playbackType===b.default.VOD||this._dvrInUse?(this.settings.left=["playpause","position","duration"],this.settings.seekEnabled=!0):this._dvrEnabled?(this.settings.left=["playpause"],this.settings.seekEnabled=!0):this.settings.seekEnabled=!1},e.prototype._createCallbacks=function(){var t=this;window.Clappr||(window.Clappr={}),window.Clappr.flashlsCallbacks||(window.Clappr.flashlsCallbacks={}),this.flashlsEvents=new L.default(this.cid),window.Clappr.flashlsCallbacks[this.cid]=function(e,i){t.flashlsEvents[e].apply(t.flashlsEvents,i)}},e.prototype.render=function(){return t.prototype.render.call(this),this._createCallbacks(),this},(0,u.default)(e,[{key:"isReady",get:function(){return this._isReadyState}},{key:"dvrEnabled",get:function(){return!!this._dvrEnabled}}]),e}(f.default);e.default=I,I.canPlay=function(t,e){var i=t.split("?")[0].match(/.*\.(.*)$/)||[];return A.default.hasFlash&&(i.length>1&&"m3u8"===i[1].toLowerCase()||"application/x-mpegURL"===e||"application/vnd.apple.mpegurl"===e)},t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(24),s=n(o),l=function(){function t(e){(0,a.default)(this,t),this.instanceId=e}return t.prototype.ready=function(){s.default.trigger(this.instanceId+":flashready")},t.prototype.videoSize=function(t,e){s.default.trigger(this.instanceId+":videosizechanged",t,e)},t.prototype.complete=function(){s.default.trigger(this.instanceId+":complete")},t.prototype.error=function(t,e,i){s.default.trigger(this.instanceId+":error",t,e,i)},t.prototype.manifest=function(t,e){s.default.trigger(this.instanceId+":manifestloaded",t,e)},t.prototype.audioLevelLoaded=function(t){s.default.trigger(this.instanceId+":audiolevelloaded",t)},t.prototype.levelLoaded=function(t){s.default.trigger(this.instanceId+":levelloaded",t)},t.prototype.levelEndlist=function(t){s.default.trigger(this.instanceId+":levelendlist",t)},t.prototype.fragmentLoaded=function(t){s.default.trigger(this.instanceId+":fragmentloaded",t)},t.prototype.fragmentPlaying=function(t){s.default.trigger(this.instanceId+":fragmentplaying",t)},t.prototype.position=function(t){s.default.trigger(this.instanceId+":timeupdate",t)},t.prototype.state=function(t){s.default.trigger(this.instanceId+":playbackstate",t)},t.prototype.seekState=function(t){s.default.trigger(this.instanceId+":seekstate",t)},t.prototype.switch=function(t){s.default.trigger(this.instanceId+":levelchanged",t)},t.prototype.audioTracksListChange=function(t){s.default.trigger(this.instanceId+":audiotracklistchanged",t)},t.prototype.audioTrackChange=function(t){s.default.trigger(this.instanceId+":audiotrackchanged",t)},t}();e.default=l,t.exports=e.default},function(t,e){t.exports="<%=baseUrl%>/8fa12a459188502b9f0d39b8a67d9e6c.swf"},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(80),a=n(r),o=i(0),s=n(o),l=i(1),u=n(l),c=i(3),d=n(c),h=i(2),f=n(h),p=i(35),g=n(p),y=i(181),m=n(y),v=i(4),b=n(v),_=i(9),E=n(_),T=i(5),A=i(55),S=n(A),L=function(t){function e(){(0,s.default)(this,e);for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];var a=(0,u.default)(this,t.call.apply(t,[this].concat(n)));return a.options.playback||(a.options.playback=a.options),a._minDvrSize=void 0===a.options.hlsMinimumDvrSize?60:a.options.hlsMinimumDvrSize,a._extrapolatedWindowNumSegments=a.options.playback&&void 0!==a.options.playback.extrapolatedWindowNumSegments?a.options.playback.extrapolatedWindowNumSegments:2,a._playbackType=E.default.VOD,a._lastTimeUpdate=null,a._lastDuration=null,a._playableRegionStartTime=0,a._localStartTimeCorrelation=null,a._localEndTimeCorrelation=null,a._playableRegionDuration=0,a._durationExcludesAfterLiveSyncPoint=!1,a._segmentTargetDuration=null,a._playlistType=null,a._recoverAttemptsRemaining=a.options.hlsRecoverAttempts||16,a._startTimeUpdateTimer(),a}return(0,f.default)(e,t),(0,d.default)(e,[{key:"name",get:function(){return"hls"}},{key:"levels",get:function(){return this._levels||[]}},{key:"currentLevel",get:function(){return null===this._currentLevel||void 0===this._currentLevel?-1:this._currentLevel},set:function(t){this._currentLevel=t,this.trigger(b.default.PLAYBACK_LEVEL_SWITCH_START),this._hls.currentLevel=this._currentLevel}},{key:"isReady",get:function(){return this._isReadyState}},{key:"_startTime",get:function(){return this._playbackType===E.default.LIVE&&"EVENT"!==this._playlistType?this._extrapolatedStartTime:this._playableRegionStartTime}},{key:"_now",get:function(){return(0,T.now)()}},{key:"_extrapolatedStartTime",get:function(){if(!this._localStartTimeCorrelation)return this._playableRegionStartTime;var t=this._localStartTimeCorrelation,e=this._now-t.local,i=(t.remote+e)/1e3;return Math.min(i,this._playableRegionStartTime+this._extrapolatedWindowDuration)}},{key:"_extrapolatedEndTime",get:function(){var t=this._playableRegionStartTime+this._playableRegionDuration;if(!this._localEndTimeCorrelation)return t;var e=this._localEndTimeCorrelation,i=this._now-e.local,n=(e.remote+i)/1e3;return Math.max(t-this._extrapolatedWindowDuration,Math.min(n,t))}},{key:"_duration",get:function(){return this._extrapolatedEndTime-this._startTime}},{key:"_extrapolatedWindowDuration",get:function(){return null===this._segmentTargetDuration?0:this._extrapolatedWindowNumSegments*this._segmentTargetDuration}}],[{key:"HLSJS",get:function(){return m.default}}]),e.prototype._setup=function(){var t=this;this._ccIsSetup=!1,this._ccTracksUpdated=!1,this._hls=new m.default(this.options.playback.hlsjsConfig||{}),this._hls.on(m.default.Events.MEDIA_ATTACHED,function(){return t._hls.loadSource(t.options.src)}),this._hls.on(m.default.Events.LEVEL_LOADED,function(e,i){return t._updatePlaybackType(e,i)}),this._hls.on(m.default.Events.LEVEL_UPDATED,function(e,i){return t._onLevelUpdated(e,i)}),this._hls.on(m.default.Events.LEVEL_SWITCH,function(e,i){return t._onLevelSwitch(e,i)}),this._hls.on(m.default.Events.FRAG_LOADED,function(e,i){return t._onFragmentLoaded(e,i)}),this._hls.on(m.default.Events.ERROR,function(e,i){return t._onHLSJSError(e,i)}),this._hls.on(m.default.Events.SUBTITLE_TRACK_LOADED,function(e,i){return t._onSubtitleLoaded(e,i)}),this._hls.on(m.default.Events.SUBTITLE_TRACKS_UPDATED,function(){return t._ccTracksUpdated=!0}),this._hls.attachMedia(this.el),this._ready()},e.prototype._ready=function(){this._hls&&(this._isReadyState=!0,this.trigger(b.default.PLAYBACK_READY,this.name))},e.prototype._recover=function(t,e){this._recoveredDecodingError?this._recoveredAudioCodecError?(S.default.error("hlsjs: failed to recover"),this.trigger(b.default.PLAYBACK_ERROR,"hlsjs: could not recover from error, evt "+t+", data "+e+" ",this.name)):(this._recoveredAudioCodecError=!0,this._hls.swapAudioCodec(),this._hls.recoverMediaError()):(this._recoveredDecodingError=!0,this._hls.recoverMediaError())},e.prototype._setupSrc=function(t){},e.prototype._startTimeUpdateTimer=function(){var t=this;this._timeUpdateTimer=setInterval(function(){t._onDurationChange(),t._onTimeUpdate()},100)},e.prototype._stopTimeUpdateTimer=function(){clearInterval(this._timeUpdateTimer)},e.prototype.getDuration=function(){return this._duration},e.prototype.getCurrentTime=function(){return Math.max(0,this.el.currentTime-this._startTime)},e.prototype.getStartTimeOffset=function(){return this._startTime},e.prototype.seekPercentage=function(t){var e=this._duration;t>0&&(e=this._duration*(t/100)),this.seek(e)},e.prototype.seek=function(e){e<0&&(S.default.warn("Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point."),e=this.getDuration()),this.dvrEnabled&&this._updateDvr(e<this.getDuration()-3),e+=this._startTime,t.prototype.seek.call(this,e)},e.prototype.seekToLivePoint=function(){this.seek(this.getDuration())},e.prototype._updateDvr=function(t){this.trigger(b.default.PLAYBACK_DVR,t),this.trigger(b.default.PLAYBACK_STATS_ADD,{dvr:t})},e.prototype._updateSettings=function(){this._playbackType===E.default.VOD?this.settings.left=["playpause","position","duration"]:this.dvrEnabled?this.settings.left=["playpause"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(b.default.PLAYBACK_SETTINGSUPDATE)},e.prototype._onHLSJSError=function(t,e){if(e.fatal)if(this._recoverAttemptsRemaining>0)switch(this._recoverAttemptsRemaining-=1,e.type){case m.default.ErrorTypes.NETWORK_ERROR:switch(e.details){case m.default.ErrorDetails.MANIFEST_LOAD_ERROR:case m.default.ErrorDetails.MANIFEST_LOAD_TIMEOUT:case m.default.ErrorDetails.MANIFEST_PARSING_ERROR:case m.default.ErrorDetails.LEVEL_LOAD_ERROR:case m.default.ErrorDetails.LEVEL_LOAD_TIMEOUT:S.default.error("hlsjs: unrecoverable network fatal error, evt "+t+", data "+e+" "),this.trigger(b.default.PLAYBACK_ERROR,{evt:t,data:e},this.name);break;default:S.default.warn("hlsjs: trying to recover from network error, evt "+t+", data "+e+" "),this._hls.startLoad()}break;case m.default.ErrorTypes.MEDIA_ERROR:S.default.warn("hlsjs: trying to recover from media error, evt "+t+", data "+e+" "),this._recover(t,e);break;default:S.default.error("hlsjs: trying to recover from error, evt "+t+", data "+e+" "),this.trigger(b.default.PLAYBACK_ERROR,"hlsjs: could not recover from error, evt "+t+", data "+e+" ",this.name)}else S.default.error("hlsjs: could not recover from error after maximum number of attempts, evt "+t+", data "+e+" "),this.trigger(b.default.PLAYBACK_ERROR,{evt:t,data:e},this.name);else S.default.warn("hlsjs: non-fatal error occurred, evt "+t+", data "+e+" ")},e.prototype._onTimeUpdate=function(){var t={current:this.getCurrentTime(),total:this.getDuration()};this._lastTimeUpdate&&t.current===this._lastTimeUpdate.current&&t.total===this._lastTimeUpdate.total||(this._lastTimeUpdate=t,this.trigger(b.default.PLAYBACK_TIMEUPDATE,t,this.name))},e.prototype._onDurationChange=function(){var e=this.getDuration();this._lastDuration!==e&&(this._lastDuration=e,t.prototype._onDurationChange.call(this))},e.prototype._onProgress=function(){if(this.el.buffered.length){for(var t=[],e=0,i=0;i<this.el.buffered.length;i++)t=[].concat((0,a.default)(t),[{start:Math.max(0,this.el.buffered.start(i)-this._playableRegionStartTime),end:Math.max(0,this.el.buffered.end(i)-this._playableRegionStartTime)}]),this.el.currentTime>=t[i].start&&this.el.currentTime<=t[i].end&&(e=i);var n={start:t[e].start,current:t[e].end,total:this.getDuration()};this.trigger(b.default.PLAYBACK_PROGRESS,n,t)}},e.prototype.play=function(){this._hls||this._setup(),t.prototype.play.call(this)},e.prototype.pause=function(){this._hls&&(t.prototype.pause.call(this),this.dvrEnabled&&this._updateDvr(!0))},e.prototype.stop=function(){this._hls&&(t.prototype.stop.call(this),this._hls.destroy(),delete this._hls)},e.prototype.destroy=function(){this._stopTimeUpdateTimer(),this._hls&&(this._hls.destroy(),delete this._hls),t.prototype.destroy.call(this)},e.prototype._updatePlaybackType=function(t,e){this._playbackType=e.details.live?E.default.LIVE:E.default.VOD,this._fillLevels(),this._onLevelUpdated(t,e),this._ccTracksUpdated&&this._playbackType===E.default.LIVE&&this.hasClosedCaptionsTracks&&this._onSubtitleLoaded()},e.prototype._fillLevels=function(){this._levels=this._hls.levels.map(function(t,e){return{id:e,level:t,label:t.bitrate/1e3+"Kbps"}}),this.trigger(b.default.PLAYBACK_LEVELS_AVAILABLE,this._levels)},e.prototype._onLevelUpdated=function(t,e){this._segmentTargetDuration=e.details.targetduration,this._playlistType=e.details.type||null;var i=!1,n=!1,r=e.details.fragments,a=this._playableRegionStartTime,o=this._playableRegionDuration;if(0!==r.length){if(this._playableRegionStartTime!==r[0].start&&(i=!0,this._playableRegionStartTime=r[0].start),i)if(this._localStartTimeCorrelation){var s=this._localStartTimeCorrelation,l=this._now-s.local,u=(s.remote+l)/1e3;u<r[0].start?this._localStartTimeCorrelation={local:this._now,remote:1e3*r[0].start}:u>a+this._extrapolatedWindowDuration&&(this._localStartTimeCorrelation={local:this._now,remote:1e3*Math.max(r[0].start,a+this._extrapolatedWindowDuration)})}else this._localStartTimeCorrelation={local:this._now,remote:1e3*(r[0].start+this._extrapolatedWindowDuration/2)};var c=e.details.totalduration;if(this._playbackType===E.default.LIVE){var d=e.details.targetduration,h=this.options.playback.hlsjsConfig||{},f=h.liveSyncDurationCount||m.default.DefaultConfig.liveSyncDurationCount,p=d*f;p<=c?(c-=p,this._durationExcludesAfterLiveSyncPoint=!0):this._durationExcludesAfterLiveSyncPoint=!1}c!==this._playableRegionDuration&&(n=!0,this._playableRegionDuration=c);var g=r[0].start+c,y=a+o;if(g!==y)if(this._localEndTimeCorrelation){var v=this._localEndTimeCorrelation,b=this._now-v.local,_=(v.remote+b)/1e3;_>g?this._localEndTimeCorrelation={local:this._now,remote:1e3*g}:_<g-this._extrapolatedWindowDuration?this._localEndTimeCorrelation={local:this._now,remote:1e3*(g-this._extrapolatedWindowDuration)}:_>y&&(this._localEndTimeCorrelation={local:this._now,remote:1e3*y})}else this._localEndTimeCorrelation={local:this._now,remote:1e3*g};n&&this._onDurationChange(),i&&this._onProgress()}},e.prototype._onFragmentLoaded=function(t,e){this.trigger(b.default.PLAYBACK_FRAGMENT_LOADED,e)},e.prototype._onSubtitleLoaded=function(){if(!this._ccIsSetup){this.trigger(b.default.PLAYBACK_SUBTITLE_AVAILABLE);var t=this._playbackType===E.default.LIVE?-1:this.closedCaptionsTrackId;this.closedCaptionsTrackId=t,this._ccIsSetup=!0}},e.prototype._onLevelSwitch=function(t,e){this.levels.length||this._fillLevels(),this.trigger(b.default.PLAYBACK_LEVEL_SWITCH_END),this.trigger(b.default.PLAYBACK_LEVEL_SWITCH,e);var i=this._hls.levels[e.level];i&&(this.highDefinition=i.height>=720||i.bitrate/1e3>=2e3,this.trigger(b.default.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this.trigger(b.default.PLAYBACK_BITRATE,{height:i.height,width:i.width,bandwidth:i.bitrate,bitrate:i.bitrate,level:e.level}))},e.prototype.getPlaybackType=function(){return this._playbackType},e.prototype.isSeekEnabled=function(){return this._playbackType===E.default.VOD||this.dvrEnabled},(0,d.default)(e,[{key:"dvrEnabled",get:function(){return this._durationExcludesAfterLiveSyncPoint&&this._duration>=this._minDvrSize&&this.getPlaybackType()===E.default.LIVE}}]),e}(g.default);e.default=L,L.canPlay=function(t,e){var i=t.split("?")[0].match(/.*\.(.*)$/)||[],n=i.length>1&&"m3u8"===i[1].toLowerCase()||"application/x-mpegURL"===e||"application/vnd.apple.mpegurl"===e;return!(!m.default.isSupported()||!n)},t.exports=e.default},function(t,e,i){!function(e,i){t.exports=i()}(0,function(){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=8)}([function(t,e,i){"use strict";function n(){}function r(t,e){return e="["+t+"] > "+e}function a(t){var e=self.console[t];return e?function(){for(var i=arguments.length,n=Array(i),a=0;a<i;a++)n[a]=arguments[a];n[0]&&(n[0]=r(t,n[0])),e.apply(self.console,n)}:n}function o(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];i.forEach(function(e){u[e]=t[e]?t[e].bind(t):a(e)})}i.d(e,"a",function(){return c}),i.d(e,"b",function(){return d});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l={trace:n,debug:n,log:n,warn:n,info:n,error:n},u=l,c=function(t){if(!0===t||"object"===(void 0===t?"undefined":s(t))){o(t,"debug","log","info","warn","error");try{u.log()}catch(t){u=l}}else u=l},d=u},function(t,e,i){"use strict";e.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_SWITCH:"hlsLevelSwitch",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_SWITCH:"hlsAudioTrackSwitch",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(t,e,i){"use strict";i.d(e,"b",function(){return n}),i.d(e,"a",function(){return r});var n={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},r={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_LOOP_LOADING_ERROR:"fragLoopLoadingError",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(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}i.d(e,"b",function(){return a});var r=function(){function t(){n(this,t)}return t.isHeader=function(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},t.isFooter=function(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},t.getID3Data=function(e,i){for(var n=i,r=0;t.isHeader(e,i);){r+=10;r+=t._readSize(e,i+6),t.isFooter(e,i+10)&&(r+=10),i+=r}if(r>0)return e.subarray(n,n+r)},t._readSize=function(t,e){var i=0;return i=(127&t[e])<<21,i|=(127&t[e+1])<<14,i|=(127&t[e+2])<<7,i|=127&t[e+3]},t.getTimeStamp=function(e){for(var i=t.getID3Frames(e),n=0;n<i.length;n++){var r=i[n];if(t.isTimeStampFrame(r))return t._readTimeStamp(r)}},t.isTimeStampFrame=function(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info},t._getFrameData=function(e){var i=String.fromCharCode(e[0],e[1],e[2],e[3]),n=t._readSize(e,4);return{type:i,size:n,data:e.subarray(10,10+n)}},t.getID3Frames=function(e){for(var i=0,n=[];t.isHeader(e,i);){var r=t._readSize(e,i+6);i+=10;for(var a=i+r;i+8<a;){var o=t._getFrameData(e.subarray(i)),s=t._decodeFrame(o);s&&n.push(s),i+=o.size+10}t.isFooter(e,i)&&(i+=10)}return n},t._decodeFrame=function(e){return"PRIV"===e.type?t._decodePrivFrame(e):"T"===e.type[0]?t._decodeTextFrame(e):"W"===e.type[0]?t._decodeURLFrame(e):void 0},t._readTimeStamp=function(t){if(8===t.data.byteLength){var e=new Uint8Array(t.data),i=1&e[3],n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,i&&(n+=47721858.84),Math.round(n)}},t._decodePrivFrame=function(e){if(!(e.size<2)){var i=t._utf8ArrayToStr(e.data,!0),n=new Uint8Array(e.data.subarray(i.length+1));return{key:e.type,info:i,data:n.buffer}}},t._decodeTextFrame=function(e){if(!(e.size<2)){if("TXXX"===e.type){var i=1,n=t._utf8ArrayToStr(e.data.subarray(i));i+=n.length+1;var r=t._utf8ArrayToStr(e.data.subarray(i));return{key:e.type,info:n,data:r}}var a=t._utf8ArrayToStr(e.data.subarray(1));return{key:e.type,data:a}}},t._decodeURLFrame=function(e){if("WXXX"===e.type){if(e.size<2)return;var i=1,n=t._utf8ArrayToStr(e.data.subarray(i));i+=n.length+1;var r=t._utf8ArrayToStr(e.data.subarray(i));return{key:e.type,info:n,data:r}}var a=t._utf8ArrayToStr(e.data);return{key:e.type,data:a}},t._utf8ArrayToStr=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t.length,n=void 0,r=void 0,a=void 0,o="",s=0;s<i;){if(0===(n=t[s++])&&e)return o;if(0!==n&&3!==n)switch(n>>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:r=t[s++],o+=String.fromCharCode((31&n)<<6|63&r);break;case 14:r=t[s++],a=t[s++],o+=String.fromCharCode((15&n)<<12|(63&r)<<6|(63&a)<<0)}}return o},t}(),a=r._utf8ArrayToStr;e.a=r},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s=function(){function t(e,i){n(this,t),this.subtle=e,this.aesIV=i}return t.prototype.decrypt=function(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)},t}(),l=s,u=function(){function t(e,i){r(this,t),this.subtle=e,this.key=i}return t.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},t}(),c=u,d=function(){function t(){a(this,t),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 t.prototype.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),i=new Uint32Array(4),n=0;n<4;n++)i[n]=e.getUint32(4*n);return i},t.prototype.initTable=function(){var t=this.sBox,e=this.invSBox,i=this.subMix,n=i[0],r=i[1],a=i[2],o=i[3],s=this.invSubMix,l=s[0],u=s[1],c=s[2],d=s[3],h=new Uint32Array(256),f=0,p=0,g=0;for(g=0;g<256;g++)h[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){var y=p^p<<1^p<<2^p<<3^p<<4;y=y>>>8^255&y^99,t[f]=y,e[y]=f;var m=h[f],v=h[m],b=h[v],_=257*h[y]^16843008*y;n[f]=_<<24|_>>>8,r[f]=_<<16|_>>>16,a[f]=_<<8|_>>>24,o[f]=_,_=16843009*b^65537*v^257*m^16843008*f,l[y]=_<<24|_>>>8,u[y]=_<<16|_>>>16,c[y]=_<<8|_>>>24,d[y]=_,f?(f=m^h[h[h[b^m]]],p^=h[h[p]]):f=p=1}},t.prototype.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),i=!0,n=0;n<e.length&&i;)i=e[n]===this.key[n],n++;if(!i){this.key=e;var r=this.keySize=e.length;if(4!==r&&6!==r&&8!==r)throw new Error("Invalid aes key size="+r);var a=this.ksRows=4*(r+6+1),o=void 0,s=void 0,l=this.keySchedule=new Uint32Array(a),u=this.invKeySchedule=new Uint32Array(a),c=this.sBox,d=this.rcon,h=this.invSubMix,f=h[0],p=h[1],g=h[2],y=h[3],m=void 0,v=void 0;for(o=0;o<a;o++)o<r?m=l[o]=e[o]:(v=m,o%r==0?(v=v<<8|v>>>24,v=c[v>>>24]<<24|c[v>>>16&255]<<16|c[v>>>8&255]<<8|c[255&v],v^=d[o/r|0]<<24):r>6&&o%r==4&&(v=c[v>>>24]<<24|c[v>>>16&255]<<16|c[v>>>8&255]<<8|c[255&v]),l[o]=m=(l[o-r]^v)>>>0);for(s=0;s<a;s++)o=a-s,v=3&s?l[o]:l[o-4],u[s]=s<4||o<=4?v:f[c[v>>>24]]^p[c[v>>>16&255]]^g[c[v>>>8&255]]^y[c[255&v]],u[s]=u[s]>>>0}},t.prototype.networkToHostOrderSwap=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},t.prototype.decrypt=function(t,e,i){for(var n,r,a=this.keySize+6,o=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,u=l[0],c=l[1],d=l[2],h=l[3],f=this.uint8ArrayToUint32Array_(i),p=f[0],g=f[1],y=f[2],m=f[3],v=new Int32Array(t),b=new Int32Array(v.length),_=void 0,E=void 0,T=void 0,A=void 0,S=void 0,L=void 0,R=void 0,k=void 0,w=void 0,C=void 0,I=void 0,D=void 0,O=this.networkToHostOrderSwap;e<v.length;){for(w=O(v[e]),C=O(v[e+1]),I=O(v[e+2]),D=O(v[e+3]),S=w^o[0],L=D^o[1],R=I^o[2],k=C^o[3],n=4,r=1;r<a;r++)_=u[S>>>24]^c[L>>16&255]^d[R>>8&255]^h[255&k]^o[n],E=u[L>>>24]^c[R>>16&255]^d[k>>8&255]^h[255&S]^o[n+1],T=u[R>>>24]^c[k>>16&255]^d[S>>8&255]^h[255&L]^o[n+2],A=u[k>>>24]^c[S>>16&255]^d[L>>8&255]^h[255&R]^o[n+3],S=_,L=E,R=T,k=A,n+=4;_=s[S>>>24]<<24^s[L>>16&255]<<16^s[R>>8&255]<<8^s[255&k]^o[n],E=s[L>>>24]<<24^s[R>>16&255]<<16^s[k>>8&255]<<8^s[255&S]^o[n+1],T=s[R>>>24]<<24^s[k>>16&255]<<16^s[S>>8&255]<<8^s[255&L]^o[n+2],A=s[k>>>24]<<24^s[S>>16&255]<<16^s[L>>8&255]<<8^s[255&R]^o[n+3],n+=3,b[e]=O(_^p),b[e+1]=O(A^g),b[e+2]=O(T^y),b[e+3]=O(E^m),p=w,g=C,y=I,m=D,e+=4}return b.buffer},t.prototype.destroy=function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0},t}(),h=d,f=i(2),p=i(0),g=function(){function t(e,i){o(this,t),this.observer=e,this.config=i,this.logEnabled=!0;try{var n=crypto||self.crypto;this.subtle=n.subtle||n.webkitSubtle}catch(t){}this.disableWebCrypto=!this.subtle}return t.prototype.isSync=function(){return this.disableWebCrypto&&this.config.enableSoftwareAES},t.prototype.decrypt=function(t,e,i,n){var r=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(p.b.log("JS AES decrypt"),this.logEnabled=!1);var a=this.decryptor;a||(this.decryptor=a=new h),a.expandKey(e),n(a.decrypt(t,0,i))}else{this.logEnabled&&(p.b.log("WebCrypto AES decrypt"),this.logEnabled=!1);var o=this.subtle;this.key!==e&&(this.key=e,this.fastAesKey=new c(o,e)),this.fastAesKey.expandKey().then(function(a){new l(o,i).decrypt(t,a).catch(function(a){r.onWebCryptoError(a,t,e,i,n)}).then(function(t){n(t)})}).catch(function(a){r.onWebCryptoError(a,t,e,i,n)})}},t.prototype.onWebCryptoError=function(t,e,i,n,r){this.config.enableSoftwareAES?(p.b.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(e,i,n,r)):(p.b.error("decrypting error : "+t.message),this.observer.trigger(Event.ERROR,{type:f.b.MEDIA_ERROR,details:f.a.FRAG_DECRYPT_ERROR,fatal:!0,reason:t.message}))},t.prototype.destroy=function(){var t=this.decryptor;t&&(t.destroy(),this.decryptor=void 0)},t}();e.a=g},function(t,e){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function r(t){return"number"==typeof t}function a(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=i,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(t){if(!r(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},i.prototype.emit=function(t){var e,i,r,s,l,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}if(i=this._events[t],o(i))return!1;if(n(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),i.apply(this,s)}else if(a(i))for(s=Array.prototype.slice.call(arguments,1),u=i.slice(),r=u.length,l=0;l<r;l++)u[l].apply(this,s);return!0},i.prototype.addListener=function(t,e){var r;if(!n(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?a(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,a(this._events[t])&&!this._events[t].warned&&(r=o(this._maxListeners)?i.defaultMaxListeners:this._maxListeners)&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(t,e){function i(){this.removeListener(t,i),r||(r=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var r=!1;return i.listener=e,this.on(t,i),this},i.prototype.removeListener=function(t,e){var i,r,o,s;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(i=this._events[t],o=i.length,r=-1,i===e||n(i.listener)&&i.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(i)){for(s=o;s-- >0;)if(i[s]===e||i[s].listener&&i[s].listener===e){r=s;break}if(r<0)return this;1===i.length?(i.length=0,delete this._events[t]):i.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},i.prototype.removeAllListeners=function(t){var e,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(i=this._events[t],n(i))this.removeListener(t,i);else if(i)for(;i.length;)this.removeListener(t,i[i.length-1]);return delete this._events[t],this},i.prototype.listeners=function(t){return this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},i.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},i.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,i){!function(e){var i=/^((?:[^\/;?#]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,n=/^([^\/;?#]*)(.*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,o={buildAbsoluteURL:function(t,e,i){if(i=i||{},t=t.trim(),!(e=e.trim())){if(!i.alwaysNormalize)return t;var r=this.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");return r.path=o.normalizePath(r.path),o.buildURLFromParts(r)}var a=this.parseURL(e);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return i.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):e;var s=this.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=n.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var u={scheme:s.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(u.netLoc=s.netLoc,"/"!==a.path[0]))if(a.path){var c=s.path,d=c.substring(0,c.lastIndexOf("/")+1)+a.path;u.path=o.normalizePath(d)}else u.path=s.path,a.params||(u.params=s.params,a.query||(u.query=s.query));return null===u.path&&(u.path=i.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(u)},parseURL:function(t){var e=i.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(r,"");t.length!==(t=t.replace(a,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};t.exports=o}()},function(t,e,i){"use strict";function n(t,e,i,n){var r,a,o,s,l,u=navigator.userAgent.toLowerCase(),c=n,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];return r=1+((192&e[i+2])>>>6),(a=(60&e[i+2])>>>2)>d.length-1?void t.trigger(Event.ERROR,{type:L.b.MEDIA_ERROR,details:L.a.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+a}):(s=(1&e[i+2])<<2,s|=(192&e[i+3])>>>6,k.b.log("manifest codec:"+n+",ADTS data:type:"+r+",sampleingIndex:"+a+"["+d[a]+"Hz],channelConfig:"+s),/firefox/i.test(u)?a>=6?(r=5,l=new Array(4),o=a-3):(r=2,l=new Array(2),o=a):-1!==u.indexOf("android")?(r=2,l=new Array(2),o=a):(r=5,l=new Array(4),n&&(-1!==n.indexOf("mp4a.40.29")||-1!==n.indexOf("mp4a.40.5"))||!n&&a>=6?o=a-3:((n&&-1!==n.indexOf("mp4a.40.2")&&(a>=6&&1===s||/vivaldi/i.test(u))||!n&&1===s)&&(r=2,l=new Array(2)),o=a)),l[0]=r<<3,l[0]|=(14&a)>>1,l[1]|=(1&a)<<7,l[1]|=s<<3,5===r&&(l[1]|=(14&o)>>1,l[2]=(1&o)<<7,l[2]|=8,l[3]=0),{config:l,samplerate:d[a],channelCount:s,codec:"mp4a.40."+r,manifestCodec:c})}function r(t,e){return 255===t[e]&&240==(246&t[e+1])}function a(t,e){return 1&t[e+1]?7:9}function o(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function s(t,e){return!!(e+1<t.length&&r(t,e))}function l(t,e){if(e+1<t.length&&r(t,e)){var i=a(t,e),n=i;e+5<t.length&&(n=o(t,e));var s=e+n;if(s===t.length||s+1<t.length&&r(t,s))return!0}return!1}function u(t,e,i,r,a){if(!t.samplerate){var o=n(e,i,r,a);t.config=o.config,t.samplerate=o.samplerate,t.channelCount=o.channelCount,t.codec=o.codec,t.manifestCodec=o.manifestCodec,k.b.log("parsed codec:"+t.codec+",rate:"+o.samplerate+",nb channel:"+o.channelCount)}}function c(t){return 9216e4/t}function d(t,e,i,n,r){var s,l,u,c=t.length;if(s=a(t,e),l=o(t,e),(l-=s)>0&&e+s+l<=c)return u=i+n*r,{headerLength:s,frameLength:l,stamp:u}}function h(t,e,i,n,r){var a=c(t.samplerate),o=d(e,i,n,r,a);if(o){var s=o.stamp,l=o.headerLength,u=o.frameLength,h={unit:e.subarray(i+l,i+l+u),pts:s,dts:s};return t.samples.push(h),t.len+=u,{sample:h,length:u+l}}}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var S=i(1),L=i(2),R=i(4),k=i(0),w=i(3),C=function(){function t(e,i,n){f(this,t),this.observer=e,this.config=n,this.remuxer=i}return t.prototype.resetInitSegment=function(t,e,i,n){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:e,duration:n,inputTimeScale:9e4}},t.prototype.resetTimeStamp=function(){},t.probe=function(t){if(!t)return!1;for(var e=w.a.getID3Data(t,0)||[],i=e.length,n=t.length;i<n;i++)if(l(t,i))return k.b.log("ADTS sync word found !"),!0;return!1},t.prototype.append=function(t,e,i,n){for(var r=this._audioTrack,a=w.a.getID3Data(t,0)||[],o=w.a.getTimeStamp(a),l=o?90*o:9e4*e,c=0,d=l,f=t.length,p=a.length,g=[{pts:d,dts:d,data:a}];p<f-1;)if(s(t,p)&&p+5<f){u(r,this.observer,t,p,r.manifestCodec);var y=h(r,t,p,l,c);if(!y){k.b.log("Unable to parse AAC frame");break}p+=y.length,d=y.sample.pts,c++}else w.a.isHeader(t,p)?(a=w.a.getID3Data(t,p),g.push({pts:d,dts:d,data:a}),p+=a.length):p++;this.remuxer.remux(r,{samples:[]},{samples:g,inputTimeScale:9e4},{samples:[]},e,i,n)},t.prototype.destroy=function(){},t}(),I=C,D=Math.pow(2,32)-1,O=function(){function t(e,i){p(this,t),this.observer=e,this.remuxer=i}return t.prototype.resetTimeStamp=function(t){this.initPTS=t},t.prototype.resetInitSegment=function(e,i,n,r){if(e&&e.byteLength){var a=this.initData=t.parseInitSegment(e);null==i&&(i="mp4a.40.5"),null==n&&(n="avc1.42e01e");var o={};a.audio&&a.video?o.audiovideo={container:"video/mp4",codec:i+","+n,initSegment:r?e:null}:(a.audio&&(o.audio={container:"audio/mp4",codec:i,initSegment:r?e:null}),a.video&&(o.video={container:"video/mp4",codec:n,initSegment:r?e:null})),this.observer.trigger(S.a.FRAG_PARSING_INIT_SEGMENT,{tracks:o})}else i&&(this.audioCodec=i),n&&(this.videoCodec=n)},t.probe=function(e){return t.findBox({data:e,start:0,end:Math.min(e.length,16384)},["moof"]).length>0},t.bin2str=function(t){return String.fromCharCode.apply(null,t)},t.readUint32=function(t,e){t.data&&(e+=t.start,t=t.data);var i=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return i<0?4294967296+i:i},t.writeUint32=function(t,e,i){t.data&&(e+=t.start,t=t.data),t[e]=i>>24,t[e+1]=i>>16&255,t[e+2]=i>>8&255,t[e+3]=255&i},t.findBox=function(e,i){var n,r,a,o,s,l,u,c=[];if(e.data?(l=e.start,o=e.end,e=e.data):(l=0,o=e.byteLength),!i.length)return null;for(n=l;n<o;)r=t.readUint32(e,n),a=t.bin2str(e.subarray(n+4,n+8)),u=r>1?n+r:o,a===i[0]&&(1===i.length?c.push({data:e,start:n+8,end:u}):(s=t.findBox({data:e,start:n+8,end:u},i.slice(1)),s.length&&(c=c.concat(s)))),n=u;return c},t.parseInitSegment=function(e){var i=[];return t.findBox(e,["moov","trak"]).forEach(function(e){var n=t.findBox(e,["tkhd"])[0];if(n){var r=n.data[n.start],a=0===r?12:20,o=t.readUint32(n,a),s=t.findBox(e,["mdia","mdhd"])[0];if(s){r=s.data[s.start],a=0===r?12:20;var l=t.readUint32(s,a),u=t.findBox(e,["mdia","hdlr"])[0];if(u){var c=t.bin2str(u.data.subarray(u.start+8,u.start+12)),d={soun:"audio",vide:"video"}[c];if(d){var h=t.findBox(e,["mdia","minf","stbl","stsd"]);if(h.length){h=h[0];var f=t.bin2str(h.data.subarray(h.start+12,h.start+16));k.b.log("MP4Demuxer:"+d+":"+f+" found")}i[o]={timescale:l,type:d},i[d]={timescale:l,id:o}}}}}}),i},t.getStartDTS=function(e,i){var n,r,a;return n=t.findBox(i,["moof","traf"]),r=[].concat.apply([],n.map(function(i){return t.findBox(i,["tfhd"]).map(function(n){var r,a;return r=t.readUint32(n,4),a=e[r].timescale||9e4,t.findBox(i,["tfdt"]).map(function(e){var i,n;return i=e.data[e.start],n=t.readUint32(e,4),1===i&&(n*=Math.pow(2,32),n+=t.readUint32(e,8)),n})[0]/a})})),a=Math.min.apply(null,r),isFinite(a)?a:0},t.offsetStartDTS=function(e,i,n){t.findBox(i,["moof","traf"]).map(function(i){return t.findBox(i,["tfhd"]).map(function(r){var a=t.readUint32(r,4),o=e[a].timescale||9e4;t.findBox(i,["tfdt"]).map(function(e){var i=e.data[e.start],r=t.readUint32(e,4);if(0===i)t.writeUint32(e,4,r-n*o);else{r*=Math.pow(2,32),r+=t.readUint32(e,8),r-=n*o,r=Math.max(r,0);var a=Math.floor(r/(D+1)),s=Math.floor(r%(D+1));t.writeUint32(e,4,a),t.writeUint32(e,8,s)}})})})},t.prototype.append=function(e,i,n,r){var a=this.initData;a||(this.resetInitSegment(e,this.audioCodec,this.videoCodec),a=this.initData);var o=void 0,s=this.initPTS;if(void 0===s){var l=t.getStartDTS(a,e);this.initPTS=s=l-i,this.observer.trigger(S.a.INIT_PTS_FOUND,{initPTS:s})}t.offsetStartDTS(a,e,s),o=t.getStartDTS(a,e),this.remuxer.remux(a.audio,a.video,null,null,o,n,r,e)},t.prototype.destroy=function(){},t}(),P=O,x={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],SamplesCoefficients:[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BytesInSlot:[0,1,1,4],appendFrame:function(t,e,i,n,r){if(!(i+24>e.length)){var a=this.parseHeader(e,i);if(a&&i+a.frameLength<=e.length){var o=9e4*a.samplesPerFrame/a.sampleRate,s=n+r*o,l={unit:e.subarray(i,i+a.frameLength),pts:s,dts:s};return t.config=[],t.channelCount=a.channelCount,t.samplerate=a.sampleRate,t.samples.push(l),t.len+=a.frameLength,{sample:l,length:a.frameLength}}}},parseHeader:function(t,e){var i=t[e+1]>>3&3,n=t[e+1]>>1&3,r=t[e+2]>>4&15,a=t[e+2]>>2&3,o=t[e+2]>>1&1;if(1!==i&&0!==r&&15!==r&&3!==a){var s=3===i?3-n:3===n?3:4,l=1e3*x.BitratesMap[14*s+r-1],u=3===i?0:2===i?1:2,c=x.SamplingRateMap[3*u+a],d=t[e+3]>>6==3?1:2,h=x.SamplesCoefficients[i][n],f=x.BytesInSlot[n],p=8*h*f;return{sampleRate:c,channelCount:d,frameLength:parseInt(h*l/c+o,10)*f,samplesPerFrame:p}}},isHeaderPattern:function(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])},isHeader:function(t,e){return!!(e+1<t.length&&this.isHeaderPattern(t,e))},probe:function(t,e){if(e+1<t.length&&this.isHeaderPattern(t,e)){var i=this.parseHeader(t,e),n=4;i&&i.frameLength&&(n=i.frameLength);var r=e+n;if(r===t.length||r+1<t.length&&this.isHeaderPattern(t,r))return!0}return!1}},N=x,M=function(){function t(e){g(this,t),this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}return t.prototype.loadWord=function(){var t=this.data,e=this.bytesAvailable,i=t.byteLength-e,n=new Uint8Array(4),r=Math.min(4,e);if(0===r)throw new Error("no bytes available");n.set(t.subarray(i,i+r)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=8*r,this.bytesAvailable-=r},t.prototype.skipBits=function(t){var e;this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,e=t>>3,t-=e>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},t.prototype.readBits=function(t){var e=Math.min(this.bitsAvailable,t),i=this.word>>>32-e;return t>32&&k.b.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),e=t-e,e>0&&this.bitsAvailable?i<<e|this.readBits(e):i},t.prototype.skipLZ=function(){var t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},t.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},t.prototype.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},t.prototype.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},t.prototype.readBoolean=function(){return 1===this.readBits(1)},t.prototype.readUByte=function(){return this.readBits(8)},t.prototype.readUShort=function(){return this.readBits(16)},t.prototype.readUInt=function(){return this.readBits(32)},t.prototype.skipScalingList=function(t){var e,i,n=8,r=8;for(e=0;e<t;e++)0!==r&&(i=this.readEG(),r=(n+i+256)%256),n=0===r?n:r},t.prototype.readSPS=function(){var t,e,i,n,r,a,o,s=0,l=0,u=0,c=0,d=this.readUByte.bind(this),h=this.readBits.bind(this),f=this.readUEG.bind(this),p=this.readBoolean.bind(this),g=this.skipBits.bind(this),y=this.skipEG.bind(this),m=this.skipUEG.bind(this),v=this.skipScalingList.bind(this);if(d(),t=d(),h(5),g(3),d(),m(),100===t||110===t||122===t||244===t||44===t||83===t||86===t||118===t||128===t){var b=f();if(3===b&&g(1),m(),m(),g(1),p())for(a=3!==b?8:12,o=0;o<a;o++)p()&&v(o<6?16:64)}m();var _=f();if(0===_)f();else if(1===_)for(g(1),y(),y(),e=f(),o=0;o<e;o++)y();m(),g(1),i=f(),n=f(),r=h(1),0===r&&g(1),g(1),p()&&(s=f(),l=f(),u=f(),c=f());var E=[1,1];if(p()&&p()){switch(d()){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:E=[d()<<8|d(),d()<<8|d()]}}return{width:Math.ceil(16*(i+1)-2*s-2*l),height:(2-r)*(n+1)*16-(r?2:4)*(u+c),pixelRatio:E}},t.prototype.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},t}(),F=M,B=function(){function t(e,i,n,r){y(this,t),this.decryptdata=n,this.discardEPB=r,this.decrypter=new R.a(e,i)}return t.prototype.decryptBuffer=function(t,e){this.decrypter.decrypt(t,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,e)},t.prototype.decryptAacSample=function(t,e,i,n){var r=t[e].unit,a=r.subarray(16,r.length-r.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),s=this;this.decryptBuffer(o,function(a){a=new Uint8Array(a),r.set(a,16),n||s.decryptAacSamples(t,e+1,i)})},t.prototype.decryptAacSamples=function(t,e,i){for(;;e++){if(e>=t.length)return void i();if(!(t[e].unit.length<32)){var n=this.decrypter.isSync();if(this.decryptAacSample(t,e,i,n),!n)return}}},t.prototype.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,i=new Int8Array(e),n=0,r=32;r<=t.length-16;r+=160,n+=16)i.set(t.subarray(r,r+16),n);return i},t.prototype.getAvcDecryptedUnit=function(t,e){e=new Uint8Array(e);for(var i=0,n=32;n<=t.length-16;n+=160,i+=16)t.set(e.subarray(i,i+16),n);return t},t.prototype.decryptAvcSample=function(t,e,i,n,r,a){var o=this.discardEPB(r.data),s=this.getAvcEncryptedData(o),l=this;this.decryptBuffer(s.buffer,function(s){r.data=l.getAvcDecryptedUnit(o,s),a||l.decryptAvcSamples(t,e,i+1,n)})},t.prototype.decryptAvcSamples=function(t,e,i,n){for(;;e++,i=0){if(e>=t.length)return void n();for(var r=t[e].units;!(i>=r.length);i++){var a=r[i];if(!(a.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(t,e,i,n,a,o),!o)return}}}},t}(),U=B,G={video:0,audio:1,id3:2,text:3},K=function(){function t(e,i,n,r){m(this,t),this.observer=e,this.config=n,this.typeSupported=r,this.remuxer=i,this.sampleAes=null}return t.prototype.setDecryptData=function(t){null!=t&&null!=t.key&&"SAMPLE-AES"===t.method?this.sampleAes=new U(this.observer,this.config,t,this.discardEPB):this.sampleAes=null},t.probe=function(e){var i=t._syncOffset(e);return!(i<0)&&(i&&k.b.warn("MPEG2-TS detected but first sync word found @ offset "+i+", junk ahead ?"),!0)},t._syncOffset=function(t){for(var e=Math.min(1e3,t.length-564),i=0;i<e;){if(71===t[i]&&71===t[i+188]&&71===t[i+376])return i;i++}return-1},t.createTrack=function(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:G[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:"video"===t?0:void 0,isAAC:"audio"===t||void 0,duration:"audio"===t?e:void 0}},t.prototype.resetInitSegment=function(e,i,n,r){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=t.createTrack("video",r),this._audioTrack=t.createTrack("audio",r),this._id3Track=t.createTrack("id3",r),this._txtTrack=t.createTrack("text",r),this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=i,this.videoCodec=n,this._duration=r},t.prototype.resetTimeStamp=function(){},t.prototype.append=function(e,i,n,r){var a,o,s,l,u,c=e.length,d=!1;this.contiguous=n;var h=this.pmtParsed,f=this._avcTrack,p=this._audioTrack,g=this._id3Track,y=f.pid,m=p.pid,v=g.pid,b=this._pmtId,_=f.pesData,E=p.pesData,T=g.pesData,A=this._parsePAT,R=this._parsePMT,w=this._parsePES,C=this._parseAVCPES.bind(this),I=this._parseAACPES.bind(this),D=this._parseMPEGPES.bind(this),O=this._parseID3PES.bind(this),P=t._syncOffset(e);for(c-=(c+P)%188,a=P;a<c;a+=188)if(71===e[a]){if(o=!!(64&e[a+1]),s=((31&e[a+1])<<8)+e[a+2],(48&e[a+3])>>4>1){if((l=a+5+e[a+4])===a+188)continue}else l=a+4;switch(s){case y:o&&(_&&(u=w(_))&&C(u,!1),_={data:[],size:0}),_&&(_.data.push(e.subarray(l,a+188)),_.size+=a+188-l);break;case m:o&&(E&&(u=w(E))&&(p.isAAC?I(u):D(u)),E={data:[],size:0}),E&&(E.data.push(e.subarray(l,a+188)),E.size+=a+188-l);break;case v:o&&(T&&(u=w(T))&&O(u),T={data:[],size:0}),T&&(T.data.push(e.subarray(l,a+188)),T.size+=a+188-l);break;case 0:o&&(l+=e[l]+1),b=this._pmtId=A(e,l);break;case b:o&&(l+=e[l]+1);var x=R(e,l,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);y=x.avc,y>0&&(f.pid=y),m=x.audio,m>0&&(p.pid=m,p.isAAC=x.isAAC),v=x.id3,v>0&&(g.pid=v),d&&!h&&(k.b.log("reparse from beginning"),d=!1,a=P-188),h=this.pmtParsed=!0;break;case 17:case 8191:break;default:d=!0}}else this.observer.trigger(S.a.ERROR,{type:L.b.MEDIA_ERROR,details:L.a.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_&&(u=w(_))?(C(u,!0),f.pesData=null):f.pesData=_,E&&(u=w(E))?(p.isAAC?I(u):D(u),p.pesData=null):(E&&E.size&&k.b.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=E),T&&(u=w(T))?(O(u),g.pesData=null):g.pesData=T,null==this.sampleAes?this.remuxer.remux(p,f,g,this._txtTrack,i,n,r):this.decryptAndRemux(p,f,g,this._txtTrack,i,n,r)},t.prototype.decryptAndRemux=function(t,e,i,n,r,a,o){if(t.samples&&t.isAAC){var s=this;this.sampleAes.decryptAacSamples(t.samples,0,function(){s.decryptAndRemuxAvc(t,e,i,n,r,a,o)})}else this.decryptAndRemuxAvc(t,e,i,n,r,a,o)},t.prototype.decryptAndRemuxAvc=function(t,e,i,n,r,a,o){if(e.samples){var s=this;this.sampleAes.decryptAvcSamples(e.samples,0,0,function(){s.remuxer.remux(t,e,i,n,r,a,o)})}else this.remuxer.remux(t,e,i,n,r,a,o)},t.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},t.prototype._parsePAT=function(t,e){return(31&t[e+10])<<8|t[e+11]},t.prototype._parsePMT=function(t,e,i,n){var r,a,o,s,l={audio:-1,avc:-1,id3:-1,isAAC:!0};for(r=(15&t[e+1])<<8|t[e+2],a=e+3+r-4,o=(15&t[e+10])<<8|t[e+11],e+=12+o;e<a;){switch(s=(31&t[e+1])<<8|t[e+2],t[e]){case 207:if(!n){k.b.log("unkown stream type:"+t[e]);break}case 15:-1===l.audio&&(l.audio=s);break;case 21:-1===l.id3&&(l.id3=s);break;case 219:if(!n){k.b.log("unkown stream type:"+t[e]);break}case 27:-1===l.avc&&(l.avc=s);break;case 3:case 4:i?-1===l.audio&&(l.audio=s,l.isAAC=!1):k.b.log("MPEG audio found, not supported in this browser for now");break;case 36:k.b.warn("HEVC stream type found, not supported for now");break;default:k.b.log("unkown stream type:"+t[e])}e+=5+((15&t[e+3])<<8|t[e+4])}return l},t.prototype._parsePES=function(t){var e,i,n,r,a,o,s,l,u=0,c=t.data;if(!t||0===t.size)return null;for(;c[0].length<19&&c.length>1;){var d=new Uint8Array(c[0].length+c[1].length);d.set(c[0]),d.set(c[1],c[0].length),c[0]=d,c.splice(1,1)}if(e=c[0],1===(e[0]<<16)+(e[1]<<8)+e[2]){if((n=(e[4]<<8)+e[5])&&n>t.size-6)return null;i=e[7],192&i&&(o=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,o>4294967295&&(o-=8589934592),64&i?(s=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2,s>4294967295&&(s-=8589934592),o-s>54e5&&(k.b.warn(Math.round((o-s)/9e4)+"s delta between PTS and DTS, align them"),o=s)):s=o),r=e[8],l=r+9,t.size-=l,a=new Uint8Array(t.size);for(var h=0,f=c.length;h<f;h++){e=c[h];var p=e.byteLength;if(l){if(l>p){l-=p;continue}e=e.subarray(l),p-=l,l=0}a.set(e,u),u+=p}return n&&(n-=r+3),{data:a,pts:o,dts:s,len:n}}return null},t.prototype.pushAccesUnit=function(t,e){if(t.units.length&&t.frame){var i=e.samples,n=i.length;!this.config.forceKeyFrameOnDiscontinuity||!0===t.key||e.sps&&(n||this.contiguous)?(t.id=n,i.push(t)):e.dropped++}t.debug.length&&k.b.log(t.pts+"/"+t.dts+":"+t.debug)},t.prototype._parseAVCPES=function(t,e){var i,n,r,a=this,o=this._avcTrack,s=this._parseAVCNALu(t.data),l=this.avcSample,u=!1,c=this.pushAccesUnit.bind(this),d=function(t,e,i,n){return{key:t,pts:e,dts:i,units:[],debug:n}};t.data=null,l&&s.length&&!o.audFound&&(c(l,o),l=this.avcSample=d(!1,t.pts,t.dts,"")),s.forEach(function(e){switch(e.type){case 1:n=!0,l||(l=a.avcSample=d(!0,t.pts,t.dts,"")),l.frame=!0;var s=e.data;if(u&&s.length>4){var h=new F(s).readSliceType();2!==h&&4!==h&&7!==h&&9!==h||(l.key=!0)}break;case 5:n=!0,l||(l=a.avcSample=d(!0,t.pts,t.dts,"")),l.key=!0,l.frame=!0;break;case 6:n=!0,i=new F(a.discardEPB(e.data)),i.readUByte();for(var f=0,p=0,g=!1,y=0;!g&&i.bytesAvailable>1;){f=0;do{y=i.readUByte(),f+=y}while(255===y);p=0;do{y=i.readUByte(),p+=y}while(255===y);if(4===f&&0!==i.bytesAvailable){g=!0;if(181===i.readUByte()){if(49===i.readUShort()){if(1195456820===i.readUInt()){if(3===i.readUByte()){var m=i.readUByte(),v=i.readUByte(),b=31&m,_=[m,v];for(r=0;r<b;r++)_.push(i.readUByte()),_.push(i.readUByte()),_.push(i.readUByte());a._insertSampleInOrder(a._txtTrack.samples,{type:3,pts:t.pts,bytes:_})}}}}}else if(p<i.bytesAvailable)for(r=0;r<p;r++)i.readUByte()}break;case 7:if(n=!0,u=!0,!o.sps){i=new F(e.data);var E=i.readSPS();o.width=E.width,o.height=E.height,o.pixelRatio=E.pixelRatio,o.sps=[e.data],o.duration=a._duration;var T=e.data.subarray(1,4),A="avc1.";for(r=0;r<3;r++){var S=T[r].toString(16);S.length<2&&(S="0"+S),A+=S}o.codec=A}break;case 8:n=!0,o.pps||(o.pps=[e.data]);break;case 9:n=!1,o.audFound=!0,l&&c(l,o),l=a.avcSample=d(!1,t.pts,t.dts,"");break;case 12:n=!1;break;default:n=!1,l&&(l.debug+="unknown NAL "+e.type+" ")}if(l&&n){l.units.push(e)}}),e&&l&&(c(l,o),this.avcSample=null)},t.prototype._insertSampleInOrder=function(t,e){var i=t.length;if(i>0){if(e.pts>=t[i-1].pts)t.push(e);else for(var n=i-1;n>=0;n--)if(e.pts<t[n].pts){t.splice(n,0,e);break}}else t.push(e)},t.prototype._getLastNalUnit=function(){var t=this.avcSample,e=void 0;if(!t||0===t.units.length){var i=this._avcTrack,n=i.samples;t=n[n.length-1]}if(t){var r=t.units;e=r[r.length-1]}return e},t.prototype._parseAVCNALu=function(t){var e,i,n,r,a,o=0,s=t.byteLength,l=this._avcTrack,u=l.naluState||0,c=u,d=[],h=-1;for(-1===u&&(h=0,a=31&t[0],u=0,o=1);o<s;)if(e=t[o++],u)if(1!==u)if(e)if(1===e){if(h>=0)n={data:t.subarray(h,o-u-1),type:a},d.push(n);else{var f=this._getLastNalUnit();if(f&&(c&&o<=4-c&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-c)),(i=o-u-1)>0)){var p=new Uint8Array(f.data.byteLength+i);p.set(f.data,0),p.set(t.subarray(0,i),f.data.byteLength),f.data=p}}o<s?(r=31&t[o],h=o,a=r,u=0):u=-1}else u=0;else u=3;else u=e?0:2;else u=e?0:1;if(h>=0&&u>=0&&(n={data:t.subarray(h,s),type:a,state:u},d.push(n)),0===d.length){var g=this._getLastNalUnit();if(g){var y=new Uint8Array(g.data.byteLength+t.byteLength);y.set(g.data,0),y.set(t,g.data.byteLength),g.data=y}}return l.naluState=u,d},t.prototype.discardEPB=function(t){for(var e,i,n=t.byteLength,r=[],a=1;a<n-2;)0===t[a]&&0===t[a+1]&&3===t[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return t;e=n-r.length,i=new Uint8Array(e);var o=0;for(a=0;a<e;o++,a++)o===r[0]&&(o++,r.shift()),i[a]=t[o];return i},t.prototype._parseAACPES=function(t){var e,i,n,r,a,o=this._audioTrack,l=t.data,d=t.pts,f=this.aacOverFlow,p=this.aacLastPTS;if(f){var g=new Uint8Array(f.byteLength+l.byteLength);g.set(f,0),g.set(l,f.byteLength),l=g}for(n=0,a=l.length;n<a-1&&!s(l,n);n++);if(n){var y,m;if(n<a-1?(y="AAC PES did not start with ADTS header,offset:"+n,m=!1):(y="no ADTS header found in AAC PES",m=!0),k.b.warn("parsing error:"+y),this.observer.trigger(S.a.ERROR,{type:L.b.MEDIA_ERROR,details:L.a.FRAG_PARSING_ERROR,fatal:m,reason:y}),m)return}if(u(o,this.observer,l,n,this.audioCodec),i=0,e=c(o.samplerate),f&&p){var v=p+e;Math.abs(v-d)>1&&(k.b.log("AAC: align PTS for overlapping frames by "+Math.round((v-d)/90)),d=v)}for(;n<a;)if(s(l,n)&&n+5<a){var b=h(o,l,n,d,i);if(!b)break;n+=b.length,r=b.sample.pts,i++}else n++;f=n<a?l.subarray(n,a):null,this.aacOverFlow=f,this.aacLastPTS=r},t.prototype._parseMPEGPES=function(t){for(var e=t.data,i=e.length,n=0,r=0,a=t.pts;r<i;)if(N.isHeader(e,r)){var o=N.appendFrame(this._audioTrack,e,r,a,n);if(!o)break;r+=o.length,n++}else r++},t.prototype._parseID3PES=function(t){this._id3Track.samples.push(t)},t}(),V=K,j=function(){function t(e,i,n){v(this,t),this.observer=e,this.config=n,this.remuxer=i}return t.prototype.resetInitSegment=function(t,e,i,n){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:e,duration:n,inputTimeScale:9e4}},t.prototype.resetTimeStamp=function(){},t.probe=function(t){var e,i,n=w.a.getID3Data(t,0);if(n&&void 0!==w.a.getTimeStamp(n))for(e=n.length,i=Math.min(t.length-1,e+100);e<i;e++)if(N.probe(t,e))return k.b.log("MPEG Audio sync word found !"),!0;return!1},t.prototype.append=function(t,e,i,n){for(var r=w.a.getID3Data(t,0),a=w.a.getTimeStamp(r),o=a?90*a:9e4*e,s=r.length,l=t.length,u=0,c=0,d=this._audioTrack,h=[{pts:o,dts:o,data:r}];s<l;)if(N.isHeader(t,s)){var f=N.appendFrame(d,t,s,o,u);if(!f)break;s+=f.length,c=f.sample.pts,u++}else w.a.isHeader(t,s)?(r=w.a.getID3Data(t,s),h.push({pts:c,dts:c,data:r}),s+=r.length):s++;this.remuxer.remux(d,{samples:[]},{samples:h,inputTimeScale:9e4},{samples:[]},e,i,n)},t.prototype.destroy=function(){},t}(),Y=j,H=function(){function t(){b(this,t)}return t.getSilentFrame=function(t,e){switch(t){case"mp4a.40.2":if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},t}(),$=H,z=Math.pow(2,32)-1,W=function(){function t(){_(this,t)}return t.init=function(){t.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var e;for(e in t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var i=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);t.HDLR_TYPES={video:i,audio:n};var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=a,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,o,l,o,s),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,r))},t.box=function(t){for(var e,i=Array.prototype.slice.call(arguments,1),n=8,r=i.length,a=r;r--;)n+=i[r].byteLength;for(e=new Uint8Array(n),e[0]=n>>24&255,e[1]=n>>16&255,e[2]=n>>8&255,e[3]=255&n,e.set(t,4),r=0,n=8;r<a;r++)e.set(i[r],n),n+=i[r].byteLength;return e},t.hdlr=function(e){return t.box(t.types.hdlr,t.HDLR_TYPES[e])},t.mdat=function(e){return t.box(t.types.mdat,e)},t.mdhd=function(e,i){i*=e;var n=Math.floor(i/(z+1)),r=Math.floor(i%(z+1));return t.box(t.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,r>>24,r>>16&255,r>>8&255,255&r,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,i,n){return t.box(t.types.moof,t.mfhd(e),t.traf(n,i))},t.moov=function(e){for(var i=e.length,n=[];i--;)n[i]=t.trak(e[i]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(t.mvex(e)))},t.mvex=function(e){for(var i=e.length,n=[];i--;)n[i]=t.trex(e[i]);return t.box.apply(null,[t.types.mvex].concat(n))},t.mvhd=function(e,i){i*=e;var n=Math.floor(i/(z+1)),r=Math.floor(i%(z+1)),a=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,r>>24,r>>16&255,r>>8&255,255&r,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 t.box(t.types.mvhd,a)},t.sdtp=function(e){var i,n,r=e.samples||[],a=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)i=r[n].flags,a[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return t.box(t.types.sdtp,a)},t.stbl=function(e){return t.box(t.types.stbl,t.stsd(e),t.box(t.types.stts,t.STTS),t.box(t.types.stsc,t.STSC),t.box(t.types.stsz,t.STSZ),t.box(t.types.stco,t.STCO))},t.avc1=function(e){var i,n,r,a=[],o=[];for(i=0;i<e.sps.length;i++)n=e.sps[i],r=n.byteLength,a.push(r>>>8&255),a.push(255&r),a=a.concat(Array.prototype.slice.call(n));for(i=0;i<e.pps.length;i++)n=e.pps[i],r=n.byteLength,o.push(r>>>8&255),o.push(255&r),o=o.concat(Array.prototype.slice.call(n));var s=t.box(t.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|e.sps.length].concat(a).concat([e.pps.length]).concat(o))),l=e.width,u=e.height,c=e.pixelRatio[0],d=e.pixelRatio[1];return t.box(t.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,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,d>>24,d>>16&255,d>>8&255,255&d])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var i=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,i>>8&255,255&i,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var i=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,i>>8&255,255&i,0,0]))},t.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var i=e.id,n=e.duration*e.timescale,r=e.width,a=e.height,o=Math.floor(n/(z+1)),s=Math.floor(n%(z+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,255&i,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,r>>8&255,255&r,0,0,a>>8&255,255&a,0,0]))},t.traf=function(e,i){var n=t.sdtp(e),r=e.id,a=Math.floor(i/(z+1)),o=Math.floor(i%(z+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,o>>24,o>>16&255,o>>8&255,255&o])),t.trun(e,n.length+16+20+8+16+8+8),n)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var i=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,i){var n,r,a,o,s,l,u=e.samples||[],c=u.length,d=12+16*c,h=new Uint8Array(d);for(i+=8+d,h.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0),n=0;n<c;n++)r=u[n],a=r.duration,o=r.size,s=r.flags,l=r.cts,h.set([a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*n);return t.box(t.types.trun,h)},t.initSegment=function(e){t.types||t.init();var i,n=t.moov(e);return i=new Uint8Array(t.FTYP.byteLength+n.byteLength),i.set(t.FTYP),i.set(n,t.FTYP.byteLength),i},t}(),q=W,X=function(){function t(e,i,n,r){E(this,t),this.observer=e,this.config=i,this.typeSupported=n;var a=navigator.userAgent;this.isSafari=r&&r.indexOf("Apple")>-1&&a&&!a.match("CriOS"),this.ISGenerated=!1}return t.prototype.destroy=function(){},t.prototype.resetTimeStamp=function(t){this._initPTS=this._initDTS=t},t.prototype.resetInitSegment=function(){this.ISGenerated=!1},t.prototype.remux=function(t,e,i,n,r,a,o){if(this.ISGenerated||this.generateIS(t,e,r),this.ISGenerated){var s=t.samples.length,l=e.samples.length,u=r,c=r;if(s&&l){var d=(t.samples[0].dts-e.samples[0].dts)/e.inputTimeScale;u+=Math.max(0,d),c+=Math.max(0,-d)}if(s){t.timescale||(k.b.warn("regenerate InitSegment as audio detected"),this.generateIS(t,e,r));var h=this.remuxAudio(t,u,a,o);if(l){var f=void 0;h&&(f=h.endPTS-h.startPTS),e.timescale||(k.b.warn("regenerate InitSegment as video detected"),this.generateIS(t,e,r)),this.remuxVideo(e,c,a,f,o)}}else{var p=void 0;l&&(p=this.remuxVideo(e,c,a,o)),p&&t.codec&&this.remuxEmptyAudio(t,u,a,p)}}i.samples.length&&this.remuxID3(i,r),n.samples.length&&this.remuxText(n,r),this.observer.trigger(S.a.FRAG_PARSED)},t.prototype.generateIS=function(t,e,i){var n,r,a=this.observer,o=t.samples,s=e.samples,l=this.typeSupported,u="audio/mp4",c={},d={tracks:c},h=void 0===this._initPTS;if(h&&(n=r=1/0),t.config&&o.length&&(t.timescale=t.samplerate,k.b.log("audio sampling rate : "+t.samplerate),t.isAAC||(l.mpeg?(u="audio/mpeg",t.codec=""):l.mp3&&(t.codec="mp3")),c.audio={container:u,codec:t.codec,initSegment:!t.isAAC&&l.mpeg?new Uint8Array:q.initSegment([t]),metadata:{channelCount:t.channelCount}},h&&(n=r=o[0].pts-t.inputTimeScale*i)),e.sps&&e.pps&&s.length){var f=e.inputTimeScale;e.timescale=f,c.video={container:"video/mp4",codec:e.codec,initSegment:q.initSegment([e]),metadata:{width:e.width,height:e.height}},h&&(n=Math.min(n,s[0].pts-f*i),r=Math.min(r,s[0].dts-f*i),this.observer.trigger(S.a.INIT_PTS_FOUND,{initPTS:n}))}Object.keys(c).length?(a.trigger(S.a.FRAG_PARSING_INIT_SEGMENT,d),this.ISGenerated=!0,h&&(this._initPTS=n,this._initDTS=r)):a.trigger(S.a.ERROR,{type:L.b.MEDIA_ERROR,details:L.a.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},t.prototype.remuxVideo=function(t,e,i,n,r){var a,o,s,l,u,c,d,h=8,f=t.timescale,p=t.samples,g=[],y=p.length,m=this._PTSNormalize,v=this._initDTS,b=this.nextAvcDts,_=this.isSafari;_&&(i|=p.length&&b&&(r&&Math.abs(e-b/f)<.1||Math.abs(p[0].pts-b-v)<f/5)),i||(b=e*f),p.forEach(function(t){t.pts=m(t.pts-v,b),t.dts=m(t.dts-v,b)}),p.sort(function(t,e){var i=t.dts-e.dts,n=t.pts-e.pts;return i||(n||t.id-e.id)});var E=p.reduce(function(t,e){return Math.max(Math.min(t,e.pts-e.dts),-18e3)},0);if(E<0){k.b.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(E/90)+" ms to overcome this issue");for(var T=0;T<p.length;T++)p[T].dts+=E}var A=p[0];u=Math.max(A.dts,0),l=Math.max(A.pts,0);var R=Math.round((u-b)/90);i&&R&&(R>1?k.b.log("AVC:"+R+" ms hole between fragments detected,filling it"):R<-1&&k.b.log("AVC:"+-R+" ms overlapping between fragments detected"),u=b,p[0].dts=u,l=Math.max(l-R,b),p[0].pts=l,k.b.log("Video/PTS/DTS adjusted: "+Math.round(l/90)+"/"+Math.round(u/90)+",delta:"+R+" ms")),A=p[p.length-1],d=Math.max(A.dts,0),c=Math.max(A.pts,0,d),_&&(a=Math.round((d-u)/(p.length-1)));for(var w=0,C=0,I=0;I<y;I++){for(var D=p[I],O=D.units,P=O.length,x=0,N=0;N<P;N++)x+=O[N].data.length;C+=x,w+=P,D.length=x,D.dts=_?u+I*a:Math.max(D.dts,u),D.pts=Math.max(D.pts,D.dts)}var M=C+4*w+8;try{o=new Uint8Array(M)}catch(t){return void this.observer.trigger(S.a.ERROR,{type:L.b.MUX_ERROR,details:L.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:M,reason:"fail allocating video mdat "+M})}var F=new DataView(o.buffer);F.setUint32(0,M),o.set(q.types.mdat,4);for(var B=0;B<y;B++){for(var U=p[B],G=U.units,K=0,V=void 0,j=0,Y=G.length;j<Y;j++){var H=G[j],$=H.data,z=H.data.byteLength;F.setUint32(h,z),h+=4,o.set($,h),h+=z,K+=4+z}if(_)V=Math.max(0,a*Math.round((U.pts-U.dts)/a));else{if(B<y-1)a=p[B+1].dts-U.dts;else{var W=this.config,X=U.dts-p[B>0?B-1:B].dts;if(W.stretchShortVideoTrack){var Z=W.maxBufferHole,J=W.maxSeekHole,Q=Math.floor(Math.min(Z,J)*f),tt=(n?l+n*f:this.nextAudioPts)-U.pts;tt>Q?(a=tt-X,a<0&&(a=X),k.b.log("It is approximately "+tt/90+" ms to the next segment; using duration "+a/90+" ms for the last video frame.")):a=X}else a=X}V=Math.round(U.pts-U.dts)}g.push({size:K,duration:a,cts:V,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:U.key?2:1,isNonSync:U.key?0:1}})}this.nextAvcDts=d+a;var et=t.dropped;if(t.len=0,t.nbNalu=0,t.dropped=0,g.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var it=g[0].flags;it.dependsOn=2,it.isNonSync=0}t.samples=g,s=q.moof(t.sequenceNumber++,u,t),t.samples=[];var nt={data1:s,data2:o,startPTS:l/f,endPTS:(c+a)/f,startDTS:u/f,endDTS:this.nextAvcDts/f,type:"video",nb:g.length,dropped:et};return this.observer.trigger(S.a.FRAG_PARSING_DATA,nt),nt},t.prototype.remuxAudio=function(t,e,i,n){var r,a,o,s,l,u,c,d=t.inputTimeScale,h=t.timescale,f=d/h,p=t.isAAC?1024:1152,g=p*f,y=this._PTSNormalize,m=this._initDTS,v=!t.isAAC&&this.typeSupported.mpeg,b=t.samples,_=[],E=this.nextAudioPts;if(i|=b.length&&E&&(n&&Math.abs(e-E/d)<.1||Math.abs(b[0].pts-E-m)<20*g),b.forEach(function(t){t.pts=t.dts=y(t.pts-m,e*d)}),b=b.filter(function(t){return t.pts>=0}),0!==b.length){if(i||(E=n?e*d:b[0].pts),t.isAAC)for(var T=this.config.maxAudioFramesDrift,A=0,R=E;A<b.length;){var w,C=b[A],I=C.pts;w=I-R;var D=Math.abs(1e3*w/d);if(w<=-T*g)k.b.warn("Dropping 1 audio frame @ "+(R/d).toFixed(3)+"s due to "+Math.round(D)+" ms overlap."),b.splice(A,1),t.len-=C.unit.length;else if(w>=T*g&&D<1e4&&R){var O=Math.round(w/g);k.b.warn("Injecting "+O+" audio frame @ "+(R/d).toFixed(3)+"s due to "+Math.round(1e3*w/d)+" ms gap.");for(var P=0;P<O;P++){var x=Math.max(R,0);o=$.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),o||(k.b.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),o=C.unit.subarray()),b.splice(A,0,{unit:o,pts:x,dts:x}),t.len+=o.length,R+=g,A++}C.pts=C.dts=R,R+=g,A++}else Math.abs(w),C.pts=C.dts=R,R+=g,A++}for(var N=0,M=b.length;N<M;N++){var F=b[N],B=F.unit,U=F.pts;if(void 0!==c)a.duration=Math.round((U-c)/f);else{var G=Math.round(1e3*(U-E)/d),K=0;if(i&&t.isAAC&&G){if(G>0&&G<1e4)K=Math.round((U-E)/g),k.b.log(G+" ms hole between AAC samples detected,filling it"),K>0&&(o=$.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),o||(o=B.subarray()),t.len+=K*o.length);else if(G<-12){k.b.log("drop overlapping AAC sample, expected/parsed/delta:"+(E/d).toFixed(3)+"s/"+(U/d).toFixed(3)+"s/"+-G+"ms"),t.len-=B.byteLength;continue}U=E}if(u=U,!(t.len>0))return;var V=v?t.len:t.len+8;r=v?0:8;try{s=new Uint8Array(V)}catch(t){return void this.observer.trigger(S.a.ERROR,{type:L.b.MUX_ERROR,details:L.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:V,reason:"fail allocating audio mdat "+V})}if(!v){new DataView(s.buffer).setUint32(0,V),s.set(q.types.mdat,4)}for(var j=0;j<K;j++)o=$.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),o||(k.b.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),o=B.subarray()),s.set(o,r),r+=o.byteLength,a={size:o.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},_.push(a)}s.set(B,r);var Y=B.byteLength;r+=Y,a={size:Y,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},_.push(a),c=U}var H=0,z=_.length;if(z>=2&&(H=_[z-2].duration,a.duration=H),z){this.nextAudioPts=E=c+f*H,t.len=0,t.samples=_,l=v?new Uint8Array:q.moof(t.sequenceNumber++,u/f,t),t.samples=[];var W=u/d,X=E/d,Z={data1:l,data2:s,startPTS:W,endPTS:X,startDTS:W,endDTS:X,type:"audio",nb:z};return this.observer.trigger(S.a.FRAG_PARSING_DATA,Z),Z}return null}},t.prototype.remuxEmptyAudio=function(t,e,i,n){var r=t.inputTimeScale,a=t.samplerate?t.samplerate:r,o=r/a,s=this.nextAudioPts,l=(void 0!==s?s:n.startDTS*r)+this._initDTS,u=n.endDTS*r+this._initDTS,c=1024*o,d=Math.ceil((u-l)/c),h=$.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(k.b.warn("remux empty Audio"),!h)return void k.b.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var f=[],p=0;p<d;p++){var g=l+p*c;f.push({unit:h,pts:g,dts:g}),t.len+=h.length}t.samples=f,this.remuxAudio(t,e,i)},t.prototype.remuxID3=function(t,e){var i,n=t.samples.length,r=t.inputTimeScale,a=this._initPTS,o=this._initDTS;if(n){for(var s=0;s<n;s++)i=t.samples[s],i.pts=(i.pts-a)/r,i.dts=(i.dts-o)/r;this.observer.trigger(S.a.FRAG_PARSING_METADATA,{samples:t.samples})}t.samples=[],e=e},t.prototype.remuxText=function(t,e){t.samples.sort(function(t,e){return t.pts-e.pts});var i,n=t.samples.length,r=t.inputTimeScale,a=this._initPTS;if(n){for(var o=0;o<n;o++)i=t.samples[o],i.pts=(i.pts-a)/r;this.observer.trigger(S.a.FRAG_PARSING_USERDATA,{samples:t.samples})}t.samples=[],e=e},t.prototype._PTSNormalize=function(t,e){var i;if(void 0===e)return t;for(i=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=i;return t},t}(),Z=X,J=function(){function t(e){T(this,t),this.observer=e}return t.prototype.destroy=function(){},t.prototype.resetTimeStamp=function(){},t.prototype.resetInitSegment=function(){},t.prototype.remux=function(t,e,i,n,r,a,o,s){var l=this.observer,u="";t&&(u+="audio"),e&&(u+="video"),l.trigger(S.a.FRAG_PARSING_DATA,{data1:s,startPTS:r,startDTS:r,type:u,nb:1,dropped:0}),l.trigger(S.a.FRAG_PARSED)},t}(),Q=J,tt=function(){function t(e,i,n,r){A(this,t),this.observer=e,this.typeSupported=i,this.config=n,this.vendor=r}return t.prototype.destroy=function(){var t=this.demuxer;t&&t.destroy()},t.prototype.push=function(t,e,i,n,r,a,o,s,l,u,c,d){if(t.byteLength>0&&null!=e&&null!=e.key&&"AES-128"===e.method){var h=this.decrypter;null==h&&(h=this.decrypter=new R.a(this.observer,this.config));var f,p=this;try{f=performance.now()}catch(t){f=Date.now()}h.decrypt(t,e.key.buffer,e.iv.buffer,function(t){var h;try{h=performance.now()}catch(t){h=Date.now()}p.observer.trigger(S.a.FRAG_DECRYPTED,{stats:{tstart:f,tdecrypt:h}}),p.pushDecrypted(new Uint8Array(t),e,new Uint8Array(i),n,r,a,o,s,l,u,c,d)})}else this.pushDecrypted(new Uint8Array(t),e,new Uint8Array(i),n,r,a,o,s,l,u,c,d)},t.prototype.pushDecrypted=function(t,e,i,n,r,a,o,s,l,u,c,d){var h=this.demuxer;if(!h||o&&!this.probe(t)){for(var f=this.observer,p=this.typeSupported,g=this.config,y=[{demux:V,remux:Z},{demux:P,remux:Q},{demux:I,remux:Z},{demux:Y,remux:Z}],m=0,v=y.length;m<v;m++){var b=y[m],_=b.demux.probe;if(_(t)){var E=this.remuxer=new b.remux(f,g,p,this.vendor);h=new b.demux(f,E,g,p),this.probe=_;break}}if(!h)return void f.trigger(S.a.ERROR,{type:L.b.MEDIA_ERROR,details:L.a.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=h}var T=this.remuxer;(o||s)&&(h.resetInitSegment(i,n,r,u),T.resetInitSegment()),o&&(h.resetTimeStamp(d),T.resetTimeStamp(d)),"function"==typeof h.setDecryptData&&h.setDecryptData(e),h.append(t,a,l,c)},t}();e.a=tt},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){var i=Kt[e];return!!i&&!0===i[t.slice(0,4)]}function o(t,e){return MediaSource.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"')}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!t)return null;for(var i=null,n=0;n<t.length;n++){var r=t[n];r.id===e&&(i=r)}return i}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function m(){if("undefined"!=typeof window)return window.MediaSource||window.WebKitMediaSource}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e,i){var n=t[e],r=t[i],a=r.startPTS;isNaN(a)?r.start=i>e?n.start+n.duration:Math.max(n.start-r.duration,0):i>e?(n.duration=a-n.start,n.duration<0&&Pt.b.warn("negative duration computed for frag "+n.sn+",level "+n.level+", there should be some duration drift between playlist and fragment!")):(r.duration=n.start-a,r.duration<0&&Pt.b.warn("negative duration computed for frag "+r.sn+",level "+r.level+", there should be some duration drift between playlist and fragment!"))}function _(t,e,i,n,r,a){var o=i;if(!isNaN(e.startPTS)){var s=Math.abs(e.startPTS-i);isNaN(e.deltaPTS)?e.deltaPTS=s:e.deltaPTS=Math.max(s,e.deltaPTS),o=Math.max(i,e.startPTS),i=Math.min(i,e.startPTS),n=Math.max(n,e.endPTS),r=Math.min(r,e.startDTS),a=Math.max(a,e.endDTS)}var l=i-e.start;e.start=e.startPTS=i,e.maxStartPTS=o,e.endPTS=n,e.startDTS=r,e.endDTS=a,e.duration=n-i;var u=e.sn;if(!t||u<t.startSN||u>t.endSN)return 0;var c,d,h;for(c=u-t.startSN,d=t.fragments,d[c]=e,h=c;h>0;h--)b(d,h,h-1);for(h=c;h<d.length-1;h++)b(d,h,h+1);return t.PTSKnown=!0,l}function E(t,e){var i,n=Math.max(t.startSN,e.startSN)-e.startSN,r=Math.min(t.endSN,e.endSN)-e.startSN,a=e.startSN-t.startSN,o=t.fragments,s=e.fragments,l=0;if(r<n)return void(e.PTSKnown=!1);for(var u=n;u<=r;u++){var c=o[a+u],d=s[u];d&&c&&(l=c.cc-d.cc,isNaN(c.startPTS)||(d.start=d.startPTS=c.startPTS,d.endPTS=c.endPTS,d.duration=c.duration,d.backtracked=c.backtracked,d.dropped=c.dropped,i=d))}if(l)for(Pt.b.log("discontinuity sliding from playlist, take drift into account"),u=0;u<s.length;u++)s[u].cc+=l;if(i)_(e,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS);else if(a>=0&&a<o.length){var h=o[a].start;for(u=0;u<s.length;u++)s[u].start+=h}e.PTSKnown=t.PTSKnown}function T(t,e){for(var i=null,n=0;n<t.length;n+=1){var r=t[n];if(r&&r.cc===e){i=r;break}}return i}function A(t,e){return ie.search(t,function(t){return t.cc<e?1:t.cc>e?-1:0})}function S(t,e,i){var n=!1;return e&&e.details&&i&&(i.endCC>i.startCC||t&&t.cc<i.startCC)&&(n=!0),n}function L(t,e){var i=t.fragments,n=e.fragments;if(!n.length||!i.length)return void Pt.b.log("No fragments to align");var r=T(i,n[0].cc);return!r||r&&!r.startPTS?void Pt.b.log("No frag in previous level to align on"):r}function R(t,e){e.fragments.forEach(function(e){if(e){var i=e.start+t;e.start=e.startPTS=i,e.endPTS=i+e.duration}}),e.PTSKnown=!0}function k(t,e,i){if(S(t,e,i)){var n=L(e.details,i);n&&(Pt.b.log("Adjusting PTS using last level due to CC increase within current level"),R(n.start,i))}if(!1===i.PTSKnown&&e&&e.details){var r=e.details.programDateTime,a=i.programDateTime,o=(a-r)/1e3+e.details.fragments[0].start;isNaN(o)||(Pt.b.log("adjusting PTS using programDateTime delta, sliding:"+o.toFixed(3)),R(o,i))}}function w(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function I(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function D(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function P(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function x(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function N(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function M(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function F(){var t=m(),e=window.SourceBuffer||window.WebKitSourceBuffer,i=t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove;return!!i&&!!n}function B(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function G(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function K(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function V(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Y(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function H(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function $(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function W(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function X(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function Z(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function J(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function et(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function it(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function rt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function at(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new Xe,this.regionList=[]}function ot(t){function e(t,e,i,n){return 3600*(0|t)+60*(0|e)+(0|i)+(0|n)/1e3}var i=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?e(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?e(i[1],i[2],0,i[4]):e(0,i[1],i[2],i[4]):null}function st(){this.values=Object.create(null)}function lt(t,e,i,n){var r=n?t.split(n):[t];for(var a in r)if("string"==typeof r[a]){var o=r[a].split(i);if(2===o.length){var s=o[0],l=o[1];e(s,l)}}}function ut(t,e,i){function n(){var e=ot(t);if(null===e)throw new Error("Malformed timestamp: "+a);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function r(){t=t.replace(/^\s+/,"")}var a=t;if(r(),e.startTime=n(),r(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+a);t=t.substr(3),r(),e.endTime=n(),r(),function(t,e){var n=new st;lt(t,function(t,e){switch(t){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===e){n.set(t,i[r].region);break}break;case"vertical":n.alt(t,e,["rl","lr"]);break;case"line":var a=e.split(","),o=a[0];n.integer(t,o),n.percent(t,o)&&n.set("snapToLines",!1),n.alt(t,o,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start",Je,"end"]);break;case"position":a=e.split(","),n.percent(t,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start",Je,"end","line-left","line-right","auto"]);break;case"size":n.percent(t,e);break;case"align":n.alt(t,e,["start",Je,"end","left","right"])}},/:/,/\s/),e.region=n.get("region",null),e.vertical=n.get("vertical","");var r=n.get("line","auto");"auto"===r&&-1===Ze.line&&(r=-1),e.line=r,e.lineAlign=n.get("lineAlign","start"),e.snapToLines=n.get("snapToLines",!0),e.size=n.get("size",100),e.align=n.get("align",Je);var a=n.get("position","auto");"auto"===a&&50===Ze.position&&(a="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=a}(t,e)}function ct(t){return t.replace(/<br(?: \/)?>/gi,"\n")}function dt(t,e,i,n){for(var r,a,o,s,l,u=window.VTTCue||window.TextTrackCue,c=0;c<n.rows.length;c++)if(r=n.rows[c],o=!0,s=0,l="",!r.isEmpty()){for(var d=0;d<r.chars.length;d++)r.chars[d].uchar.match(/\s/)&&o?s++:(l+=r.chars[d].uchar,o=!1);r.cueStartTime=e,e===i&&(i+=1e-4),a=new u(e,i,ct(l.trim())),s>=16?s--:s++,navigator.userAgent.match(/Firefox\//)?a.line=c+1:a.line=c>7?c-2:c+1,a.align="left",a.position=Math.max(0,Math.min(100,s/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),t.addCue(a)}}function ht(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ft(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function yt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function mt(t){if(t&&t.cues)for(;t.cues.length>0;)t.removeCue(t.cues[0])}function vt(t,e){return t&&t.label===e.name&&!(t.textTrack1||t.textTrack2)}function bt(t,e,i,n){return Math.min(e,n)-Math.max(t,i)}function _t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Et(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function Tt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function At(t){for(var e=[],i=0;i<t.length;i++)"subtitles"===t[i].kind&&e.push(t[i]);return e}function St(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function Rt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function kt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var wt={};i.d(wt,"newCue",function(){return dt});var Ct=i(6),It=i.n(Ct),Dt=i(1),Ot=i(2),Pt=i(0),xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt=function(){function t(e){n(this,t),this.hls=e,this.onEvent=this.onEvent.bind(this);for(var i=arguments.length,r=Array(i>1?i-1:0),a=1;a<i;a++)r[a-1]=arguments[a];this.handledEvents=r,this.useGenericHandler=!0,this.registerListeners()}return t.prototype.destroy=function(){this.unregisterListeners()},t.prototype.isEventHandler=function(){return"object"===xt(this.handledEvents)&&this.handledEvents.length&&"function"==typeof this.onEvent},t.prototype.registerListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(t){if("hlsEventGeneric"===t)throw new Error("Forbidden event name: "+t);this.hls.on(t,this.onEvent)},this)},t.prototype.unregisterListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(t){this.hls.off(t,this.onEvent)},this)},t.prototype.onEvent=function(t,e){this.onEventGeneric(t,e)},t.prototype.onEventGeneric=function(t,e){var i=function(t,e){var i="on"+t.replace("hls","");if("function"!=typeof this[i])throw new Error("Event "+t+" has no generic handler in this "+this.constructor.name+" class (tried "+i+")");return this[i].bind(this,e)};try{i.call(this,t,e).call()}catch(e){Pt.b.error("internal error happened while processing "+t+":"+e.message),this.hls.trigger(Dt.a.ERROR,{type:Ot.b.OTHER_ERROR,details:Ot.a.INTERNAL_EXCEPTION,fatal:!1,event:t,err:e})}},t}(),Mt=Nt,Ft=/^(\d+)x(\d+)$/,Bt=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,Ut=function(){function t(e){r(this,t),"string"==typeof e&&(e=t.parseAttrList(e));for(var i in e)e.hasOwnProperty(i)&&(this[i]=e[i])}return t.prototype.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},t.prototype.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var i=new Uint8Array(e.length/2),n=0;n<e.length/2;n++)i[n]=parseInt(e.slice(2*n,2*n+2),16);return i}return null},t.prototype.hexadecimalIntegerAsNumber=function(t){var e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e},t.prototype.decimalFloatingPoint=function(t){return parseFloat(this[t])},t.prototype.enumeratedString=function(t){return this[t]},t.prototype.decimalResolution=function(t){var e=Ft.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,i={};for(Bt.lastIndex=0;null!==(e=Bt.exec(t));){var n=e[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),i[e[1]]=n}return i},t}(),Gt=Ut,Kt={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}},Vt=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),jt=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,Yt=/#EXT-X-MEDIA:(.*)/g,Ht=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)(\S+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),$t=/(?:(?:#(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?/,zt=function(){function t(){u(this,t),this.method=null,this.key=null,this.iv=null,this._uri=null}return Vt(t,[{key:"uri",get:function(){return!this._uri&&this.reluri&&(this._uri=It.a.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri}}]),t}(),Wt=function(){function t(){u(this,t),this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[]}return t.prototype.createInitializationVector=function(t){for(var e=new Uint8Array(16),i=12;i<16;i++)e[i]=t>>8*(15-i)&255;return e},t.prototype.fragmentDecryptdataFromLevelkey=function(t,e){var i=t;return t&&t.method&&t.uri&&!t.iv&&(i=new zt,i.method=t.method,i.baseuri=t.baseuri,i.reluri=t.reluri,i.iv=this.createInitializationVector(e)),i},t.prototype.cloneObj=function(t){return JSON.parse(JSON.stringify(t))},Vt(t,[{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=It.a.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(t){this._url=t}},{key:"programDateTime",get:function(){return!this._programDateTime&&this.rawProgramDateTime&&(this._programDateTime=new Date(Date.parse(this.rawProgramDateTime))),this._programDateTime}},{key:"byteRange",get:function(){if(!this._byteRange){var t=this._byteRange=[];if(this.rawByteRange){var e=this.rawByteRange.split("@",2);if(1===e.length){var i=this.lastByteRangeEndOffset;t[0]=i||0}else t[0]=parseInt(e[1]);t[1]=parseInt(e[0])+t[0]}}return this._byteRange}},{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}}]),t}(),qt=function(t){function e(i){u(this,e);var n=s(this,t.call(this,i,Dt.a.MANIFEST_LOADING,Dt.a.LEVEL_LOADING,Dt.a.AUDIO_TRACK_LOADING,Dt.a.SUBTITLE_TRACK_LOADING));return n.loaders={},n}return l(e,t),e.prototype.destroy=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={},Mt.prototype.destroy.call(this)},e.prototype.onManifestLoading=function(t){this.load(t.url,{type:"manifest"})},e.prototype.onLevelLoading=function(t){this.load(t.url,{type:"level",level:t.level,id:t.id})},e.prototype.onAudioTrackLoading=function(t){this.load(t.url,{type:"audioTrack",id:t.id})},e.prototype.onSubtitleTrackLoading=function(t){this.load(t.url,{type:"subtitleTrack",id:t.id})},e.prototype.load=function(t,e){var i=this.loaders[e.type];if(void 0!==i){var n=i.context;if(n&&n.url===t)return void Pt.b.trace("playlist request ongoing");Pt.b.warn("abort previous loader for type:"+e.type),i.abort()}var r=this.hls.config,a=void 0,o=void 0,s=void 0,l=void 0;"manifest"===e.type?(a=r.manifestLoadingMaxRetry,o=r.manifestLoadingTimeOut,s=r.manifestLoadingRetryDelay,l=r.manifestLoadingMaxRetryTimeout):"level"===e.type?(a=0,o=r.levelLoadingTimeOut):(a=r.levelLoadingMaxRetry,o=r.levelLoadingTimeOut,s=r.levelLoadingRetryDelay,l=r.levelLoadingMaxRetryTimeout,Pt.b.log("loading playlist for "+e.type+" "+(e.level||e.id))),i=this.loaders[e.type]=e.loader=void 0!==r.pLoader?new r.pLoader(r):new r.loader(r),e.url=t,e.responseType="";var u=void 0,c=void 0;u={timeout:o,maxRetry:a,retryDelay:s,maxRetryDelay:l},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},i.load(e,u,c)},e.prototype.resolve=function(t,e){return It.a.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},e.prototype.parseMasterPlaylist=function(t,e){var i=[],n=void 0;for(jt.lastIndex=0;null!=(n=jt.exec(t));){var r={},o=r.attrs=new Gt(n[1]);r.url=this.resolve(n[2],e);var s=o.decimalResolution("RESOLUTION");s&&(r.width=s.width,r.height=s.height),r.bitrate=o.decimalInteger("AVERAGE-BANDWIDTH")||o.decimalInteger("BANDWIDTH"),r.name=o.NAME,function(t,e){["video","audio"].forEach(function(i){var n=t.filter(function(t){return a(t,i)});if(n.length){var r=n.filter(function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)});e[i+"Codec"]=r.length>0?r[0]:n[0],t=t.filter(function(t){return-1===n.indexOf(t)})}}),e.unknownCodecs=t}([].concat((o.CODECS||"").split(/[ ,]+/)),r),r.videoCodec&&-1!==r.videoCodec.indexOf("avc1")&&(r.videoCodec=this.avc1toavcoti(r.videoCodec)),i.push(r)}return i},e.prototype.parseMasterPlaylistMedia=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=void 0,a=[],o=0;for(Yt.lastIndex=0;null!==(r=Yt.exec(t));){var s={},l=new Gt(r[1]);if(l.TYPE===i){if(s.groupId=l["GROUP-ID"],s.name=l.NAME,s.type=i,s.default="YES"===l.DEFAULT,s.autoselect="YES"===l.AUTOSELECT,s.forced="YES"===l.FORCED,l.URI&&(s.url=this.resolve(l.URI,e)),s.lang=l.LANGUAGE,s.name||(s.name=s.lang),n.length){var u=c(n,s.groupId);s.audioCodec=u?u.codec:n[0].codec}s.id=o++,a.push(s)}}return a},e.prototype.avc1toavcoti=function(t){var e,i=t.split(".");return i.length>2?(e=i.shift()+".",e+=parseInt(i.shift()).toString(16),e+=("000"+parseInt(i.shift()).toString(16)).substr(-4)):e=t,e},e.prototype.parseLevelPlaylist=function(t,e,i,n){var r,a,o=0,s=0,l={type:null,version:null,url:e,fragments:[],live:!0,startSN:0},u=new zt,c=0,d=null,h=new Wt;for(Ht.lastIndex=0;null!==(r=Ht.exec(t));){var f=r[1];if(f){h.duration=parseFloat(f);var p=(" "+r[2]).slice(1);h.title=p||null,h.tagList.push(p?["INF",f,p]:["INF",f])}else if(r[3]){if(!isNaN(h.duration)){var g=o++;h.type=n,h.start=s,h.levelkey=u,h.sn=g,h.level=i,h.cc=c,h.baseurl=e,h.relurl=(" "+r[3]).slice(1),l.fragments.push(h),d=h,s+=h.duration,h=new Wt}}else if(r[4]){if(h.rawByteRange=(" "+r[4]).slice(1),d){var y=d.byteRangeEndOffset;y&&(h.lastByteRangeEndOffset=y)}}else if(r[5])h.rawProgramDateTime=(" "+r[5]).slice(1),h.tagList.push(["PROGRAM-DATE-TIME",h.rawProgramDateTime]),void 0===l.programDateTime&&(l.programDateTime=new Date(new Date(Date.parse(r[5]))-1e3*s));else{for(r=r[0].match($t),a=1;a<r.length&&void 0===r[a];a++);var m=(" "+r[a+1]).slice(1),v=(" "+r[a+2]).slice(1);switch(r[a]){case"#":h.tagList.push(v?[m,v]:[m]);break;case"PLAYLIST-TYPE":l.type=m.toUpperCase();break;case"MEDIA-SEQUENCE":o=l.startSN=parseInt(m);break;case"TARGETDURATION":l.targetduration=parseFloat(m);break;case"VERSION":l.version=parseInt(m);break;case"EXTM3U":break;case"ENDLIST":l.live=!1;break;case"DIS":c++,h.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":c=parseInt(m);break;case"KEY":var b=m,_=new Gt(b),E=_.enumeratedString("METHOD"),T=_.URI,A=_.hexadecimalInteger("IV");E&&(u=new zt,T&&["AES-128","SAMPLE-AES"].indexOf(E)>=0&&(u.method=E,u.baseuri=e,u.reluri=T,u.key=null,u.iv=A));break;case"START":var S=m,L=new Gt(S),R=L.decimalFloatingPoint("TIME-OFFSET");isNaN(R)||(l.startTimeOffset=R);break;case"MAP":var k=new Gt(m);h.relurl=k.URI,h.rawByteRange=k.BYTERANGE,h.baseurl=e,h.level=i,h.type=n,h.sn="initSegment",l.initSegment=h,h=new Wt;break;default:Pt.b.warn("line parsed but not handled: "+r)}}}return h=d,h&&!h.relurl&&(l.fragments.pop(),s-=h.duration),l.totalduration=s,l.averagetargetduration=s/l.fragments.length,l.endSN=o-1,l.startCC=l.fragments[0]?l.fragments[0].cc:0,l.endCC=c,l},e.prototype.loadsuccess=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=t.data,a=t.url,o=i.type,s=i.id,l=i.level,u=this.hls;if(this.loaders[o]=void 0,void 0!==a&&0!==a.indexOf("data:")||(a=i.url),e.tload=performance.now(),0===r.indexOf("#EXTM3U"))if(r.indexOf("#EXTINF:")>0){var c="audioTrack"!==o&&"subtitleTrack"!==o,d=isNaN(l)?isNaN(s)?0:s:l,h=this.parseLevelPlaylist(r,a,d,"audioTrack"===o?"audio":"subtitleTrack"===o?"subtitle":"main");h.tload=e.tload,"manifest"===o&&u.trigger(Dt.a.MANIFEST_LOADED,{levels:[{url:a,details:h}],audioTracks:[],url:a,stats:e,networkDetails:n}),e.tparsed=performance.now(),h.targetduration?c?u.trigger(Dt.a.LEVEL_LOADED,{details:h,level:l||0,id:s||0,stats:e,networkDetails:n}):"audioTrack"===o?u.trigger(Dt.a.AUDIO_TRACK_LOADED,{details:h,id:s,stats:e,networkDetails:n}):"subtitleTrack"===o&&u.trigger(Dt.a.SUBTITLE_TRACK_LOADED,{details:h,id:s,stats:e,networkDetails:n}):u.trigger(Dt.a.ERROR,{type:Ot.b.NETWORK_ERROR,details:Ot.a.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"invalid targetduration",networkDetails:n})}else{var f=this.parseMasterPlaylist(r,a);if(f.length){var p=f.map(function(t){return{id:t.attrs.AUDIO,codec:t.audioCodec}}),g=this.parseMasterPlaylistMedia(r,a,"AUDIO",p),y=this.parseMasterPlaylistMedia(r,a,"SUBTITLES");if(g.length){var m=!1;g.forEach(function(t){t.url||(m=!0)}),!1===m&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(Pt.b.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main"}))}u.trigger(Dt.a.MANIFEST_LOADED,{levels:f,audioTracks:g,subtitles:y,url:a,stats:e,networkDetails:n})}else u.trigger(Dt.a.ERROR,{type:Ot.b.NETWORK_ERROR,details:Ot.a.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no level found in manifest",networkDetails:n})}else u.trigger(Dt.a.ERROR,{type:Ot.b.NETWORK_ERROR,details:Ot.a.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no EXTM3U delimiter",networkDetails:n})},e.prototype.loaderror=function(t,e){var i,n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=e.loader;switch(e.type){case"manifest":i=Ot.a.MANIFEST_LOAD_ERROR,n=!0;break;case"level":i=Ot.a.LEVEL_LOAD_ERROR,n=!1;break;case"audioTrack":i=Ot.a.AUDIO_TRACK_LOAD_ERROR,n=!1}a&&(a.abort(),this.loaders[e.type]=void 0),this.hls.trigger(Dt.a.ERROR,{type:Ot.b.NETWORK_ERROR,details:i,fatal:n,url:a.url,loader:a,response:t,context:e,networkDetails:r})},e.prototype.loadtimeout=function(t,e){var i,n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=e.loader;switch(e.type){case"manifest":i=Ot.a.MANIFEST_LOAD_TIMEOUT,n=!0;break;case"level":i=Ot.a.LEVEL_LOAD_TIMEOUT,n=!1;break;case"audioTrack":i=Ot.a.AUDIO_TRACK_LOAD_TIMEOUT,n=!1}a&&(a.abort(),this.loaders[e.type]=void 0),this.hls.trigger(Dt.a.ERROR,{type:Ot.b.NETWORK_ERROR,details:i,fatal:n,url:a.url,loader:a,context:e,networkDetails:r})},e}(Mt),Xt=qt,Zt=function(t){function e(i){d(this,e);var n=h(this,t.call(this,i,Dt.a.FRAG_LOADING));return n.loaders={},n}return f(e,t),e.prototype.destroy=function(){var t=this.loaders;for(var e in t){var i=t[e];i&&i.destroy()}this.loaders={},Mt.prototype.destroy.call(this)},e.prototype.onFragLoading=function(t){var e=t.frag,i=e.type,n=this.loaders[i],r=this.hls.config;e.loaded=0,n&&(Pt.b.warn("abort previous fragment loader for type:"+i),n.abort()),n=this.loaders[i]=e.loader=void 0!==r.fLoader?new r.fLoader(r):new r.loader(r);var a=void 0,o=void 0,s=void 0;a={url:e.url,frag:e,responseType:"arraybuffer",progressData:!1};var l=e.byteRangeStartOffset,u=e.byteRangeEndOffset;isNaN(l)||isNaN(u)||(a.rangeStart=l,a.rangeEnd=u),o={timeout:r.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:r.fragLoadingMaxRetryTimeout},s={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},n.load(a,o,s)},e.prototype.loadsuccess=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=t.data,a=i.frag;a.loader=void 0,this.loaders[a.type]=void 0,this.hls.trigger(Dt.a.FRAG_LOADED,{payload:r,frag:a,stats:e,networkDetails:n})},e.prototype.loaderror=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=e.loader;n&&n.abort(),this.loaders[e.type]=void 0,this.hls.trigger(Dt.a.ERROR,{type:Ot.b.NETWORK_ERROR,details:Ot.a.FRAG_LOAD_ERROR,fatal:!1,frag:e.frag,response:t,networkDetails:i})},e.prototype.loadtimeout=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=e.loader;n&&n.abort(),this.loaders[e.type]=void 0,this.hls.trigger(Dt.a.ERROR,{type:Ot.b.NETWORK_ERROR,details:Ot.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e.frag,networkDetails:i})},e.prototype.loadprogress=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=e.frag;r.loaded=t.loaded,this.hls.trigger(Dt.a.FRAG_LOAD_PROGRESS,{frag:r,stats:t,networkDetails:n})},e}(Mt),Jt=Zt,Qt=function(t){function e(i){p(this,e);var n=g(this,t.call(this,i,Dt.a.KEY_LOADING));return n.loaders={},n.decryptkey=null,n.decrypturl=null,n}return y(e,t),e.prototype.destroy=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={},Mt.prototype.destroy.call(this)},e.prototype.onKeyLoading=function(t){var e=t.frag,i=e.type,n=this.loaders[i],r=e.decryptdata,a=r.uri;if(a!==this.decrypturl||null===this.decryptkey){var o=this.hls.config;n&&(Pt.b.warn("abort previous key loader for type:"+i),n.abort()),e.loader=this.loaders[i]=new o.loader(o),this.decrypturl=a,this.decryptkey=null;var s=void 0,l=void 0,u=void 0;s={url:a,frag:e,responseType:"arraybuffer"},l={timeout:o.fragLoadingTimeOut,maxRetry:o.fragLoadingMaxRetry,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout},u={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},e.loader.load(s,l,u)}else this.decryptkey&&(r.key=this.decryptkey,this.hls.trigger(Dt.a.KEY_LOADED,{frag:e}))},e.prototype.loadsuccess=function(t,e,i){var n=i.frag;this.decryptkey=n.decryptdata.key=new Uint8Array(t.data),n.loader=void 0,this.loaders[n.type]=void 0,this.hls.trigger(Dt.a.KEY_LOADED,{frag:n})},e.prototype.loaderror=function(t,e){var i=e.frag,n=i.loader;n&&n.abort(),this.loaders[e.type]=void 0,this.hls.trigger(Dt.a.ERROR,{type:Ot.b.NETWORK_ERROR,details:Ot.a.KEY_LOAD_ERROR,fatal:!1,frag:i,response:t})},e.prototype.loadtimeout=function(t,e){var i=e.frag,n=i.loader;n&&n.abort(),this.loaders[e.type]=void 0,this.hls.trigger(Dt.a.ERROR,{type:Ot.b.NETWORK_ERROR,details:Ot.a.KEY_LOAD_TIMEOUT,fatal:!1,frag:i})},e}(Mt),te=Qt,ee={search:function(t,e){for(var i=0,n=t.length-1,r=null,a=null;i<=n;){r=(i+n)/2|0,a=t[r];var o=e(a);if(o>0)i=r+1;else{if(!(o<0))return a;n=r-1}}return null}},ie=ee,ne={isBuffered:function(t,e){try{if(t)for(var i=t.buffered,n=0;n<i.length;n++)if(e>=i.start(n)&&e<=i.end(n))return!0}catch(t){}return!1},bufferInfo:function(t,e,i){try{if(t){var n,r=t.buffered,a=[];for(n=0;n<r.length;n++)a.push({start:r.start(n),end:r.end(n)});return this.bufferedInfo(a,e,i)}}catch(t){}return{len:0,start:e,end:e,nextStart:void 0}},bufferedInfo:function(t,e,i){var n,r,a,o,s,l=[];for(t.sort(function(t,e){var i=t.start-e.start;return i||e.end-t.end}),s=0;s<t.length;s++){var u=l.length;if(u){var c=l[u-1].end;t[s].start-c<i?t[s].end>c&&(l[u-1].end=t[s].end):l.push(t[s])}else l.push(t[s])}for(s=0,n=0,r=a=e;s<l.length;s++){var d=l[s].start,h=l[s].end;if(e+i>=d&&e<h)r=d,a=h,n=a-e;else if(e+i<d){o=d;break}}return{len:n,start:r,end:a,nextStart:o}}},re=ne,ae=i(7),oe=i(5),se=i.n(oe),le=i(9),ue=i.n(le),ce=m(),de=function(){function t(e,i){v(this,t),this.hls=e,this.id=i;var n=this.observer=new se.a,r=e.config;n.trigger=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];n.emit.apply(n,[t,t].concat(i))},n.off=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];n.removeListener.apply(n,[t].concat(i))};var a=function(t,i){i=i||{},i.frag=this.frag,i.id=this.id,e.trigger(t,i)}.bind(this);n.on(Dt.a.FRAG_DECRYPTED,a),n.on(Dt.a.FRAG_PARSING_INIT_SEGMENT,a),n.on(Dt.a.FRAG_PARSING_DATA,a),n.on(Dt.a.FRAG_PARSED,a),n.on(Dt.a.ERROR,a),n.on(Dt.a.FRAG_PARSING_METADATA,a),n.on(Dt.a.FRAG_PARSING_USERDATA,a),n.on(Dt.a.INIT_PTS_FOUND,a);var o={mp4:ce.isTypeSupported("video/mp4"),mpeg:ce.isTypeSupported("audio/mpeg"),mp3:ce.isTypeSupported('audio/mp4; codecs="mp3"')},s=navigator.vendor;if(r.enableWorker&&"undefined"!=typeof Worker){Pt.b.log("demuxing in webworker");var l=void 0;try{l=this.w=ue()(10),this.onwmsg=this.onWorkerMessage.bind(this),l.addEventListener("message",this.onwmsg),l.onerror=function(t){e.trigger(Dt.a.ERROR,{type:Ot.b.OTHER_ERROR,details:Ot.a.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:t.message+" ("+t.filename+":"+t.lineno+")"}})},l.postMessage({cmd:"init",typeSupported:o,vendor:s,id:i,config:JSON.stringify(r)})}catch(t){Pt.b.error("error while initializing DemuxerWorker, fallback on DemuxerInline"),l&&URL.revokeObjectURL(l.objectURL),this.demuxer=new ae.a(n,o,r,s),this.w=void 0}}else this.demuxer=new ae.a(n,o,r,s)}return t.prototype.destroy=function(){var t=this.w;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.w=null;else{var e=this.demuxer;e&&(e.destroy(),this.demuxer=null)}var i=this.observer;i&&(i.removeAllListeners(),this.observer=null)},t.prototype.push=function(t,e,i,n,r,a,o,s){var l=this.w,u=isNaN(r.startDTS)?r.start:r.startDTS,c=r.decryptdata,d=this.frag,h=!(d&&r.cc===d.cc),f=!(d&&r.level===d.level),p=d&&r.sn===d.sn+1,g=!f&&p;if(h&&Pt.b.log(this.id+":discontinuity detected"),f&&Pt.b.log(this.id+":switch detected"),this.frag=r,l)l.postMessage({cmd:"demux",data:t,decryptdata:c,initSegment:e,audioCodec:i,videoCodec:n,timeOffset:u,discontinuity:h,trackSwitch:f,contiguous:g,duration:a,accurateTimeOffset:o,defaultInitPTS:s},t instanceof ArrayBuffer?[t]:[]);else{var y=this.demuxer;y&&y.push(t,c,e,i,n,u,h,f,g,a,o,s)}},t.prototype.onWorkerMessage=function(t){var e=t.data,i=this.hls;switch(e.event){case"init":URL.revokeObjectURL(this.w.objectURL);break;case Dt.a.FRAG_PARSING_DATA:e.data.data1=new Uint8Array(e.data1),e.data2&&(e.data.data2=new Uint8Array(e.data2));default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,i.trigger(e.event,e.data)}},t}(),he=de,fe={toString:function(t){for(var e="",i=t.length,n=0;n<i;n++)e+="["+t.start(n).toFixed(3)+","+t.end(n).toFixed(3)+"]";return e}},pe=fe,ge=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),ye={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_LEVEL:"WAITING_LEVEL",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR"},me=function(t){function e(i){w(this,e);var n=C(this,t.call(this,i,Dt.a.MEDIA_ATTACHED,Dt.a.MEDIA_DETACHING,Dt.a.MANIFEST_LOADING,Dt.a.MANIFEST_PARSED,Dt.a.LEVEL_LOADED,Dt.a.KEY_LOADED,Dt.a.FRAG_LOADED,Dt.a.FRAG_LOAD_EMERGENCY_ABORTED,Dt.a.FRAG_PARSING_INIT_SEGMENT,Dt.a.FRAG_PARSING_DATA,Dt.a.FRAG_PARSED,Dt.a.ERROR,Dt.a.AUDIO_TRACK_SWITCHING,Dt.a.AUDIO_TRACK_SWITCHED,Dt.a.BUFFER_CREATED,Dt.a.BUFFER_APPENDED,Dt.a.BUFFER_FLUSHED));return n.config=i.config,n.audioCodecSwap=!1,n.ticks=0,n._state=ye.STOPPED,n.ontick=n.tick.bind(n),n}return I(e,t),e.prototype.destroy=function(){this.stopLoad(),this.timer&&(clearInterval(this.timer),this.timer=null),Mt.prototype.destroy.call(this),this.state=ye.STOPPED},e.prototype.startLoad=function(t){if(this.levels){var e=this.lastCurrentTime,i=this.hls;if(this.stopLoad(),this.timer||(this.timer=setInterval(this.ontick,100)),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var n=i.startLevel;-1===n&&(n=0,this.bitrateTest=!0),this.level=i.nextLoadLevel=n,this.loadedmetadata=!1}e>0&&-1===t&&(Pt.b.log("override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=ye.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this.forceStartLoad=!0,this.state=ye.STOPPED},e.prototype.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=ye.STOPPED,this.forceStartLoad=!1},e.prototype.tick=function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)},e.prototype.doTick=function(){switch(this.state){case ye.ERROR:break;case ye.BUFFER_FLUSHING:this.fragLoadError=0;break;case ye.IDLE:this._doTickIdle();break;case ye.WAITING_LEVEL:var t=this.levels[this.level];t&&t.details&&(this.state=ye.IDLE);break;case ye.FRAG_LOADING_WAITING_RETRY:var e=performance.now(),i=this.retryDate;(!i||e>=i||this.media&&this.media.seeking)&&(Pt.b.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=ye.IDLE);break;case ye.ERROR:case ye.STOPPED:case ye.FRAG_LOADING:case ye.PARSING:case ye.PARSED:case ye.ENDED:}this._checkBuffer(),this._checkFragmentChanged()},e.prototype._doTickIdle=function(){var t=this.hls,e=t.config,i=this.media;if(void 0!==this.levelLastLoaded&&(i||!this.startFragRequested&&e.startFragPrefetch)){var n=void 0;n=this.loadedmetadata?i.currentTime:this.nextLoadPosition;var r=t.nextLoadLevel,a=this.levels[r];if(a){var o=a.bitrate,s=void 0;s=o?Math.max(8*e.maxBufferSize/o,e.maxBufferLength):e.maxBufferLength,s=Math.min(s,e.maxMaxBufferLength);var l=re.bufferInfo(this.mediaBuffer?this.mediaBuffer:i,n,e.maxBufferHole),u=l.len;if(!(u>=s)){Pt.b.trace("buffer length of "+u.toFixed(3)+" is below max of "+s.toFixed(3)+". checking for more payload ..."),this.level=t.nextLoadLevel=r;var c=a.details;if(void 0===c||!0===c.live&&this.levelLastLoaded!==r)return void(this.state=ye.WAITING_LEVEL);var d=this.fragPrevious;if(!c.live&&d&&!d.backtracked&&d.sn===c.endSN&&!l.nextStart){if(Math.min(i.duration,d.start+d.duration)-Math.max(l.end,d.start)<=Math.max(.2,d.duration)){var h={};return this.altAudio&&(h.type="video"),this.hls.trigger(Dt.a.BUFFER_EOS,h),void(this.state=ye.ENDED)}}this._fetchPayloadOrEos(n,l,c)}}}},e.prototype._fetchPayloadOrEos=function(t,e,i){var n=this.fragPrevious,r=this.level,a=i.fragments,o=a.length;if(0!==o){var s=a[0].start,l=a[o-1].start+a[o-1].duration,u=e.end,c=void 0;if(i.initSegment&&!i.initSegment.data)c=i.initSegment;else if(i.live){var d=this.config.initialLiveManifestSize;if(o<d)return void Pt.b.warn("Can not start playback of a level, reason: not enough fragments "+o+" < "+d);if(null===(c=this._ensureFragmentAtLivePoint(i,u,s,l,n,a,o)))return}else u<s&&(c=a[0]);c||(c=this._findFragment(s,n,o,a,u,l,i)),c&&this._loadFragmentOrKey(c,r,i,t,u)}},e.prototype._ensureFragmentAtLivePoint=function(t,e,i,n,r,a,o){var s=this.hls.config,l=this.media,u=void 0,c=void 0!==s.liveMaxLatencyDuration?s.liveMaxLatencyDuration:s.liveMaxLatencyDurationCount*t.targetduration;if(e<Math.max(i-s.maxFragLookUpTolerance,n-c)){var d=this.liveSyncPosition=this.computeLivePosition(i,t);Pt.b.log("buffer end: "+e.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+d.toFixed(3)),e=d,l&&l.readyState&&l.duration>d&&(l.currentTime=d),this.nextLoadPosition=d}if(t.PTSKnown&&e>n&&l&&l.readyState)return null;if(this.startFragRequested&&!t.PTSKnown){if(r){var h=r.sn+1;if(h>=t.startSN&&h<=t.endSN){var f=a[h-t.startSN];r.cc===f.cc&&(u=f,Pt.b.log("live playlist, switching playlist, load frag with next SN: "+u.sn))}u||(u=ie.search(a,function(t){return r.cc-t.cc}))&&Pt.b.log("live playlist, switching playlist, load frag with same CC: "+u.sn)}u||(u=a[Math.min(o-1,Math.round(o/2))],Pt.b.log("live playlist, switching playlist, unknown, load middle frag : "+u.sn))}return u},e.prototype._findFragment=function(t,e,i,n,r,a,o){var s=this.hls.config,l=void 0,u=void 0,c=s.maxFragLookUpTolerance,d=e?n[e.sn-n[0].sn+1]:void 0,h=function(t){var e=Math.min(c,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-e<=r?1:t.start-e>r&&t.start?-1:0};if(r<a?(r>a-c&&(c=0),u=d&&!h(d)?d:ie.search(n,h)):u=n[i-1],u){l=u;var f=l.sn-o.startSN,p=e&&l.level===e.level,g=n[f-1],y=n[f+1];if(e&&l.sn===e.sn)if(p&&!l.backtracked)if(l.sn<o.endSN){var m=e.deltaPTS;m&&m>s.maxBufferHole&&e.dropped&&f?(l=g,Pt.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"),e.loadCounter--):(l=y,Pt.b.log("SN just loaded, load next one: "+l.sn))}else l=null;else l.backtracked&&(y&&y.backtracked?(Pt.b.warn("Already backtracked from fragment "+y.sn+", will not backtrack to fragment "+l.sn+". Loading fragment "+y.sn),l=y):(Pt.b.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),l.dropped=0,g?(g.loadCounter&&g.loadCounter--,l=g,l.backtracked=!0):f&&(l=null)))}return l},e.prototype._loadFragmentOrKey=function(t,e,i,n,r){var a=this.hls,o=a.config;if(!t.decryptdata||null==t.decryptdata.uri||null!=t.decryptdata.key){if(Pt.b.log("Loading "+t.sn+" of ["+i.startSN+" ,"+i.endSN+"],level "+e+", currentTime:"+n.toFixed(3)+",bufferEnd:"+r.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,t.loadCounter){t.loadCounter++;var s=o.fragLoadingLoopThreshold;if(t.loadCounter>s&&Math.abs(this.fragLoadIdx-t.loadIdx)<s)return void a.trigger(Dt.a.ERROR,{type:Ot.b.MEDIA_ERROR,details:Ot.a.FRAG_LOOP_LOADING_ERROR,fatal:!1,frag:t})}else t.loadCounter=1;return t.loadIdx=this.fragLoadIdx,t.autoLevel=a.autoLevelEnabled,t.bitrateTest=this.bitrateTest,this.fragCurrent=t,this.startFragRequested=!0,isNaN(t.sn)||t.bitrateTest||(this.nextLoadPosition=t.start+t.duration),a.trigger(Dt.a.FRAG_LOADING,{frag:t}),this.demuxer||(this.demuxer=new he(a,"main")),void(this.state=ye.FRAG_LOADING)}Pt.b.log("Loading key for "+t.sn+" of ["+i.startSN+" ,"+i.endSN+"],level "+e),this.state=ye.KEY_LOADING,a.trigger(Dt.a.KEY_LOADING,{frag:t})},e.prototype.getBufferedFrag=function(t){return ie.search(this._bufferedFrags,function(e){return t<e.startPTS?-1:t>e.endPTS?1:0})},e.prototype.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.endPTS+.5):null},e.prototype._checkFragmentChanged=function(){var t,e,i=this.media;if(i&&i.readyState&&!1===i.seeking&&(e=i.currentTime,e>i.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=e),re.isBuffered(i,e)?t=this.getBufferedFrag(e):re.isBuffered(i,e+.1)&&(t=this.getBufferedFrag(e+.1)),t)){var n=t;if(n!==this.fragPlaying){this.hls.trigger(Dt.a.FRAG_CHANGED,{frag:n});var r=n.level;this.fragPlaying&&this.fragPlaying.level===r||this.hls.trigger(Dt.a.LEVEL_SWITCHED,{level:r}),this.fragPlaying=n}}},e.prototype.immediateLevelSwitch=function(){if(Pt.b.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,e=void 0;t?(e=t.paused,t.pause()):e=!0,this.previouslyPaused=e}var i=this.fragCurrent;i&&i.loader&&i.loader.abort(),this.fragCurrent=null,void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},e.prototype.immediateLevelSwitchEnd=function(){var t=this.media;t&&t.buffered.length&&(this.immediateSwitch=!1,re.isBuffered(t,t.currentTime)&&(t.currentTime-=1e-4),this.previouslyPaused||t.play())},e.prototype.nextLevelSwitch=function(){var t=this.media;if(t&&t.readyState){var e=void 0,i=void 0,n=void 0;if(void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),i=this.getBufferedFrag(t.currentTime),i&&i.startPTS>1&&this.flushMainBuffer(0,i.startPTS-1),t.paused)e=0;else{var r=this.hls.nextLoadLevel,a=this.levels[r],o=this.fragLastKbps;e=o&&this.fragCurrent?this.fragCurrent.duration*a.bitrate/(1e3*o)+1:0}if((n=this.getBufferedFrag(t.currentTime+e))&&(n=this.followingBufferedFrag(n))){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(n.maxStartPTS,Number.POSITIVE_INFINITY)}}},e.prototype.flushMainBuffer=function(t,e){this.state=ye.BUFFER_FLUSHING;var i={startOffset:t,endOffset:e};this.altAudio&&(i.type="video"),this.hls.trigger(Dt.a.BUFFER_FLUSHING,i)},e.prototype.onMediaAttached=function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("seeked",this.onvseeked),e.addEventListener("ended",this.onvended);var i=this.config;this.levels&&i.autoStartLoad&&this.hls.startLoad(i.startPosition)},e.prototype.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(Pt.b.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var e=this.levels;e&&e.forEach(function(t){t.details&&t.details.fragments.forEach(function(t){t.loadCounter=void 0,t.backtracked=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("seeked",this.onvseeked),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},e.prototype.onMediaSeeking=function(){var t=this.media,e=t?t.currentTime:void 0,i=this.config;isNaN(e)||Pt.b.log("media seeking to "+e.toFixed(3));var n=this.mediaBuffer?this.mediaBuffer:t,r=re.bufferInfo(n,e,this.config.maxBufferHole);if(this.state===ye.FRAG_LOADING){var a=this.fragCurrent;if(0===r.len&&a){var o=i.maxFragLookUpTolerance,s=a.start-o,l=a.start+a.duration+o;e<s||e>l?(a.loader&&(Pt.b.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),a.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=ye.IDLE):Pt.b.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===ye.ENDED&&(0===r.len&&(this.fragPrevious=0),this.state=ye.IDLE);t&&(this.lastCurrentTime=e),this.state!==ye.FRAG_LOADING&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*i.fragLoadingLoopThreshold),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=e),this.tick()},e.prototype.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:void 0;isNaN(e)||Pt.b.log("media seeked to "+e.toFixed(3)),this.tick()},e.prototype.onMediaEnded=function(){Pt.b.log("media ended"),this.startPosition=this.lastCurrentTime=0},e.prototype.onManifestLoading=function(){Pt.b.log("trigger BUFFER_RESET"),this.hls.trigger(Dt.a.BUFFER_RESET),this._bufferedFrags=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0},e.prototype.onManifestParsed=function(t){var e,i=!1,n=!1;t.levels.forEach(function(t){(e=t.audioCodec)&&(-1!==e.indexOf("mp4a.40.2")&&(i=!0),-1!==e.indexOf("mp4a.40.5")&&(n=!0))}),this.audioCodecSwitch=i&&n,this.audioCodecSwitch&&Pt.b.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1;var r=this.config;(r.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(r.startPosition)},e.prototype.onLevelLoaded=function(t){var e=t.details,i=t.level,n=this.levels[this.levelLastLoaded],r=this.levels[i],a=e.totalduration,o=0;if(Pt.b.log("level "+i+" loaded ["+e.startSN+","+e.endSN+"],duration:"+a),e.live){var s=r.details;s&&e.fragments.length>0?(E(s,e),o=e.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(o,s),e.PTSKnown&&!isNaN(o)?Pt.b.log("live playlist sliding:"+o.toFixed(3)):(Pt.b.log("live playlist - outdated PTS, unknown sliding"),k(this.fragPrevious,n,e))):(Pt.b.log("live playlist - first load, unknown sliding"),e.PTSKnown=!1,k(this.fragPrevious,n,e))}else e.PTSKnown=!1;if(r.details=e,this.levelLastLoaded=i,this.hls.trigger(Dt.a.LEVEL_UPDATED,{details:e,level:i}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var l=e.startTimeOffset;isNaN(l)?e.live?(this.startPosition=this.computeLivePosition(o,e),Pt.b.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(l<0&&(Pt.b.log("negative start time offset "+l+", count from end of last fragment"),l=o+a+l),Pt.b.log("start time offset found in playlist, adjust startPosition to "+l),this.startPosition=l),this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===ye.WAITING_LEVEL&&(this.state=ye.IDLE),this.tick()},e.prototype.onKeyLoaded=function(){this.state===ye.KEY_LOADING&&(this.state=ye.IDLE,this.tick())},e.prototype.onFragLoaded=function(t){var e=this.fragCurrent,i=t.frag;if(this.state===ye.FRAG_LOADING&&e&&"main"===i.type&&i.level===e.level&&i.sn===e.sn){var n=t.stats,r=this.levels[e.level],a=r.details;if(Pt.b.log("Loaded "+e.sn+" of ["+a.startSN+" ,"+a.endSN+"],level "+e.level),this.bitrateTest=!1,this.stats=n,!0===i.bitrateTest&&this.hls.nextLoadLevel)this.state=ye.IDLE,this.startFragRequested=!1,n.tparsed=n.tbuffered=performance.now(),this.hls.trigger(Dt.a.FRAG_BUFFERED,{stats:n,frag:e,id:"main"}),this.tick();else if("initSegment"===i.sn)this.state=ye.IDLE,n.tparsed=n.tbuffered=performance.now(),a.initSegment.data=t.payload,this.hls.trigger(Dt.a.FRAG_BUFFERED,{stats:n,frag:e,id:"main"}),this.tick();else{this.state=ye.PARSING;var o=a.totalduration,s=e.level,l=e.sn,u=this.config.defaultAudioCodec||r.audioCodec;this.audioCodecSwap&&(Pt.b.log("swapping playlist audio codec"),void 0===u&&(u=this.lastAudioCodec),u&&(u=-1!==u.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,Pt.b.log("Parsing "+l+" of ["+a.startSN+" ,"+a.endSN+"],level "+s+", cc "+e.cc);var c=this.demuxer;c||(c=this.demuxer=new he(this.hls,"main"));var d=this.media,h=d&&d.seeking,f=!h&&(a.PTSKnown||!a.live),p=a.initSegment?a.initSegment.data:[];c.push(t.payload,p,u,r.videoCodec,e,o,f,void 0)}}this.fragLoadError=0},e.prototype.onFragParsingInitSegment=function(t){var e=this.fragCurrent,i=t.frag;if(e&&"main"===t.id&&i.sn===e.sn&&i.level===e.level&&this.state===ye.PARSING){var n,r,a=t.tracks;if(a.audio&&this.altAudio&&delete a.audio,r=a.audio){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(Pt.b.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==r.metadata.channelCount&&-1===s.indexOf("firefox")&&(o="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==r.container&&(o="mp4a.40.2",Pt.b.log("Android: force audio codec to "+o)),r.levelCodec=o,r.id=t.id}r=a.video,r&&(r.levelCodec=this.levels[this.level].videoCodec,r.id=t.id),this.hls.trigger(Dt.a.BUFFER_CODECS,a);for(n in a){r=a[n],Pt.b.log("main track:"+n+",container:"+r.container+",codecs[level/parsed]=["+r.levelCodec+"/"+r.codec+"]");var l=r.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(Dt.a.BUFFER_APPENDING,{type:n,data:l,parent:"main",content:"initSegment"}))}this.tick()}},e.prototype.onFragParsingData=function(t){var e=this,i=this.fragCurrent,n=t.frag;if(i&&"main"===t.id&&n.sn===i.sn&&n.level===i.level&&("audio"!==t.type||!this.altAudio)&&this.state===ye.PARSING){var r=this.levels[this.level],a=i;if(isNaN(t.endPTS)&&(t.endPTS=t.startPTS+i.duration,t.endDTS=t.startDTS+i.duration),Pt.b.log("Parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb+",dropped:"+(t.dropped||0)),"video"===t.type)if(a.dropped=t.dropped,a.dropped)if(a.backtracked)Pt.b.warn("Already backtracked on this fragment, appending with the gap");else{var o=r.details;if(!o||a.sn!==o.startSN)return Pt.b.warn("missing video frame(s), backtracking fragment"),a.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=ye.IDLE,this.fragPrevious=a,void this.tick();Pt.b.warn("missing video frame(s) on first frag, appending with gap")}else a.backtracked=!1;var s=_(r.details,a,t.startPTS,t.endPTS,t.startDTS,t.endDTS),l=this.hls;l.trigger(Dt.a.LEVEL_PTS_UPDATED,{details:r.details,level:this.level,drift:s,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(i){i&&i.length&&e.state===ye.PARSING&&(e.appended=!0,e.pendingBuffering=!0,l.trigger(Dt.a.BUFFER_APPENDING,{type:t.type,data:i,parent:"main",content:"data"}))}),this.tick()}},e.prototype.onFragParsed=function(t){var e=this.fragCurrent,i=t.frag;e&&"main"===t.id&&i.sn===e.sn&&i.level===e.level&&this.state===ye.PARSING&&(this.stats.tparsed=performance.now(),this.state=ye.PARSED,this._checkAppendedParsed())},e.prototype.onAudioTrackSwitching=function(t){var e=!!t.url,i=t.id;if(!e){if(this.mediaBuffer!==this.media){Pt.b.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var n=this.fragCurrent;n.loader&&(Pt.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=ye.IDLE}var r=this.hls;r.trigger(Dt.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),r.trigger(Dt.a.AUDIO_TRACK_SWITCHED,{id:i}),this.altAudio=!1}},e.prototype.onAudioTrackSwitched=function(t){var e=t.id,i=!!this.hls.audioTracks[e].url;if(i){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(Pt.b.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=i,this.tick()},e.prototype.onBufferCreated=function(t){var e=t.tracks,i=void 0,n=void 0,r=!1;for(var a in e){var o=e[a];"main"===o.id?(n=a,i=o,"video"===a&&(this.videoBuffer=e[a].buffer)):r=!0}r&&i?(Pt.b.log("alternate track found, use "+n+".buffered to schedule main fragment loading"),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media},e.prototype.onBufferAppended=function(t){if("main"===t.parent){var e=this.state;e!==ye.PARSING&&e!==ye.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},e.prototype._checkAppendedParsed=function(){if(!(this.state!==ye.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent;if(t){var e=this.mediaBuffer?this.mediaBuffer:this.media;Pt.b.log("main buffered : "+pe.toString(e.buffered));var i=this._bufferedFrags.filter(function(t){return re.isBuffered(e,(t.startPTS+t.endPTS)/2)});i.push(t),this._bufferedFrags=i.sort(function(t,e){return t.startPTS-e.startPTS}),this.fragPrevious=t;var n=this.stats;n.tbuffered=performance.now(),this.fragLastKbps=Math.round(8*n.total/(n.tbuffered-n.tfirst)),this.hls.trigger(Dt.a.FRAG_BUFFERED,{stats:n,frag:t,id:"main"}),this.state=ye.IDLE}this.tick()}},e.prototype.onError=function(t){var e=t.frag||this.fragCurrent;if(!e||"main"===e.type){var i=!!this.media&&re.isBuffered(this.media,this.media.currentTime)&&re.isBuffered(this.media,this.media.currentTime+.5);switch(t.details){case Ot.a.FRAG_LOAD_ERROR:case Ot.a.FRAG_LOAD_TIMEOUT:case Ot.a.KEY_LOAD_ERROR:case Ot.a.KEY_LOAD_TIMEOUT:if(!t.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var n=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);e.loadCounter=0,Pt.b.warn("mediaController: frag loading failed, retry in "+n+" ms"),this.retryDate=performance.now()+n,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=ye.FRAG_LOADING_WAITING_RETRY}else Pt.b.error("mediaController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=ye.ERROR;break;case Ot.a.FRAG_LOOP_LOADING_ERROR:t.fatal||(i?(this._reduceMaxBufferLength(e.duration),this.state=ye.IDLE):e.autoLevel&&0!==e.level||(t.fatal=!0,this.state=ye.ERROR));break;case Ot.a.LEVEL_LOAD_ERROR:case Ot.a.LEVEL_LOAD_TIMEOUT:this.state!==ye.ERROR&&(t.fatal?(this.state=ye.ERROR,Pt.b.warn("streamController: "+t.details+",switch to "+this.state+" state ...")):t.levelRetry||this.state!==ye.WAITING_LEVEL||(this.state=ye.IDLE));break;case Ot.a.BUFFER_FULL_ERROR:"main"!==t.parent||this.state!==ye.PARSING&&this.state!==ye.PARSED||(i?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=ye.IDLE):(Pt.b.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}},e.prototype._reduceMaxBufferLength=function(t){var e=this.config;e.maxMaxBufferLength>=t&&(e.maxMaxBufferLength/=2,Pt.b.warn("main:reduce max buffer length to "+e.maxMaxBufferLength+"s"),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*e.fragLoadingLoopThreshold))},e.prototype._checkBuffer=function(){var t=this.media,e=this.config;if(t&&t.readyState){var i=t.currentTime,n=this.mediaBuffer?this.mediaBuffer:t,r=n.buffered;if(!this.loadedmetadata&&r.length){this.loadedmetadata=!0;var a=t.seeking?i:this.startPosition,o=re.isBuffered(n,a),s=r.start(0),l=!o&&Math.abs(a-s)<e.maxSeekHole;(i!==a||l)&&(Pt.b.log("target start position:"+a),l&&(a=s,Pt.b.log("target start position not buffered, seek to buffered.start(0) "+a)),Pt.b.log("adjust currentTime from "+i+" to "+a),t.currentTime=a)}else if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var u=re.bufferInfo(t,i,0),c=!(t.paused||t.ended||0===t.buffered.length),d=i!==this.lastCurrentTime;if(d)this.stallReported&&(Pt.b.warn("playback not stuck anymore @"+i+", after "+Math.round(performance.now()-this.stalled)+"ms"),this.stallReported=!1),this.stalled=void 0,this.nudgeRetry=0;else if(c){var h=performance.now(),f=this.hls;if(this.stalled){var p=h-this.stalled,g=u.len,y=this.nudgeRetry||0;if(g<=.5&&p>1e3*e.lowBufferWatchdogPeriod){this.stallReported||(this.stallReported=!0,Pt.b.warn("playback stalling in low buffer @"+i),f.trigger(Dt.a.ERROR,{type:Ot.b.MEDIA_ERROR,details:Ot.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:g}));var m=u.nextStart,v=m-i;if(m&&v<e.maxSeekHole&&v>0){this.nudgeRetry=++y;var b=y*e.nudgeOffset;Pt.b.log("adjust currentTime from "+t.currentTime+" to next buffered @ "+m+" + nudge "+b),t.currentTime=m+b,this.stalled=void 0,f.trigger(Dt.a.ERROR,{type:Ot.b.MEDIA_ERROR,details:Ot.a.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:m+b-i})}}else if(g>.5&&p>1e3*e.highBufferWatchdogPeriod)if(this.stallReported||(this.stallReported=!0,Pt.b.warn("playback stalling in high buffer @"+i),f.trigger(Dt.a.ERROR,{type:Ot.b.MEDIA_ERROR,details:Ot.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:g})),this.stalled=void 0,this.nudgeRetry=++y,y<e.nudgeMaxRetry){var _=t.currentTime,E=_+y*e.nudgeOffset;Pt.b.log("adjust currentTime from "+_+" to "+E),t.currentTime=E,f.trigger(Dt.a.ERROR,{type:Ot.b.MEDIA_ERROR,details:Ot.a.BUFFER_NUDGE_ON_STALL,fatal:!1})}else Pt.b.error("still stuck in high buffer @"+i+" after "+e.nudgeMaxRetry+", raise fatal error"),f.trigger(Dt.a.ERROR,{type:Ot.b.MEDIA_ERROR,details:Ot.a.BUFFER_STALLED_ERROR,fatal:!0})}else this.stalled=h,this.stallReported=!1}}}},e.prototype.onFragLoadEmergencyAborted=function(){this.state=ye.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},e.prototype.onBufferFlushed=function(){var t=this.mediaBuffer?this.mediaBuffer:this.media;this._bufferedFrags=this._bufferedFrags.filter(function(e){return re.isBuffered(t,(e.startPTS+e.endPTS)/2)}),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.state=ye.IDLE,this.fragPrevious=null},e.prototype.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},e.prototype.computeLivePosition=function(t,e){var i=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*e.targetduration;return t+Math.max(0,e.totalduration-i)},ge(e,[{key:"state",set:function(t){if(this.state!==t){var e=this.state;this._state=t,Pt.b.log("main stream:"+e+"->"+t),this.hls.trigger(Dt.a.STREAM_STATE_TRANSITION,{previousState:e,nextState:t})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var t=this.media;if(t){var e=this.getBufferedFrag(t.currentTime);if(e)return e.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;return t?this.followingBufferedFrag(this.getBufferedFrag(t.currentTime)):null}},{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(t){this._liveSyncPosition=t}}]),e}(Mt),ve=me,be=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),_e=function(t){function e(i){D(this,e);var n=O(this,t.call(this,i,Dt.a.MANIFEST_LOADED,Dt.a.LEVEL_LOADED,Dt.a.FRAG_LOADED,Dt.a.ERROR));return n.canload=!1,n.currentLevelIndex=null,n.manualLevelIndex=-1,n.timer=null,n}return P(e,t),e.prototype.destroy=function(){this.cleanTimer(),this.manualLevelIndex=-1},e.prototype.cleanTimer=function(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.startLoad=function(){var t=this._levels;this.canload=!0,this.levelRetryCount=0,t&&t.forEach(function(t){t.loadError=0;var e=t.details;e&&e.live&&(t.details=void 0)}),null!==this.timer&&this.loadLevel()},e.prototype.stopLoad=function(){this.canload=!1},e.prototype.onManifestLoaded=function(t){var e=[],i=void 0,n={},r=null,a=!1,s=!1,l=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),u=[];if(t.levels.forEach(function(t){t.loadError=0,t.fragmentError=!1,a=a||!!t.videoCodec,s=s||!!t.audioCodec||!(!t.attrs||!t.attrs.AUDIO),!0===l&&t.audioCodec&&-1!==t.audioCodec.indexOf("mp4a.40.34")&&(t.audioCodec=void 0),r=n[t.bitrate],void 0===r?(t.url=[t.url],t.urlId=0,n[t.bitrate]=t,e.push(t)):r.url.push(t.url)}),!0===a&&!0===s&&(e=e.filter(function(t){return!!t.videoCodec})),e=e.filter(function(t){var e=t.audioCodec,i=t.videoCodec;return(!e||o(e))&&(!i||o(i))}),t.audioTracks&&(u=t.audioTracks.filter(function(t){return!t.audioCodec||o(t.audioCodec,"audio")})),e.length>0){i=e[0].bitrate,e.sort(function(t,e){return t.bitrate-e.bitrate}),this._levels=e;for(var c=0;c<e.length;c++)if(e[c].bitrate===i){this._firstLevel=c,Pt.b.log("manifest loaded,"+e.length+" level(s) found, first bitrate:"+i);break}this.hls.trigger(Dt.a.MANIFEST_PARSED,{levels:e,audioTracks:u,firstLevel:this._firstLevel,stats:t.stats,audio:s,video:a,altAudio:u.length>0})}else this.hls.trigger(Dt.a.ERROR,{type:Ot.b.MEDIA_ERROR,details:Ot.a.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:this.hls.url,reason:"no level with compatible codecs found in manifest"})},e.prototype.setLevelInternal=function(t){var e=this._levels,i=this.hls;if(t>=0&&t<e.length){if(this.cleanTimer(),this.currentLevelIndex!==t){Pt.b.log("switching to level "+t),this.currentLevelIndex=t;var n=e[t];n.level=t,i.trigger(Dt.a.LEVEL_SWITCH,n),i.trigger(Dt.a.LEVEL_SWITCHING,n)}var r=e[t],a=r.details;if(!a||!0===a.live){var o=r.urlId;i.trigger(Dt.a.LEVEL_LOADING,{url:r.url[o],level:t,id:o})}}else i.trigger(Dt.a.ERROR,{type:Ot.b.OTHER_ERROR,details:Ot.a.LEVEL_SWITCH_ERROR,level:t,fatal:!1,reason:"invalid level idx"})},e.prototype.onError=function(t){if(!0===t.fatal)return void(t.type===Ot.b.NETWORK_ERROR&&this.cleanTimer());var e=!1,i=!1,n=void 0;switch(t.details){case Ot.a.FRAG_LOAD_ERROR:case Ot.a.FRAG_LOAD_TIMEOUT:case Ot.a.FRAG_LOOP_LOADING_ERROR:case Ot.a.KEY_LOAD_ERROR:case Ot.a.KEY_LOAD_TIMEOUT:n=t.frag.level,i=!0;break;case Ot.a.LEVEL_LOAD_ERROR:case Ot.a.LEVEL_LOAD_TIMEOUT:n=t.context.level,e=!0;break;case Ot.a.REMUX_ALLOC_ERROR:n=t.level,e=!0}void 0!==n&&this.recoverLevel(t,n,e,i)},e.prototype.recoverLevel=function(t,e,i,n){var r=this,a=this.hls.config,o=t.details,s=this._levels[e],l=void 0,u=void 0,c=void 0;if(s.loadError++,s.fragmentError=n,!0===i){if(!(this.levelRetryCount+1<=a.levelLoadingMaxRetry))return Pt.b.error("level controller, cannot recover from "+o+" error"),this.currentLevelIndex=null,this.cleanTimer(),void(t.fatal=!0);u=Math.min(Math.pow(2,this.levelRetryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout),this.timer=setTimeout(function(){return r.loadLevel()},u),t.levelRetry=!0,this.levelRetryCount++,Pt.b.warn("level controller, "+o+", retry in "+u+" ms, current retry count is "+this.levelRetryCount)}!0!==i&&!0!==n||(l=s.url.length,l>1&&s.loadError<l?(Pt.b.warn("level controller, "+o+" for level "+e+": switching to redundant stream id "+s.urlId),s.urlId=(s.urlId+1)%l,s.details=void 0):-1===this.manualLevelIndex?(c=0===e?this._levels.length-1:e-1,Pt.b.warn("level controller, "+o+": switch to "+c),this.hls.nextAutoLevel=this.currentLevelIndex=c):!0===n&&(Pt.b.warn("level controller, "+o+": reload a fragment"),this.currentLevelIndex=null))},e.prototype.onFragLoaded=function(t){var e=t.frag;if(void 0!==e&&"main"===e.type){var i=this._levels[e.level];void 0!==i&&(i.fragmentError=!1,i.loadError=0,this.levelRetryCount=0)}},e.prototype.onLevelLoaded=function(t){var e=this,i=t.level;if(i===this.currentLevelIndex){var n=this._levels[i];!1===n.fragmentError&&(n.loadError=0,this.levelRetryCount=0);var r=t.details;if(r.live){var a=1e3*(r.averagetargetduration?r.averagetargetduration:r.targetduration),o=n.details;o&&r.endSN===o.endSN&&(a/=2,Pt.b.log("same live playlist, reload twice faster")),a-=performance.now()-t.stats.trequest,a=Math.max(1e3,Math.round(a)),Pt.b.log("live playlist, reload in "+a+" ms"),this.timer=setTimeout(function(){return e.loadLevel()},a)}else this.cleanTimer()}},e.prototype.loadLevel=function(){var t=void 0,e=void 0;null!==this.currentLevelIndex&&!0===this.canload&&void 0!==(t=this._levels[this.currentLevelIndex])&&t.url.length>0&&(e=t.urlId,this.hls.trigger(Dt.a.LEVEL_LOADING,{url:t.url[e],level:this.currentLevelIndex,id:e}))},be(e,[{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e=this._levels;e&&(t=Math.min(t,e.length-1),this.currentLevelIndex===t&&void 0!==e[t].details||this.setLevelInternal(t))}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}]),e}(Mt),Ee=_e,Te=i(3),Ae=function(t){function e(i){x(this,e);var n=N(this,t.call(this,i,Dt.a.MEDIA_ATTACHED,Dt.a.MEDIA_DETACHING,Dt.a.FRAG_PARSING_METADATA));return n.id3Track=void 0,n.media=void 0,n}return M(e,t),e.prototype.destroy=function(){Mt.prototype.destroy.call(this)},e.prototype.onMediaAttached=function(t){this.media=t.media,this.media},e.prototype.onMediaDetaching=function(){this.media=void 0},e.prototype.onFragParsingMetadata=function(t){var e=t.frag,i=t.samples;this.id3Track||(this.id3Track=this.media.addTextTrack("metadata","id3"),this.id3Track.mode="hidden");for(var n=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,r=0;r<i.length;r++){var a=Te.a.getID3Frames(i[r].data);if(a){var o=i[r].pts,s=r<i.length-1?i[r+1].pts:e.endPTS;o===s&&(s+=1e-4);for(var l=0;l<a.length;l++){var u=a[l];if(!Te.a.isTimeStampFrame(u)){var c=new n(o,s,"");c.value=u,this.id3Track.addCue(c)}}}}},e}(Mt),Se=Ae,Le=function(){function t(e){B(this,t),this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=0,this.totalWeight_=0}return t.prototype.sample=function(t,e){var i=Math.pow(this.alpha_,t);this.estimate_=e*(1-i)+i*this.estimate_,this.totalWeight_+=t},t.prototype.getTotalWeight=function(){return this.totalWeight_},t.prototype.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/t}return this.estimate_},t}(),Re=Le,ke=function(){function t(e,i,n,r){U(this,t),this.hls=e,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Re(i),this.fast_=new Re(n)}return t.prototype.sample=function(t,e){t=Math.max(t,this.minDelayMs_);var i=8e3*e/t,n=t/1e3;this.fast_.sample(n,i),this.slow_.sample(n,i)},t.prototype.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},t.prototype.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.prototype.destroy=function(){},t}(),we=ke,Ce=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),Ie=function(t){function e(i){G(this,e);var n=K(this,t.call(this,i,Dt.a.FRAG_LOADING,Dt.a.FRAG_LOADED,Dt.a.FRAG_BUFFERED,Dt.a.ERROR));return n.lastLoadedFragLevel=0,n._nextAutoLevel=-1,n.hls=i,n.timer=null,n._bwEstimator=null,n.onCheck=n._abandonRulesCheck.bind(n),n}return V(e,t),e.prototype.destroy=function(){this.clearTimer(),Mt.prototype.destroy.call(this)},e.prototype.onFragLoading=function(t){var e=t.frag;if("main"===e.type){if(this.timer||(this.timer=setInterval(this.onCheck,100)),!this._bwEstimator){var i=this.hls,n=t.frag.level,r=i.levels[n].details.live,a=i.config,o=void 0,s=void 0;r?(o=a.abrEwmaFastLive,s=a.abrEwmaSlowLive):(o=a.abrEwmaFastVoD,s=a.abrEwmaSlowVoD),this._bwEstimator=new we(i,s,o,a.abrEwmaDefaultEstimate)}this.fragCurrent=e}},e.prototype._abandonRulesCheck=function(){var t=this.hls,e=t.media,i=this.fragCurrent,n=i.loader,r=t.minAutoLevel;if(!n||n.stats&&n.stats.aborted)return Pt.b.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);var a=n.stats;if(e&&a&&(!e.paused&&0!==e.playbackRate||!e.readyState)&&i.autoLevel&&i.level){var o=performance.now()-a.trequest,s=Math.abs(e.playbackRate);if(o>500*i.duration/s){var l=t.levels,u=Math.max(1,a.bw?a.bw/8:1e3*a.loaded/o),c=l[i.level],d=c.realBitrate?Math.max(c.realBitrate,c.bitrate):c.bitrate,h=a.total?a.total:Math.max(a.loaded,Math.round(i.duration*d/8)),f=e.currentTime,p=(h-a.loaded)/u,g=(re.bufferInfo(e,f,t.config.maxBufferHole).end-f)/s;if(g<2*i.duration/s&&p>g){var y=void 0,m=void 0;for(m=i.level-1;m>r;m--){var v=l[m].realBitrate?Math.max(l[m].realBitrate,l[m].bitrate):l[m].bitrate;if((y=i.duration*v/(6.4*u))<g)break}y<p&&(Pt.b.warn("loading too slow, abort fragment loading and switch to level "+m+":fragLoadedDelay["+m+"]<fragLoadedDelay["+(i.level-1)+"];bufferStarvationDelay:"+y.toFixed(1)+"<"+p.toFixed(1)+":"+g.toFixed(1)),t.nextLoadLevel=m,this._bwEstimator.sample(o,a.loaded),n.abort(),this.clearTimer(),t.trigger(Dt.a.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,stats:a}))}}}},e.prototype.onFragLoaded=function(t){var e=t.frag;if("main"===e.type&&!isNaN(e.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=e.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var i=this.hls.levels[e.level],n=(i.loaded?i.loaded.bytes:0)+t.stats.loaded,r=(i.loaded?i.loaded.duration:0)+t.frag.duration;i.loaded={bytes:n,duration:r},i.realBitrate=Math.round(8*n/r)}if(t.frag.bitrateTest){var a=t.stats;a.tparsed=a.tbuffered=a.tload,this.onFragBuffered(t)}}},e.prototype.onFragBuffered=function(t){var e=t.stats,i=t.frag;if(!(!0===e.aborted||1!==i.loadCounter||"main"!==i.type||isNaN(i.sn)||i.bitrateTest&&e.tload!==e.tbuffered)){var n=e.tparsed-e.trequest;Pt.b.log("latency/loading/parsing/append/kbps:"+Math.round(e.tfirst-e.trequest)+"/"+Math.round(e.tload-e.tfirst)+"/"+Math.round(e.tparsed-e.tload)+"/"+Math.round(e.tbuffered-e.tparsed)+"/"+Math.round(8*e.loaded/(e.tbuffered-e.trequest))),this._bwEstimator.sample(n,e.loaded),e.bwEstimate=this._bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}},e.prototype.onError=function(t){switch(t.details){case Ot.a.FRAG_LOAD_ERROR:case Ot.a.FRAG_LOAD_TIMEOUT:this.clearTimer()}},e.prototype.clearTimer=function(){clearInterval(this.timer),this.timer=null},e.prototype._findBestLevel=function(t,e,i,n,r,a,o,s,l){for(var u=r;u>=n;u--){var c=l[u],d=c.details,h=d?d.totalduration/d.fragments.length:e,f=!!d&&d.live,p=void 0;p=u<=t?o*i:s*i;var g=l[u].realBitrate?Math.max(l[u].realBitrate,l[u].bitrate):l[u].bitrate,y=g*h/p;if(Pt.b.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+u+"/"+Math.round(p)+"/"+g+"/"+h+"/"+a+"/"+y),p>g&&(!y||f&&!this.bitrateTestDelay||y<a))return u}return-1},Ce(e,[{key:"nextAutoLevel",get:function(){var t=this._nextAutoLevel,e=this._bwEstimator;if(!(-1===t||e&&e.canEstimate()))return t;var i=this._nextABRAutoLevel;return-1!==t&&(i=Math.min(t,i)),i},set:function(t){this._nextAutoLevel=t}},{key:"_nextABRAutoLevel",get:function(){var t=this.hls,e=t.maxAutoLevel,i=t.levels,n=t.config,r=t.minAutoLevel,a=t.media,o=this.lastLoadedFragLevel,s=this.fragCurrent?this.fragCurrent.duration:0,l=a?a.currentTime:0,u=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,c=this._bwEstimator?this._bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,d=(re.bufferInfo(a,l,n.maxBufferHole).end-l)/u,h=this._findBestLevel(o,s,c,r,e,d,n.abrBandWidthFactor,n.abrBandWidthUpFactor,i);if(h>=0)return h;Pt.b.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var f=s?Math.min(s,n.maxStarvationDelay):n.maxStarvationDelay,p=n.abrBandWidthFactor,g=n.abrBandWidthUpFactor;if(0===d){var y=this.bitrateTestDelay;if(y){f=(s?Math.min(s,n.maxLoadingDelay):n.maxLoadingDelay)-y,Pt.b.trace("bitrate test took "+Math.round(1e3*y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*f)+" ms"),p=g=1}}return h=this._findBestLevel(o,s,c,r,e,d+f,p,g,i),Math.max(h,0)}}]),e}(Mt),De=Ie,Oe=m(),Pe=function(t){function e(i){j(this,e);var n=Y(this,t.call(this,i,Dt.a.MEDIA_ATTACHING,Dt.a.MEDIA_DETACHING,Dt.a.MANIFEST_PARSED,Dt.a.BUFFER_RESET,Dt.a.BUFFER_APPENDING,Dt.a.BUFFER_CODECS,Dt.a.BUFFER_EOS,Dt.a.BUFFER_FLUSHING,Dt.a.LEVEL_PTS_UPDATED,Dt.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 H(e,t),e.prototype.destroy=function(){Mt.prototype.destroy.call(this)},e.prototype.onLevelPtsUpdated=function(t){var e=t.type,i=this.tracks.audio;if("audio"===e&&i&&"audio/mpeg"===i.container){var n=this.sourceBuffer.audio;if(Math.abs(n.timestampOffset-t.start)>.1){var r=n.updating;try{n.abort()}catch(t){r=!0,Pt.b.warn("can not abort audio buffer: "+t)}r?this.audioTimestampOffset=t.start:(Pt.b.warn("change mpeg audio timestamp offset from "+n.timestampOffset+" to "+t.start),n.timestampOffset=t.start)}}},e.prototype.onManifestParsed=function(t){var e=t.audio,i=t.video||t.levels.length&&t.audio,n=0;t.altAudio&&(e||i)&&(n=(e?1:0)+(i?1:0),Pt.b.log(n+" sourceBuffer(s) expected")),this.sourceBufferNb=n},e.prototype.onMediaAttaching=function(t){var e=this.media=t.media;if(e){var i=this.mediaSource=new Oe;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),i.addEventListener("sourceopen",this.onmso),i.addEventListener("sourceended",this.onmse),i.addEventListener("sourceclose",this.onmsc),e.src=URL.createObjectURL(i),this._objectUrl=e.src}},e.prototype.onMediaDetaching=function(){Pt.b.log("media source detaching");var t=this.mediaSource;if(t){if("open"===t.readyState)try{t.endOfStream()}catch(t){Pt.b.warn("onMediaDetaching:"+t.message+" while calling endOfStream")}t.removeEventListener("sourceopen",this.onmso),t.removeEventListener("sourceended",this.onmse),t.removeEventListener("sourceclose",this.onmsc),this.media&&(URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):Pt.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(Dt.a.MEDIA_DETACHED)},e.prototype.onMediaSourceOpen=function(){Pt.b.log("media source opened"),this.hls.trigger(Dt.a.MEDIA_ATTACHED,{media:this.media});var t=this.mediaSource;t&&t.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()},e.prototype.checkPendingTracks=function(){var t=this.pendingTracks,e=Object.keys(t).length;e&&(this.sourceBufferNb<=e||0===this.sourceBufferNb)&&(this.createSourceBuffers(t),this.pendingTracks={},this.doAppending())},e.prototype.onMediaSourceClose=function(){Pt.b.log("media source closed")},e.prototype.onMediaSourceEnded=function(){Pt.b.log("media source ended")},e.prototype.onSBUpdateEnd=function(){if(this.audioTimestampOffset){var t=this.sourceBuffer.audio;Pt.b.warn("change mpeg audio timestamp offset from "+t.timestampOffset+" to "+this.audioTimestampOffset),t.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var e=this.parent,i=this.segments.reduce(function(t,i){return i.parent===e?t+1:t},0);this.hls.trigger(Dt.a.BUFFER_APPENDED,{parent:e,pending:i}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()},e.prototype.onSBUpdateError=function(t){Pt.b.error("sourceBuffer error:",t),this.hls.trigger(Dt.a.ERROR,{type:Ot.b.MEDIA_ERROR,details:Ot.a.BUFFER_APPENDING_ERROR,fatal:!1})},e.prototype.onBufferReset=function(){var t=this.sourceBuffer;for(var e in t){var i=t[e];try{this.mediaSource.removeSourceBuffer(i),i.removeEventListener("updateend",this.onsbue),i.removeEventListener("error",this.onsbe)}catch(t){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},e.prototype.onBufferCodecs=function(t){if(0===Object.keys(this.sourceBuffer).length){for(var e in t)this.pendingTracks[e]=t[e];var i=this.mediaSource;i&&"open"===i.readyState&&this.checkPendingTracks()}},e.prototype.createSourceBuffers=function(t){var e=this.sourceBuffer,i=this.mediaSource;for(var n in t)if(!e[n]){var r=t[n],a=r.levelCodec||r.codec,o=r.container+";codecs="+a;Pt.b.log("creating sourceBuffer("+o+")");try{var s=e[n]=i.addSourceBuffer(o);s.addEventListener("updateend",this.onsbue),s.addEventListener("error",this.onsbe),this.tracks[n]={codec:a,container:r.container},r.buffer=s}catch(t){Pt.b.error("error while trying to add sourceBuffer:"+t.message),this.hls.trigger(Dt.a.ERROR,{type:Ot.b.MEDIA_ERROR,details:Ot.a.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:t,mimeType:o})}}this.hls.trigger(Dt.a.BUFFER_CREATED,{tracks:t})},e.prototype.onBufferAppending=function(t){this._needsFlush||(this.segments?this.segments.push(t):this.segments=[t],this.doAppending())},e.prototype.onBufferAppendFail=function(t){Pt.b.error("sourceBuffer error:",t.event),this.hls.trigger(Dt.a.ERROR,{type:Ot.b.MEDIA_ERROR,details:Ot.a.BUFFER_APPENDING_ERROR,fatal:!1})},e.prototype.onBufferEos=function(t){var e=this.sourceBuffer,i=t.type;for(var n in e)i&&n!==i||e[n].ended||(e[n].ended=!0,Pt.b.log(n+" sourceBuffer now EOS"));this.checkEos()},e.prototype.checkEos=function(){var t=this.sourceBuffer,e=this.mediaSource;if(!e||"open"!==e.readyState)return void(this._needsEos=!1);for(var i in t){var n=t[i];if(!n.ended)return;if(n.updating)return void(this._needsEos=!0)}Pt.b.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{e.endOfStream()}catch(t){Pt.b.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1},e.prototype.onBufferFlushing=function(t){this.flushRange.push({start:t.startOffset,end:t.endOffset,type:t.type}),this.flushBufferCounter=0,this.doFlush()},e.prototype.onLevelUpdated=function(t){var e=t.details;e.fragments.length>0&&(this._levelDuration=e.totalduration+e.fragments[0].start,this._live=e.live,this.updateMediaElementDuration())},e.prototype.updateMediaElementDuration=function(){var t=this.hls.config,e=void 0;if(null!==this._levelDuration&&this.media&&this.mediaSource&&this.sourceBuffer&&0!==this.media.readyState&&"open"===this.mediaSource.readyState){for(var i in this.sourceBuffer)if(!0===this.sourceBuffer[i].updating)return;e=this.media.duration,null===this._msDuration&&(this._msDuration=this.mediaSource.duration),!0===this._live&&!0===t.liveDurationInfinity?(Pt.b.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>e||e===1/0||isNaN(e))&&(Pt.b.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},e.prototype.doFlush=function(){for(;this.flushRange.length;){var t=this.flushRange[0];if(!this.flushBuffer(t.start,t.end,t.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var e=0,i=this.sourceBuffer;try{for(var n in i)e+=i[n].buffered.length}catch(t){Pt.b.error("error while accessing sourceBuffer.buffered")}this.appended=e,this.hls.trigger(Dt.a.BUFFER_FLUSHED)}},e.prototype.doAppending=function(){var t=this.hls,e=this.sourceBuffer,i=this.segments;if(Object.keys(e).length){if(this.media.error)return this.segments=[],void Pt.b.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(i&&i.length){var n=i.shift();try{var r=n.type,a=e[r];a?a.updating?i.unshift(n):(a.ended=!1,this.parent=n.parent,a.appendBuffer(n.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(e){Pt.b.error("error while trying to append buffer:"+e.message),i.unshift(n);var o={type:Ot.b.MEDIA_ERROR,parent:n.parent};if(22===e.code)return this.segments=[],o.details=Ot.a.BUFFER_FULL_ERROR,o.fatal=!1,void t.trigger(Dt.a.ERROR,o);if(this.appendError?this.appendError++:this.appendError=1,o.details=Ot.a.BUFFER_APPEND_ERROR,this.appendError>t.config.appendErrorMaxRetry)return Pt.b.log("fail "+t.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),i=[],o.fatal=!0,void t.trigger(Dt.a.ERROR,o);o.fatal=!1,t.trigger(Dt.a.ERROR,o)}}}},e.prototype.flushBuffer=function(t,e,i){var n,r,a,o,s,l,u=this.sourceBuffer;if(Object.keys(u).length){if(Pt.b.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+t+"/"+e),this.flushBufferCounter<this.appended){for(var c in u)if(!i||c===i){if(n=u[c],n.ended=!1,n.updating)return Pt.b.warn("cannot flush, sb updating in progress"),!1;try{for(r=0;r<n.buffered.length;r++)if(a=n.buffered.start(r),o=n.buffered.end(r),-1!==navigator.userAgent.toLowerCase().indexOf("firefox")&&e===Number.POSITIVE_INFINITY?(s=t,l=e):(s=Math.max(a,t),l=Math.min(o,e)),Math.min(l,o)-s>.5)return this.flushBufferCounter++,Pt.b.log("flush "+c+" ["+s+","+l+"], of ["+a+","+o+"], pos:"+this.media.currentTime),n.remove(s,l),!1}catch(t){Pt.b.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else Pt.b.warn("abort flushing too many retries");Pt.b.log("buffer flushed")}return!0},e}(Mt),xe=Pe,Ne=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),Me=function(t){function e(i){return $(this,e),z(this,t.call(this,i,Dt.a.FPS_DROP_LEVEL_CAPPING,Dt.a.MEDIA_ATTACHING,Dt.a.MANIFEST_PARSED))}return W(e,t),e.prototype.destroy=function(){this.hls.config.capLevelToPlayerSize&&(this.media=this.restrictedLevels=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer)))},e.prototype.onFpsDropLevelCapping=function(t){e.isLevelAllowed(t.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(t.droppedLevel)},e.prototype.onMediaAttaching=function(t){this.media=t.media instanceof HTMLVideoElement?t.media:null},e.prototype.onManifestParsed=function(t){var e=this.hls;this.restrictedLevels=[],e.config.capLevelToPlayerSize&&(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.levels=t.levels,e.firstLevel=this.getMaxLevel(t.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},e.prototype.detectPlayerSize=function(){if(this.media){var t=this.levels?this.levels.length:0;if(t){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t-1),e.autoLevelCapping>this.autoLevelCapping&&e.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},e.prototype.getMaxLevel=function(t){var i=this;if(!this.levels)return-1;var n=this.levels.filter(function(n,r){return e.isLevelAllowed(r,i.restrictedLevels)&&r<=t});return e.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},e.isLevelAllowed=function(t){return-1===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).indexOf(t)},e.getMaxLevelByMediaSize=function(t,e,i){if(!t||t&&!t.length)return-1;for(var n=t.length-1,r=0;r<t.length;r+=1){var a=t[r];if((a.width>=e||a.height>=i)&&function(t,e){return!e||(t.width!==e.width||t.height!==e.height)}(a,t[r+1])){n=r;break}}return n},Ne(e,[{key:"mediaWidth",get:function(){var t=void 0,i=this.media;return i&&(t=i.width||i.clientWidth||i.offsetWidth,t*=e.contentScaleFactor),t}},{key:"mediaHeight",get:function(){var t=void 0,i=this.media;return i&&(t=i.height||i.clientHeight||i.offsetHeight,t*=e.contentScaleFactor),t}}],[{key:"contentScaleFactor",get:function(){var t=1;try{t=window.devicePixelRatio}catch(t){}return t}}]),e}(Mt),Fe=Me,Be=function(t){function e(i){return q(this,e),X(this,t.call(this,i,Dt.a.MEDIA_ATTACHING))}return Z(e,t),e.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},e.prototype.onMediaAttaching=function(t){var e=this.hls.config;if(e.capLevelOnFPSDrop){"function"==typeof(this.video=t.media instanceof HTMLVideoElement?t.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),e.fpsDroppedMonitoringPeriod)}},e.prototype.checkFPS=function(t,e,i){var n=performance.now();if(e){if(this.lastTime){var r=n-this.lastTime,a=i-this.lastDroppedFrames,o=e-this.lastDecodedFrames,s=1e3*a/r,l=this.hls;if(l.trigger(Dt.a.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:i}),s>0&&a>l.config.fpsDroppedMonitoringThreshold*o){var u=l.currentLevel;Pt.b.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(-1===l.autoLevelCapping||l.autoLevelCapping>=u)&&(u-=1,l.trigger(Dt.a.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:l.currentLevel}),l.autoLevelCapping=u,l.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=i,this.lastDecodedFrames=e}},e.prototype.checkFPSInterval=function(){var t=this.video;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},e}(Mt),Ue=Be,Ge=function(){function t(e){J(this,t),e&&e.xhrSetup&&(this.xhrSetup=e.xhrSetup)}return t.prototype.destroy=function(){this.abort(),this.loader=null},t.prototype.abort=function(){var t=this.loader;t&&4!==t.readyState&&(this.stats.aborted=!0,t.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},t.prototype.load=function(t,e,i){this.context=t,this.config=e,this.callbacks=i,this.stats={trequest:performance.now(),retry:0},this.retryDelay=e.retryDelay,this.loadInternal()},t.prototype.loadInternal=function(){var t,e=this.context;t=this.loader=new XMLHttpRequest;var i=this.stats;i.tfirst=0,i.loaded=0;var n=this.xhrSetup;try{if(n)try{n(t,e.url)}catch(i){t.open("GET",e.url,!0),n(t,e.url)}t.readyState||t.open("GET",e.url,!0)}catch(i){return void this.callbacks.onError({code:t.status,text:i.message},e,t)}e.rangeEnd&&t.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),t.send()},t.prototype.readystatechange=function(t){var e=t.currentTarget,i=e.readyState,n=this.stats,r=this.context,a=this.config;if(!n.aborted&&i>=2)if(window.clearTimeout(this.requestTimeout),0===n.tfirst&&(n.tfirst=Math.max(performance.now(),n.trequest)),4===i){var o=e.status;if(o>=200&&o<300){n.tload=Math.max(n.tfirst,performance.now());var s=void 0,l=void 0;"arraybuffer"===r.responseType?(s=e.response,l=s.byteLength):(s=e.responseText,l=s.length),n.loaded=n.total=l;var u={url:e.responseURL,data:s};this.callbacks.onSuccess(u,n,r,e)}else n.retry>=a.maxRetry||o>=400&&o<499?(Pt.b.error(o+" while loading "+r.url),this.callbacks.onError({code:o,text:e.statusText},r,e)):(Pt.b.warn(o+" while loading "+r.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,a.maxRetryDelay),n.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),a.timeout)},t.prototype.loadtimeout=function(){Pt.b.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},t.prototype.loadprogress=function(t){var e=t.currentTarget,i=this.stats;i.loaded=t.loaded,t.lengthComputable&&(i.total=t.total);var n=this.callbacks.onProgress;n&&n(i,this.context,null,e)},t}(),Ke=Ge,Ve=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),je=function(t){function e(i){Q(this,e);var n=tt(this,t.call(this,i,Dt.a.MANIFEST_LOADING,Dt.a.MANIFEST_PARSED,Dt.a.AUDIO_TRACK_LOADED,Dt.a.ERROR));return n.ticks=0,n.ontick=n.tick.bind(n),n}return et(e,t),e.prototype.destroy=function(){this.cleanTimer(),Mt.prototype.destroy.call(this)},e.prototype.cleanTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.tick=function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)},e.prototype.doTick=function(){this.updateTrack(this.trackId)},e.prototype.onError=function(t){t.fatal&&t.type===Ot.b.NETWORK_ERROR&&this.cleanTimer()},e.prototype.onManifestLoading=function(){this.tracks=[],this.trackId=-1},e.prototype.onManifestParsed=function(t){var e=this,i=t.audioTracks||[],n=!1;this.tracks=i,this.hls.trigger(Dt.a.AUDIO_TRACKS_UPDATED,{audioTracks:i});var r=0;i.forEach(function(t){if(t.default&&!n)return e.audioTrack=r,void(n=!0);r++}),!1===n&&i.length&&(Pt.b.log("no default audio track defined, use first audio track as default"),this.audioTrack=0)},e.prototype.onAudioTrackLoaded=function(t){t.id<this.tracks.length&&(Pt.b.log("audioTrack "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.timer&&(this.timer=setInterval(this.ontick,1e3*t.details.targetduration)),!t.details.live&&this.timer&&this.cleanTimer())},e.prototype.setAudioTrackInternal=function(t){if(t>=0&&t<this.tracks.length){this.cleanTimer(),this.trackId=t,Pt.b.log("switching to audioTrack "+t);var e=this.tracks[t],i=this.hls,n=e.type,r=e.url,a={id:t,type:n,url:r};i.trigger(Dt.a.AUDIO_TRACK_SWITCH,a),i.trigger(Dt.a.AUDIO_TRACK_SWITCHING,a);var o=e.details;!r||void 0!==o&&!0!==o.live||(Pt.b.log("(re)loading playlist for audioTrack "+t),i.trigger(Dt.a.AUDIO_TRACK_LOADING,{url:r,id:t}))}},e.prototype.updateTrack=function(t){if(t>=0&&t<this.tracks.length){this.cleanTimer(),this.trackId=t,Pt.b.log("updating audioTrack "+t);var e=this.tracks[t],i=e.url,n=e.details;!i||void 0!==n&&!0!==n.live||(Pt.b.log("(re)loading playlist for audioTrack "+t),this.hls.trigger(Dt.a.AUDIO_TRACK_LOADING,{url:i,id:t}))}},Ve(e,[{key:"audioTracks",get:function(){return this.tracks}},{key:"audioTrack",get:function(){return this.trackId},set:function(t){this.trackId===t&&void 0!==this.tracks[t].details||this.setAudioTrackInternal(t)}}]),e}(Mt),Ye=je,He=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),$e={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS"},ze=function(t){function e(i){it(this,e);var n=nt(this,t.call(this,i,Dt.a.MEDIA_ATTACHED,Dt.a.MEDIA_DETACHING,Dt.a.AUDIO_TRACKS_UPDATED,Dt.a.AUDIO_TRACK_SWITCHING,Dt.a.AUDIO_TRACK_LOADED,Dt.a.KEY_LOADED,Dt.a.FRAG_LOADED,Dt.a.FRAG_PARSING_INIT_SEGMENT,Dt.a.FRAG_PARSING_DATA,Dt.a.FRAG_PARSED,Dt.a.ERROR,Dt.a.BUFFER_RESET,Dt.a.BUFFER_CREATED,Dt.a.BUFFER_APPENDED,Dt.a.BUFFER_FLUSHED,Dt.a.INIT_PTS_FOUND));return n.config=i.config,n.audioCodecSwap=!1,n.ticks=0,n._state=$e.STOPPED,n.ontick=n.tick.bind(n),n.initPTS=[],n.waitingFragment=null,n.videoTrackCC=null,n}return rt(e,t),e.prototype.destroy=function(){this.stopLoad(),this.timer&&(clearInterval(this.timer),this.timer=null),Mt.prototype.destroy.call(this),this.state=$e.STOPPED},e.prototype.onInitPtsFound=function(t){var e=t.id,i=t.frag.cc,n=t.initPTS;"main"===e&&(this.initPTS[i]=n,this.videoTrackCC=i,Pt.b.log("InitPTS for cc:"+i+" found from video track:"+n),this.state===$e.WAITING_INIT_PTS&&this.tick())},e.prototype.startLoad=function(t){if(this.tracks){var e=this.lastCurrentTime;this.stopLoad(),this.timer||(this.timer=setInterval(this.ontick,100)),this.fragLoadError=0,e>0&&-1===t?(Pt.b.log("audio:override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=$e.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:t,this.state=$e.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=t,this.state=$e.STOPPED},e.prototype.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=$e.STOPPED},e.prototype.tick=function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)},e.prototype.doTick=function(){var t,e,i,n=this.hls,r=n.config;switch(this.state){case $e.ERROR:case $e.PAUSED:case $e.BUFFER_FLUSHING:break;case $e.STARTING:this.state=$e.WAITING_TRACK,this.loadedmetadata=!1;break;case $e.IDLE:var a=this.tracks;if(!a)break;if(!this.media&&(this.startFragRequested||!r.startFragPrefetch))break;if(this.loadedmetadata)t=this.media.currentTime;else if(void 0===(t=this.nextLoadPosition))break;var o=this.mediaBuffer?this.mediaBuffer:this.media,s=this.videoBuffer?this.videoBuffer:this.media,l=re.bufferInfo(o,t,r.maxBufferHole),u=re.bufferInfo(s,t,r.maxBufferHole),c=l.len,d=l.end,h=this.fragPrevious,f=Math.max(r.maxBufferLength,u.len),p=this.audioSwitch,g=this.trackId;if((c<f||p)&&g<a.length){if(void 0===(i=a[g].details)){this.state=$e.WAITING_TRACK;break}if(!p&&!i.live&&h&&h.sn===i.endSN&&!l.nextStart&&(!this.media.seeking||this.media.duration-d<h.duration/2)){this.hls.trigger(Dt.a.BUFFER_EOS,{type:"audio"}),this.state=$e.ENDED;break}var y=i.fragments,m=y.length,v=y[0].start,b=y[m-1].start+y[m-1].duration,_=void 0;if(p)if(i.live&&!i.PTSKnown)Pt.b.log("switching audiotrack, live stream, unknown PTS,load first fragment"),d=0;else if(d=t,i.PTSKnown&&t<v){if(!(l.end>v||l.nextStart))return;Pt.b.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=v+.05}if(i.initSegment&&!i.initSegment.data)_=i.initSegment;else if(d<=v){if(_=y[0],null!==this.videoTrackCC&&_.cc!==this.videoTrackCC&&(_=A(y,this.videoTrackCC)),i.live&&_.loadIdx&&_.loadIdx===this.fragLoadIdx){var E=l.nextStart?l.nextStart:v;return Pt.b.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(E+.05)),void(this.media.currentTime=E+.05)}}else{var T=void 0,S=r.maxFragLookUpTolerance,L=h?y[h.sn-y[0].sn+1]:void 0,R=function(t){var e=Math.min(S,t.duration);return t.start+t.duration-e<=d?1:t.start-e>d&&t.start?-1:0};d<b?(d>b-S&&(S=0),T=L&&!R(L)?L:ie.search(y,R)):T=y[m-1],T&&(_=T,v=T.start,h&&_.level===h.level&&_.sn===h.sn&&(_.sn<i.endSN?(_=y[_.sn+1-i.startSN],Pt.b.log("SN just loaded, load next one: "+_.sn)):_=null))}if(_)if(_.decryptdata&&null!=_.decryptdata.uri&&null==_.decryptdata.key)Pt.b.log("Loading key for "+_.sn+" of ["+i.startSN+" ,"+i.endSN+"],track "+g),this.state=$e.KEY_LOADING,n.trigger(Dt.a.KEY_LOADING,{frag:_});else{if(Pt.b.log("Loading "+_.sn+", cc: "+_.cc+" of ["+i.startSN+" ,"+i.endSN+"],track "+g+", currentTime:"+t+",bufferEnd:"+d.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,_.loadCounter){_.loadCounter++;var k=r.fragLoadingLoopThreshold;if(_.loadCounter>k&&Math.abs(this.fragLoadIdx-_.loadIdx)<k)return void n.trigger(Dt.a.ERROR,{type:Ot.b.MEDIA_ERROR,details:Ot.a.FRAG_LOOP_LOADING_ERROR,fatal:!1,frag:_})}else _.loadCounter=1;_.loadIdx=this.fragLoadIdx,this.fragCurrent=_,this.startFragRequested=!0,isNaN(_.sn)||(this.nextLoadPosition=_.start+_.duration),n.trigger(Dt.a.FRAG_LOADING,{frag:_}),this.state=$e.FRAG_LOADING}}break;case $e.WAITING_TRACK:e=this.tracks[this.trackId],e&&e.details&&(this.state=$e.IDLE);break;case $e.FRAG_LOADING_WAITING_RETRY:var w=performance.now(),C=this.retryDate;o=this.media;var I=o&&o.seeking;(!C||w>=C||I)&&(Pt.b.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=$e.IDLE);break;case $e.WAITING_INIT_PTS:var D=this.videoTrackCC;if(void 0===this.initPTS[D])break;var O=this.waitingFragment;if(O){var P=O.frag.cc;D!==P?(e=this.tracks[this.trackId],e.details&&e.details.live&&(Pt.b.warn("Waiting fragment CC ("+P+") does not match video track CC ("+D+")"),this.waitingFragment=null,this.state=$e.IDLE)):(this.state=$e.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=$e.IDLE;break;case $e.STOPPED:case $e.FRAG_LOADING:case $e.PARSING:case $e.PARSED:case $e.ENDED:}},e.prototype.onMediaAttached=function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("ended",this.onvended);var i=this.config;this.tracks&&i.autoStartLoad&&this.startLoad(i.startPosition)},e.prototype.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(Pt.b.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var e=this.tracks;e&&e.forEach(function(t){t.details&&t.details.fragments.forEach(function(t){t.loadCounter=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.stopLoad()},e.prototype.onMediaSeeking=function(){this.state===$e.ENDED&&(this.state=$e.IDLE),this.media&&(this.lastCurrentTime=this.media.currentTime),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.tick()},e.prototype.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},e.prototype.onAudioTracksUpdated=function(t){Pt.b.log("audio tracks updated"),this.tracks=t.audioTracks},e.prototype.onAudioTrackSwitching=function(t){var e=!!t.url;this.trackId=t.id,this.fragCurrent=null,this.state=$e.PAUSED,this.waitingFragment=null,e?this.timer||(this.timer=setInterval(this.ontick,100)):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),e&&(this.audioSwitch=!0,this.state=$e.IDLE,void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold)),this.tick()},e.prototype.onAudioTrackLoaded=function(t){var e=t.details,i=t.id,n=this.tracks[i],r=e.totalduration,a=0;if(Pt.b.log("track "+i+" loaded ["+e.startSN+","+e.endSN+"],duration:"+r),e.live){var o=n.details;o&&e.fragments.length>0?(E(o,e),a=e.fragments[0].start,e.PTSKnown?Pt.b.log("live audio playlist sliding:"+a.toFixed(3)):Pt.b.log("live audio playlist - outdated PTS, unknown sliding")):(e.PTSKnown=!1,Pt.b.log("live audio playlist - first load, unknown sliding"))}else e.PTSKnown=!1;if(n.details=e,!this.startFragRequested){if(-1===this.startPosition){var s=e.startTimeOffset;isNaN(s)?this.startPosition=0:(Pt.b.log("start time offset found in playlist, adjust startPosition to "+s),this.startPosition=s)}this.nextLoadPosition=this.startPosition}this.state===$e.WAITING_TRACK&&(this.state=$e.IDLE),this.tick()},e.prototype.onKeyLoaded=function(){this.state===$e.KEY_LOADING&&(this.state=$e.IDLE,this.tick())},e.prototype.onFragLoaded=function(t){var e=this.fragCurrent,i=t.frag;if(this.state===$e.FRAG_LOADING&&e&&"audio"===i.type&&i.level===e.level&&i.sn===e.sn){var n=this.tracks[this.trackId],r=n.details,a=r.totalduration,o=e.level,s=e.sn,l=e.cc,u=this.config.defaultAudioCodec||n.audioCodec||"mp4a.40.2",c=this.stats=t.stats;if("initSegment"===s)this.state=$e.IDLE,c.tparsed=c.tbuffered=performance.now(),r.initSegment.data=t.payload,this.hls.trigger(Dt.a.FRAG_BUFFERED,{stats:c,frag:e,id:"audio"}),this.tick();else{this.state=$e.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new he(this.hls,"audio"));var d=this.initPTS[l],h=r.initSegment?r.initSegment.data:[];if(r.initSegment||void 0!==d){this.pendingBuffering=!0,Pt.b.log("Demuxing "+s+" of ["+r.startSN+" ,"+r.endSN+"],track "+o);this.demuxer.push(t.payload,h,u,null,e,a,!1,d)}else Pt.b.log("unknown video PTS for continuity counter "+l+", waiting for video PTS before demuxing audio frag "+s+" of ["+r.startSN+" ,"+r.endSN+"],track "+o),this.waitingFragment=t,this.state=$e.WAITING_INIT_PTS}}this.fragLoadError=0},e.prototype.onFragParsingInitSegment=function(t){var e=this.fragCurrent,i=t.frag;if(e&&"audio"===t.id&&i.sn===e.sn&&i.level===e.level&&this.state===$e.PARSING){var n=t.tracks,r=void 0;if(n.video&&delete n.video,r=n.audio){r.levelCodec=r.codec,r.id=t.id,this.hls.trigger(Dt.a.BUFFER_CODECS,n),Pt.b.log("audio track:audio,container:"+r.container+",codecs[level/parsed]=["+r.levelCodec+"/"+r.codec+"]");var a=r.initSegment;if(a){var o={type:"audio",data:a,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[o]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(Dt.a.BUFFER_APPENDING,o))}this.tick()}}},e.prototype.onFragParsingData=function(t){var e=this,i=this.fragCurrent,n=t.frag;if(i&&"audio"===t.id&&"audio"===t.type&&n.sn===i.sn&&n.level===i.level&&this.state===$e.PARSING){var r=this.trackId,a=this.tracks[r],o=this.hls;isNaN(t.endPTS)&&(t.endPTS=t.startPTS+i.duration,t.endDTS=t.startDTS+i.duration),Pt.b.log("parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb),_(a.details,i,t.startPTS,t.endPTS);var s=this.audioSwitch,l=this.media,u=!1;if(s&&l)if(l.readyState){var c=l.currentTime;Pt.b.log("switching audio track : currentTime:"+c),c>=t.startPTS&&(Pt.b.log("switching audio track : flushing all audio"),this.state=$e.BUFFER_FLUSHING,o.trigger(Dt.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),u=!0,this.audioSwitch=!1,o.trigger(Dt.a.AUDIO_TRACK_SWITCHED,{id:r}))}else this.audioSwitch=!1,o.trigger(Dt.a.AUDIO_TRACK_SWITCHED,{id:r});var d=this.pendingData;this.audioSwitch||([t.data1,t.data2].forEach(function(e){e&&e.length&&d.push({type:t.type,data:e,parent:"audio",content:"data"})}),!u&&d.length&&(d.forEach(function(t){e.state===$e.PARSING&&(e.pendingBuffering=!0,e.hls.trigger(Dt.a.BUFFER_APPENDING,t))}),this.pendingData=[],this.appended=!0)),this.tick()}},e.prototype.onFragParsed=function(t){var e=this.fragCurrent,i=t.frag;e&&"audio"===t.id&&i.sn===e.sn&&i.level===e.level&&this.state===$e.PARSING&&(this.stats.tparsed=performance.now(),this.state=$e.PARSED,this._checkAppendedParsed())},e.prototype.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},e.prototype.onBufferCreated=function(t){var e=t.tracks.audio;e&&(this.mediaBuffer=e.buffer,this.loadedmetadata=!0),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},e.prototype.onBufferAppended=function(t){if("audio"===t.parent){var e=this.state;e!==$e.PARSING&&e!==$e.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},e.prototype._checkAppendedParsed=function(){if(!(this.state!==$e.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent,e=this.stats,i=this.hls;if(t){this.fragPrevious=t,e.tbuffered=performance.now(),i.trigger(Dt.a.FRAG_BUFFERED,{stats:e,frag:t,id:"audio"});var n=this.mediaBuffer?this.mediaBuffer:this.media;Pt.b.log("audio buffered : "+pe.toString(n.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,i.trigger(Dt.a.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=$e.IDLE}this.tick()}},e.prototype.onError=function(t){var e=t.frag;if(!e||"audio"===e.type)switch(t.details){case Ot.a.FRAG_LOAD_ERROR:case Ot.a.FRAG_LOAD_TIMEOUT:if(!t.fatal){var i=this.fragLoadError;i?i++:i=1;var n=this.config;if(i<=n.fragLoadingMaxRetry){this.fragLoadError=i,e.loadCounter=0;var r=Math.min(Math.pow(2,i-1)*n.fragLoadingRetryDelay,n.fragLoadingMaxRetryTimeout);Pt.b.warn("audioStreamController: frag loading failed, retry in "+r+" ms"),this.retryDate=performance.now()+r,this.state=$e.FRAG_LOADING_WAITING_RETRY}else Pt.b.error("audioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=$e.ERROR}break;case Ot.a.FRAG_LOOP_LOADING_ERROR:case Ot.a.AUDIO_TRACK_LOAD_ERROR:case Ot.a.AUDIO_TRACK_LOAD_TIMEOUT:case Ot.a.KEY_LOAD_ERROR:case Ot.a.KEY_LOAD_TIMEOUT:this.state!==$e.ERROR&&(this.state=t.fatal?$e.ERROR:$e.IDLE,Pt.b.warn("audioStreamController: "+t.details+" while loading frag,switch to "+this.state+" state ..."));break;case Ot.a.BUFFER_FULL_ERROR:if("audio"===t.parent&&(this.state===$e.PARSING||this.state===$e.PARSED)){var a=this.mediaBuffer,o=this.media.currentTime;if(a&&re.isBuffered(a,o)&&re.isBuffered(a,o+.5)){var s=this.config;s.maxMaxBufferLength>=s.maxBufferLength&&(s.maxMaxBufferLength/=2,Pt.b.warn("audio:reduce max buffer length to "+s.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*s.fragLoadingLoopThreshold),this.state=$e.IDLE}else Pt.b.warn("buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=$e.BUFFER_FLUSHING,this.hls.trigger(Dt.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}}},e.prototype.onBufferFlushed=function(){var t=this,e=this.pendingData;e&&e.length?(Pt.b.log("appending pending audio data on Buffer Flushed"),e.forEach(function(e){t.hls.trigger(Dt.a.BUFFER_APPENDING,e)}),this.appended=!0,this.pendingData=[],this.state=$e.PARSED):(this.state=$e.IDLE,this.fragPrevious=null,this.tick())},He(e,[{key:"state",set:function(t){if(this.state!==t){var e=this.state;this._state=t,Pt.b.log("audio stream:"+e+"->"+t)}},get:function(){return this._state}}]),e}(Mt),We=ze,qe=function(){function t(t){return"string"==typeof t&&(!!a[t.toLowerCase()]&&t.toLowerCase())}function e(t){return"string"==typeof t&&(!!o[t.toLowerCase()]&&t.toLowerCase())}function i(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)t[n]=i[n]}return t}function n(n,a,o){var s=this,l=function(){if("undefined"!=typeof navigator)return/MSIE\s8\.0/.test(navigator.userAgent)}(),u={};l?s=document.createElement("custom"):u.enumerable=!0,s.hasBeenReset=!1;var c="",d=!1,h=n,f=a,p=o,g=null,y="",m=!0,v="auto",b="start",_=50,E="middle",T=50,A="middle";if(Object.defineProperty(s,"id",i({},u,{get:function(){return c},set:function(t){c=""+t}})),Object.defineProperty(s,"pauseOnExit",i({},u,{get:function(){return d},set:function(t){d=!!t}})),Object.defineProperty(s,"startTime",i({},u,{get:function(){return h},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");h=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"endTime",i({},u,{get:function(){return f},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");f=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"text",i({},u,{get:function(){return p},set:function(t){p=""+t,this.hasBeenReset=!0}})),Object.defineProperty(s,"region",i({},u,{get:function(){return g},set:function(t){g=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"vertical",i({},u,{get:function(){return y},set:function(e){var i=t(e);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");y=i,this.hasBeenReset=!0}})),Object.defineProperty(s,"snapToLines",i({},u,{get:function(){return m},set:function(t){m=!!t,this.hasBeenReset=!0}})),Object.defineProperty(s,"line",i({},u,{get:function(){return v},set:function(t){if("number"!=typeof t&&t!==r)throw new SyntaxError("An invalid number or illegal string was specified.");v=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"lineAlign",i({},u,{get:function(){return b},set:function(t){var i=e(t);if(!i)throw new SyntaxError("An invalid or illegal string was specified.");b=i,this.hasBeenReset=!0}})),Object.defineProperty(s,"position",i({},u,{get:function(){return _},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",i({},u,{get:function(){return E},set:function(t){var i=e(t);if(!i)throw new SyntaxError("An invalid or illegal string was specified.");E=i,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",i({},u,{get:function(){return T},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",i({},u,{get:function(){return A},set:function(t){var i=e(t);if(!i)throw new SyntaxError("An invalid or illegal string was specified.");A=i,this.hasBeenReset=!0}})),s.displayState=void 0,l)return s}if("undefined"!=typeof window&&window.VTTCue)return window.VTTCue;var r="auto",a={"":!0,lr:!0,rl:!0},o={start:!0,middle:!0,end:!0,left:!0,right:!0};return n.prototype.getCueAsHTML=function(){return window.WebVTT.convertCueToDOMTree(window,this.text)},n}(),Xe=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}};st.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,i){return i?this.has(t)?this.values[t]:e[i]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,i){for(var n=0;n<i.length;++n)if(e===i[n]){this.set(t,e);break}},integer:function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},percent:function(t,e){return!!(e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e))>=0&&e<=100)&&(this.set(t,e),!0)}};var Ze=new qe(0,0,0),Je="middle"===Ze.align?"middle":"center";at.prototype={parse:function(t){function e(){var t=i.buffer,e=0;for(t=ct(t);e<t.length&&"\r"!==t[e]&&"\n"!==t[e];)++e;var n=t.substr(0,e);return"\r"===t[e]&&++e,"\n"===t[e]&&++e,i.buffer=t.substr(e),n}var i=this;t&&(i.buffer+=i.decoder.decode(t,{stream:!0}));try{var n;if("INITIAL"===i.state){if(!/\r\n|\n/.test(i.buffer))return this;n=e();var r=n.match(/^()?WEBVTT([ \t].*)?$/);if(!r||!r[0])throw new Error("Malformed WebVTT signature.");i.state="HEADER"}for(var a=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(a?a=!1:n=e(),i.state){case"HEADER":/:/.test(n)?function(t){lt(t,function(t,e){switch(t){case"Region":console.log("parse region",e)}},/:/)}(n):n||(i.state="ID");continue;case"NOTE":n||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){i.state="NOTE";break}if(!n)continue;if(i.cue=new qe(0,0,""),i.state="CUE",-1===n.indexOf("--\x3e")){i.cue.id=n;continue}case"CUE":try{ut(n,i.cue,i.regionList)}catch(t){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var o=-1!==n.indexOf("--\x3e");if(!n||o&&(a=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+="\n"),i.cue.text+=n;continue;case"BADCUE":n||(i.state="ID");continue}}}catch(t){"CUETEXT"===i.state&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state="INITIAL"===i.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),(t.cue||"HEADER"===t.state)&&(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state)throw new Error("Malformed WebVTT signature.")}catch(t){throw t}return t.onflush&&t.onflush(),this}};var Qe=at,ti={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},ei=function(t){var e=t;return ti.hasOwnProperty(t)&&(e=ti[t]),String.fromCharCode(e)},ii=15,ni=100,ri={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},ai={17:2,18:4,21:6,22:8,23:10,19:13,20:15},oi={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},si={25:2,26:4,29:6,30:8,31:10,27:13,28:15},li=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],ui={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(t){this.time=t},log:function(t,e){var i=this.verboseFilter[t];this.verboseLevel>=i&&console.log(this.time+" ["+t+"] "+e)}},ci=function(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i].toString(16));return e},di=function(){function t(e,i,n,r,a){ht(this,t),this.foreground=e||"white",this.underline=i||!1,this.italics=n||!1,this.background=r||"black",this.flash=a||!1}return t.prototype.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},t.prototype.setStyles=function(t){for(var e=["foreground","underline","italics","background","flash"],i=0;i<e.length;i++){var n=e[i];t.hasOwnProperty(n)&&(this[n]=t[n])}},t.prototype.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},t.prototype.equals=function(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash},t.prototype.copy=function(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash},t.prototype.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},t}(),hi=function(){function t(e,i,n,r,a,o){ht(this,t),this.uchar=e||" ",this.penState=new di(i,n,r,a,o)}return t.prototype.reset=function(){this.uchar=" ",this.penState.reset()},t.prototype.setChar=function(t,e){this.uchar=t,this.penState.copy(e)},t.prototype.setPenState=function(t){this.penState.copy(t)},t.prototype.equals=function(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)},t.prototype.copy=function(t){this.uchar=t.uchar,this.penState.copy(t.penState)},t.prototype.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},t}(),fi=function(){function t(){ht(this,t),this.chars=[];for(var e=0;e<ni;e++)this.chars.push(new hi);this.pos=0,this.currPenState=new di}return t.prototype.equals=function(t){for(var e=!0,i=0;i<ni;i++)if(!this.chars[i].equals(t.chars[i])){e=!1;break}return e},t.prototype.copy=function(t){for(var e=0;e<ni;e++)this.chars[e].copy(t.chars[e])},t.prototype.isEmpty=function(){for(var t=!0,e=0;e<ni;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t},t.prototype.setCursor=function(t){this.pos!==t&&(this.pos=t),this.pos<0?(ui.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>ni&&(ui.log("ERROR","Too large cursor position "+this.pos),this.pos=ni)},t.prototype.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var i=this.pos+1;i<e+1;i++)this.chars[i].setPenState(this.currPenState);this.setCursor(e)},t.prototype.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},t.prototype.insertChar=function(t){t>=144&&this.backSpace();var e=ei(t);if(this.pos>=ni)return void ui.log("ERROR","Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!");this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1)},t.prototype.clearFromPos=function(t){var e;for(e=t;e<ni;e++)this.chars[e].reset()},t.prototype.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},t.prototype.clearToEndOfRow=function(){this.clearFromPos(this.pos)},t.prototype.getTextString=function(){for(var t=[],e=!0,i=0;i<ni;i++){var n=this.chars[i].uchar;" "!==n&&(e=!1),t.push(n)}return e?"":t.join("")},t.prototype.setPenStyles=function(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)},t}(),pi=function(){function t(){ht(this,t),this.rows=[];for(var e=0;e<ii;e++)this.rows.push(new fi);this.currRow=ii-1,this.nrRollUpRows=null,this.reset()}return t.prototype.reset=function(){for(var t=0;t<ii;t++)this.rows[t].clear();this.currRow=ii-1},t.prototype.equals=function(t){for(var e=!0,i=0;i<ii;i++)if(!this.rows[i].equals(t.rows[i])){e=!1;break}return e},t.prototype.copy=function(t){for(var e=0;e<ii;e++)this.rows[e].copy(t.rows[e])},t.prototype.isEmpty=function(){for(var t=!0,e=0;e<ii;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t},t.prototype.backSpace=function(){this.rows[this.currRow].backSpace()},t.prototype.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},t.prototype.insertChar=function(t){this.rows[this.currRow].insertChar(t)},t.prototype.setPen=function(t){this.rows[this.currRow].setPenStyles(t)},t.prototype.moveCursor=function(t){this.rows[this.currRow].moveCursor(t)},t.prototype.setCursor=function(t){ui.log("INFO","setCursor: "+t),this.rows[this.currRow].setCursor(t)},t.prototype.setPAC=function(t){ui.log("INFO","pacData = "+JSON.stringify(t));var e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(var i=0;i<ii;i++)this.rows[i].clear();var n=this.currRow+1-this.nrRollUpRows,r=this.lastOutputScreen;if(r){var a=r.rows[n].cueStartTime;if(a&&a<ui.time)for(var o=0;o<this.nrRollUpRows;o++)this.rows[e-this.nrRollUpRows+o+1].copy(r.rows[n+o])}}this.currRow=e;var s=this.rows[this.currRow];if(null!==t.indent){var l=t.indent,u=Math.max(l-1,0);s.setCursor(t.indent),t.color=s.chars[u].penState.foreground}var c={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(c)},t.prototype.setBkgData=function(t){ui.log("INFO","bkgData = "+JSON.stringify(t)),this.backSpace(),this.setPen(t),this.insertChar(32)},t.prototype.setRollUpRows=function(t){this.nrRollUpRows=t},t.prototype.rollUp=function(){if(null===this.nrRollUpRows)return void ui.log("DEBUG","roll_up but nrRollUpRows not set yet");ui.log("TEXT",this.getDisplayText());var t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),ui.log("INFO","Rolling up")},t.prototype.getDisplayText=function(t){t=t||!1;for(var e=[],i="",n=-1,r=0;r<ii;r++){var a=this.rows[r].getTextString();a&&(n=r+1,t?e.push("Row "+n+": '"+a+"'"):e.push(a.trim()))}return e.length>0&&(i=t?"["+e.join(" | ")+"]":e.join("\n")),i},t.prototype.getTextAndFormat=function(){return this.rows},t}(),gi=function(){function t(e,i){ht(this,t),this.chNr=e,this.outputFilter=i,this.mode=null,this.verbose=0,this.displayedMemory=new pi,this.nonDisplayedMemory=new pi,this.lastOutputScreen=new pi,this.currRollUpRow=this.displayedMemory.rows[ii-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return t.prototype.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[ii-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},t.prototype.getHandler=function(){return this.outputFilter},t.prototype.setHandler=function(t){this.outputFilter=t},t.prototype.setPAC=function(t){this.writeScreen.setPAC(t)},t.prototype.setBkgData=function(t){this.writeScreen.setBkgData(t)},t.prototype.setMode=function(t){t!==this.mode&&(this.mode=t,ui.log("INFO","MODE="+t),"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=t)},t.prototype.insertChars=function(t){for(var e=0;e<t.length;e++)this.writeScreen.insertChar(t[e]);var i=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";ui.log("INFO",i+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(ui.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},t.prototype.ccRCL=function(){ui.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},t.prototype.ccBS=function(){ui.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},t.prototype.ccAOF=function(){},t.prototype.ccAON=function(){},t.prototype.ccDER=function(){ui.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},t.prototype.ccRU=function(t){ui.log("INFO","RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)},t.prototype.ccFON=function(){ui.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},t.prototype.ccRDC=function(){ui.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},t.prototype.ccTR=function(){ui.log("INFO","TR"),this.setMode("MODE_TEXT")},t.prototype.ccRTD=function(){ui.log("INFO","RTD"),this.setMode("MODE_TEXT")},t.prototype.ccEDM=function(){ui.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},t.prototype.ccCR=function(){ui.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},t.prototype.ccENM=function(){ui.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},t.prototype.ccEOC=function(){if(ui.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,ui.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},t.prototype.ccTO=function(t){ui.log("INFO","TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)},t.prototype.ccMIDROW=function(t){var e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{var i=Math.floor(t/2)-16,n=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=n[i]}ui.log("INFO","MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},t.prototype.outputDataUpdate=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=ui.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),!0===t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue()),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},t.prototype.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}(),yi=function(){function t(e,i,n){ht(this,t),this.field=e||1,this.outputs=[i,n],this.channels=[new gi(1,i),new gi(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 t.prototype.getHandler=function(t){return this.channels[t].getHandler()},t.prototype.setHandler=function(t,e){this.channels[t].setHandler(e)},t.prototype.addData=function(t,e){var i,n,r,a=!1;this.lastTime=t,ui.setTime(t);for(var o=0;o<e.length;o+=2)if(n=127&e[o],r=127&e[o+1],0!==n||0!==r){if(ui.log("DATA","["+ci([e[o],e[o+1]])+"] -> ("+ci([n,r])+")"),i=this.parseCmd(n,r),i||(i=this.parseMidrow(n,r)),i||(i=this.parsePAC(n,r)),i||(i=this.parseBackgroundAttributes(n,r)),!i&&(a=this.parseChars(n,r)))if(this.currChNr&&this.currChNr>=0){var s=this.channels[this.currChNr-1];s.insertChars(a)}else ui.log("WARNING","No channel found yet. TEXT-MODE?");i?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,ui.log("WARNING","Couldn't parse cleaned data "+ci([n,r])+" orig: "+ci([e[o],e[o+1]])))}else this.dataCounters.padding+=2},t.prototype.parseCmd=function(t,e){var i=null,n=(20===t||28===t)&&32<=e&&e<=47,r=(23===t||31===t)&&33<=e&&e<=35;if(!n&&!r)return!1;if(t===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,ui.log("DEBUG","Repeated command ("+ci([t,e])+") is dropped"),!0;i=20===t||23===t?1:2;var a=this.channels[i-1];return 20===t||28===t?32===e?a.ccRCL():33===e?a.ccBS():34===e?a.ccAOF():35===e?a.ccAON():36===e?a.ccDER():37===e?a.ccRU(2):38===e?a.ccRU(3):39===e?a.ccRU(4):40===e?a.ccFON():41===e?a.ccRDC():42===e?a.ccTR():43===e?a.ccRTD():44===e?a.ccEDM():45===e?a.ccCR():46===e?a.ccENM():47===e&&a.ccEOC():a.ccTO(e-32),this.lastCmdA=t,this.lastCmdB=e,this.currChNr=i,!0},t.prototype.parseMidrow=function(t,e){var i=null;if((17===t||25===t)&&32<=e&&e<=47){if((i=17===t?1:2)!==this.currChNr)return ui.log("ERROR","Mismatch channel in midrow parsing"),!1;return this.channels[i-1].ccMIDROW(e),ui.log("DEBUG","MIDROW ("+ci([t,e])+")"),!0}return!1},t.prototype.parsePAC=function(t,e){var i=null,n=null,r=(17<=t&&t<=23||25<=t&&t<=31)&&64<=e&&e<=127,a=(16===t||24===t)&&64<=e&&e<=95;if(!r&&!a)return!1;if(t===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;i=t<=23?1:2,n=64<=e&&e<=95?1===i?ri[t]:oi[t]:1===i?ai[t]:si[t];var o=this.interpretPAC(n,e);return this.channels[i-1].setPAC(o),this.lastCmdA=t,this.lastCmdB=e,this.currChNr=i,!0},t.prototype.interpretPAC=function(t,e){var i=e,n={color:null,italics:!1,indent:null,underline:!1,row:t};return i=e>95?e-96:e-64,n.underline=1==(1&i),i<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((i-16)/2),n},t.prototype.parseChars=function(t,e){var i=null,n=null,r=null;if(t>=25?(i=2,r=t-8):(i=1,r=t),17<=r&&r<=19){var a=e;a=17===r?e+80:18===r?e+112:e+144,ui.log("INFO","Special char '"+ei(a)+"' in channel "+i),n=[a]}else 32<=t&&t<=127&&(n=0===e?[t]:[t,e]);if(n){var o=ci(n);ui.log("DEBUG","Char codes = "+o.join(",")),this.lastCmdA=null,this.lastCmdB=null}return n},t.prototype.parseBackgroundAttributes=function(t,e){var i,n,r,a,o=(16===t||24===t)&&32<=e&&e<=47,s=(23===t||31===t)&&45<=e&&e<=47;return!(!o&&!s)&&(i={},16===t||24===t?(n=Math.floor((e-32)/2),i.background=li[n],e%2==1&&(i.background=i.background+"_semi")):45===e?i.background="transparent":(i.foreground="black",47===e&&(i.underline=!0)),r=t<24?1:2,a=this.channels[r-1],a.setBkgData(i),this.lastCmdA=null,this.lastCmdB=null,!0)},t.prototype.reset=function(){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].reset();this.lastCmdA=null,this.lastCmdB=null},t.prototype.cueSplitAtTime=function(t){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].cueSplitAtTime(t)},t}(),mi=yi,vi=function(){function t(e,i){ft(this,t),this.timelineController=e,this.track=i,this.startTime=null,this.endTime=null,this.screen=null}return t.prototype.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues("textTrack"+this.track,this.startTime,this.endTime,this.screen),this.startTime=null)},t.prototype.newCue=function(t,e,i){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=i,this.timelineController.createCaptionsTrack(this.track)},t}(),bi=vi,_i=function(t,e,i){return t.substr(i||0,e.length)===e},Ei=function(t){var e=parseInt(t.substr(-3)),i=parseInt(t.substr(-6,2)),n=parseInt(t.substr(-9,2)),r=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;return isNaN(e)||isNaN(i)||isNaN(n)||isNaN(r)?-1:(e+=1e3*i,e+=6e4*n,e+=36e5*r)},Ti=function(t){for(var e=5381,i=t.length;i;)e=33*e^t.charCodeAt(--i);return(e>>>0).toString()},Ai=function(t,e,i){var n=t[e],r=t[n.prevCC];if(!r||!r.new&&n.new)return t.ccOffset=t.presentationOffset=n.start,void(n.new=!1);for(;r&&r.new;)t.ccOffset+=n.start-r.start,n.new=!1,n=r,r=t[n.prevCC];t.presentationOffset=i},Si={parse:function(t,e,i,n,r,a){var o=/\r\n|\n\r|\n|\r/g,s=Object(Te.b)(new Uint8Array(t)).trim().replace(o,"\n").split("\n"),l="00:00.000",u=0,c=0,d=0,h=[],f=void 0,p=!0,g=new Qe;g.oncue=function(t){var e=i[n],r=i.ccOffset;e&&e.new&&(void 0!==c?r=i.ccOffset=e.start:Ai(i,n,d)),d&&(r=d+i.ccOffset-i.presentationOffset),t.startTime+=r-c,t.endTime+=r-c,t.id=Ti(t.startTime.toString())+Ti(t.endTime.toString())+Ti(t.text),t.text=decodeURIComponent(encodeURIComponent(t.text)),t.endTime>0&&h.push(t)},g.onparsingerror=function(t){f=t},g.onflush=function(){if(f&&a)return void a(f);r(h)},s.forEach(function(t){if(p){if(_i(t,"X-TIMESTAMP-MAP=")){p=!1,t.substr(16).split(",").forEach(function(t){_i(t,"LOCAL:")?l=t.substr(6):_i(t,"MPEGTS:")&&(u=parseInt(t.substr(7)))});try{e=e<0?e+8589934592:e,u-=e,c=Ei(l)/1e3,d=u/9e4,-1===c&&(f=new Error("Malformed X-TIMESTAMP-MAP: "+t))}catch(e){f=new Error("Malformed X-TIMESTAMP-MAP: "+t)}return}""===t&&(p=!1)}g.parse(t+"\n")}),g.flush()}},Li=Si,Ri=function(t){function e(i){pt(this,e);var n=gt(this,t.call(this,i,Dt.a.MEDIA_ATTACHING,Dt.a.MEDIA_DETACHING,Dt.a.FRAG_PARSING_USERDATA,Dt.a.FRAG_DECRYPTED,Dt.a.MANIFEST_LOADING,Dt.a.MANIFEST_LOADED,Dt.a.FRAG_LOADED,Dt.a.LEVEL_SWITCHING,Dt.a.INIT_PTS_FOUND));if(n.hls=i,n.config=i.config,n.enabled=!0,n.Cues=i.config.cueHandler,n.textTracks=[],n.tracks=[],n.unparsedVttFrags=[],n.initPTS=void 0,n.cueRanges=[],n.config.enableCEA708Captions){var r=new bi(n,1),a=new bi(n,2);n.cea608Parser=new mi(0,r,a)}return n}return yt(e,t),e.prototype.addCues=function(t,e,i,n){for(var r=this.cueRanges,a=!1,o=r.length;o--;){var s=r[o],l=bt(s[0],s[1],e,i);if(l>=0&&(s[0]=Math.min(s[0],e),s[1]=Math.max(s[1],i),a=!0,l/(i-e)>.5))return}a||r.push([e,i]),this.Cues.newCue(this[t],e,i,n)},e.prototype.onInitPtsFound=function(t){var e=this;void 0===this.initPTS&&(this.initPTS=t.initPTS),this.unparsedVttFrags.length&&(this.unparsedVttFrags.forEach(function(t){e.onFragLoaded(t)}),this.unparsedVttFrags=[])},e.prototype.getExistingTrack=function(t){var e=this.media;if(e)for(var i=0;i<e.textTracks.length;i++){var n=e.textTracks[i],r="textTrack"+t;if(!0===n[r])return n}return null},e.prototype.sendAddTrackEvent=function(t,e){var i=null;try{i=new window.Event("addtrack")}catch(t){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=t,e.dispatchEvent(i)},e.prototype.createCaptionsTrack=function(t){var e="textTrack"+t;if(!this[e]){var i=this.getExistingTrack(t);if(i)this[e]=i,mt(this[e]),this.sendAddTrackEvent(this[e],this.media);else{var n=this.createTextTrack("captions",this.config["captionsTextTrack"+t+"Label"],this.config.captionsTextTrack1LanguageCode);n&&(n[e]=!0,this[e]=n)}}},e.prototype.createTextTrack=function(t,e,i){var n=this.media;if(n)return n.addTextTrack(t,e,i)},e.prototype.destroy=function(){Mt.prototype.destroy.call(this)},e.prototype.onMediaAttaching=function(t){this.media=t.media,this._cleanTracks()},e.prototype.onMediaDetaching=function(){mt(this.textTrack1),mt(this.textTrack2)},e.prototype.onManifestLoading=function(){this.lastSn=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0},this._cleanTracks()},e.prototype._cleanTracks=function(){var t=this.media;if(t){var e=t.textTracks;if(e)for(var i=0;i<e.length;i++)mt(e[i])}},e.prototype.onManifestLoaded=function(t){var e=this;if(this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=void 0,this.cueRanges=[],this.config.enableWebVTT){this.tracks=t.subtitles||[];var i=this.media?this.media.textTracks:[];this.tracks.forEach(function(t,n){var r=void 0;if(n<i.length){var a=i[n];vt(a,t)&&(r=a)}r||(r=e.createTextTrack("subtitles",t.name,t.lang)),r.mode=t.default?"showing":"hidden",e.textTracks.push(r)})}},e.prototype.onLevelSwitching=function(){this.enabled="NONE"!==this.hls.currentLevel.closedCaptions},e.prototype.onFragLoaded=function(t){var e=t.frag,i=t.payload;if("main"===e.type){var n=e.sn;if(n!==this.lastSn+1){var r=this.cea608Parser;r&&r.reset()}this.lastSn=n}else if("subtitle"===e.type)if(i.byteLength){if(void 0===this.initPTS)return void this.unparsedVttFrags.push(t);var a=e.decryptdata;null!=a&&null!=a.key&&"AES-128"===a.method||this._parseVTTs(e,i)}else this.hls.trigger(Dt.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e})},e.prototype._parseVTTs=function(t,e){var i=this.vttCCs;i[t.cc]||(i[t.cc]={start:t.start,prevCC:this.prevCC,new:!0},this.prevCC=t.cc);var n=this.textTracks,r=this.hls;Li.parse(e,this.initPTS,i,t.cc,function(e){var i=n[t.trackId];e.forEach(function(t){if(!i.cues.getCueById(t.id))try{i.addCue(t)}catch(n){var e=new window.TextTrackCue(t.startTime,t.endTime,t.text);e.id=t.id,i.addCue(e)}}),r.trigger(Dt.a.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(e){Pt.b.log("Failed to parse VTT cue: "+e),r.trigger(Dt.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t})})},e.prototype.onFragDecrypted=function(t){var e=t.payload,i=t.frag;if("subtitle"===i.type){if(void 0===this.initPTS)return void this.unparsedVttFrags.push(t);this._parseVTTs(i,e)}},e.prototype.onFragParsingUserdata=function(t){if(this.enabled&&this.config.enableCEA708Captions)for(var e=0;e<t.samples.length;e++){var i=this.extractCea608Data(t.samples[e].bytes);this.cea608Parser.addData(t.samples[e].pts,i)}},e.prototype.extractCea608Data=function(t){for(var e,i,n,r,a,o=31&t[0],s=2,l=[],u=0;u<o;u++)e=t[s++],i=127&t[s++],n=127&t[s++],r=0!=(4&e),a=3&e,0===i&&0===n||r&&0===a&&(l.push(i),l.push(n));return l},e}(Mt),ki=Ri,wi=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),Ci=function(t){function e(i){_t(this,e);var n=Et(this,t.call(this,i,Dt.a.MEDIA_ATTACHED,Dt.a.MEDIA_DETACHING,Dt.a.MANIFEST_LOADING,Dt.a.MANIFEST_LOADED,Dt.a.SUBTITLE_TRACK_LOADED));return n.tracks=[],n.trackId=-1,n.media=void 0,n.subtitleDisplay=!1,n}return Tt(e,t),e.prototype._onTextTracksChanged=function(){if(this.media){for(var t=-1,e=At(this.media.textTracks),i=0;i<e.length;i++)"showing"===e[i].mode&&(t=i);this.subtitleTrack=t}},e.prototype.destroy=function(){Mt.prototype.destroy.call(this)},e.prototype.onMediaAttached=function(t){var e=this;this.media=t.media,this.media&&(void 0!==this.queuedDefaultTrack&&(this.subtitleTrack=this.queuedDefaultTrack,delete this.queuedDefaultTrack),this.trackChangeListener=this._onTextTracksChanged.bind(this),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.subtitlePollingInterval=setInterval(function(){e.trackChangeListener()},500):this.media.textTracks.addEventListener("change",this.trackChangeListener))},e.prototype.onMediaDetaching=function(){this.media&&(this.useTextTrackPolling?clearInterval(this.subtitlePollingInterval):this.media.textTracks.removeEventListener("change",this.trackChangeListener),this.media=void 0)},e.prototype.onManifestLoading=function(){this.tracks=[],this.trackId=-1},e.prototype.onManifestLoaded=function(t){var e=this,i=t.subtitles||[];this.tracks=i,this.trackId=-1,this.hls.trigger(Dt.a.SUBTITLE_TRACKS_UPDATED,{subtitleTracks:i}),i.forEach(function(t){t.default&&(e.media?e.subtitleTrack=t.id:e.queuedDefaultTrack=t.id)})},e.prototype.onTick=function(){var t=this.trackId,e=this.tracks[t];if(e){var i=e.details;void 0!==i&&!0!==i.live||(Pt.b.log("(re)loading playlist for subtitle track "+t),this.hls.trigger(Dt.a.SUBTITLE_TRACK_LOADING,{url:e.url,id:t}))}},e.prototype.onSubtitleTrackLoaded=function(t){var e=this;t.id<this.tracks.length&&(Pt.b.log("subtitle track "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.timer&&(this.timer=setInterval(function(){e.onTick()},1e3*t.details.targetduration,this)),!t.details.live&&this.timer&&(clearInterval(this.timer),this.timer=null))},e.prototype.setSubtitleTrackInternal=function(t){if(!(t<-1||t>=this.tracks.length)){this.timer&&(clearInterval(this.timer),this.timer=null);var e=At(this.media.textTracks);if(-1!==this.trackId&&this.subtitleDisplay&&(e[this.trackId].mode="hidden"),this.trackId=t,Pt.b.log("switching to subtitle track "+t),this.hls.trigger(Dt.a.SUBTITLE_TRACK_SWITCH,{id:t}),-1!==t){var i=this.tracks[t];this.subtitleDisplay&&(e[t].mode="showing");var n=i.details;void 0!==n&&!0!==n.live||(Pt.b.log("(re)loading playlist for subtitle track "+t),this.hls.trigger(Dt.a.SUBTITLE_TRACK_LOADING,{url:i.url,id:t}))}}},wi(e,[{key:"subtitleTracks",get:function(){return this.tracks}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.trackId!==t&&this.setSubtitleTrackInternal(t)}}]),e}(Mt),Ii=Ci,Di=i(4),Oi={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING"},Pi=function(t){function e(i){St(this,e);var n=Lt(this,t.call(this,i,Dt.a.MEDIA_ATTACHED,Dt.a.ERROR,Dt.a.KEY_LOADED,Dt.a.FRAG_LOADED,Dt.a.SUBTITLE_TRACKS_UPDATED,Dt.a.SUBTITLE_TRACK_SWITCH,Dt.a.SUBTITLE_TRACK_LOADED,Dt.a.SUBTITLE_FRAG_PROCESSED));return n.config=i.config,n.vttFragSNsProcessed={},n.vttFragQueues=void 0,n.currentlyProcessing=null,n.state=Oi.STOPPED,n.currentTrackId=-1,n.ticks=0,n.decrypter=new Di.a(i.observer,i.config),n}return Rt(e,t),e.prototype.destroy=function(){Mt.prototype.destroy.call(this),this.state=Oi.STOPPED},e.prototype.clearVttFragQueues=function(){var t=this;this.vttFragQueues={},this.tracks.forEach(function(e){t.vttFragQueues[e.id]=[]})},e.prototype.nextFrag=function(){if(null===this.currentlyProcessing&&this.currentTrackId>-1&&this.vttFragQueues[this.currentTrackId].length){var t=this.currentlyProcessing=this.vttFragQueues[this.currentTrackId].shift();this.fragCurrent=t,this.hls.trigger(Dt.a.FRAG_LOADING,{frag:t}),this.state=Oi.FRAG_LOADING}},e.prototype.onSubtitleFragProcessed=function(t){t.success&&this.vttFragSNsProcessed[t.frag.trackId].push(t.frag.sn),this.currentlyProcessing=null,this.state=Oi.IDLE,this.nextFrag()},e.prototype.onMediaAttached=function(){this.state=Oi.IDLE},e.prototype.onError=function(t){var e=t.frag;e&&"subtitle"!==e.type||this.currentlyProcessing&&(this.currentlyProcessing=null,this.nextFrag())},e.prototype.tick=function(){var t=this;1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(function(){t.tick()},1),this.ticks=0)},e.prototype.doTick=function(){var t=this;switch(this.state){case Oi.IDLE:var e=this.tracks,i=this.currentTrackId,n=this.vttFragSNsProcessed[i],r=this.vttFragQueues[i],a=this.currentlyProcessing?this.currentlyProcessing.sn:-1,o=function(t){return n.indexOf(t.sn)>-1},s=function(t){return r.some(function(e){return e.sn===t.sn})};if(!e)break;var l;if(i<e.length&&(l=e[i].details),void 0===l)break;l.fragments.forEach(function(e){o(e)||e.sn===a||s(e)||(e.decryptdata&&null!=e.decryptdata.uri&&null==e.decryptdata.key?(Pt.b.log("Loading key for "+e.sn),t.state=Oi.KEY_LOADING,t.hls.trigger(Dt.a.KEY_LOADING,{frag:e})):(e.trackId=i,r.push(e),t.nextFrag()))})}},e.prototype.onSubtitleTracksUpdated=function(t){var e=this;Pt.b.log("subtitle tracks updated"),this.tracks=t.subtitleTracks,this.clearVttFragQueues(),this.vttFragSNsProcessed={},this.tracks.forEach(function(t){e.vttFragSNsProcessed[t.id]=[]})},e.prototype.onSubtitleTrackSwitch=function(t){this.currentTrackId=t.id,this.clearVttFragQueues()},e.prototype.onSubtitleTrackLoaded=function(){this.tick()},e.prototype.onKeyLoaded=function(){this.state===Oi.KEY_LOADING&&(this.state=Oi.IDLE,this.tick())},e.prototype.onFragLoaded=function(t){var e=this.fragCurrent,i=t.frag.decryptdata,n=t.frag,r=this.hls;if(this.state===Oi.FRAG_LOADING&&e&&"subtitle"===t.frag.type&&e.sn===t.frag.sn&&t.payload.byteLength>0&&null!=i&&null!=i.key&&"AES-128"===i.method){var a;try{a=performance.now()}catch(t){a=Date.now()}this.decrypter.decrypt(t.payload,i.key.buffer,i.iv.buffer,function(t){var e;try{e=performance.now()}catch(t){e=Date.now()}r.trigger(Dt.a.FRAG_DECRYPTED,{frag:n,payload:t,stats:{tstart:a,tdecrypt:e}})})}},e}(Mt),xi=Pi,Ni={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,maxBufferSize:6e7,maxBufferHole:.5,maxSeekHole:2,lowBufferWatchdogPeriod:.5,highBufferWatchdogPeriod:3,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,liveDurationInfinity:!1,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,fragLoadingLoopThreshold:3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:Ke,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,fetchSetup:void 0,abrController:De,bufferController:xe,capLevelController:Fe,fpsController:Ue,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0};Ni.subtitleStreamController=xi,Ni.subtitleTrackController=Ii,Ni.timelineController=ki,Ni.cueHandler=wt,Ni.enableCEA708Captions=!0,Ni.enableWebVTT=!0,Ni.captionsTextTrack1Label="English",Ni.captionsTextTrack1LanguageCode="en",Ni.captionsTextTrack2Label="Spanish",Ni.captionsTextTrack2LanguageCode="es",Ni.audioStreamController=We,Ni.audioTrackController=Ye;var Mi=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),Fi=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};kt(this,t);var n=t.DefaultConfig;if((i.liveSyncDurationCount||i.liveMaxLatencyDurationCount)&&(i.liveSyncDuration||i.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var r in n)r in i||(i[r]=n[r]);if(void 0!==i.liveMaxLatencyDurationCount&&i.liveMaxLatencyDurationCount<=i.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==i.liveMaxLatencyDuration&&(i.liveMaxLatencyDuration<=i.liveSyncDuration||void 0===i.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');Object(Pt.a)(i.debug),this.config=i,this._autoLevelCapping=-1;var a=this.observer=new se.a;a.trigger=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];a.emit.apply(a,[t,t].concat(i))},a.off=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];a.removeListener.apply(a,[t].concat(i))},this.on=a.on.bind(a),this.off=a.off.bind(a),this.trigger=a.trigger.bind(a);var o=this.abrController=new i.abrController(this),s=new i.bufferController(this),l=new i.capLevelController(this),u=new i.fpsController(this),c=new Xt(this),d=new Jt(this),h=new te(this),f=new Se(this),p=this.levelController=new Ee(this),g=this.streamController=new ve(this),y=[p,g],m=i.audioStreamController;m&&y.push(new m(this)),this.networkControllers=y;var v=[c,d,h,o,s,l,u,f];if(m=i.audioTrackController){var b=new m(this);this.audioTrackController=b,v.push(b)}if(m=i.subtitleTrackController){var _=new m(this);this.subtitleTrackController=_,v.push(_)}[i.subtitleStreamController,i.timelineController].forEach(function(t){t&&v.push(new t(e))}),this.coreComponents=v}return t.isSupported=function(){return F()},Mi(t,null,[{key:"version",get:function(){return"0.8.9"}},{key:"Events",get:function(){return Dt.a}},{key:"ErrorTypes",get:function(){return Ot.b}},{key:"ErrorDetails",get:function(){return Ot.a}},{key:"DefaultConfig",get:function(){return t.defaultConfig?t.defaultConfig:Ni},set:function(e){t.defaultConfig=e}}]),t.prototype.destroy=function(){Pt.b.log("destroy"),this.trigger(Dt.a.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach(function(t){t.destroy()}),this.url=null,this.observer.removeAllListeners(),this._autoLevelCapping=-1},t.prototype.attachMedia=function(t){Pt.b.log("attachMedia"),this.media=t,this.trigger(Dt.a.MEDIA_ATTACHING,{media:t})},t.prototype.detachMedia=function(){Pt.b.log("detachMedia"),this.trigger(Dt.a.MEDIA_DETACHING),this.media=null},t.prototype.loadSource=function(t){t=It.a.buildAbsoluteURL(window.location.href,t,{alwaysNormalize:!0}),Pt.b.log("loadSource:"+t),this.url=t,this.trigger(Dt.a.MANIFEST_LOADING,{url:t})},t.prototype.startLoad=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;Pt.b.log("startLoad("+t+")"),this.networkControllers.forEach(function(e){e.startLoad(t)})},t.prototype.stopLoad=function(){Pt.b.log("stopLoad"),this.networkControllers.forEach(function(t){t.stopLoad()})},t.prototype.swapAudioCodec=function(){Pt.b.log("swapAudioCodec"),this.streamController.swapAudioCodec()},t.prototype.recoverMediaError=function(){Pt.b.log("recoverMediaError");var t=this.media;this.detachMedia(),this.attachMedia(t)},Mi(t,[{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(t){Pt.b.log("set currentLevel:"+t),this.loadLevel=t,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(t){Pt.b.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){Pt.b.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){Pt.b.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){Pt.b.log("set startLevel:"+t);var e=this;-1!==t&&(t=Math.max(t,e.minAutoLevel)),e.levelController.startLevel=t}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(t){Pt.b.log("set autoLevelCapping:"+t),this._autoLevelCapping=t}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var t=this,e=t.levels,i=t.config.minAutoBitrate,n=e?e.length:0,r=0;r<n;r++){if((e[r].realBitrate?Math.max(e[r].realBitrate,e[r].bitrate):e[r].bitrate)>i)return r}return 0}},{key:"maxAutoLevel",get:function(){var t=this,e=t.levels,i=t.autoLevelCapping;return-1===i&&e&&e.length?e.length-1:i}},{key:"nextAutoLevel",get:function(){var t=this;return Math.min(Math.max(t.abrController.nextAutoLevel,t.minAutoLevel),t.maxAutoLevel)},set:function(t){var e=this;e.abrController.nextAutoLevel=Math.max(e.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}}]),t}();e.default=Fi},function(t,e,i){function n(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e.oe=function(t){throw console.error(t),t};var n=e(e.s=ENTRY_MODULE);return n.default||n}function r(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function a(t){var e=[],i=t.toString(),n=i.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);if(!n)return e;for(var a,o=n[1],s=new RegExp("(\\\\n|\\W)"+r(o)+"\\((/\\*.*?\\*/)?s?.*?([\\.|\\-|\\w|/|@]+).*?\\)","g");a=s.exec(i);)e.push(a[3]);return e}function o(t,e){for(var i=[e],n=[],r={};i.length;){var o=i.pop();if(!r[o]&&t[o]){r[o]=!0,n.push(o);var s=a(t[o]);i=i.concat(s)}}return n}t.exports=function(t,e){e=e||{};var r=i.m,a=e.all?Object.keys(r):o(r,t),s="("+n.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+a.map(function(t){return JSON.stringify(t)+": "+r[t].toString()}).join(",")+"})(self);",l=new window.Blob([s],{type:"text/javascript"});if(e.bare)return l;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,c=u.createObjectURL(l),d=new window.Worker(c);return d.objectURL=c,d}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(7),r=i(1),a=i(0),o=i(5),s=i.n(o),l=function(t){var e=new s.a;e.trigger=function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];e.emit.apply(e,[t,t].concat(n))},e.off=function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];e.removeListener.apply(e,[t].concat(n))};var i=function(e,i){t.postMessage({event:e,data:i})};t.addEventListener("message",function(r){var o=r.data;switch(o.cmd){case"init":var s=JSON.parse(o.config);t.demuxer=new n.a(e,o.typeSupported,s,o.vendor);try{Object(a.a)(!0===s.debug)}catch(t){console.warn("demuxerWorker: unable to enable logs")}i("init",null);break;case"demux":t.demuxer.push(o.data,o.decryptdata,o.initSegment,o.audioCodec,o.videoCodec,o.timeOffset,o.discontinuity,o.trackSwitch,o.contiguous,o.duration,o.accurateTimeOffset,o.defaultInitPTS)}}),e.on(r.a.FRAG_DECRYPTED,i),e.on(r.a.FRAG_PARSING_INIT_SEGMENT,i),e.on(r.a.FRAG_PARSED,i),e.on(r.a.ERROR,i),e.on(r.a.FRAG_PARSING_METADATA,i),e.on(r.a.FRAG_PARSING_USERDATA,i),e.on(r.a.INIT_PTS_FOUND,i),e.on(r.a.FRAG_PARSING_DATA,function(e,i){var n=[],r={event:e,data:i};i.data1&&(r.data1=i.data1.buffer,n.push(i.data1.buffer),delete i.data1),i.data2&&(r.data2=i.data2.buffer,n.push(i.data2.buffer),delete i.data2),t.postMessage(r,n)})};e.default=l}]).default})},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(9),f=n(h),p=i(4),g=n(p);i(183);var y=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n.el.src=i.src,n}return(0,d.default)(e,t),e.prototype.getPlaybackType=function(){return f.default.NO_OP},(0,u.default)(e,[{key:"name",get:function(){return"html_img"}},{key:"tagName",get:function(){return"img"}},{key:"attributes",get:function(){return{"data-html-img":""}}},{key:"events",get:function(){return{load:"_onLoad",abort:"_onError",error:"_onError"}}}]),e.prototype.render=function(){return this.trigger(g.default.PLAYBACK_READY,this.name),this},e.prototype._onLoad=function(){this.trigger(g.default.PLAYBACK_ENDED,this.name)},e.prototype._onError=function(t){var e="error"===t.type?"load error":"loading aborted";this.trigger(g.default.PLAYBACK_ERROR,{message:e},this.name)},e}(f.default);e.default=y,y.canPlay=function(t){return/\.(png|jpg|jpeg|gif|bmp|tiff|pgm|pnm|webp)(|\?.*)$/i.test(t)},t.exports=e.default},function(t,e,i){var n=i(184);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,"[data-html-img]{max-width:100%;max-height:100%}",""])},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(5),f=i(9),p=n(f),g=i(8),y=n(g),m=i(4),v=n(m),b=i(186),_=n(b);i(187);var E=function(t){function e(){(0,a.default)(this,e);for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];var o=(0,s.default)(this,t.call.apply(t,[this].concat(n)));return o._noiseFrameNum=-1,o._started=!1,o}return(0,d.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"no_op"}},{key:"template",get:function(){return(0,y.default)(_.default)}},{key:"attributes",get:function(){return{"data-no-op":""}}}]),e.prototype.render=function(){var t=this.options.playbackNotSupportedMessage||this.i18n.t("playback_not_supported");this.$el.html(this.template({message:t})),this.trigger(v.default.PLAYBACK_READY,this.name);var e=!(!this.options.poster||!this.options.poster.showForNoOp);return!this.options.autoPlay&&e||this.play(),this},e.prototype.play=function(){this._started||(this._started=!0,this.trigger(v.default.PLAYBACK_PLAY),this._animate())},e.prototype._noise=function(){if(this._noiseFrameNum=(this._noiseFrameNum+1)%5,!this._noiseFrameNum){var t=this.context.createImageData(this.context.canvas.width,this.context.canvas.height),e=void 0;try{e=new Uint32Array(t.data.buffer)}catch(r){e=new Uint32Array(this.context.canvas.width*this.context.canvas.height*4);for(var i=t.data,n=0;n<i.length;n++)e[n]=i[n]}for(var r=e.length,a=6*Math.random()+4,o=0,s=0,l=0;l<r;){if(o<0){o=a*Math.random();s=255*Math.pow(Math.random(),.4)<<24}o-=1,e[l++]=s}this.context.putImageData(t,0,0)}},e.prototype._loop=function(){var t=this;this._stop||(this._noise(),this._animationHandle=(0,h.requestAnimationFrame)(function(){return t._loop()}))},e.prototype.destroy=function(){this._animationHandle&&((0,h.cancelAnimationFrame)(this._animationHandle),this._stop=!0)},e.prototype._animate=function(){this.canvas=this.$el.find("canvas[data-no-op-canvas]")[0],this.context=this.canvas.getContext("2d"),this._loop()},e}(p.default);e.default=E,E.canPlay=function(t){return!0},t.exports=e.default},function(t,e){t.exports="<canvas data-no-op-canvas></canvas>\n<p data-no-op-msg><%=message%><p>\n"},function(t,e,i){var n=i(188);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,"[data-no-op]{position:absolute;height:100%;width:100%;text-align:center}[data-no-op] p[data-no-op-msg]{position:absolute;text-align:center;font-size:25px;left:0;right:0;color:#fff;padding:10px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);max-height:100%;overflow:auto}[data-no-op] canvas[data-no-op-canvas]{background-color:#777;height:100%;width:100%}",""])},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(190),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(36),f=n(h),p=i(4),g=n(p),y=i(8),m=n(y),v=i(191),b=n(v);i(192);var _=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n.template=(0,m.default)(b.default),n.showTimeout=null,n.listenTo(n.container,g.default.CONTAINER_STATE_BUFFERING,n.onBuffering),n.listenTo(n.container,g.default.CONTAINER_STATE_BUFFERFULL,n.onBufferFull),n.listenTo(n.container,g.default.CONTAINER_STOP,n.onStop),n.listenTo(n.container,g.default.CONTAINER_ENDED,n.onStop),n.listenTo(n.container,g.default.CONTAINER_ERROR,n.onStop),n.render(),n}return(0,d.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"spinner"}},{key:"attributes",get:function(){return{"data-spinner":"",class:"spinner-three-bounce"}}}]),e.prototype.onBuffering=function(){this.show()},e.prototype.onBufferFull=function(){this.hide()},e.prototype.onStop=function(){this.hide()},e.prototype.show=function(){var t=this;null===this.showTimeout&&(this.showTimeout=setTimeout(function(){return t.$el.show()},300))},e.prototype.hide=function(){null!==this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null),this.$el.hide()},e.prototype.render=function(){return this.$el.html(this.template()),this.container.$el.append(this.$el),this.$el.hide(),this.container.buffering&&this.onBuffering(),this},e}(f.default);e.default=_,t.exports=e.default},function(t,e){t.exports="<div data-bounce1></div><div data-bounce2></div><div data-bounce3></div>\n"},function(t,e,i){var n=i(193);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,".spinner-three-bounce[data-spinner]{position:absolute;margin:0 auto;width:70px;text-align:center;z-index:999;left:0;right:0;margin-left:auto;margin-right:auto;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.spinner-three-bounce[data-spinner]>div{width:18px;height:18px;background-color:#fff;border-radius:100%;display:inline-block;-webkit-animation:bouncedelay 1.4s infinite ease-in-out;animation:bouncedelay 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner-three-bounce[data-spinner] [data-bounce1]{-webkit-animation-delay:-.32s;animation-delay:-.32s}.spinner-three-bounce[data-spinner] [data-bounce2]{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}",""])},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(195),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(37),f=n(h),p=i(4),g=n(p),y=i(6),m=n(y),v=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n.setInitialAttrs(),n.reportInterval=n.options.reportInterval||5e3,n.state="IDLE",n}return(0,d.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"stats"}}]),e.prototype.bindEvents=function(){this.listenTo(this.container.playback,g.default.PLAYBACK_PLAY,this.onPlay),this.listenTo(this.container,g.default.CONTAINER_STOP,this.onStop),this.listenTo(this.container,g.default.CONTAINER_ENDED,this.onStop),this.listenTo(this.container,g.default.CONTAINER_DESTROYED,this.onStop),this.listenTo(this.container,g.default.CONTAINER_STATE_BUFFERING,this.onBuffering),this.listenTo(this.container,g.default.CONTAINER_STATE_BUFFERFULL,this.onBufferFull),this.listenTo(this.container,g.default.CONTAINER_STATS_ADD,this.onStatsAdd),this.listenTo(this.container,g.default.CONTAINER_BITRATE,this.onStatsAdd),this.listenTo(this.container.playback,g.default.PLAYBACK_STATS_ADD,this.onStatsAdd)},e.prototype.setInitialAttrs=function(){this.firstPlay=!0,this.startupTime=0,this.rebufferingTime=0,this.watchingTime=0,this.rebuffers=0,this.externalMetrics={}},e.prototype.onPlay=function(){this.state="PLAYING",this.watchingTimeInit=Date.now(),this.intervalId||(this.intervalId=setInterval(this.report.bind(this),this.reportInterval))},e.prototype.onStop=function(){clearInterval(this.intervalId),this.report(),this.intervalId=void 0,this.state="STOPPED"},e.prototype.onBuffering=function(){this.firstPlay?this.startupTimeInit=Date.now():this.rebufferingTimeInit=Date.now(),this.state="BUFFERING",this.rebuffers++},e.prototype.onBufferFull=function(){this.firstPlay&&this.startupTimeInit?(this.firstPlay=!1,this.startupTime=Date.now()-this.startupTimeInit,this.watchingTimeInit=Date.now()):this.rebufferingTimeInit&&(this.rebufferingTime+=this.getRebufferingTime()),this.rebufferingTimeInit=void 0,this.state="PLAYING"},e.prototype.getRebufferingTime=function(){return Date.now()-this.rebufferingTimeInit},e.prototype.getWatchingTime=function(){return Date.now()-this.watchingTimeInit-this.rebufferingTime},e.prototype.isRebuffering=function(){return!!this.rebufferingTimeInit},e.prototype.onStatsAdd=function(t){m.default.extend(this.externalMetrics,t)},e.prototype.getStats=function(){var t={startupTime:this.startupTime,rebuffers:this.rebuffers,rebufferingTime:this.isRebuffering()?this.rebufferingTime+this.getRebufferingTime():this.rebufferingTime,watchingTime:this.isRebuffering()?this.getWatchingTime()-this.getRebufferingTime():this.getWatchingTime()};return m.default.extend(t,this.externalMetrics),t},e.prototype.report=function(){this.container.statsReport(this.getStats())},e}(f.default);e.default=v,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(197),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(36),f=n(h),p=i(4),g=n(p),y=i(8),m=n(y),v=i(198),b=n(v);i(199);var _=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n.configure(),n}return(0,d.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"watermark"}},{key:"template",get:function(){return(0,m.default)(b.default)}}]),e.prototype.bindEvents=function(){this.listenTo(this.container,g.default.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,g.default.CONTAINER_STOP,this.onStop),this.listenTo(this.container,g.default.CONTAINER_OPTIONS_CHANGE,this.configure)},e.prototype.configure=function(){this.position=this.options.position||"bottom-right",this.options.watermark?(this.imageUrl=this.options.watermark,this.imageLink=this.options.watermarkLink,this.render()):this.$el.remove()},e.prototype.onPlay=function(){this.hidden||this.$el.show()},e.prototype.onStop=function(){this.$el.hide()},e.prototype.render=function(){this.$el.hide();var t={position:this.position,imageUrl:this.imageUrl,imageLink:this.imageLink};return this.$el.html(this.template(t)),this.container.$el.append(this.$el),this},e}(f.default);e.default=_,t.exports=e.default},function(t,e){t.exports="<div data-watermark data-watermark-<%=position %>>\n<% if(typeof imageLink !== 'undefined') { %>\n<a target=_blank href=\"<%= imageLink %>\">\n<% } %>\n<img src=\"<%= imageUrl %>\">\n<% if(typeof imageLink !== 'undefined') { %>\n</a>\n<% } %>\n</div>\n"},function(t,e,i){var n=i(200);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,"[data-watermark]{position:absolute;min-width:70px;max-width:200px;width:12%;text-align:center;z-index:10}[data-watermark] a{outline:none;cursor:pointer}[data-watermark] img{max-width:100%}[data-watermark-bottom-left]{bottom:10px;left:10px}[data-watermark-bottom-right]{bottom:10px;right:42px}[data-watermark-top-left]{top:10px;left:10px}[data-watermark-top-right]{top:10px;right:37px}",""])},function(t,e,i){"use strict";(function(n){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=i(0),o=r(a),s=i(1),l=r(s),u=i(3),c=r(u),d=i(2),h=r(d),f=i(36),p=r(f),g=i(4),y=r(g),m=i(8),v=r(m),b=i(9),_=r(b),E=i(202),T=r(E),A=i(58),S=r(A);i(203);var L=function(t){function e(i){(0,o.default)(this,e);var r=(0,l.default)(this,t.call(this,i));return r.hasStartedPlaying=!1,r.playRequested=!1,r.render(),n.nextTick(function(){return r.update()}),r}return(0,h.default)(e,t),(0,c.default)(e,[{key:"name",get:function(){return"poster"}},{key:"template",get:function(){return(0,v.default)(T.default)}},{key:"shouldRender",get:function(){var t=!(!this.options.poster||!this.options.poster.showForNoOp);return"html_img"!==this.container.playback.name&&(this.container.playback.getPlaybackType()!==_.default.NO_OP||t)}},{key:"attributes",get:function(){return{class:"player-poster","data-poster":""}}},{key:"events",get:function(){return{click:"clicked"}}},{key:"showOnVideoEnd",get:function(){return!this.options.poster||this.options.poster.showOnVideoEnd||void 0===this.options.poster.showOnVideoEnd}}]),e.prototype.bindEvents=function(){this.listenTo(this.container,y.default.CONTAINER_STOP,this.onStop),this.listenTo(this.container,y.default.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,y.default.CONTAINER_STATE_BUFFERING,this.update),this.listenTo(this.container,y.default.CONTAINER_STATE_BUFFERFULL,this.update),this.listenTo(this.container,y.default.CONTAINER_OPTIONS_CHANGE,this.render),this.showOnVideoEnd&&this.listenTo(this.container,y.default.CONTAINER_ENDED,this.onStop)},e.prototype.stopListening=function(){t.prototype.stopListening.call(this)},e.prototype.onPlay=function(){this.hasStartedPlaying=!0,this.update()},e.prototype.onStop=function(){this.hasStartedPlaying=!1,this.playRequested=!1,this.update()},e.prototype.showPlayButton=function(t){!t||this.options.chromeless&&!this.options.allowUserInteraction?(this.$playButton.hide(),this.$el.removeClass("clickable")):(this.$playButton.show(),this.$el.addClass("clickable"))},e.prototype.clicked=function(){return this.options.chromeless&&!this.options.allowUserInteraction||(this.playRequested=!0,this.update(),this.container.play()),!1},e.prototype.shouldHideOnPlay=function(){return!this.container.playback.isAudioOnly},e.prototype.update=function(){if(this.shouldRender){var t=!this.playRequested&&!this.hasStartedPlaying&&!this.container.buffering;this.showPlayButton(t),this.hasStartedPlaying?(this.container.enableMediaControl(),this.shouldHideOnPlay()&&this.$el.hide()):(this.container.disableMediaControl(),this.$el.show())}},e.prototype.render=function(){if(this.shouldRender){this.$el.html(this.template());if(this.options.poster&&void 0===this.options.poster.custom){var t=this.options.poster.url||this.options.poster;this.$el.css({"background-image":"url("+t+")"})}else this.options.poster&&this.$el.css({background:this.options.poster.custom});this.container.$el.append(this.el),this.$playWrapper=this.$el.find(".play-wrapper"),this.$playWrapper.append(S.default),this.$playButton=this.$playWrapper.find("svg"),this.$playButton.addClass("poster-icon"),this.$playButton.attr("data-poster","");var e=this.options.mediacontrol&&this.options.mediacontrol.buttons;return e&&this.$el.find("svg path").css("fill",e),this.options.mediacontrol&&this.options.mediacontrol.buttons&&(e=this.options.mediacontrol.buttons,this.$playButton.css("color",e)),this.update(),this}},e}(p.default);e.default=L,t.exports=e.default}).call(e,i(57))},function(t,e){t.exports='<div class="play-wrapper" data-poster></div>\n'},function(t,e,i){var n=i(204);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,".player-poster[data-poster]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;height:100%;width:100%;z-index:998;top:0;left:0;background-color:#000;background-size:cover;background-repeat:no-repeat;background-position:50% 50%}.player-poster[data-poster].clickable{cursor:pointer}.player-poster[data-poster]:hover .play-wrapper[data-poster]{opacity:1}.player-poster[data-poster] .play-wrapper[data-poster]{width:100%;height:25%;margin:0 auto;opacity:.75;transition:opacity .1s ease}.player-poster[data-poster] .play-wrapper[data-poster] svg{height:100%}.player-poster[data-poster] .play-wrapper[data-poster] svg path{fill:#fff}",""])},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(206),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(37),f=n(h),p=i(4),g=n(p),y=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n.container.options.gaAccount&&(n.account=n.container.options.gaAccount,n.trackerName=n.container.options.gaTrackerName?n.container.options.gaTrackerName+".":"Clappr.",n.domainName=n.container.options.gaDomainName,n.currentHDState=void 0,n.embedScript()),n}return(0,d.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"google_analytics"}}]),e.prototype.embedScript=function(){var t=this;if(window._gat)this.addEventListeners();else{var e=document.createElement("script");e.setAttribute("type","text/javascript"),e.setAttribute("async","async"),e.setAttribute("src","//www.google-analytics.com/ga.js"),e.onload=function(){return t.addEventListeners()},document.body.appendChild(e)}},e.prototype.addEventListeners=function(){var t=this;this.container&&(this.listenTo(this.container,g.default.CONTAINER_READY,this.onReady),this.listenTo(this.container,g.default.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,g.default.CONTAINER_STOP,this.onStop),this.listenTo(this.container,g.default.CONTAINER_PAUSE,this.onPause),this.listenTo(this.container,g.default.CONTAINER_ENDED,this.onEnded),this.listenTo(this.container,g.default.CONTAINER_STATE_BUFFERING,this.onBuffering),this.listenTo(this.container,g.default.CONTAINER_STATE_BUFFERFULL,this.onBufferFull),this.listenTo(this.container,g.default.CONTAINER_ERROR,this.onError),this.listenTo(this.container,g.default.CONTAINER_PLAYBACKSTATE,this.onPlaybackChanged),this.listenTo(this.container,g.default.CONTAINER_VOLUME,function(e){return t.onVolumeChanged(e)}),this.listenTo(this.container,g.default.CONTAINER_SEEK,function(e){return t.onSeek(e)}),this.listenTo(this.container,g.default.CONTAINER_FULL_SCREEN,this.onFullscreen),this.listenTo(this.container,g.default.CONTAINER_HIGHDEFINITIONUPDATE,this.onHD),this.listenTo(this.container,g.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.onDVR)),_gaq.push([this.trackerName+"_setAccount",this.account]),this.domainName&&_gaq.push([this.trackerName+"_setDomainName",this.domainName])},e.prototype.onReady=function(){this.push(["Video","Playback",this.container.playback.name])},e.prototype.onPlay=function(){this.push(["Video","Play",this.container.playback.src])},e.prototype.onStop=function(){this.push(["Video","Stop",this.container.playback.src])},e.prototype.onEnded=function(){this.push(["Video","Ended",this.container.playback.src])},e.prototype.onBuffering=function(){this.push(["Video","Buffering",this.container.playback.src])},e.prototype.onBufferFull=function(){this.push(["Video","Bufferfull",this.container.playback.src])},e.prototype.onError=function(){this.push(["Video","Error",this.container.playback.src])},e.prototype.onHD=function(t){var e=t?"ON":"OFF";e!==this.currentHDState&&(this.currentHDState=e,this.push(["Video","HD - "+e,this.container.playback.src]))},e.prototype.onPlaybackChanged=function(t){null!==t.type&&this.push(["Video","Playback Type - "+t.type,this.container.playback.src])},e.prototype.onDVR=function(t){var e=t?"ON":"OFF";this.push(["Interaction","DVR - "+e,this.container.playback.src])},e.prototype.onPause=function(){this.push(["Video","Pause",this.container.playback.src])},e.prototype.onSeek=function(){this.push(["Video","Seek",this.container.playback.src])},e.prototype.onVolumeChanged=function(){this.push(["Interaction","Volume",this.container.playback.src])},e.prototype.onFullscreen=function(){this.push(["Interaction","Fullscreen",this.container.playback.src])},e.prototype.push=function(t){var e=[this.trackerName+"_trackEvent"].concat(t);_gaq.push(e)},e}(f.default);e.default=y,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(208),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(37),f=n(h),p=i(4),g=n(p),y=i(9),m=n(y),v=function(t){function e(i){return(0,a.default)(this,e),(0,s.default)(this,t.call(this,i))}return(0,d.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"click_to_pause"}}]),e.prototype.bindEvents=function(){this.listenTo(this.container,g.default.CONTAINER_CLICK,this.click),this.listenTo(this.container,g.default.CONTAINER_SETTINGSUPDATE,this.settingsUpdate)},e.prototype.click=function(){(this.container.getPlaybackType()!==m.default.LIVE||this.container.isDvrEnabled())&&(this.container.isPlaying()?this.container.pause():this.container.play())},e.prototype.settingsUpdate=function(){var t=this.container.getPlaybackType()!==m.default.LIVE||this.container.isDvrEnabled();if(t!==this.pointerEnabled){var e=t?"addClass":"removeClass";this.container.$el[e]("pointer-enabled"),this.pointerEnabled=t}},e}(f.default);e.default=v,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(210),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(38),f=n(h),p=i(8),g=n(p),y=i(9),m=n(y),v=i(4),b=n(v),_=i(211),E=n(_);i(212);var T=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n.settingsUpdate(),n}return(0,d.default)(e,t),(0,u.default)(e,[{key:"template",get:function(){return(0,g.default)(E.default)}},{key:"name",get:function(){return"dvr_controls"}},{key:"events",get:function(){return{"click .live-button":"click"}}},{key:"attributes",get:function(){return{class:"dvr-controls","data-dvr-controls":""}}}]),e.prototype.bindEvents=function(){this.listenTo(this.core.mediaControl,b.default.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged),this.listenTo(this.core.mediaControl,b.default.MEDIACONTROL_RENDERED,this.settingsUpdate),this.listenTo(this.core,b.default.CORE_OPTIONS_CHANGE,this.render),this.core.getCurrentContainer()&&(this.listenToOnce(this.core.getCurrentContainer(),b.default.CONTAINER_TIMEUPDATE,this.render),this.listenTo(this.core.getCurrentContainer(),b.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.dvrChanged))},e.prototype.containerChanged=function(){this.stopListening(),this.bindEvents()},e.prototype.dvrChanged=function(t){this.core.getPlaybackType()===m.default.LIVE&&(this.settingsUpdate(),this.core.mediaControl.$el.addClass("live"),t?(this.core.mediaControl.$el.addClass("dvr"),this.core.mediaControl.$el.find(".media-control-indicator[data-position], .media-control-indicator[data-duration]").hide()):this.core.mediaControl.$el.removeClass("dvr"))},e.prototype.click=function(){var t=this.core.mediaControl,e=t.container;e.isPlaying()||e.play(),t.$el.hasClass("dvr")&&e.seek(e.getDuration())},e.prototype.settingsUpdate=function(){var t=this;this.stopListening(),this.core.mediaControl.$el.removeClass("live"),this.shouldRender()&&(this.render(),this.$el.click(function(){return t.click()})),this.bindEvents()},e.prototype.shouldRender=function(){return(void 0===this.core.options.useDvrControls||!!this.core.options.useDvrControls)&&this.core.getPlaybackType()===m.default.LIVE},e.prototype.render=function(){return this.$el.html(this.template({live:this.core.i18n.t("live"),backToLive:this.core.i18n.t("back_to_live")})),this.shouldRender()&&(this.core.mediaControl.$el.addClass("live"),this.core.mediaControl.$(".media-control-left-panel[data-media-control]").append(this.$el)),this},e}(f.default);e.default=T,t.exports=e.default},function(t,e){t.exports='<div class="live-info"><%= live %></div>\n<button type="button" class="live-button" aria-label="<%= backToLive %>"><%= backToLive %></button>\n'},function(t,e,i){var n=i(213);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,'.dvr-controls[data-dvr-controls]{display:inline-block;float:left;color:#fff;line-height:32px;font-size:10px;font-weight:700;margin-left:6px}.dvr-controls[data-dvr-controls] .live-info{cursor:default;font-family:Roboto,Open Sans,Arial,sans-serif;text-transform:uppercase}.dvr-controls[data-dvr-controls] .live-info:before{content:"";display:inline-block;position:relative;width:7px;height:7px;border-radius:3.5px;margin-right:3.5px;background-color:#ff0101}.dvr-controls[data-dvr-controls] .live-info.disabled{opacity:.3}.dvr-controls[data-dvr-controls] .live-info.disabled:before{background-color:#fff}.dvr-controls[data-dvr-controls] .live-button{cursor:pointer;outline:none;display:none;border:0;color:#fff;background-color:transparent;height:32px;padding:0;opacity:.7;font-family:Roboto,Open Sans,Arial,sans-serif;text-transform:uppercase;transition:all .1s ease}.dvr-controls[data-dvr-controls] .live-button:before{content:"";display:inline-block;position:relative;width:7px;height:7px;border-radius:3.5px;margin-right:3.5px;background-color:#fff}.dvr-controls[data-dvr-controls] .live-button:hover{opacity:1;text-shadow:hsla(0,0%,100%,.75) 0 0 5px}.dvr .dvr-controls[data-dvr-controls] .live-info{display:none}.dvr .dvr-controls[data-dvr-controls] .live-button{display:block}.dvr.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{background-color:#005aff}.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{background-color:#ff0101}',""])},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(215),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(38),f=n(h),p=i(8),g=n(p),y=i(4),m=n(y),v=i(216),b=n(v),_=i(217),E=n(_);i(218);var T=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i)),r=i.options.closedCaptionsConfig;return n._title=r&&r.title?r.title:null,n._ariaLabel=r&&r.ariaLabel?r.ariaLabel:"cc-button",n._labelCb=r&&r.labelCallback&&"function"==typeof r.labelCallback?r.labelCallback:function(t){return t.name},n}return(0,d.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"closed_captions"}},{key:"template",get:function(){return(0,g.default)(E.default)}},{key:"events",get:function(){return{"click [data-cc-button]":"toggleContextMenu","click [data-cc-select]":"onTrackSelect"}}},{key:"attributes",get:function(){return{class:"cc-controls","data-cc-controls":""}}}]),e.prototype.bindEvents=function(){this.listenTo(this.core.mediaControl,m.default.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged),this.listenTo(this.core.mediaControl,m.default.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.core.mediaControl,m.default.MEDIACONTROL_HIDE,this.hideContextMenu),this.container=this.core.getCurrentContainer(),this.container&&(this.listenTo(this.container,m.default.CONTAINER_SUBTITLE_AVAILABLE,this.onSubtitleAvailable),this.listenTo(this.container,m.default.CONTAINER_SUBTITLE_CHANGED,this.onSubtitleChanged),this.listenTo(this.container,m.default.CONTAINER_STOP,this.onContainerStop))},e.prototype.onContainerStop=function(){this.ccAvailable(!1)},e.prototype.containerChanged=function(){this.ccAvailable(!1),this.stopListening(),this.bindEvents()},e.prototype.onSubtitleAvailable=function(){this.renderCcButton(),this.ccAvailable(!0)},e.prototype.onSubtitleChanged=function(t){this.setCurrentContextMenuElement(t.id)},e.prototype.onTrackSelect=function(t){var e=parseInt(t.target.dataset.ccSelect,10);return this.container.closedCaptionsTrackId=e,this.hideContextMenu(),t.stopPropagation(),!1},e.prototype.ccAvailable=function(t){var e=t?"addClass":"removeClass";this.$el[e]("available")},e.prototype.toggleContextMenu=function(){this.$el.find("ul").toggle()},e.prototype.hideContextMenu=function(){this.$el.find("ul").hide()},e.prototype.contextMenuElement=function(t){return this.$el.find("ul a"+(isNaN(t)?"":'[data-cc-select="'+t+'"]')).parent()},e.prototype.setCurrentContextMenuElement=function(t){if(this._trackId!==t){this.contextMenuElement().removeClass("current"),this.contextMenuElement(t).addClass("current");var e=t>-1?"addClass":"removeClass";this.$ccButton[e]("enabled"),this._trackId=t}},e.prototype.renderCcButton=function(){for(var t=this.container?this.container.closedCaptionsTracks:[],e=0;e<t.length;e++)t[e].label=this._labelCb(t[e]);this.$el.html(this.template({ariaLabel:this._ariaLabel,disabledLabel:this.core.i18n.t("disabled"),title:this._title,tracks:t})),this.$ccButton=this.$el.find("button.cc-button[data-cc-button]"),this.$ccButton.append(b.default),this.$el.append(this.style)},e.prototype.render=function(){this.renderCcButton();var t=this.core.mediaControl.$el.find("button[data-fullscreen]");return t[0]?this.$el.insertAfter(t):this.core.mediaControl.$el.find(".media-control-right-panel[data-media-control]").prepend(this.$el),this},e}(f.default);e.default=T,t.exports=e.default},function(t,e){t.exports='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 49 41.8" style="enable-background:new 0 0 49 41.8;" xml:space="preserve"><path d="M47.1,0H3.2C1.6,0,0,1.2,0,2.8v31.5C0,35.9,1.6,37,3.2,37h11.9l3.2,1.9l4.7,2.7c0.9,0.5,2-0.1,2-1.1V37h22.1 c1.6,0,1.9-1.1,1.9-2.7V2.8C49,1.2,48.7,0,47.1,0z M7.2,18.6c0-4.8,3.5-9.3,9.9-9.3c4.8,0,7.1,2.7,7.1,2.7l-2.5,4 c0,0-1.7-1.7-4.2-1.7c-2.8,0-4.3,2.1-4.3,4.3c0,2.1,1.5,4.4,4.5,4.4c2.5,0,4.9-2.1,4.9-2.1l2.2,4.2c0,0-2.7,2.9-7.6,2.9 C10.8,27.9,7.2,23.5,7.2,18.6z M36.9,27.9c-6.4,0-9.9-4.4-9.9-9.3c0-4.8,3.5-9.3,9.9-9.3C41.7,9.3,44,12,44,12l-2.5,4 c0,0-1.7-1.7-4.2-1.7c-2.8,0-4.3,2.1-4.3,4.3c0,2.1,1.5,4.4,4.5,4.4c2.5,0,4.9-2.1,4.9-2.1l2.2,4.2C44.5,25,41.9,27.9,36.9,27.9z"></path></svg>'},function(t,e){t.exports='<button type="button" class="cc-button media-control-button media-control-icon" data-cc-button aria-label="<%= ariaLabel %>"></button>\n<ul>\n <% if (title) { %>\n <li data-title><%= title %></li>\n <% }; %>\n <li><a href="#" data-cc-select="-1"><%= disabledLabel %></a></li>\n <% for (var i = 0; i < tracks.length; i++) { %>\n <li><a href="#" data-cc-select="<%= tracks[i].id %>"><%= tracks[i].label %></a></li>\n <% }; %>\n</ul>\n'},function(t,e,i){var n=i(219);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,".cc-controls[data-cc-controls]{float:right;position:relative;display:none}.cc-controls[data-cc-controls].available{display:block}.cc-controls[data-cc-controls] .cc-button{padding:6px!important}.cc-controls[data-cc-controls] .cc-button.enabled{display:block;opacity:1}.cc-controls[data-cc-controls] .cc-button.enabled:hover{opacity:1;text-shadow:none}.cc-controls[data-cc-controls]>ul{list-style-type:none;position:absolute;bottom:25px;border:1px solid #000;display:none;background-color:#e6e6e6}.cc-controls[data-cc-controls] li{font-size:10px}.cc-controls[data-cc-controls] li[data-title]{background-color:#c3c2c2;padding:5px}.cc-controls[data-cc-controls] li a{color:#444;padding:2px 10px;display:block;text-decoration:none}.cc-controls[data-cc-controls] li a:hover{background-color:#555;color:#fff}.cc-controls[data-cc-controls] li a:hover a{color:#fff;text-decoration:none}.cc-controls[data-cc-controls] li.current a{color:red}",""])},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(221),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(30),f=n(h),p=i(4),g=n(p),y=i(6),m=n(y),v=i(58),b=n(v),_=i(76),E=n(_),T=(0,m.default)('link[rel="shortcut icon"]'),A=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n._container=null,n.configure(),n}return(0,d.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"favicon"}},{key:"oldIcon",get:function(){return T}}]),e.prototype.configure=function(){this.core.options.changeFavicon?this.enabled||(this.stopListening(this.core,g.default.CORE_OPTIONS_CHANGE),this.enable()):this.enabled&&(this.disable(),this.listenTo(this.core,g.default.CORE_OPTIONS_CHANGE,this.configure))},e.prototype.bindEvents=function(){this.listenTo(this.core,g.default.CORE_OPTIONS_CHANGE,this.configure),this.listenTo(this.core.mediaControl,g.default.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged),this.core.mediaControl.container&&this.containerChanged()},e.prototype.containerChanged=function(){this._container&&this.stopListening(this._container),this._container=this.core.mediaControl.container,this.listenTo(this._container,g.default.CONTAINER_PLAY,this.setPlayIcon),this.listenTo(this._container,g.default.CONTAINER_PAUSE,this.setPauseIcon),this.listenTo(this._container,g.default.CONTAINER_STOP,this.resetIcon),this.listenTo(this._container,g.default.CONTAINER_ENDED,this.resetIcon),this.listenTo(this._container,g.default.CONTAINER_ERROR,this.resetIcon),this.resetIcon()},e.prototype.disable=function(){t.prototype.disable.call(this),this.resetIcon()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.resetIcon()},e.prototype.createIcon=function(t){var e=(0,m.default)("<canvas/>");e[0].width=16,e[0].height=16;var i=e[0].getContext("2d");i.fillStyle="#000";var n=(0,m.default)(t).find("path").attr("d"),r=new Path2D(n);i.fill(r);var a=(0,m.default)('<link rel="shortcut icon" type="image/png"/>');return a.attr("href",e[0].toDataURL("image/png")),a},e.prototype.setPlayIcon=function(){this.playIcon||(this.playIcon=this.createIcon(b.default)),this.changeIcon(this.playIcon)},e.prototype.setPauseIcon=function(){this.pauseIcon||(this.pauseIcon=this.createIcon(E.default)),this.changeIcon(this.pauseIcon)},e.prototype.resetIcon=function(){(0,m.default)('link[rel="shortcut icon"]').remove(),(0,m.default)("head").append(this.oldIcon)},e.prototype.changeIcon=function(t){t&&((0,m.default)('link[rel="shortcut icon"]').remove(),(0,m.default)("head").append(t))},e}(f.default);e.default=A,t.exports=e.default},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(223),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=r.default,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(1),s=n(o),l=i(3),u=n(l),c=i(2),d=n(c),h=i(5),f=i(38),p=n(f),g=i(8),y=n(g),m=i(4),v=n(m),b=i(9),_=n(b),E=i(224),T=n(E);i(225);var A=function(t){function e(i){(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,i));return n.hoveringOverSeekBar=!1,n.hoverPosition=null,n.duration=null,n.actualLiveTime=!!n.mediaControl.options.actualLiveTime,n.actualLiveTime&&(n.mediaControl.options.actualLiveServerTime?n.actualLiveServerTimeDiff=(new Date).getTime()-new Date(n.mediaControl.options.actualLiveServerTime).getTime():n.actualLiveServerTimeDiff=0),n}return(0,d.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"seek_time"}},{key:"template",get:function(){return(0,y.default)(T.default)}},{key:"attributes",get:function(){return{class:"seek-time","data-seek-time":""}}},{key:"mediaControl",get:function(){return this.core.mediaControl}},{key:"mediaControlContainer",get:function(){return this.mediaControl.container}},{key:"isLiveStreamWithDvr",get:function(){return this.mediaControlContainer&&this.mediaControlContainer.getPlaybackType()===_.default.LIVE&&this.mediaControlContainer.isDvrEnabled()}},{key:"durationShown",get:function(){return this.isLiveStreamWithDvr&&!this.useActualLiveTime}},{key:"useActualLiveTime",get:function(){return this.actualLiveTime&&this.isLiveStreamWithDvr}}]),e.prototype.bindEvents=function(){this.listenTo(this.mediaControl,v.default.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.mediaControl,v.default.MEDIACONTROL_MOUSEMOVE_SEEKBAR,this.showTime),this.listenTo(this.mediaControl,v.default.MEDIACONTROL_MOUSELEAVE_SEEKBAR,this.hideTime),this.listenTo(this.mediaControl,v.default.MEDIACONTROL_CONTAINERCHANGED,this.onContainerChanged),this.mediaControlContainer&&(this.listenTo(this.mediaControlContainer,v.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.update),this.listenTo(this.mediaControlContainer,v.default.CONTAINER_TIMEUPDATE,this.updateDuration))},e.prototype.onContainerChanged=function(){this.stopListening(),this.bindEvents()},e.prototype.updateDuration=function(t){this.duration=t.total,this.update()},e.prototype.showTime=function(t){this.hoveringOverSeekBar=!0,this.calculateHoverPosition(t),this.update()},e.prototype.hideTime=function(){this.hoveringOverSeekBar=!1,this.update()},e.prototype.calculateHoverPosition=function(t){var e=t.pageX-this.mediaControl.$seekBarContainer.offset().left;this.hoverPosition=Math.min(1,Math.max(e/this.mediaControl.$seekBarContainer.width(),0))},e.prototype.getSeekTime=function(){var t=void 0,e=void 0;if(this.useActualLiveTime){var i=new Date((new Date).getTime()-this.actualLiveServerTimeDiff);e=(new Date(i)-i.setHours(0,0,0,0))/1e3,t=e-this.duration+this.hoverPosition*this.duration,t<0&&(t+=86400)}else t=this.hoverPosition*this.duration;return{seekTime:t,secondsSinceMidnight:e}},e.prototype.update=function(){if(this.rendered)if(this.shouldBeVisible()){var t=this.getSeekTime(),e=(0,h.formatTime)(t.seekTime,this.useActualLiveTime);if(e!==this.displayedSeekTime&&(this.$seekTimeEl.text(e),this.displayedSeekTime=e),this.durationShown){this.$durationEl.show();var i=(0,h.formatTime)(this.actualLiveTime?t.secondsSinceMidnight:this.duration,this.actualLiveTime);i!==this.displayedDuration&&(this.$durationEl.text(i),this.displayedDuration=i)}else this.$durationEl.hide();this.$el.show();var n=this.mediaControl.$seekBarContainer.width(),r=this.$el.width(),a=this.hoverPosition*n;a-=r/2,a=Math.max(0,Math.min(a,n-r)),this.$el.css("left",a)}else this.$el.hide(),this.$el.css("left","-100%")},e.prototype.shouldBeVisible=function(){return this.mediaControlContainer&&this.mediaControlContainer.settings.seekEnabled&&this.hoveringOverSeekBar&&null!==this.hoverPosition&&null!==this.duration},e.prototype.render=function(){this.rendered=!0,this.displayedDuration=null,this.displayedSeekTime=null,this.$el.html(this.template()),this.$el.hide(),this.mediaControl.$el.append(this.el),this.$seekTimeEl=this.$el.find("[data-seek-time]"),this.$durationEl=this.$el.find("[data-duration]"),this.$durationEl.hide(),this.update()},e}(p.default);e.default=A,t.exports=e.default},function(t,e){t.exports="<span data-seek-time></span>\n<span data-duration></span>\n"},function(t,e,i){var n=i(226);"string"==typeof n&&(n=[[t.i,n,""]]);var r={singleton:!0,hmr:!0};r.transform=void 0;i(10)(n,r);n.locals&&(t.exports=n.locals)},function(t,e,i){e=t.exports=i(7)(void 0),e.push([t.i,'.seek-time[data-seek-time]{position:absolute;white-space:nowrap;height:20px;line-height:20px;font-size:0;left:-100%;bottom:55px;background-color:rgba(2,2,2,.5);z-index:9999;transition:opacity .1s ease}.seek-time[data-seek-time].hidden[data-seek-time]{opacity:0}.seek-time[data-seek-time] [data-seek-time]{display:inline-block;color:#fff;font-size:10px;padding-left:7px;padding-right:7px;vertical-align:top}.seek-time[data-seek-time] [data-duration]{display:inline-block;color:hsla(0,0%,100%,.5);font-size:10px;padding-right:7px;vertical-align:top}.seek-time[data-seek-time] [data-duration]:before{content:"|";margin-right:7px}',""])},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(3),s=n(o),l=i(1),u=n(l),c=i(2),d=n(c),h=i(30),f=n(h),p=i(4),g=n(p),y=function(t){function e(){return(0,a.default)(this,e),(0,u.default)(this,t.apply(this,arguments))}return(0,d.default)(e,t),e.prototype.bindEvents=function(){this.listenTo(this.core,g.default.CORE_CONTAINERS_CREATED,this.onContainersCreated)},e.prototype.onContainersCreated=function(){var t=this.core.containers.filter(function(t){return"no_op"!==t.playback.name})[0]||this.core.containers[0];t&&this.core.containers.forEach(function(e){e!==t&&e.destroy()})},(0,s.default)(e,[{key:"name",get:function(){return"sources"}}]),e}(f.default);e.default=y,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),o=i(3),s=n(o),l=i(1),u=n(l),c=i(2),d=n(c),h=i(4),f=n(h),p=i(30),g=n(p),y=i(5),m=function(t){function e(){return(0,a.default)(this,e),(0,u.default)(this,t.apply(this,arguments))}return(0,d.default)(e,t),e.prototype.bindEvents=function(){this.listenTo(this.core.mediaControl,f.default.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged);var t=this.core.getCurrentContainer();t&&(this.listenTo(t,f.default.CONTAINER_ENDED,this.ended),this.listenTo(t,f.default.CONTAINER_STOP,this.ended))},e.prototype.containerChanged=function(){this.stopListening(),this.bindEvents()},e.prototype.ended=function(){(void 0===this.core.options.exitFullscreenOnEnd||this.core.options.exitFullscreenOnEnd)&&y.Fullscreen.isFullscreen()&&this.core.toggleFullscreen()},(0,s.default)(e,[{key:"name",get:function(){return"end_video"}}]),e}(g.default);e.default=m,t.exports=e.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(31),a=n(r),o=i(0),s=n(o),l=i(1),u=n(l),c=i(3),d=n(c),h=i(2),f=n(h),p=i(5),g=i(6),y=n(g),m=i(30),v=n(m),b=function(t){function e(i){(0,s.default)(this,e);var n=(0,u.default)(this,t.call(this,i));return n._initializeMessages(),n}return(0,f.default)(e,t),(0,d.default)(e,[{key:"name",get:function(){return"strings"}}]),e.prototype.t=function(t){var e=this._language();return(e&&this._messages[e]||this._messages.en)[t]||t},e.prototype._language=function(){return this.core.options.language||(0,p.getBrowserLanguage)()},e.prototype._initializeMessages=function(){var t={en:{live:"live",back_to_live:"back to live",disabled:"Disabled",playback_not_supported:"Your browser does not support the playback of this video. Please try using a different browser."},pt:{live:"ao vivo",back_to_live:"voltar para o ao vivo",disabled:"Desativado",playback_not_supported:"Seu navegador não supporta a reprodução deste video. Por favor, tente usar um navegador diferente."},es:{live:"vivo",back_to_live:"volver en vivo",disabled:"Discapacitado",playback_not_supported:"Su navegador no soporta la reproducción de un video. Por favor, trate de usar un navegador diferente."},ru:{live:"прямой эфир",back_to_live:"к прямому эфиру",disabled:"Отключено",playback_not_supported:"Ваш браузер не поддерживает воспроизведение этого видео. Пожалуйста, попробуйте другой браузер."},fr:{live:"en direct",disabled:"Désactivé",back_to_live:"retour au direct",playback_not_supported:"Votre navigateur ne supporte pas la lecture de cette vidéo. Merci de tenter sur un autre navigateur."},tr:{live:"canlı",back_to_live:"canlı yayına dön",disabled:"Engelli",playback_not_supported:"Tarayıcınız bu videoyu oynatma desteğine sahip değil. Lütfen farklı bir tarayıcı ile deneyin."},et:{live:"Otseülekanne",back_to_live:"Tagasi otseülekande juurde",disabled:"Keelatud",playback_not_supported:"Teie brauser ei toeta selle video taasesitust. Proovige kasutada muud brauserit."}},e=this.core.options.strings||{};this._messages=(0,a.default)(t).reduce(function(i,n){return i[n]=y.default.extend({},t[n],e[n]),i},{}),this._messages["pt-BR"]=this._messages.pt,this._messages["en-US"]=this._messages.en,this._messages["es-419"]=this._messages.es,this._messages["fr-FR"]=this._messages.fr,this._messages["tr-TR"]=this._messages.tr,this._messages["et-EE"]=this._messages.et},e}(v.default);e.default=b,t.exports=e.default}])}); \ No newline at end of file
diff --git a/assets/clapprio/clappr.min.js.map b/assets/clapprio/clappr.min.js.map
deleted file mode 100644
index 411c11b..0000000
--- a/assets/clapprio/clappr.min.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///clappr.min.js","webpack:///webpack/bootstrap d556a0cfcd71319135ca","webpack:///./src/main.js","webpack:///./src/base/events.js","webpack:///./src/base/utils.js","webpack:///./src/base/playback.js","webpack:///./src/base/styler.js","webpack:///./~/clappr-zepto/zepto.min.js","webpack:///./src/base/template.js","webpack:///./~/css-loader/lib/css-base.js","webpack:///./src/components/browser.js","webpack:///./src/base/base_object.js","webpack:///./src/base/ui_object.js","webpack:///./src/components/mediator.js","webpack:///./src/base/core_plugin.js","webpack:///./src/base/container_plugin.js","webpack:///./src/base/ui_container_plugin.js","webpack:///./src/components/player_info.js","webpack:///./src/playbacks/html5_video/index.js","webpack:///./src/base/ui_core_plugin.js","webpack:///./src/playbacks/base_flash_playback/index.js","webpack:///./src/plugins/log/index.js","webpack:///./src/vendor/index.js","webpack:///./~/process/browser.js","webpack:///./src/icons/01-play.svg","webpack:///(webpack)/buildin/module.js","webpack:///./src/components/container/index.js","webpack:///./src/components/core/index.js","webpack:///./src/components/loader/index.js","webpack:///./src/components/media_control/index.js","webpack:///./src/playbacks/flash/index.js","webpack:///./src/playbacks/flashls/index.js","webpack:///./src/playbacks/hls/index.js","webpack:///./src/playbacks/html5_audio/index.js","webpack:///./src/playbacks/html_img/index.js","webpack:///./src/playbacks/no_op/index.js","webpack:///./src/plugins/poster/index.js","webpack:///./~/lodash.merge/index.js","webpack:///./src/icons/02-pause.svg","webpack:///./src/components/media_control/public/closed-hand.cur","webpack:///./src/components/container/container.js","webpack:///./src/components/container_factory/container_factory.js","webpack:///./src/components/container_factory/index.js","webpack:///./src/components/core/core.js","webpack:///./src/components/core_factory/core_factory.js","webpack:///./src/components/core_factory/index.js","webpack:///./src/components/loader/loader.js","webpack:///./src/components/media_control/media_control.js","webpack:///./src/components/player.js","webpack:///./src/playbacks/base_flash_playback/base_flash_playback.js","webpack:///./src/playbacks/flash/flash.js","webpack:///./src/playbacks/flashls/flashls.js","webpack:///./src/playbacks/flashls/flashls_events.js","webpack:///./src/playbacks/hls/hls.js","webpack:///./src/playbacks/html5_audio/html5_audio.js","webpack:///./src/playbacks/html5_video/html5_video.js","webpack:///./src/playbacks/html_img/html_img.js","webpack:///./src/playbacks/no_op/no_op.js","webpack:///./src/plugins/click_to_pause/click_to_pause.js","webpack:///./src/plugins/click_to_pause/index.js","webpack:///./src/plugins/dvr_controls/dvr_controls.js","webpack:///./src/plugins/dvr_controls/index.js","webpack:///./src/plugins/end_video.js","webpack:///./src/plugins/favicon/favicon.js","webpack:///./src/plugins/favicon/index.js","webpack:///./src/plugins/google_analytics/google_analytics.js","webpack:///./src/plugins/google_analytics/index.js","webpack:///./src/plugins/log/log.js","webpack:///./src/plugins/poster/poster.js","webpack:///./src/plugins/seek_time/index.js","webpack:///./src/plugins/seek_time/seek_time.js","webpack:///./src/plugins/sources.js","webpack:///./src/plugins/spinner_three_bounce/index.js","webpack:///./src/plugins/spinner_three_bounce/spinner_three_bounce.js","webpack:///./src/plugins/stats/index.js","webpack:///./src/plugins/stats/stats.js","webpack:///./src/plugins/strings.js","webpack:///./src/plugins/watermark/index.js","webpack:///./src/plugins/watermark/watermark.js","webpack:///./src/vendor/kibo.js","webpack:///./src/components/container/public/style.scss","webpack:///./src/components/core/public/style.scss","webpack:///./src/components/media_control/public/media-control.scss","webpack:///./src/playbacks/base_flash_playback/public/flash.scss","webpack:///./src/playbacks/html5_video/public/style.scss","webpack:///./src/playbacks/html_img/public/style.scss","webpack:///./src/playbacks/no_op/public/style.scss","webpack:///./src/plugins/dvr_controls/public/dvr_controls.scss","webpack:///./src/plugins/poster/public/poster.scss","webpack:///./src/plugins/seek_time/public/seek_time.scss","webpack:///./src/plugins/spinner_three_bounce/public/spinner.scss","webpack:///./src/plugins/watermark/public/watermark.scss","webpack:///./~/hls.js/dist/hls.js","webpack:///./src/components/media_control/public/media-control.html","webpack:///./src/playbacks/base_flash_playback/public/flash.html","webpack:///./src/playbacks/no_op/public/error.html","webpack:///./src/plugins/dvr_controls/public/index.html","webpack:///./src/plugins/poster/public/poster.html","webpack:///./src/plugins/seek_time/public/seek_time.html","webpack:///./src/plugins/spinner_three_bounce/public/spinner.html","webpack:///./src/plugins/watermark/public/watermark.html","webpack:///./~/lodash.isequal/index.js","webpack:///./~/lodash.isplainobject/index.js","webpack:///./~/lodash.once/index.js","webpack:///./~/lodash.result/index.js","webpack:///./~/lodash.uniqby/index.js","webpack:///./src/icons/03-stop.svg","webpack:///./src/icons/04-volume.svg","webpack:///./src/icons/05-mute.svg","webpack:///./src/icons/06-expand.svg","webpack:///./src/icons/07-shrink.svg","webpack:///./src/icons/08-hd.svg","webpack:///./src/components/core/public/Roboto.ttf","webpack:///./src/playbacks/flash/public/Player.swf","webpack:///./src/playbacks/flashls/public/HLSPlayer.swf"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","_player","_player2","_utils","_utils2","_events","_events2","_playback","_playback2","_container_plugin","_container_plugin2","_core_plugin","_core_plugin2","_ui_core_plugin","_ui_core_plugin2","_ui_container_plugin","_ui_container_plugin2","_base_object","_base_object2","_ui_object","_ui_object2","_browser","_browser2","_container","_container2","_core","_core2","_loader","_loader2","_mediator","_mediator2","_media_control","_media_control2","_player_info","_player_info2","_base_flash_playback","_base_flash_playback2","_flash","_flash2","_flashls","_flashls2","_hls","_hls2","_html5_audio","_html5_audio2","_html5_video","_html5_video2","_html_img","_html_img2","_no_op","_no_op2","_poster","_poster2","_log","_log2","_styler","_styler2","_vendor","_vendor2","_template","_template2","_clapprZepto","_clapprZepto2","version","Player","Mediator","Events","Browser","PlayerInfo","MediaControl","ContainerPlugin","UIContainerPlugin","CorePlugin","UICorePlugin","Playback","Container","Core","Loader","BaseObject","UIObject","Utils","BaseFlashPlayback","Flash","FlasHLS","HLS","HTML5Audio","HTML5Video","HTMLImg","NoOp","Poster","Log","Styler","Vendor","template","$","_classCallCheck","instance","Constructor","TypeError","_typeof","Symbol","iterator","constructor","prototype","_lodash","_lodash2","slice","Array","eventSplitter","eventsApi","action","name","rest","key","apply","concat","test","names","split","i","l","length","triggerEvents","events","args","klass","run","ev","callback","ctx","a1","a2","a3","exception","error","on","context","push","once","self","off","arguments","_callback","retain","j","k","keys","trigger","debug","allEvents","all","stopListening","listeningTo","_listeningTo","remove","_listenId","listenMethods","listenTo","listenToOnce","forEach","method","uniqueId","PLAYER_READY","PLAYER_RESIZE","PLAYER_FULLSCREEN","PLAYER_PLAY","PLAYER_PAUSE","PLAYER_STOP","PLAYER_ENDED","PLAYER_SEEK","PLAYER_ERROR","PLAYER_TIMEUPDATE","PLAYER_VOLUMEUPDATE","PLAYBACK_PROGRESS","PLAYBACK_TIMEUPDATE","PLAYBACK_READY","PLAYBACK_BUFFERING","PLAYBACK_BUFFERFULL","PLAYBACK_SETTINGSUPDATE","PLAYBACK_LOADEDMETADATA","PLAYBACK_HIGHDEFINITIONUPDATE","PLAYBACK_BITRATE","PLAYBACK_LEVELS_AVAILABLE","PLAYBACK_LEVEL_SWITCH_START","PLAYBACK_LEVEL_SWITCH_END","PLAYBACK_PLAYBACKSTATE","PLAYBACK_DVR","PLAYBACK_MEDIACONTROL_DISABLE","PLAYBACK_MEDIACONTROL_ENABLE","PLAYBACK_ENDED","PLAYBACK_PLAY_INTENT","PLAYBACK_PLAY","PLAYBACK_PAUSE","PLAYBACK_STOP","PLAYBACK_ERROR","PLAYBACK_STATS_ADD","PLAYBACK_FRAGMENT_LOADED","PLAYBACK_LEVEL_SWITCH","CORE_OPTIONS_CHANGE","CORE_READY","CORE_FULLSCREEN","CONTAINER_PLAYBACKSTATE","CONTAINER_PLAYBACKDVRSTATECHANGED","CONTAINER_BITRATE","CONTAINER_STATS_REPORT","CONTAINER_DESTROYED","CONTAINER_READY","CONTAINER_ERROR","CONTAINER_LOADEDMETADATA","CONTAINER_TIMEUPDATE","CONTAINER_PROGRESS","CONTAINER_PLAY","CONTAINER_STOP","CONTAINER_PAUSE","CONTAINER_ENDED","CONTAINER_CLICK","CONTAINER_DBLCLICK","CONTAINER_CONTEXTMENU","CONTAINER_MOUSE_ENTER","CONTAINER_MOUSE_LEAVE","CONTAINER_SEEK","CONTAINER_VOLUME","CONTAINER_FULLSCREEN","CONTAINER_STATE_BUFFERING","CONTAINER_STATE_BUFFERFULL","CONTAINER_SETTINGSUPDATE","CONTAINER_HIGHDEFINITIONUPDATE","CONTAINER_MEDIACONTROL_SHOW","CONTAINER_MEDIACONTROL_HIDE","CONTAINER_MEDIACONTROL_DISABLE","CONTAINER_MEDIACONTROL_ENABLE","CONTAINER_STATS_ADD","CONTAINER_OPTIONS_CHANGE","MEDIACONTROL_RENDERED","MEDIACONTROL_FULLSCREEN","MEDIACONTROL_SHOW","MEDIACONTROL_HIDE","MEDIACONTROL_MOUSEMOVE_SEEKBAR","MEDIACONTROL_MOUSELEAVE_SEEKBAR","MEDIACONTROL_PLAYING","MEDIACONTROL_NOTPLAYING","MEDIACONTROL_CONTAINERCHANGED","CORE_CONTAINERS_CREATED","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","create","enumerable","writable","configurable","setPrototypeOf","__proto__","assign","source","prop","propDescriptor","getOwnPropertyDescriptor","extend","parent","properties","Surrogate","_parent","_len","_key","_this","initialize","formatTime","time","paddedHours","isFinite","parseInt","seconds","minutes","hours","days","out","trim","seekStringToSeconds","paramName","undefined","seekString","QueryString","params","hashParams","parts","match","factor","h","s","el","suffix","prefix","idsCounter","isNumber","parseFloat","currentScriptUrl","scripts","document","getElementsByTagName","src","getBrowserLanguage","window","navigator","language","now","performance","Date","removeArrayItem","arr","item","indexOf","splice","cancelAnimationFrame","requestAnimationFrame","Config","Fullscreen","_createClass","defineProperties","target","props","descriptor","protoProps","staticProps","isFullscreen","webkitFullscreenElement","webkitIsFullScreen","mozFullScreen","msFullscreenElement","requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen","querySelector","webkitEnterFullScreen","cancelFullscreen","exitFullscreen","webkitCancelFullScreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullscreenEnabled","_defaultConfig","volume","parse","_defaultValueFor","e","_createKeyspace","domain","restore","hasLocalstorage","localStorage","persist","paramsString","pl","search","decode","decodeURIComponent","replace","exec","toLowerCase","get","query","location","substring","_urlParams","hash","_hashParams","mozRequestAnimationFrame","webkitRequestAnimationFrame","fn","setTimeout","bind","mozCancelAnimationFrame","webkitCancelAnimationFrame","clearTimeout","_UIObject","options","i18n","settings","_i18n","play","pause","stop","seek","seekPercentage","percentage","getStartTimeOffset","getDuration","isPlaying","getPlaybackType","NO_OP","isHighDefinitionInUse","destroy","$el","canPlay","mimeType","VOD","AOD","LIVE","type","getStyleFor","style","baseUrl","html","toString","Zepto","D","t","String","S","L","Z","nodeType","DOCUMENT_NODE","F","getPrototypeOf","R","q","W","n","z","H","RegExp","_","I","f","u","createElement","body","appendChild","getComputedStyle","getPropertyValue","parentNode","removeChild","U","a","children","map","childNodes","X","selector","B","r","A","V","filter","Y","J","removeAttribute","setAttribute","G","className","baseVal","K","parseJSON","Q","N","P","o","column-count","columns","font-weight","line-height","opacity","z-index","zoom","d","g","v","y","w","x","b","tr","tbody","thead","tfoot","td","th","*","E","T","C","O","M","tabindex","readonly","for","class","maxlength","cellspacing","cellpadding","rowspan","colspan","usemap","frameborder","contenteditable","isArray","matches","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","matchesSelector","qsa","toUpperCase","fragment","$1","innerHTML","each","attr","isZ","init","find","ready","shift","getElementById","getElementsByClassName","querySelectorAll","contains","documentElement","isFunction","isWindow","isPlainObject","isEmptyObject","inArray","camelCase","uuid","support","expr","noop","grep","JSON","reduce","sort","toArray","readyState","addEventListener","size","every","not","add","is","has","eq","first","last","some","closest","parents","pluck","contents","contentDocument","siblings","empty","show","display","nodeName","replaceWith","before","wrap","wrapAll","cloneNode","append","wrapInner","unwrap","clone","hide","css","toggle","prev","next","text","textContent","getAttribute","removeAttr","data","val","multiple","selected","offset","offsetParent","top","left","position","getBoundingClientRect","pageXOffset","pageYOffset","width","Math","round","height","removeProperty","cssText","index","hasClass","addClass","join","removeClass","toggleClass","scrollTop","scrollTo","scrollX","scrollLeft","scrollY","detach","nextSibling","firstChild","insertBefore","eval","uniq","deserializeValue","zepto","_zid","ns","sel","del","relatedTarget","proxy","isImmediatePropagationStopped","_args","preventDefault","stopPropagation","removeEventListener","isDefaultPrevented","defaultPrevented","returnValue","getPreventDefault","originalEvent","focus","blur","mouseenter","mouseleave","click","mousedown","mouseup","mousemove","event","unshift","unbind","one","stopImmediatePropagation","delegate","undelegate","live","die","currentTarget","liveFired","Event","dispatchEvent","triggerHandler","createEvent","initEvent","global","active","beforeSend","success","resolveWith","rejectWith","complete","processData","param","traditional","url","dataType","href","ajaxJSONP","ajax","jsonpCallback","abort","promise","head","timeout","ajaxSettings","xhr","XMLHttpRequest","accepts","script","json","xml","crossDomain","cache","Deferred","protocol","host","jsonp","setRequestHeader","overrideMimeType","contentType","headers","onreadystatechange","status","getResponseHeader","responseText","responseXML","statusText","xhrFields","async","open","username","password","send","post","getJSON","load","encodeURIComponent","Callbacks","memory","stopOnFalse","disable","unique","disabled","lock","locked","fireWith","fire","fired","state","always","done","fail","then","resolve","reject","progress","notify","when","notifyWith","abs","pointerType","MSPOINTER_TYPE_TOUCH","isPrimary","MSGesture","velocityX","velocityY","touches","x2","y2","x1","pageX","y1","pageY","isDoubleTap","addPointer","pointerId","cancelTouch","Number","isNaN","visible","hidden","checked","console","evaluate","interpolate","escape","noMatch","escapes","'","\\","\r","\n","\t","
","
","escaper","htmlEntities","&","<",">","\"","entityRe","escapeExpr","string","counter","tmpl","render","matcher","variable","Function","list","result","mediaQuery","alreadyImportedModules","setItem","removeItem","hasFlash","fo","ActiveXObject","mimeTypes","enabledPlugin","getBrowserInfo","ua","userAgent","extra","appName","appVersion","browserInfo","isSafari","isChrome","isFirefox","isLegacyIE","isIE","isIE11","isChromecast","isMobile","isiOS","isAndroid","isWindowsPhone","isWin8App","isWiiU","isPS4","_Events","_options","delegateEventSplitter","_BaseObject","cid","_ensureElement","delegateEvents","undelegateEvents","setElement","element","eventName","attrs","opts","core","enabled","bindEvents","enable","getExternalInterface","container","playbackPlugins","currentSize","_players","getInstance","playerId","_kibo","_kibo2","Kibo","defaultSetTimout","Error","defaultClearTimeout","runTimeout","fun","cachedSetTimeout","runClearTimeout","marker","cachedClearTimeout","cleanUpNextTick","draining","currentQueue","queue","queueIndex","drainQueue","len","Item","array","process","nextTick","title","browser","env","argv","versions","addListener","removeListener","removeAllListeners","emit","binding","cwd","chdir","dir","umask","webpackPolyfill","deprecate","paths","addMapEntry","pair","set","addSetEntry","func","thisArg","arrayEach","iteratee","arrayPush","values","arrayReduce","accumulator","initAccum","baseTimes","baseUnary","getValue","object","isHostObject","mapToArray","overArg","transform","arg","setToArray","Hash","entries","clear","entry","hashClear","__data__","nativeCreate","hashDelete","hashGet","HASH_UNDEFINED","hasOwnProperty","hashHas","hashSet","ListCache","listCacheClear","listCacheDelete","assocIndexOf","lastIndex","pop","listCacheGet","listCacheHas","listCacheSet","MapCache","mapCacheClear","Map","mapCacheDelete","getMapData","mapCacheGet","mapCacheHas","mapCacheSet","Stack","stackClear","stackDelete","stackGet","stackHas","stackSet","pairs","LARGE_ARRAY_SIZE","arrayLikeKeys","inherited","isArguments","skipIndexes","isIndex","assignMergeValue","assignValue","objValue","baseAssign","copyObject","baseClone","isDeep","isFull","customizer","stack","isObject","isArr","initCloneArray","copyArray","tag","getTag","isFunc","funcTag","genTag","isBuffer","cloneBuffer","objectTag","argsTag","initCloneObject","copySymbols","cloneableTags","initCloneByTag","stacked","getAllKeys","subValue","baseCreate","proto","objectCreate","baseGetAllKeys","keysFunc","symbolsFunc","baseGetTag","objectToString","baseIsNative","isMasked","pattern","reIsNative","reIsHostCtor","toSource","baseIsTypedArray","isObjectLike","isLength","typedArrayTags","baseKeys","isPrototype","nativeKeys","baseKeysIn","nativeKeysIn","isProto","baseMerge","srcIndex","isTypedArray","srcValue","baseMergeDeep","newValue","mergeFunc","isCommon","isArrayLikeObject","toPlainObject","baseRest","start","nativeMax","otherArgs","buffer","copy","cloneArrayBuffer","arrayBuffer","byteLength","Uint8Array","cloneDataView","dataView","byteOffset","cloneMap","cloneFunc","cloneRegExp","regexp","reFlags","cloneSet","cloneSymbol","symbol","symbolValueOf","cloneTypedArray","typedArray","getSymbols","createAssigner","assigner","sources","guard","isIterateeCall","isKeyable","getNative","input","getPrototype","Ctor","arrayBufferTag","boolTag","dateTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","mapTag","numberTag","stringTag","regexpTag","setTag","symbolTag","MAX_SAFE_INTEGER","reIsUint","isArrayLike","maskSrcKey","objectProto","funcToString","other","propertyIsEnumerable","objectCtorString","keysIn","stubArray","stubFalse","arrayTag","errorTag","promiseTag","weakMapTag","reRegExpChar","freeGlobal","freeSelf","freeExports","freeModule","moduleExports","freeProcess","nodeUtil","nodeIsTypedArray","arrayProto","funcProto","coreJsData","uid","IE_PROTO","Buffer","nativeGetSymbols","getOwnPropertySymbols","nativeIsBuffer","max","DataView","Promise","Set","WeakMap","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","valueOf","ArrayBuffer","ctorString","merge","_style","_style2","currentTime","playback","isReady","mediaControlDisabled","plugins","data-container","dblclick","doubleTap","contextmenu","ended","buffering","timeUpdated","onBuffering","bufferfull","settingsUpdate","loadedMetadata","highDefinitionUpdate","updateBitrate","playbackStateChanged","playbackDvrStateChanged","disableMediaControl","enableMediaControl","onEnded","playing","paused","stopped","dvrInUse","newBitrate","statsReport","metrics","isDvrEnabled","dvrEnabled","isDvrInUse","plugin","setStyle","animate","duration","getCurrentTime","errorObj","metadata","timeProgress","current","clicked","chromeless","allowUserInteraction","dblClicked","onContextMenu","setVolume","fullscreen","addPlugin","hasPlugin","getPlugin","mouseEnter","mouseLeave","isHD","updateStyle","configure","ContainerFactory","loader","createContainers","_this2","createContainer","findPlaybackPlugin","resolvedSource","playbackPlugin","defer","addContainerPlugins","containerPlugins","Plugin","_container_factory","_container_factory2","playerInfo","firstResize","containers","setupMediaControl","_boundFullscreenHandler","handleFullscreenChange","webkitfullscreenchange","data-player","containerFactory","setupContainers","resolveOnContainersReady","updateSize","setFullscreen","setPlayerSize","previousSize","resize","triggerResize","enableResizeObserver","_this3","checkSizeCallback","computedSize","clientWidth","clientHeight","resizeObserverInterval","setInterval","newSize","thereWasChange","oldHeight","oldWidth","disableResizeObserver","clearInterval","_this4","_this5","mediaControl","setMediaControlContainer","setContainer","removeContainer","appendContainer","renderContainers","getCurrentContainer","appendTo","parentElement","_this6","createMediaControl","focusElement","toggleFullscreen","onMediaControlShow","mediacontrol","external","getCurrentPlayback","showMediaControl","hideMediaControl","hideMediaControlDelay","showing","_this7","CoreFactory","player","addCorePlugins","corePlugins","setupExternalInterface","externalFunctions","_spinner_three_bounce","_spinner_three_bounce2","_stats","_stats2","_watermark","_watermark2","_google_analytics","_google_analytics2","_click_to_pause","_click_to_pause2","_dvr_controls","_dvr_controls2","_favicon","_favicon2","_seek_time","_seek_time2","_sources","_sources2","_end_video","_end_video2","_strings","_strings2","externalPlugins","validateExternalPluginsType","addExternalPlugins","groupPluginsByType","memo","pluginName","plugintypes","errorMessage","_mediaControl","_mediaControl2","_mediaControl3","_mediaControl4","_play","_play2","_pause","_pause2","_stop","_stop2","_volume","_volume2","_mute","_mute2","_expand","_expand2","_shrink","_shrink2","_hd","_hd2","persistConfig","currentPositionValue","currentDurationValue","initialVolume","mute","keepVisible","fullScreenOnVideoTagSupported","addEventListeners","right","userDisabled","stopDragHandler","stopDrag","updateDragHandler","updateDrag","data-media-control","click [data-play]","click [data-pause]","click [data-playpause]","click [data-stop]","click [data-playstop]","click [data-fullscreen]","click .bar-container[data-seekbar]","click .bar-container[data-volume]","click .drawer-icon[data-volume]","mouseenter .drawer-container[data-volume]","mouseleave .drawer-container[data-volume]","mousedown .bar-container[data-volume]","mousemove .bar-container[data-volume]","mousedown .bar-scrubber[data-seekbar]","mousemove .bar-container[data-seekbar]","mouseleave .bar-container[data-seekbar]","mouseenter .media-control-layer[data-controls]","mouseleave .media-control-layer[data-controls]","intendedVolume","playerResize","changeTogglePlay","onTimeUpdate","updateProgressBar","onVolumeChanged","onLoadedMetadataOnVideoTag","updateVolumeUI","video","webkitSupportsFullscreen","rendered","$volumeBarContainer","containerWidth","barWidth","$volumeBarBackground","pos","$volumeBarFill","$volumeBarScrubber","ceil","$volumeIcon","muted","applyButtonStyle","$playPauseToggle","$playStopToggle","mousemoveOnSeekBar","seekEnabled","offsetX","$seekBarContainer","$seekBarHover","mouseleaveOnSeekBar","onVolumeClick","getVolumeFromUIEvent","mousemoveOnVolumeBar","draggingVolumeBar","$fullscreenToggle","hideVolumeBar","togglePlayPause","togglePlayStop","startSeekDrag","draggingSeekBar","$seekBarLoaded","$seekBarPosition","$seekBarScrubber","startVolumeDrag","min","setSeekPercentage","offsetY","volumeFromUI","toggleMute","setWhenContainerReady","resetUserKeepVisible","showVolumeBar","hideVolumeId","loadedStart","total","loadedEnd","renderSeekBar","currentSeekBarPercentage","newPosition","newDuration","displayedPosition","$position","displayedDuration","$duration","setKeepVisible","resetKeepVisible","setUserKeepVisible","userKeepVisible","isVisible","clientX","lastMouseX","clientY","lastMouseY","hideId","delay","newSettings","getSettings","settingsChanged","stringify","$hdIndicator","createCachedElements","$layer","$volumeContainer","resetIndicators","initializeIcons","displayedSeekBarPercentage","seekRelative","delta","bindKeyEvents","unbindKeyEvents","kibo","down","parseColors","buttonsColor","buttons","seekbarColor","seekbar","stylesheet","previousSeekPercentage","disableKeyboardShortcuts","_core_factory","_core_factory2","defaultOptions","_normalizeSources","_registerOptionEventListeners","_coreFactory","parentId","setParentId","attachTo","_ready","onReady","onResize","onPlay","onPause","onStop","onSeek","onError","onVolumeUpdate","_addEventListeners","_onReady","_containerChanged","_onFullscreenChange","_addContainerEventListeners","_onPlay","_onPause","_onStop","_onEnded","_onSeek","_onError","_onTimeUpdate","_onVolumeUpdate","userEvents","userEvent","eventType","eventsMapping","eventFunction","autoPlay","getVolume","_mutedVolume","unmute","_flash3","_flash4","IE_CLASSID","_Playback","_setupFirefox","attributes","swfPath","playbackId","wmode","callbackName","data-flash-playback","_Player","_Player2","MAX_ATTEMPTS","_BaseFlashPlayback","_src","_baseUrl","_autoPlay","_isReadyState","_addListeners","_currentState","_bufferingState","_bootstrap","playerPlay","_firstPlay","insertAfter","_metadataLoaded","_attempts","message","_updateTime","getPosition","_progress","_checkState","_isIdle","getState","getBytesLoaded","getBytesTotal","_checkInitialSeek","seekTime","seekSeconds","playerResume","playerVolume","playerPause","playerStop","playerSeek","bootstrapId","resource","resourceParts","_flashls_events","_flashls_events2","_HLSPlayer","_HLSPlayer2","AUTO","_initHlsParameters","highDefinition","_loop","loop","_defaultSettings","_playbackType","_hasEnded","_levels","_currentLevel","playerSetCurrentLevel","_autoStartLoad","autoStartLoad","_capLevelToStage","capLevelToStage","_maxLevelCappingMode","maxLevelCappingMode","_minBufferLength","minBufferLength","_minBufferLengthCapping","minBufferLengthCapping","_maxBufferLength","maxBufferLength","_maxBackBufferLength","maxBackBufferLength","_lowBufferLength","lowBufferLength","_mediaTimePeriod","mediaTimePeriod","_fpsDroppedMonitoringPeriod","fpsDroppedMonitoringPeriod","_fpsDroppedMonitoringThreshold","fpsDroppedMonitoringThreshold","_capLevelonFPSDrop","capLevelonFPSDrop","_smoothAutoSwitchonFPSDrop","smoothAutoSwitchonFPSDrop","_switchDownOnLevelError","switchDownOnLevelError","_seekMode","seekMode","_keyLoadMaxRetry","keyLoadMaxRetry","_keyLoadMaxRetryTimeout","keyLoadMaxRetryTimeout","_fragmentLoadMaxRetry","fragmentLoadMaxRetry","_fragmentLoadMaxRetryTimeout","fragmentLoadMaxRetryTimeout","_fragmentLoadSkipAfterMaxRetry","fragmentLoadSkipAfterMaxRetry","_maxSkippedFragments","maxSkippedFragments","_flushLiveURLCache","flushLiveURLCache","_initialLiveManifestSize","initialLiveManifestSize","_manifestLoadMaxRetry","manifestLoadMaxRetry","_manifestLoadMaxRetryTimeout","manifestLoadMaxRetryTimeout","_manifestRedundantLoadmaxRetry","manifestRedundantLoadmaxRetry","_startFromBitrate","startFromBitrate","_startFromLevel","startFromLevel","_autoStartMaxDuration","autoStartMaxDuration","_seekFromLevel","seekFromLevel","_useHardwareVideoDecoder","useHardwareVideoDecoder","_hlsLogEnabled","hlsLogEnabled","_logDebug","logDebug","_logDebug2","logDebug2","_logWarn","logWarn","_logError","logError","_hlsMinimumDvrSize","hlsMinimumDvrSize","timeMetrics","_setPlaybackState","level","_levelChanged","code","_flashPlaybackError","loadmetrics","_onFragmentLoaded","_onLevelEndlist","playerLoad","_srcLoaded","_setFlashSettings","_updatePlaybackType","_shouldPlayOnManifestLoaded","_bootstrapAttempts","playerSetAutoStartLoad","playerSetCapLevelToStage","playerSetMaxLevelCappingMode","playerSetMinBufferLength","playerSetMinBufferLengthCapping","playerSetMaxBufferLength","playerSetMaxBackBufferLength","playerSetLowBufferLength","playerSetMediaTimePeriod","playerSetFpsDroppedMonitoringPeriod","playerSetFpsDroppedMonitoringThreshold","playerSetCapLevelonFPSDrop","playerSetSmoothAutoSwitchonFPSDrop","playerSetSwitchDownOnLevelError","playerSetSeekMode","playerSetKeyLoadMaxRetry","playerSetKeyLoadMaxRetryTimeout","playerSetFragmentLoadMaxRetry","playerSetFragmentLoadMaxRetryTimeout","playerSetFragmentLoadSkipAfterMaxRetry","playerSetMaxSkippedFragments","playerSetFlushLiveURLCache","playerSetInitialLiveManifestSize","playerSetManifestLoadMaxRetry","playerSetManifestLoadMaxRetryTimeout","playerSetManifestRedundantLoadmaxRetry","playerSetStartFromBitrate","playerSetStartFromLevel","playerSetAutoStartMaxDuration","playerSetSeekFromLevel","playerSetUseHardwareVideoDecoder","playerSetLogInfo","playerSetLogDebug","playerSetLogDebug2","playerSetLogWarn","playerSetLogError","setAutoStartLoad","setCapLevelToStage","setMaxLevelCappingMode","setSetMinBufferLength","setMinBufferLengthCapping","setMaxBufferLength","setMaxBackBufferLength","setLowBufferLength","setMediaTimePeriod","setFpsDroppedMonitoringPeriod","setFpsDroppedMonitoringThreshold","setCapLevelonFPSDrop","setSmoothAutoSwitchonFPSDrop","setSwitchDownOnLevelError","setSeekMode","setKeyLoadMaxRetry","setKeyLoadMaxRetryTimeout","setFragmentLoadMaxRetry","setFragmentLoadMaxRetryTimeout","setFragmentLoadSkipAfterMaxRetry","setMaxSkippedFragments","setFlushLiveURLCache","setInitialLiveManifestSize","setManifestLoadMaxRetry","setManifestLoadMaxRetryTimeout","setManifestRedundantLoadmaxRetry","setStartFromBitrate","setStartFromLevel","setAutoStartMaxDuration","setSeekFromLevel","setUseHardwareVideoDecoder","setSetLogInfo","setLogDebug","setLogDebug2","setLogWarn","setLogError","currentLevel","getLevels","bitrate","_fillLevels","bandwidth","_normalizeDuration","previousDVRStatus","_dvrEnabled","livePlayback","_updateSettings","_dvrInUse","getCurrentLevelIndex","getCurrentLevel","levels","getCurrentBitrate","setCurrentLevel","_updateCurrentState","getType","_startReportingProgress","_stopReportingProgress","_reportingProgress","buffered","getbufferLength","_manifestLoaded","_updateDvr","previousDvrInUse","dvr","levelsLength","label","_createCallbacks","Clappr","flashlsCallbacks","flashlsEvents","HLSEvents","instanceId","videoSize","manifest","audioLevelLoaded","levelLoaded","levelEndlist","fragmentLoaded","fragmentPlaying","playmetrics","timemetrics","newState","seekState","switch","newLevel","audioTracksListChange","trackList","audioTrackChange","trackId","_toConsumableArray","arr2","from","_HTML5VideoPlayback","_minDvrSize","_extrapolatedWindowNumSegments","extrapolatedWindowNumSegments","_lastTimeUpdate","_lastDuration","_playableRegionStartTime","_localStartTimeCorrelation","_localEndTimeCorrelation","_playableRegionDuration","_durationExcludesAfterLiveSyncPoint","_segmentTargetDuration","_playlistType","_recoverAttemptsRemaining","hlsRecoverAttempts","_startTimeUpdateTimer","_extrapolatedStartTime","corr","timePassed","_now","local","extrapolatedWindowStartTime","remote","_extrapolatedWindowDuration","actualEndTime","extrapolatedEndTime","_extrapolatedEndTime","_startTime","_setupHls","hlsjsConfig","MEDIA_ATTACHED","loadSource","LEVEL_LOADED","evt","LEVEL_UPDATED","_onLevelUpdated","LEVEL_SWITCH","_onLevelSwitch","FRAG_LOADED","ERROR","_onHLSJSError","attachMedia","_recover","_recoveredDecodingError","_recoveredAudioCodecError","swapAudioCodec","recoverMediaError","_setupSrc","srcUrl","_timeUpdateTimer","_onDurationChange","_stopTimeUpdateTimer","_duration","seekTo","warn","seekToLivePoint","isSeekEnabled","fatal","ErrorTypes","NETWORK_ERROR","startLoad","MEDIA_ERROR","update","_onProgress","bufferedPos","end","details","targetduration","startTimeChanged","durationChanged","fragments","previousPlayableRegionStartTime","previousPlayableRegionDuration","startTime","totalduration","fragmentTargetDuration","liveSyncDurationCount","DefaultConfig","hiddenAreaDuration","endTime","previousEndTime","endTimeChanged","isHls","isSupported","_HTML5Video","updateSettings","resourceUrl","mimetypes","wav","mp3","aac","oga","_canPlay","MIMETYPES","mp4","codec","ogg","3gpp","webm","mkv","m3u8","AUDIO_MIMETYPES","KNOWN_AUDIO_MIMETYPES","acc","_loadStarted","_playheadMoving","_playheadMovingTimer","_stopped","disableContextMenu","disableVideoTagContextMenu","playbackConfig","preload","poster","controls","useVideoTagDefaultControls","crossOrigin","x-webkit-playsinline","playInline","isAudioOnly","_mimeTypesForUrl","audioOnly","data-html5-video","canplay","canplaythrough","durationchange","loadeddata","loadedmetadata","seeked","seeking","stalled","timeupdate","waiting","_onLoadedMetadata","_handleBufferingEvents","autoSeekFromUrl","onDemandType","tagName","Infinity","_stopPlayheadMovingChecks","isMuted","_startPlayheadMovingChecks","_playheadMovingTimeOnCheck","_determineIfPlayheadMoving","_onWaiting","_onLoadedData","_onCanPlay","_onPlaying","playheadShouldBeMoving","HAVE_FUTURE_DATA","_typeFor","mimeTypesByExtension","extension","media","mediaType","canPlayType","data-html-img","_onLoad","_error","_error2","_noiseFrameNum","_started","data-no-op","playbackNotSupported","playbackNotSupportedMessage","showForNoOp","_animate","_noise","idata","createImageData","canvas","buffer32","Uint32Array","err","random","color","pow","putImageData","_animationHandle","getContext","ClickToPausePlugin","_ContainerPlugin","_index","_index2","DVRControls","_UICorePlugin","click .live-button","data-dvr-controls","containerChanged","dvrChanged","shouldRender","useDvrControls","backToLive","EndVideo","_CorePlugin","exitOnEnd","exitFullscreenOnEnd","oldIcon","Favicon","changeFavicon","setPlayIcon","setPauseIcon","resetIcon","createIcon","svg","fillStyle","path","Path2D","fill","icon","toDataURL","playIcon","changeIcon","pauseIcon","GoogleAnalytics","gaAccount","account","trackerName","gaTrackerName","domainName","gaDomainName","currentHDState","embedScript","_gat","onload","onBufferFull","onPlaybackChanged","CONTAINER_FULL_SCREEN","onFullscreen","onHD","onDVR","_gaq","playbackState","res","BOLD","INFO","DEBUG","WARN","LEVEL_DEBUG","LEVEL_INFO","LEVEL_WARN","LEVEL_ERROR","LEVEL_DISABLED","COLORS","DESCRIPTIONS","offLevel","onOff","BLACKLIST","log","info","previousLevel","klassDescription","_instance","setLevel","_poster3","_poster4","PosterPlugin","_UIContainerPlugin","hasStartedPlaying","playRequested","data-poster","showOnVideoEnd","showPlayButton","$playButton","shouldHideOnPlay","posterUrl","background-image","$playWrapper","_seek_time3","_seek_time4","SeekTime","hoveringOverSeekBar","hoverPosition","actualLiveTime","actualLiveServerTime","actualLiveServerTimeDiff","getTime","data-seek-time","mediaControlContainer","isLiveStreamWithDvr","useActualLiveTime","showTime","hideTime","onContainerChanged","updateDuration","calculateHoverPosition","getSeekTime","secondsSinceMidnight","setHours","shouldBeVisible","currentSeekTime","displayedSeekTime","$seekTimeEl","durationShown","$durationEl","currentDuration","elWidth","elLeftPos","SourcesPlugin","onContainersCreated","firstValidSource","_spinner","_spinner2","_spinner3","_spinner4","SpinnerThreeBouncePlugin","showTimeout","data-spinner","StatsPlugin","setInitialAttrs","reportInterval","onStatsAdd","firstPlay","startupTime","rebufferingTime","watchingTime","rebuffers","externalMetrics","watchingTimeInit","intervalId","report","startupTimeInit","rebufferingTimeInit","getRebufferingTime","getWatchingTime","totalTime","isRebuffering","metric","getStats","Strings","_initializeMessages","lang","_language","_messages","en","back_to_live","playback_not_supported","pt","es","ru","strings","_watermark3","_watermark4","WaterMarkPlugin","watermark","imageUrl","imageLink","watermarkLink","templateOptions","KEY_NAMES_BY_CODE","8","9","13","16","17","18","20","27","32","37","38","39","40","48","49","50","51","52","53","54","55","56","57","65","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","112","113","114","115","116","117","118","119","120","121","122","123","KEY_CODES_BY_NAME","MODIFIERS","registerEvent","attachEvent","unregisterEvent","detachEvent","stringContains","neatString","capitalize","isString","what","arrayIncludes","haystack","needle","extractModifiers","keyCombination","modifiers","extractKey","modifiersAndKey","keyName","keyCode","that","lastKeyCode","lastModifiers","keysDown","any","keysUp","downHandler","handler","upHandler","unloader","upOrDown","registeredKeys","lastModifiersAndKey","registerKeys","newKeys","unregisterKeys","up","lastKey","modifier","require","1","_dereq_","EventEmitter","_maxListeners","isUndefined","defaultMaxListeners","setMaxListeners","er","listeners","listener","newListener","warned","trace","ret","listenerCount","evlistener","emitter","2","bundleFn","resolveSources","workerSources","depPath","depKey","wkey","cacheKeys","exp","floor","wcache","skey","scache","URL","webkitURL","mozURL","msURL","blob","Blob","bare","workerUrl","createObjectURL","worker","Worker","objectURL","3","_eventHandler","_eventHandler2","_bufferHelper","_bufferHelper2","_errors","_logger","_ewmaBandwidthEstimator","_ewmaBandwidthEstimator2","AbrController","_EventHandler","hls","FRAG_LOADING","FRAG_BUFFERED","lastLoadedFragLevel","_autoLevelCapping","_nextAutoLevel","onCheck","abandonRulesCheck","clearTimer","frag","timer","bwEstimator","isLive","config","ewmaFast","ewmaSlow","abrEwmaFastLive","abrEwmaSlowLive","abrEwmaFastVoD","abrEwmaSlowVoD","abrEwmaDefaultEstimate","fragCurrent","stats","aborted","logger","playbackRate","autoLevel","requestDelay","trequest","loadRate","bw","expectedLen","fragLoadedDelay","bufferStarvationDelay","bufferInfo","maxBufferHole","fragLevelNextLoadedDelay","nextLoadLevel","toFixed","sample","FRAG_LOAD_EMERGENCY_ABORTED","bitrateTest","tparsed","tbuffered","tload","onFragBuffered","loadCounter","fragLoadingProcessingMs","tfirst","bitrateTestDelay","ErrorDetails","FRAG_LOAD_ERROR","FRAG_LOAD_TIMEOUT","currentFragDuration","currentBw","minAutoLevel","maxAutoLevel","maxFetchDuration","bwFactor","bwUpFactor","levelInfo","levelDetails","avgDuration","adjustedbw","fetchDuration","nextAutoLevel","minAutoBitrate","canEstimate","nextABRAutoLevel","nextLevel","autoLevelCapping","avgbw","getEstimate","bestLevel","findBestLevel","abrBandWidthFactor","abrBandWidthUpFactor","maxStarvationDelay","maxLoadingDelay","24","25","26","28","43","4","_binarySearch","_binarySearch2","_demuxer","_demuxer2","_levelHelper","_levelHelper2","_timeRanges","_timeRanges2","State","STOPPED","STARTING","IDLE","PAUSED","KEY_LOADING","FRAG_LOADING_WAITING_RETRY","WAITING_TRACK","PARSING","PARSED","ENDED","AudioStreamController","MEDIA_DETACHING","AUDIO_TRACKS_UPDATED","AUDIO_TRACK_SWITCH","AUDIO_TRACK_LOADED","KEY_LOADED","FRAG_PARSING_INIT_SEGMENT","FRAG_PARSING_DATA","FRAG_PARSED","BUFFER_CREATED","BUFFER_APPENDED","BUFFER_FLUSHED","audioCodecSwap","ticks","ontick","tick","stopLoad","startPosition","tracks","lastCurrentTime","fragLoadError","nextLoadPosition","fragPrevious","demuxer","doTick","track","trackDetails","startFragRequested","startFragPrefetch","mediaBuffer","bufferLen","bufferEnd","maxBufLen","maxMaxBufferLength","sn","endSN","BUFFER_EOS","fragLen","foundFrag","maxFragLookUpTolerance","candidate","startSN","decryptdata","uri","fragLoadIdx","maxThreshold","fragLoadingLoopThreshold","loadIdx","FRAG_LOOP_LOADING_ERROR","retryDate","isSeeking","onvseeking","onMediaSeeking","onvended","onMediaEnded","onvseeked","audioTracks","altAudio","BUFFER_FLUSHING","startOffset","endOffset","POSITIVE_INFINITY","PTSKnown","startTimeOffset","audioCodec","defaultAudioCodec","pendingAppending","accurateTimeOffset","payload","cc","audio","levelCodec","BUFFER_CODECS","initSegment","BUFFER_APPENDING","content","startPTS","endPTS","startDTS","endDTS","nb","updateFragPTSDTS","data1","data2","_checkAppendedParsed","audioTrack","loadError","fragLoadingMaxRetry","fragLoadingRetryDelay","fragLoadingMaxRetryTimeout","AUDIO_TRACK_LOAD_ERROR","AUDIO_TRACK_LOAD_TIMEOUT","KEY_LOAD_ERROR","KEY_LOAD_TIMEOUT","29","45","5","AudioTrackController","MANIFEST_LOADING","MANIFEST_LOADED","defaultFound","newId","AUDIO_TRACK_LOADING","audioTrackId","setAudioTrackInternal","6","BufferController","MEDIA_ATTACHING","MANIFEST_PARSED","BUFFER_RESET","_msDuration","_levelDuration","onsbue","onSBUpdateEnd","onsbe","onSBUpdateError","pendingTracks","audioExpected","videoExpected","sourceBufferNb","ms","mediaSource","MediaSource","onmso","onMediaSourceOpen","onmse","onMediaSourceEnded","onmsc","onMediaSourceClose","endOfStream","sourceBuffer","flushRange","segments","appended","MEDIA_DETACHED","checkPendingTracks","pendingTracksNb","createSourceBuffers","doAppending","_needsFlush","doFlush","_needsEos","checkEos","appending","updateMediaElementDuration","BUFFER_APPENDING_ERROR","sb","removeSourceBuffer","trackName","addSourceBuffer","BUFFER_ADD_CODEC_ERROR","updating","flushBufferCounter","range","flushBuffer","segment","appendBuffer","appendError","BUFFER_FULL_ERROR","BUFFER_APPEND_ERROR","appendErrorMaxRetry","typeIn","bufStart","bufEnd","flushStart","flushEnd","7","CapLevelController","FPS_DROP_LEVEL_CAPPING","capLevelToPlayerSize","restrictedLevels","isLevelRestricted","droppedLevel","HTMLVideoElement","firstLevel","getMaxLevel","detectPlayerSize","streamController","nextLevelSwitch","capLevelIndex","mWidth","mediaWidth","mHeight","mediaHeight","lWidth","lHeight","pixelRatio","devicePixelRatio","offsetWidth","contentScaleFactor","offsetHeight","_ewma","_ewma2","EwmaBandWidthEstimator","slow","fast","defaultEstimate","defaultEstimate_","minWeight_","minDelayMs_","slow_","fast_","durationMs","numBytes","weight","getTotalWeight","42","FPSController","isVideoPlaybackQualityAvailable","capLevelOnFPSDrop","getVideoPlaybackQuality","checkFPSInterval","decodedFrames","droppedFrames","lastTime","currentPeriod","currentDropped","lastDroppedFrames","currentDecoded","lastDecodedFrames","droppedFPS","FPS_DROP","totalDroppedFrames","videoPlaybackQuality","checkFPS","totalVideoFrames","droppedVideoFrames","webkitDecodedFrameCount","webkitDroppedFrameCount","10","LevelController","_manualLevel","canload","bitrateStart","levels0","bitrateSet","videoCodecFound","audioCodecFound","videoCodec","AUDIO","redundantLevelId","urlId","checkSupportedAudio","isTypeSupported","checkSupportedVideo","_firstLevel","MANIFEST_INCOMPATIBLE_CODECS_ERROR","reason","_level","LEVEL_LOADING","OTHER_ERROR","LEVEL_SWITCH_ERROR","levelId","levelError","LEVEL_LOAD_ERROR","LEVEL_LOAD_TIMEOUT","recoverable","abrController","mediaBuffered","isBuffered","retryDelay","levelLoadingRetryDelay","newDetails","reloadInterval","averagetargetduration","curLevel","curDetails","setLevelInternal","_startLevel","configStartLevel","startLevel","11","WAITING_LEVEL","StreamController","lastPaused","_doTickIdle","_checkBuffer","_checkFragmentChanged","maxBufferSize","levelLastLoaded","_fetchPayloadOrEos","_ref","_ensureFragmentAtLivePoint","_findFragment","_loadFragmentOrKey","_ref2","maxLatency","liveMaxLatencyDuration","liveMaxLatencyDurationCount","liveSyncPosition","computeLivePosition","targetSN","_ref3","deltaPTS","curSNIdx","dropped","_ref4","autoLevelEnabled","bufferRange","getBufferRange","rangeCurrent","fragPlaying","FRAG_CHANGED","immediateSwitch","previouslyPaused","fetchdelay","currentRange","nextRange","nextLevelId","fragLastKbps","followingBufferRange","onMediaSeeked","tolerance","fragStartOffset","fragEndOffset","heaac","audioCodecSwitch","startLevelLoaded","newLevelId","sliding","mergeDetails","fragLoaded","lastAudioCodec","channelCount","mergedTrack","audiovideo","drift","LEVEL_PTS_UPDATED","videoBuffer","mediaTrack","alternate","_reduceMaxBufferLength","minLength","startPositionBuffered","immediateLevelSwitchEnd","expectedPlaying","jumpThreshold","playheadMoving","seekHoleNudgeDuration","BUFFER_STALLED_ERROR","nextBufferStart","nextStart","maxSeekHole","hole","BUFFER_SEEK_OVER_HOLE","newRange","targetLatency","liveSyncDuration","nextState","previousState","_state","STREAM_STATE_TRANSITION","nextBufferRange","_liveSyncPosition","12","_cea608Parser","_cea608Parser2","TimelineController","FRAG_PARSING_USERDATA","Cues","cueHandler","enableCEA708Captions","channel1","newCue","screen","textTrack1","existingTrack1","getExistingTrack","clearCurrentCues","createTextTrack","channel2","textTrack2","existingTrack2","cea608Parser","cues","removeCue","channelNumber","textTracks","textTrack","propName","kind","addTextTrack","lastPts","NEGATIVE_INFINITY","closedCaptions","pts","samples","ccdatas","extractCea608Data","bytes","addData","byteArray","tmpByte","ccbyte1","ccbyte2","ccValid","ccType","count","actualCCBytes","AES","_tables","_precompute","tmp","encKey","decKey","sbox","decTable","keyLen","rcon","xInv","x4","x8","tEnc","tDec","encTable","sboxInv","encrypted0","encrypted1","encrypted2","encrypted3","b2","c2","nInnerRounds","kIndex","table","table0","table1","table2","table3","14","_aes","_aes2","AES128Decrypter","initVector","iv","word","encrypted","init0","init1","init2","init3","wordIx","encrypted32","Int32Array","decipher","decrypted","decrypted32","ntoh","decrypt","doDecrypt","step","localDecrypt","subarray","15","_aes128Decrypter","_aes128Decrypter2","Decrypter","browserCrypto","crypto","subtle","webkitSubtle","disableWebCrypto","enableSoftwareAES","decryptBySoftware","decryptByWebCrypto","importKey","importedKey","catch","onWebCryptoError","key8","iv8","view","getUint32","decrypter","FRAG_DECRYPT_ERROR","_adts","_adts2","_id","_id2","AACDemuxer","observer","remuxerClass","remuxer","insertDiscontinuity","_aacTrack","sequenceNumber","timeOffset","frameLength","frameDuration","frameIndex","headerLength","stamp","aacSample","id3","timeStamp","contiguous","lastCC","switchLevel","lastLevel","lastSN","audiosamplerate","getAudioConfig","samplerate","unit","dts","remux","hasTimeStamp","22","ADTS","adtsObjectType","adtsSampleingIndex","adtsExtensionSampleingIndex","adtsChanelConfig","adtsSampleingRates","FRAG_PARSING_ERROR","_aacdemuxer","_aacdemuxer2","_tsdemuxer","_tsdemuxer2","_mp4Remuxer","_mp4Remuxer2","_passthroughRemuxer","_passthroughRemuxer2","DemuxerInline","typeSupported","probe","mp2t","23","36","19","_demuxerInline","_demuxerInline2","_events3","_events4","DemuxerWorker","_len2","_key2","forwardMessage","postMessage","cmd","enableLogs","FRAG_PARSING_METADATA","_demuxerWorker","_demuxerWorker2","_decrypter","_decrypter2","Demuxer","enableMP2TPassThrough","enableWorker","work","onwmsg","onWorkerMessage","onerror","INTERNAL_EXCEPTION","filename","lineno","revokeObjectURL","demuxInitialized","terminate","localthis","decryptedData","pushDecrypted","21","ExpGolomb","bytesAvailable","bitsAvailable","workingBytes","availableBytes","skipBytes","loadWord","bits","valu","readBits","leadingZeroCount","skipLZ","skipBits","clz","readUEG","deltaScale","lastScale","nextScale","readEG","profileIdc","profileCompat","levelIdc","numRefFramesInPicOrderCntCycle","picWidthInMbsMinus1","picHeightInMapUnitsMinus1","frameMbsOnlyFlag","scalingListCount","frameCropLeftOffset","frameCropRightOffset","frameCropTopOffset","frameCropBottomOffset","sarScale","readUByte","skipUEG","chromaFormatIdc","readBoolean","skipScalingList","picOrderCntType","skipEG","sarRatio","aspectRatioIdc","ID3","_hasTimeStamp","byte1","byte2","byte3","byte4","tagSize","endPos","header","readUTF","_parseID3Frames","_length","_payload","fromCharCode","tagId","tagLen","tagStart","tagFlags","timestamp","pts33Bit","_timeStamp","_expGolomb","_expGolomb2","TSDemuxer","pmtParsed","_pmtId","_avcTrack","_id3Track","_txtTrack","aacOverFlow","aacLastPTS","avcSample","stt","pid","atf","pes","codecsOnly","passthrough","unknownPIDs","avcTrack","aacTrack","id3Track","avcId","aacId","id3Id","pmtId","avcData","pesData","aacData","id3Data","parsePAT","_parsePAT","parsePMT","_parsePMT","parsePES","_parsePES","parseAVCPES","_parseAVCPES","parseAACPES","_parseAACPES","parseID3PES","_parseID3PES","parsedPIDs","avc","trackData","prevSampleData","curSample","sampleData","units","prevUnitData","curUnit","nbNalu","_initPTS","_initDTS","sectionLength","tableEnd","programInfoLength","stream","pesFlags","pesPrefix","pesLen","pesHdrLen","pesPts","pesDts","payloadStartOffset","newData","forceKeyFrameOnDiscontinuity","sps","expGolombDecoder","_parseAVCNALu","_createAVCSample","discardEPB","payloadType","payloadSize","endOfCaptions","countryCode","providerCode","readUShort","userStructure","readUInt","userDataType","firstByte","secondByte","totalCCs","_insertSampleInOrder","readSPS","codecarray","codecstring","pps","pushAccesUnit","_units","lastUnit","overflow","unitType","lastUnitType","naluState","lastState","lastUnitStart","_getLastNalUnit","_lastUnit","_tmp","newLength","EPBPositions","sourceIndex","newPTS","MANIFEST_LOAD_ERROR","MANIFEST_LOAD_TIMEOUT","MANIFEST_PARSING_ERROR","EventHandler","onEvent","handledEvents","useGenericHandler","registerListeners","unregisterListeners","isEventHandler","onEventGeneric","eventToFunction","funcName","FRAG_LOAD_PROGRESS","DESTROYING","AAC","BufferHelper","maxHoleDuration","vbuffered","bufferedInfo","bufferStart","bufferStartNext","buffered2","diff","buf2len","buf2end","LevelHelper","oldDetails","PTSFrag","oldfragments","newfragments","ccOffset","oldFrag","newFrag","fragIdx","updatePTS","fromIdx","toIdx","fragFrom","fragTo","fragToPTS","30","_playlistLoader","_playlistLoader2","_fragmentLoader","_fragmentLoader2","_abrController","_abrController2","_bufferController","_bufferController2","_capLevelController","_capLevelController2","_audioStreamController","_audioStreamController2","_streamController","_streamController2","_levelController","_levelController2","_timelineController","_timelineController2","_fpsController","_fpsController2","_audioTrackController","_audioTrackController2","_xhrLoader","_xhrLoader2","_keyLoader","_keyLoader2","_cues","_cues2","Hls","defaultConfig","playlistLoader","fragmentLoader","levelController","bufferController","capLevelController","fpsController","audioStreamController","timelineController","audioTrackController","keyLoader","stalledInBufferedNudgeThreshold","manifestLoadingTimeOut","manifestLoadingMaxRetry","manifestLoadingRetryDelay","manifestLoadingMaxRetryTimeout","levelLoadingTimeOut","levelLoadingMaxRetry","levelLoadingMaxRetryTimeout","fragLoadingTimeOut","fLoader","pLoader","xhrSetup","fetchSetup","stretchShortVideoTrack","detachMedia","loadLevel","immediateLevelSwitch","manualLevel","33","34","41","47","31","FragmentLoader","loaders","loaderName","loaderContext","loaderConfig","loaderCallbacks","responseType","progressData","byteRangeStartOffset","byteRangeEndOffset","rangeStart","rangeEnd","maxRetry","maxRetryDelay","onSuccess","loadsuccess","loaderror","onTimeout","loadtimeout","onProgress","loadprogress","response","KeyLoader","decryptkey","decrypturl","_url","_url2","_attrList","_attrList2","PlaylistLoader","retry","manifestLoadingMaxRetryTimeOut","levelLoadingMaxRetryTimeOut","buildAbsoluteURL","baseurl","re","resolution","decimalResolution","decimalInteger","NAME","codecs","CODECS","avc1toavcoti","medias","TYPE","groupId","DEFAULT","autoselect","AUTOSELECT","forced","FORCED","URI","LANGUAGE","segmentNumber","uint8View","levelkey","cloneObj","createInitializationVector","avcdata","substr","fragdecryptdata","currentSN","programDateTime","tagList","fragmentDecryptdataFromLevelkey","decryptparams","keyAttrs","decryptmethod","enumeratedString","decrypturi","decryptiv","hexadecimalInteger","startParams","startAttrs","decimalFloatingPoint","isLevel","parseLevelPlaylist","parseMasterPlaylist","audiotracks","parseMasterPlaylistMedia","embeddedAudioFound","46","35","MP4","types","avc1","avcC","btrt","dinf","dref","esds","ftyp","hdlr","mdat","mdhd","mdia","mfhd","minf","moof","moov","mp4a","mvex","mvhd","sdtp","stbl","stco","stsc","stsd","stsz","stts","tfdt","tfhd","traf","trak","trun","trex","tkhd","vmhd","smhd","charCodeAt","videoHdlr","audioHdlr","HDLR_TYPES","STTS","STSC","STCO","STSZ","VMHD","SMHD","STSD","majorBrand","avc1Brand","minorVersion","FTYP","box","DINF","timescale","baseMediaDecodeTime","boxes","flags","dependsOn","isDependedOn","hasRedundancy","avcc","configlen","sampleDependencyTable","cts","arraylen","isLeading","paddingValue","isNonSync","degradPrio","movie","_aac","_aac2","_mp4Generator","_mp4Generator2","MP4Remuxer","ISGenerated","PES2MP4SCALEFACTOR","PES_TIMESCALE","MP4_TIMESCALE","videoTrack","generateIS","audioData","remuxAudio","audioTrackLength","remuxVideo","videoData","remuxEmptyAudio","remuxID3","remuxText","initPTS","initDTS","audioSamples","videoSamples","pesTimeScale","computePTSDTS","greatestCommonDivisor","mp4SampleDuration","firstPTS","firstDTS","nextDTS","lastPTS","lastDTS","pes2mp4ScaleFactor","inputSamples","outputSamples","PTSDTSshift","curr","nextAvcDts","_PTSNormalize","vendor","_i","_sample","setUint32","_i2","mp4SampleLength","compositionTimeOffset","lastFrameDuration","gapTolerance","deltaToFrameEnd","nextAacPts","mp4Sample","ptsnorm","dtsnorm","fillFrame","newStamp","mp4timeScale","expectedSampleDuration","samples0","pesFrameDuration","nextPtsNorm","ptsNorm","missing","getSilentFrame","_delta","numMissingFrames","_i3","lastSampleDuration","nbSamples","sampleDuration","silentFrame","reference","44","PassThroughRemuxer","rawData","AttrList","parseAttrList","attrName","intValue","stringValue","quote","lastIndexOf","BinarySearch","comparisonFunction","minIndex","maxIndex","currentIndex","currentElement","comparisonResult","specialCea608CharsCodes","92","94","95","96","124","125","126","127","128","129","130","131","132","133","134","135","136","137","138","139","140","141","142","143","144","145","146","147","148","149","150","151","152","153","154","155","156","157","158","159","160","161","162","163","164","165","166","167","168","169","170","171","172","173","174","175","176","177","178","179","180","181","182","183","184","185","186","187","188","189","190","191","192","193","194","195","196","197","198","199","200","201","202","203","204","205","206","207","getCharForByte","byte","charCode","NR_ROWS","NR_COLS","rowsLowCh1","rowsHighCh1","rowsLowCh2","rowsHighCh2","backgroundColors","verboseFilter","DATA","WARNING","TEXT","verboseLevel","setTime","newTime","severity","msg","minLevel","numArrayToHexArray","numArray","hexArray","PenState","foreground","underline","italics","background","flash","styles","attribs","newPenState","StyledUnicodeChar","uchar","penState","reset","equals","newChar","isDefault","Row","chars","currPenState","equal","isEmpty","absPos","relPos","newPos","setPenState","setCursor","moveCursor","setChar","backSpace","char","startPos","clearFromPos","setStyles","currChar","CaptionScreen","rows","currRow","nrRollUpRows","row","clearToEndOfRow","insertChar","setPenStyles","pacData","newRow","indent","prevPos","setPen","bkgData","nrRows","getDisplayText","topRowIndex","topRow","asOneRow","displayText","rowNr","rowText","getTextString","Cea608Channel","outputFilter","chNr","mode","verbose","displayedMemory","nonDisplayedMemory","lastOutputScreen","currRollUpRow","writeScreen","cueStartTime","lastCueEndTime","newHandler","setPAC","setBkgData","newMode","outputDataUpdate","setMode","setRollUpRows","rollUp","nrCols","colorIndex","colors","updateData","Cea608Parser","field","out1","out2","outputs","channels","currChNr","lastCmdA","lastCmdB","bufferedData","dataCounters","padding","getHandler","setHandler","byteList","cmdFound","charsFound","parseCmd","parseMidrow","parsePAC","parseBackgroundAttributes","parseChars","channel","insertChars","cond1","cond2","ccRCL","ccBS","ccAOF","ccAON","ccDER","ccRU","ccFON","ccRDC","ccTR","ccRTD","ccEDM","ccCR","ccENM","ccEOC","ccTO","ccMIDROW","case1","case2","interpretPAC","pacIndex","channelNr","charCodes","charCode1","oneCode","hexCodes","cueSplitAtTime","captionScreen","cue","indenting","VTTCue","TextTrackCue","line","align","addCue","EWMA","halfLife","alpha_","estimate_","totalWeight_","adjAlpha","zeroFactor","formatMsg","consolePrintFn","exportLoggerFunctions","debugConfig","functions","exportedLogger","fakeLogger","resultArray","TimeRanges","URLHelper","baseURL","relativeURL","relativeURLQuery","relativeURLHash","relativeURLHashSplit","relativeURLQuerySplit","baseURLHashSplit","baseURLQuerySplit","baseURLDomainSplit","baseURLProtocol","baseURLProtocolDomain","baseURLPath","builtURL","buildAbsolutePath","basePath","relativePath","nUpLn","nEnd","sRelPath","sDir","sPath","nStart","XhrLoader","requestTimeout","retryTimeout","callbacks","loadInternal","XDomainRequest","readystatechange","onprogress","responseURL","lengthComputable","arraySome","predicate","SetCache","setCacheAdd","setCacheHas","baseIsEqual","bitmask","baseIsEqualDeep","equalFunc","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","equalByTag","PARTIAL_COMPARE_FLAG","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","equalObjects","isPartial","arrLength","othLength","seen","UNORDERED_COMPARE_FLAG","arrValue","othValue","compared","othIndex","convert","objProps","objLength","othProps","skipCtor","objCtor","othCtor","isEqual","FUNC_ERROR_TEXT","toInteger","isSymbol","toFinite","toNumber","INFINITY","sign","MAX_INTEGER","remainder","NAN","reTrim","isBinary","reIsBinary","reIsOctal","freeParseInt","reIsBadHex","baseToString","symbolToString","castPath","stringToPath","isKey","reIsPlainProp","reIsDeepProp","toKey","memoize","resolver","memoized","Cache","defaultValue","reLeadingDot","rePropName","reEscapeChar","number","baseIndexOf","arrayIncludesWith","comparator","baseFindIndex","fromIndex","fromRight","baseIsNaN","baseProperty","cacheHas","baseGet","baseHasIn","baseIsMatch","matchData","noCustomizer","baseIteratee","identity","baseMatchesProperty","baseMatches","property","getMatchData","matchesStrictComparable","isStrictComparable","hasIn","basePropertyDeep","baseUniq","includes","createSet","outer","computed","seenIndex","hasPath","hasFunc","uniqBy"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,OAAAD,IAEAD,EAAA,OAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAA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D,QAAA,mN7Gmk+BM,SAASC,EAAQD,G8Gnk+BvBC,EAAAD,QAAA,kO9G4k+BM,SAASC,EAAQD,G+G5k+BvBC,EAAAD,QAAA,8W/Gql+BM,SAASC,EAAQD,EAASM,GgHrl+BhCL,EAAAD,QAAAM,EAAAQ,EAAA,wChH8l+BM,SAASb,EAAQD,EAASM,GiH9l+BhCL,EAAAD,QAAAM,EAAAQ,EAAA,wCjHum+BM,SAASb,EAAQD,EAASM,GkHvm+BhCL,EAAAD,QAAAM,EAAAQ,EAAA","file":"clappr.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Clappr\"] = factory();\n\telse\n\t\troot[\"Clappr\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Clappr\"] = factory();\n\telse\n\t\troot[\"Clappr\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"<%=baseUrl%>/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/*!*********************!*\\\n !*** ./src/main.js ***!\n \\*********************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _player = __webpack_require__(/*! components/player */ 46);\n\t\n\tvar _player2 = _interopRequireDefault(_player);\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _utils2 = _interopRequireDefault(_utils);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _container_plugin = __webpack_require__(/*! base/container_plugin */ 13);\n\t\n\tvar _container_plugin2 = _interopRequireDefault(_container_plugin);\n\t\n\tvar _core_plugin = __webpack_require__(/*! base/core_plugin */ 12);\n\t\n\tvar _core_plugin2 = _interopRequireDefault(_core_plugin);\n\t\n\tvar _ui_core_plugin = __webpack_require__(/*! base/ui_core_plugin */ 17);\n\t\n\tvar _ui_core_plugin2 = _interopRequireDefault(_ui_core_plugin);\n\t\n\tvar _ui_container_plugin = __webpack_require__(/*! base/ui_container_plugin */ 14);\n\t\n\tvar _ui_container_plugin2 = _interopRequireDefault(_ui_container_plugin);\n\t\n\tvar _base_object = __webpack_require__(/*! base/base_object */ 9);\n\t\n\tvar _base_object2 = _interopRequireDefault(_base_object);\n\t\n\tvar _ui_object = __webpack_require__(/*! base/ui_object */ 10);\n\t\n\tvar _ui_object2 = _interopRequireDefault(_ui_object);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _container = __webpack_require__(/*! components/container */ 24);\n\t\n\tvar _container2 = _interopRequireDefault(_container);\n\t\n\tvar _core = __webpack_require__(/*! components/core */ 25);\n\t\n\tvar _core2 = _interopRequireDefault(_core);\n\t\n\tvar _loader = __webpack_require__(/*! components/loader */ 26);\n\t\n\tvar _loader2 = _interopRequireDefault(_loader);\n\t\n\tvar _mediator = __webpack_require__(/*! components/mediator */ 11);\n\t\n\tvar _mediator2 = _interopRequireDefault(_mediator);\n\t\n\tvar _media_control = __webpack_require__(/*! components/media_control */ 27);\n\t\n\tvar _media_control2 = _interopRequireDefault(_media_control);\n\t\n\tvar _player_info = __webpack_require__(/*! components/player_info */ 15);\n\t\n\tvar _player_info2 = _interopRequireDefault(_player_info);\n\t\n\tvar _base_flash_playback = __webpack_require__(/*! playbacks/base_flash_playback */ 18);\n\t\n\tvar _base_flash_playback2 = _interopRequireDefault(_base_flash_playback);\n\t\n\tvar _flash = __webpack_require__(/*! playbacks/flash */ 28);\n\t\n\tvar _flash2 = _interopRequireDefault(_flash);\n\t\n\tvar _flashls = __webpack_require__(/*! playbacks/flashls */ 29);\n\t\n\tvar _flashls2 = _interopRequireDefault(_flashls);\n\t\n\tvar _hls = __webpack_require__(/*! playbacks/hls */ 30);\n\t\n\tvar _hls2 = _interopRequireDefault(_hls);\n\t\n\tvar _html5_audio = __webpack_require__(/*! playbacks/html5_audio */ 31);\n\t\n\tvar _html5_audio2 = _interopRequireDefault(_html5_audio);\n\t\n\tvar _html5_video = __webpack_require__(/*! playbacks/html5_video */ 16);\n\t\n\tvar _html5_video2 = _interopRequireDefault(_html5_video);\n\t\n\tvar _html_img = __webpack_require__(/*! playbacks/html_img */ 32);\n\t\n\tvar _html_img2 = _interopRequireDefault(_html_img);\n\t\n\tvar _no_op = __webpack_require__(/*! playbacks/no_op */ 33);\n\t\n\tvar _no_op2 = _interopRequireDefault(_no_op);\n\t\n\tvar _poster = __webpack_require__(/*! plugins/poster */ 34);\n\t\n\tvar _poster2 = _interopRequireDefault(_poster);\n\t\n\tvar _log = __webpack_require__(/*! plugins/log */ 19);\n\t\n\tvar _log2 = _interopRequireDefault(_log);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _vendor = __webpack_require__(/*! vendor */ 20);\n\t\n\tvar _vendor2 = _interopRequireDefault(_vendor);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar version = (\"0.2.64\"); // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\texports.default = {\n\t Player: _player2.default,\n\t Mediator: _mediator2.default,\n\t Events: _events2.default,\n\t Browser: _browser2.default,\n\t PlayerInfo: _player_info2.default,\n\t MediaControl: _media_control2.default,\n\t ContainerPlugin: _container_plugin2.default,\n\t UIContainerPlugin: _ui_container_plugin2.default,\n\t CorePlugin: _core_plugin2.default,\n\t UICorePlugin: _ui_core_plugin2.default,\n\t Playback: _playback2.default,\n\t Container: _container2.default,\n\t Core: _core2.default,\n\t Loader: _loader2.default,\n\t BaseObject: _base_object2.default,\n\t UIObject: _ui_object2.default,\n\t Utils: _utils2.default,\n\t BaseFlashPlayback: _base_flash_playback2.default,\n\t Flash: _flash2.default,\n\t FlasHLS: _flashls2.default,\n\t HLS: _hls2.default,\n\t HTML5Audio: _html5_audio2.default,\n\t HTML5Video: _html5_video2.default,\n\t HTMLImg: _html_img2.default,\n\t NoOp: _no_op2.default,\n\t Poster: _poster2.default,\n\t Log: _log2.default,\n\t Styler: _styler2.default,\n\t Vendor: _vendor2.default,\n\t version: version,\n\t template: _template2.default,\n\t $: _clapprZepto2.default\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 1 */\n/*!****************************!*\\\n !*** ./src/base/events.js ***!\n \\****************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar _log = __webpack_require__(/*! plugins/log */ 19);\n\t\n\tvar _log2 = _interopRequireDefault(_log);\n\t\n\tvar _utils = __webpack_require__(/*! ./utils */ 2);\n\t\n\tvar _lodash = __webpack_require__(/*! lodash.once */ 101);\n\t\n\tvar _lodash2 = _interopRequireDefault(_lodash);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar slice = Array.prototype.slice;\n\t\n\tvar eventSplitter = /\\s+/;\n\t\n\tvar eventsApi = function eventsApi(obj, action, name, rest) {\n\t if (!name) {\n\t return true;\n\t }\n\t\n\t // Handle event maps.\n\t if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n\t for (var key in name) {\n\t obj[action].apply(obj, [key, name[key]].concat(rest));\n\t }\n\t return false;\n\t }\n\t\n\t // Handle space separated event names.\n\t if (eventSplitter.test(name)) {\n\t var names = name.split(eventSplitter);\n\t for (var i = 0, l = names.length; i < l; i++) {\n\t obj[action].apply(obj, [names[i]].concat(rest));\n\t }\n\t return false;\n\t }\n\t\n\t return true;\n\t};\n\t\n\tvar triggerEvents = function triggerEvents(events, args, klass, name) {\n\t var ev = void 0,\n\t i = -1;\n\t var l = events.length,\n\t a1 = args[0],\n\t a2 = args[1],\n\t a3 = args[2];\n\t run();\n\t\n\t function run() {\n\t try {\n\t switch (args.length) {\n\t case 0:\n\t while (++i < l) {\n\t (ev = events[i]).callback.call(ev.ctx);\n\t }return;\n\t case 1:\n\t while (++i < l) {\n\t (ev = events[i]).callback.call(ev.ctx, a1);\n\t }return;\n\t case 2:\n\t while (++i < l) {\n\t (ev = events[i]).callback.call(ev.ctx, a1, a2);\n\t }return;\n\t case 3:\n\t while (++i < l) {\n\t (ev = events[i]).callback.call(ev.ctx, a1, a2, a3);\n\t }return;\n\t default:\n\t while (++i < l) {\n\t (ev = events[i]).callback.apply(ev.ctx, args);\n\t }return;\n\t }\n\t } catch (exception) {\n\t _log2.default.error.apply(_log2.default, [klass, 'error on event', name, 'trigger', '-', exception]);\n\t run();\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * @class Events\n\t * @constructor\n\t * @module base\n\t */\n\t\n\tvar Events = function () {\n\t function Events() {\n\t _classCallCheck(this, Events);\n\t }\n\t\n\t /**\n\t * listen to an event indefinitely, if you want to stop you need to call `off`\n\t * @method on\n\t * @param {String} name\n\t * @param {Function} callback\n\t * @param {Object} context\n\t */\n\t Events.prototype.on = function on(name, callback, context) {\n\t if (!eventsApi(this, 'on', name, [callback, context]) || !callback) {\n\t return this;\n\t }\n\t this._events || (this._events = {});\n\t var events = this._events[name] || (this._events[name] = []);\n\t events.push({ callback: callback, context: context, ctx: context || this });\n\t return this;\n\t };\n\t\n\t /**\n\t * listen to an event only once\n\t * @method once\n\t * @param {String} name\n\t * @param {Function} callback\n\t * @param {Object} context\n\t */\n\t\n\t\n\t Events.prototype.once = function once(name, callback, context) {\n\t if (!eventsApi(this, 'once', name, [callback, context]) || !callback) {\n\t return this;\n\t }\n\t var self = this;\n\t var once = (0, _lodash2.default)(function () {\n\t self.off(name, once);\n\t callback.apply(this, arguments);\n\t });\n\t once._callback = callback;\n\t return this.on(name, once, context);\n\t };\n\t\n\t /**\n\t * stop listening to an event\n\t * @method off\n\t * @param {String} name\n\t * @param {Function} callback\n\t * @param {Object} context\n\t */\n\t\n\t\n\t Events.prototype.off = function off(name, callback, context) {\n\t var retain = void 0,\n\t ev = void 0,\n\t events = void 0,\n\t names = void 0,\n\t i = void 0,\n\t l = void 0,\n\t j = void 0,\n\t k = void 0;\n\t if (!this._events || !eventsApi(this, 'off', name, [callback, context])) {\n\t return this;\n\t }\n\t if (!name && !callback && !context) {\n\t this._events = void 0;\n\t return this;\n\t }\n\t names = name ? [name] : Object.keys(this._events);\n\t // jshint maxdepth:5\n\t for (i = 0, l = names.length; i < l; i++) {\n\t name = names[i];\n\t events = this._events[name];\n\t if (events) {\n\t this._events[name] = retain = [];\n\t if (callback || context) {\n\t for (j = 0, k = events.length; j < k; j++) {\n\t ev = events[j];\n\t if (callback && callback !== ev.callback && callback !== ev.callback._callback || context && context !== ev.context) {\n\t retain.push(ev);\n\t }\n\t }\n\t }\n\t if (!retain.length) {\n\t delete this._events[name];\n\t }\n\t }\n\t }\n\t return this;\n\t };\n\t\n\t /**\n\t * triggers an event given its `name`\n\t * @method trigger\n\t * @param {String} name\n\t */\n\t\n\t\n\t Events.prototype.trigger = function trigger(name) {\n\t var klass = this.name || this.constructor.name;\n\t _log2.default.debug.apply(_log2.default, [klass].concat(Array.prototype.slice.call(arguments)));\n\t if (!this._events) {\n\t return this;\n\t }\n\t var args = slice.call(arguments, 1);\n\t if (!eventsApi(this, 'trigger', name, args)) {\n\t return this;\n\t }\n\t var events = this._events[name];\n\t var allEvents = this._events.all;\n\t if (events) {\n\t triggerEvents(events, args, klass, name);\n\t }\n\t if (allEvents) {\n\t triggerEvents(allEvents, arguments, klass, name);\n\t }\n\t return this;\n\t };\n\t\n\t /**\n\t * stop listening an event for a given object\n\t * @method stopListening\n\t * @param {Object} obj\n\t * @param {String} name\n\t * @param {Function} callback\n\t */\n\t\n\t\n\t Events.prototype.stopListening = function stopListening(obj, name, callback) {\n\t var listeningTo = this._listeningTo;\n\t if (!listeningTo) {\n\t return this;\n\t }\n\t var remove = !name && !callback;\n\t if (!callback && (typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n\t callback = this;\n\t }\n\t if (obj) {\n\t (listeningTo = {})[obj._listenId] = obj;\n\t }\n\t for (var id in listeningTo) {\n\t obj = listeningTo[id];\n\t obj.off(name, callback, this);\n\t if (remove || Object.keys(obj._events).length === 0) {\n\t delete this._listeningTo[id];\n\t }\n\t }\n\t return this;\n\t };\n\t\n\t return Events;\n\t}();\n\t\n\t/**\n\t * listen to an event indefinitely for a given `obj`\n\t * @method listenTo\n\t * @param {Object} obj\n\t * @param {String} name\n\t * @param {Function} callback\n\t * @param {Object} context\n\t * @example\n\t * ```javascript\n\t * this.listenTo(this.core.playback, Events.PLAYBACK_PAUSE, this.callback)\n\t * ```\n\t */\n\t/**\n\t * listen to an event once for a given `obj`\n\t * @method listenToOnce\n\t * @param {Object} obj\n\t * @param {String} name\n\t * @param {Function} callback\n\t * @param {Object} context\n\t * @example\n\t * ```javascript\n\t * this.listenToOnce(this.core.playback, Events.PLAYBACK_PAUSE, this.callback)\n\t * ```\n\t */\n\t\n\t\n\texports.default = Events;\n\tvar listenMethods = { listenTo: 'on', listenToOnce: 'once' };\n\t\n\tObject.keys(listenMethods).forEach(function (method) {\n\t Events.prototype[method] = function (obj, name, callback) {\n\t var listeningTo = this._listeningTo || (this._listeningTo = {});\n\t var id = obj._listenId || (obj._listenId = (0, _utils.uniqueId)('l'));\n\t listeningTo[id] = obj;\n\t if (!callback && (typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n\t callback = this;\n\t }\n\t obj[listenMethods[method]](name, callback, this);\n\t return this;\n\t };\n\t});\n\t\n\t// PLAYER EVENTS\n\t/**\n\t * Fired when the player is ready on startup\n\t *\n\t * @event PLAYER_READY\n\t */\n\tEvents.PLAYER_READY = 'ready';\n\t/**\n\t * Fired when player resizes\n\t *\n\t * @event PLAYER_RESIZE\n\t * @param {Object} currentSize an object with the current size\n\t */\n\tEvents.PLAYER_RESIZE = 'resize';\n\t/**\n\t * Fired when player changes its fullscreen state\n\t *\n\t * @event PLAYER_FULLSCREEN\n\t * @param {Boolean} whether or not the player is on fullscreen mode\n\t */\n\tEvents.PLAYER_FULLSCREEN = 'fullscreen';\n\t/**\n\t * Fired when player starts to play\n\t *\n\t * @event PLAYER_PLAY\n\t */\n\tEvents.PLAYER_PLAY = 'play';\n\t/**\n\t * Fired when player pauses\n\t *\n\t * @event PLAYER_PAUSE\n\t */\n\tEvents.PLAYER_PAUSE = 'pause';\n\t/**\n\t * Fired when player stops\n\t *\n\t * @event PLAYER_STOP\n\t */\n\tEvents.PLAYER_STOP = 'stop';\n\t/**\n\t * Fired when player ends the video\n\t *\n\t * @event PLAYER_ENDED\n\t */\n\tEvents.PLAYER_ENDED = 'ended';\n\t/**\n\t * Fired when player seeks the video\n\t *\n\t * @event PLAYER_SEEK\n\t * @param {Number} time the current time in seconds\n\t */\n\tEvents.PLAYER_SEEK = 'seek';\n\t/**\n\t * Fired when player receives an error\n\t *\n\t * @event PLAYER_ERROR\n\t * @param {Object} error the error\n\t */\n\tEvents.PLAYER_ERROR = 'error';\n\t/**\n\t * Fired when the time is updated on player\n\t *\n\t * @event PLAYER_TIMEUPDATE\n\t * @param {Object} progress Data\n\t * progress object\n\t * @param {Number} [progress.current]\n\t * current time\n\t * @param {Number} [progress.total]\n\t * total time\n\t */\n\tEvents.PLAYER_TIMEUPDATE = 'timeupdate';\n\t/**\n\t * Fired when player updates its volume\n\t *\n\t * @event PLAYER_VOLUMEUPDATE\n\t * @param {Number} volume the current volume\n\t */\n\tEvents.PLAYER_VOLUMEUPDATE = 'volumeupdate';\n\t\n\t// Playback Events\n\t/**\n\t * Fired when the playback is downloading the media\n\t *\n\t * @event PLAYBACK_PROGRESS\n\t * @param progress {Object}\n\t * Data progress object\n\t * @param [progress.start] {Number}\n\t * start position of buffered content at current position\n\t * @param [progress.current] {Number}\n\t * end position of buffered content at current position\n\t * @param [progress.total] {Number}\n\t * total content to be downloaded\n\t * @param buffered {Array}\n\t * array of buffered segments ({start, end}). [Only for supported playbacks]\n\t */\n\tEvents.PLAYBACK_PROGRESS = 'playback:progress';\n\t/**\n\t * Fired when the time is updated on playback\n\t *\n\t * @event PLAYBACK_TIMEUPDATE\n\t * @param {Object} progress Data\n\t * progress object\n\t * @param {Number} [progress.current]\n\t * current time\n\t * @param {Number} [progress.total]\n\t * total time\n\t */\n\tEvents.PLAYBACK_TIMEUPDATE = 'playback:timeupdate';\n\t/**\n\t * Fired when playback is ready\n\t *\n\t * @event PLAYBACK_READY\n\t */\n\tEvents.PLAYBACK_READY = 'playback:ready';\n\t/**\n\t * Fired when the playback starts having to buffer because\n\t * playback can currently not be smooth.\n\t *\n\t * This corresponds to the playback `buffering` property being\n\t * `true`.\n\t *\n\t * @event PLAYBACK_BUFFERING\n\t */\n\tEvents.PLAYBACK_BUFFERING = 'playback:buffering';\n\t/**\n\t * Fired when the playback has enough in the buffer to be\n\t * able to play smoothly, after previously being unable to\n\t * do this.\n\t *\n\t * This corresponds to the playback `buffering` property being\n\t * `false`.\n\t *\n\t * @event PLAYBACK_BUFFERFULL\n\t */\n\tEvents.PLAYBACK_BUFFERFULL = 'playback:bufferfull';\n\t/**\n\t * Fired when playback changes any settings (volume, seek and etc)\n\t *\n\t * @event PLAYBACK_SETTINGSUPDATE\n\t */\n\tEvents.PLAYBACK_SETTINGSUPDATE = 'playback:settingsupdate';\n\t/**\n\t * Fired when playback loaded its metadata\n\t *\n\t * @event PLAYBACK_LOADEDMETADATA\n\t * @param {Object} metadata Data\n\t * settings object\n\t * @param {Number} [metadata.duration]\n\t * the playback duration\n\t * @param {Object} [metadata.data]\n\t * extra meta data\n\t */\n\tEvents.PLAYBACK_LOADEDMETADATA = 'playback:loadedmetadata';\n\t/**\n\t * Fired when playback updates its video quality\n\t *\n\t * @event PLAYBACK_HIGHDEFINITIONUPDATE\n\t * @param {Boolean} isHD\n\t * true when is on HD, false otherwise\n\t */\n\tEvents.PLAYBACK_HIGHDEFINITIONUPDATE = 'playback:highdefinitionupdate';\n\t/**\n\t * Fired when playback updates its bitrate\n\t *\n\t * @event PLAYBACK_BITRATE\n\t * @param {Object} bitrate Data\n\t * bitrate object\n\t * @param {Number} [bitrate.bandwidth]\n\t * bitrate bandwidth when it's available\n\t * @param {Number} [bitrate.width]\n\t * playback width (ex: 720, 640, 1080)\n\t * @param {Number} [bitrate.height]\n\t * playback height (ex: 240, 480, 720)\n\t * @param {Number} [bitrate.level]\n\t * playback level when it's available, it could be just a map for width (0 => 240, 1 => 480, 2 => 720)\n\t */\n\tEvents.PLAYBACK_BITRATE = 'playback:bitrate';\n\t/**\n\t * Fired when the playback has its levels\n\t *\n\t * @event PLAYBACK_LEVELS_AVAILABLE\n\t * @param {Array} levels\n\t * the ordered levels, each one with the following format `{id: 1, label: '500kbps'}` ps: id should be a number >= 0\n\t * @param {Number} initial\n\t * the initial level otherwise -1 (AUTO)\n\t */\n\tEvents.PLAYBACK_LEVELS_AVAILABLE = 'playback:levels:available';\n\t/**\n\t * Fired when the playback starts to switch level\n\t *\n\t * @event PLAYBACK_LEVEL_SWITCH_START\n\t *\n\t */\n\tEvents.PLAYBACK_LEVEL_SWITCH_START = 'playback:levels:switch:start';\n\t/**\n\t * Fired when the playback ends the level switch\n\t *\n\t * @event PLAYBACK_LEVEL_SWITCH_END\n\t *\n\t */\n\tEvents.PLAYBACK_LEVEL_SWITCH_END = 'playback:levels:switch:end';\n\t\n\t/**\n\t * Fired when playback internal state changes\n\t *\n\t * @event PLAYBACK_PLAYBACKSTATE\n\t * @param {Object} state Data\n\t * state object\n\t * @param {String} [state.type]\n\t * the playback type\n\t */\n\tEvents.PLAYBACK_PLAYBACKSTATE = 'playback:playbackstate';\n\t/**\n\t * Fired when DVR becomes enabled/disabled.\n\t *\n\t * @event PLAYBACK_DVR\n\t * @param {boolean} state true if dvr enabled\n\t */\n\tEvents.PLAYBACK_DVR = 'playback:dvr';\n\t// TODO doc\n\tEvents.PLAYBACK_MEDIACONTROL_DISABLE = 'playback:mediacontrol:disable';\n\t// TODO doc\n\tEvents.PLAYBACK_MEDIACONTROL_ENABLE = 'playback:mediacontrol:enable';\n\t/**\n\t * Fired when the media for a playback ends.\n\t *\n\t * @event PLAYBACK_ENDED\n\t * @param {String} name the name of the playback\n\t */\n\tEvents.PLAYBACK_ENDED = 'playback:ended';\n\t/**\n\t * Fired when user requests `play()`\n\t *\n\t * @event PLAYBACK_PLAY_INTENT\n\t */\n\tEvents.PLAYBACK_PLAY_INTENT = 'playback:play:intent';\n\t/**\n\t * Fired when the media for a playback starts playing.\n\t * This is not necessarily when the user requests `play()`\n\t * The media may have to buffer first.\n\t * I.e. `isPlaying()` might return `true` before this event is fired,\n\t * because `isPlaying()` represents the intended state.\n\t *\n\t * @event PLAYBACK_PLAY\n\t */\n\tEvents.PLAYBACK_PLAY = 'playback:play';\n\t/**\n\t * Fired when the media for a playback pauses.\n\t *\n\t * @event PLAYBACK_PAUSE\n\t */\n\tEvents.PLAYBACK_PAUSE = 'playback:pause';\n\t/**\n\t * Fired when the media for a playback is stopped.\n\t *\n\t * @event PLAYBACK_STOP\n\t */\n\tEvents.PLAYBACK_STOP = 'playback:stop';\n\t/**\n\t * Fired if an error occurs in the playback.\n\t *\n\t * @event PLAYBACK_ERROR\n\t * @param {Object} error An object containing the error details\n\t * @param {String} name Playback name\n\t */\n\tEvents.PLAYBACK_ERROR = 'playback:error';\n\t// TODO doc\n\tEvents.PLAYBACK_STATS_ADD = 'playback:stats:add';\n\t// TODO doc\n\tEvents.PLAYBACK_FRAGMENT_LOADED = 'playback:fragment:loaded';\n\t// TODO doc\n\tEvents.PLAYBACK_LEVEL_SWITCH = 'playback:level:switch';\n\t\n\t/**\n\t * Fired when the options were changed for the core\n\t *\n\t * @event CORE_OPTIONS_CHANGE\n\t */\n\tEvents.CORE_OPTIONS_CHANGE = 'core:options:change';\n\t/**\n\t * Fired after creating containers, when the core is ready\n\t *\n\t * @event CORE_READY\n\t */\n\tEvents.CORE_READY = 'core:ready';\n\t/**\n\t * Fired when the fullscreen state change\n\t *\n\t * @param {Boolean} whether or not the player is on fullscreen mode\n\t * @event CORE_READY\n\t */\n\tEvents.CORE_FULLSCREEN = 'core:fullscreen';\n\t\n\t// Container Events\n\t/**\n\t * Fired when the container internal state changes\n\t *\n\t * @event CONTAINER_PLAYBACKSTATE\n\t * @param {Object} state Data\n\t * state object\n\t * @param {String} [state.type]\n\t * the playback type\n\t */\n\tEvents.CONTAINER_PLAYBACKSTATE = 'container:playbackstate';\n\tEvents.CONTAINER_PLAYBACKDVRSTATECHANGED = 'container:dvr';\n\t/**\n\t * Fired when the container updates its bitrate\n\t *\n\t * @event CONTAINER_BITRATE\n\t * @param {Object} bitrate Data\n\t * bitrate object\n\t * @param {Number} [bitrate.bandwidth]\n\t * bitrate bandwidth when it's available\n\t * @param {Number} [bitrate.width]\n\t * playback width (ex: 720, 640, 1080)\n\t * @param {Number} [bitrate.height]\n\t * playback height (ex: 240, 480, 720)\n\t * @param {Number} [bitrate.level]\n\t * playback level when it's available, it could be just a map for width (0 => 240, 1 => 480, 2 => 720)\n\t */\n\tEvents.CONTAINER_BITRATE = 'container:bitrate';\n\tEvents.CONTAINER_STATS_REPORT = 'container:stats:report';\n\tEvents.CONTAINER_DESTROYED = 'container:destroyed';\n\t/**\n\t * Fired when the container is ready\n\t *\n\t * @event CONTAINER_READY\n\t */\n\tEvents.CONTAINER_READY = 'container:ready';\n\tEvents.CONTAINER_ERROR = 'container:error';\n\t/**\n\t * Fired when the container loaded its metadata\n\t *\n\t * @event CONTAINER_LOADEDMETADATA\n\t * @param {Object} metadata Data\n\t * settings object\n\t * @param {Number} [metadata.duration]\n\t * the playback duration\n\t * @param {Object} [metadata.data]\n\t * extra meta data\n\t */\n\tEvents.CONTAINER_LOADEDMETADATA = 'container:loadedmetadata';\n\t/**\n\t * Fired when the time is updated on container\n\t *\n\t * @event CONTAINER_TIMEUPDATE\n\t * @param {Object} progress Data\n\t * progress object\n\t * @param {Number} [progress.current]\n\t * current time\n\t * @param {Number} [progress.total]\n\t * total time\n\t */\n\tEvents.CONTAINER_TIMEUPDATE = 'container:timeupdate';\n\t/**\n\t * Fired when the container is downloading the media\n\t *\n\t * @event CONTAINER_PROGRESS\n\t * @param {Object} progress Data\n\t * progress object\n\t * @param {Number} [progress.start]\n\t * initial downloaded content\n\t * @param {Number} [progress.current]\n\t * current dowloaded content\n\t * @param {Number} [progress.total]\n\t * total content to be downloaded\n\t */\n\tEvents.CONTAINER_PROGRESS = 'container:progress';\n\tEvents.CONTAINER_PLAY = 'container:play';\n\tEvents.CONTAINER_STOP = 'container:stop';\n\tEvents.CONTAINER_PAUSE = 'container:pause';\n\tEvents.CONTAINER_ENDED = 'container:ended';\n\tEvents.CONTAINER_CLICK = 'container:click';\n\tEvents.CONTAINER_DBLCLICK = 'container:dblclick';\n\tEvents.CONTAINER_CONTEXTMENU = 'container:contextmenu';\n\tEvents.CONTAINER_MOUSE_ENTER = 'container:mouseenter';\n\tEvents.CONTAINER_MOUSE_LEAVE = 'container:mouseleave';\n\t/**\n\t * Fired when the container seeks the video\n\t *\n\t * @event CONTAINER_SEEK\n\t * @param {Number} time the current time in seconds\n\t */\n\tEvents.CONTAINER_SEEK = 'container:seek';\n\tEvents.CONTAINER_VOLUME = 'container:volume';\n\tEvents.CONTAINER_FULLSCREEN = 'container:fullscreen';\n\t/**\n\t * Fired when container is buffering\n\t *\n\t * @event CONTAINER_STATE_BUFFERING\n\t */\n\tEvents.CONTAINER_STATE_BUFFERING = 'container:state:buffering';\n\t/**\n\t * Fired when the container filled the buffer\n\t *\n\t * @event CONTAINER_STATE_BUFFERFULL\n\t */\n\tEvents.CONTAINER_STATE_BUFFERFULL = 'container:state:bufferfull';\n\t/**\n\t * Fired when the container changes any settings (volume, seek and etc)\n\t *\n\t * @event CONTAINER_SETTINGSUPDATE\n\t */\n\tEvents.CONTAINER_SETTINGSUPDATE = 'container:settingsupdate';\n\t/**\n\t * Fired when container updates its video quality\n\t *\n\t * @event CONTAINER_HIGHDEFINITIONUPDATE\n\t * @param {Boolean} isHD\n\t * true when is on HD, false otherwise\n\t */\n\tEvents.CONTAINER_HIGHDEFINITIONUPDATE = 'container:highdefinitionupdate';\n\t\n\t/**\n\t * Fired when the media control shows\n\t *\n\t * @event CONTAINER_MEDIACONTROL_SHOW\n\t */\n\tEvents.CONTAINER_MEDIACONTROL_SHOW = 'container:mediacontrol:show';\n\t/**\n\t * Fired when the media control hides\n\t *\n\t * @event CONTAINER_MEDIACONTROL_HIDE\n\t */\n\tEvents.CONTAINER_MEDIACONTROL_HIDE = 'container:mediacontrol:hide';\n\t\n\tEvents.CONTAINER_MEDIACONTROL_DISABLE = 'container:mediacontrol:disable';\n\tEvents.CONTAINER_MEDIACONTROL_ENABLE = 'container:mediacontrol:enable';\n\tEvents.CONTAINER_STATS_ADD = 'container:stats:add';\n\t/**\n\t * Fired when the options were changed for the container\n\t *\n\t * @event CONTAINER_OPTIONS_CHANGE\n\t */\n\tEvents.CONTAINER_OPTIONS_CHANGE = 'container:options:change';\n\t\n\t// MediaControl Events\n\tEvents.MEDIACONTROL_RENDERED = 'mediacontrol:rendered';\n\t/**\n\t * Fired when the player enters/exit on fullscreen\n\t *\n\t * @event MEDIACONTROL_FULLSCREEN\n\t */\n\tEvents.MEDIACONTROL_FULLSCREEN = 'mediacontrol:fullscreen';\n\t/**\n\t * Fired when the media control shows\n\t *\n\t * @event MEDIACONTROL_SHOW\n\t */\n\tEvents.MEDIACONTROL_SHOW = 'mediacontrol:show';\n\t/**\n\t * Fired when the media control hides\n\t *\n\t * @event MEDIACONTROL_HIDE\n\t */\n\tEvents.MEDIACONTROL_HIDE = 'mediacontrol:hide';\n\t/**\n\t * Fired when mouse enters on the seekbar\n\t *\n\t * @event MEDIACONTROL_MOUSEMOVE_SEEKBAR\n\t * @param {Object} event\n\t * the javascript event\n\t */\n\tEvents.MEDIACONTROL_MOUSEMOVE_SEEKBAR = 'mediacontrol:mousemove:seekbar';\n\t/**\n\t * Fired when mouse leaves the seekbar\n\t *\n\t * @event MEDIACONTROL_MOUSELEAVE_SEEKBAR\n\t * @param {Object} event\n\t * the javascript event\n\t */\n\tEvents.MEDIACONTROL_MOUSELEAVE_SEEKBAR = 'mediacontrol:mouseleave:seekbar';\n\t/**\n\t * Fired when the media is being played\n\t *\n\t * @event MEDIACONTROL_PLAYING\n\t */\n\tEvents.MEDIACONTROL_PLAYING = 'mediacontrol:playing';\n\t/**\n\t * Fired when the media is not being played\n\t *\n\t * @event MEDIACONTROL_NOTPLAYING\n\t */\n\tEvents.MEDIACONTROL_NOTPLAYING = 'mediacontrol:notplaying';\n\t/**\n\t * Fired when the container was changed\n\t *\n\t * @event MEDIACONTROL_CONTAINERCHANGED\n\t */\n\tEvents.MEDIACONTROL_CONTAINERCHANGED = 'mediacontrol:containerchanged';\n\t\n\t// Core Events\n\tEvents.CORE_CONTAINERS_CREATED = 'core:containers:created';\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 2 */\n/*!***************************!*\\\n !*** ./src/base/utils.js ***!\n \\***************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.cancelAnimationFrame = exports.requestAnimationFrame = exports.QueryString = exports.Config = exports.Fullscreen = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\texports.extend = extend;\n\texports.formatTime = formatTime;\n\texports.seekStringToSeconds = seekStringToSeconds;\n\texports.uniqueId = uniqueId;\n\texports.isNumber = isNumber;\n\texports.currentScriptUrl = currentScriptUrl;\n\texports.getBrowserLanguage = getBrowserLanguage;\n\texports.now = now;\n\texports.removeArrayItem = removeArrayItem;\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t/*jshint -W079 */\n\t\n\tfunction assign(obj, source) {\n\t if (source) {\n\t for (var prop in source) {\n\t var propDescriptor = Object.getOwnPropertyDescriptor(source, prop);\n\t propDescriptor ? Object.defineProperty(obj, prop, propDescriptor) : obj[prop] = source[prop];\n\t }\n\t }\n\t return obj;\n\t}\n\t\n\tfunction extend(parent, properties) {\n\t var Surrogate = function (_parent) {\n\t _inherits(Surrogate, _parent);\n\t\n\t function Surrogate() {\n\t _classCallCheck(this, Surrogate);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var _this = _possibleConstructorReturn(this, _parent.call.apply(_parent, [this].concat(args)));\n\t\n\t if (properties.initialize) {\n\t properties.initialize.apply(_this, args);\n\t }\n\t return _this;\n\t }\n\t\n\t return Surrogate;\n\t }(parent);\n\t\n\t assign(Surrogate.prototype, properties);\n\t return Surrogate;\n\t}\n\t\n\tfunction formatTime(time, paddedHours) {\n\t if (!isFinite(time)) {\n\t return '--:--';\n\t }\n\t time = time * 1000;\n\t time = parseInt(time / 1000);\n\t var seconds = time % 60;\n\t time = parseInt(time / 60);\n\t var minutes = time % 60;\n\t time = parseInt(time / 60);\n\t var hours = time % 24;\n\t var days = parseInt(time / 24);\n\t var out = '';\n\t if (days && days > 0) {\n\t out += days + ':';\n\t if (hours < 1) {\n\t out += '00:';\n\t }\n\t }\n\t if (hours && hours > 0 || paddedHours) {\n\t out += ('0' + hours).slice(-2) + ':';\n\t }\n\t out += ('0' + minutes).slice(-2) + ':';\n\t out += ('0' + seconds).slice(-2);\n\t return out.trim();\n\t}\n\t\n\tvar Fullscreen = exports.Fullscreen = {\n\t isFullscreen: function isFullscreen() {\n\t return !!(document.webkitFullscreenElement || document.webkitIsFullScreen || document.mozFullScreen || document.msFullscreenElement);\n\t },\n\t requestFullscreen: function requestFullscreen(el) {\n\t if (el.requestFullscreen) {\n\t el.requestFullscreen();\n\t } else if (el.webkitRequestFullscreen) {\n\t el.webkitRequestFullscreen();\n\t } else if (el.mozRequestFullScreen) {\n\t el.mozRequestFullScreen();\n\t } else if (el.msRequestFullscreen) {\n\t el.msRequestFullscreen();\n\t } else if (el.querySelector && el.querySelector('video') && el.querySelector('video').webkitEnterFullScreen) {\n\t el.querySelector('video').webkitEnterFullScreen();\n\t }\n\t },\n\t cancelFullscreen: function cancelFullscreen() {\n\t if (document.exitFullscreen) {\n\t document.exitFullscreen();\n\t } else if (document.webkitCancelFullScreen) {\n\t document.webkitCancelFullScreen();\n\t } else if (document.webkitExitFullscreen) {\n\t document.webkitExitFullscreen();\n\t } else if (document.mozCancelFullScreen) {\n\t document.mozCancelFullScreen();\n\t } else if (document.msExitFullscreen) {\n\t document.msExitFullscreen();\n\t }\n\t },\n\t fullscreenEnabled: function fullscreenEnabled() {\n\t return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled);\n\t }\n\t};\n\t\n\tvar Config = exports.Config = function () {\n\t function Config() {\n\t _classCallCheck(this, Config);\n\t }\n\t\n\t Config._defaultConfig = function _defaultConfig() {\n\t return {\n\t volume: {\n\t value: 100,\n\t parse: parseInt\n\t }\n\t };\n\t };\n\t\n\t Config._defaultValueFor = function _defaultValueFor(key) {\n\t try {\n\t return this._defaultConfig()[key].parse(this._defaultConfig()[key].value);\n\t } catch (e) {\n\t return undefined;\n\t }\n\t };\n\t\n\t Config._createKeyspace = function _createKeyspace(key) {\n\t return 'clappr.' + document.domain + '.' + key;\n\t };\n\t\n\t Config.restore = function restore(key) {\n\t if (_browser2.default.hasLocalstorage && localStorage[this._createKeyspace(key)]) {\n\t return this._defaultConfig()[key].parse(localStorage[this._createKeyspace(key)]);\n\t }\n\t return this._defaultValueFor(key);\n\t };\n\t\n\t Config.persist = function persist(key, value) {\n\t if (_browser2.default.hasLocalstorage) {\n\t try {\n\t localStorage[this._createKeyspace(key)] = value;\n\t return true;\n\t } catch (e) {\n\t return false;\n\t }\n\t }\n\t };\n\t\n\t return Config;\n\t}();\n\t\n\tvar QueryString = exports.QueryString = function () {\n\t function QueryString() {\n\t _classCallCheck(this, QueryString);\n\t }\n\t\n\t QueryString.parse = function parse(paramsString) {\n\t var match = void 0;\n\t var pl = /\\+/g,\n\t // Regex for replacing addition symbol with a space\n\t search = /([^&=]+)=?([^&]*)/g,\n\t decode = function decode(s) {\n\t return decodeURIComponent(s.replace(pl, ' '));\n\t },\n\t params = {};\n\t while (match = search.exec(paramsString)) {\n\t // eslint-disable-line no-cond-assign\n\t params[decode(match[1]).toLowerCase()] = decode(match[2]);\n\t }\n\t return params;\n\t };\n\t\n\t _createClass(QueryString, null, [{\n\t key: 'params',\n\t get: function get() {\n\t var query = window.location.search.substring(1);\n\t if (query !== this.query) {\n\t this._urlParams = this.parse(query);\n\t this.query = query;\n\t }\n\t return this._urlParams;\n\t }\n\t }, {\n\t key: 'hashParams',\n\t get: function get() {\n\t var hash = window.location.hash.substring(1);\n\t if (hash !== this.hash) {\n\t this._hashParams = this.parse(hash);\n\t this.hash = hash;\n\t }\n\t return this._hashParams;\n\t }\n\t }]);\n\t\n\t return QueryString;\n\t}();\n\t\n\tfunction seekStringToSeconds() {\n\t var paramName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 't';\n\t\n\t var seconds = 0;\n\t var seekString = QueryString.params[paramName] || QueryString.hashParams[paramName] || '';\n\t var parts = seekString.match(/[0-9]+[hms]+/g) || [];\n\t if (parts.length > 0) {\n\t (function () {\n\t var factor = { 'h': 3600, 'm': 60, 's': 1 };\n\t parts.forEach(function (el) {\n\t if (el) {\n\t var suffix = el[el.length - 1];\n\t var time = parseInt(el.slice(0, el.length - 1), 10);\n\t seconds += time * factor[suffix];\n\t }\n\t });\n\t })();\n\t } else if (seekString) {\n\t seconds = parseInt(seekString, 10);\n\t }\n\t return seconds;\n\t}\n\t\n\tvar idsCounter = {};\n\t\n\tfunction uniqueId(prefix) {\n\t idsCounter[prefix] || (idsCounter[prefix] = 0);\n\t var id = ++idsCounter[prefix];\n\t return prefix + id;\n\t}\n\t\n\tfunction isNumber(value) {\n\t return value - parseFloat(value) + 1 >= 0;\n\t}\n\t\n\tfunction currentScriptUrl() {\n\t var scripts = document.getElementsByTagName('script');\n\t return scripts.length ? scripts[scripts.length - 1].src : '';\n\t}\n\t\n\tvar requestAnimationFrame = exports.requestAnimationFrame = (window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (fn) {\n\t window.setTimeout(fn, 1000 / 60);\n\t}).bind(window);\n\t\n\tvar cancelAnimationFrame = exports.cancelAnimationFrame = (window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout).bind(window);\n\t\n\tfunction getBrowserLanguage() {\n\t return window.navigator && window.navigator.language;\n\t}\n\t\n\tfunction now() {\n\t if (window.performance && window.performance.now) {\n\t return performance.now();\n\t }\n\t return Date.now();\n\t}\n\t\n\t// remove the item from the array if it exists in the array\n\tfunction removeArrayItem(arr, item) {\n\t var i = arr.indexOf(item);\n\t if (i >= 0) {\n\t arr.splice(i, 1);\n\t }\n\t}\n\t\n\texports.default = {\n\t Config: Config,\n\t Fullscreen: Fullscreen,\n\t QueryString: QueryString,\n\t extend: extend,\n\t formatTime: formatTime,\n\t seekStringToSeconds: seekStringToSeconds,\n\t uniqueId: uniqueId,\n\t currentScriptUrl: currentScriptUrl,\n\t isNumber: isNumber,\n\t requestAnimationFrame: requestAnimationFrame,\n\t cancelAnimationFrame: cancelAnimationFrame,\n\t getBrowserLanguage: getBrowserLanguage,\n\t now: now,\n\t removeArrayItem: removeArrayItem\n\t};\n\n/***/ },\n/* 3 */\n/*!******************************!*\\\n !*** ./src/base/playback.js ***!\n \\******************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! ./utils */ 2);\n\t\n\tvar _ui_object = __webpack_require__(/*! ./ui_object */ 10);\n\t\n\tvar _ui_object2 = _interopRequireDefault(_ui_object);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\t/**\n\t * An abstraction to represent a generic playback, it's like an interface to be implemented by subclasses.\n\t * @class Playback\n\t * @constructor\n\t * @extends UIObject\n\t * @module base\n\t */\n\tvar Playback = function (_UIObject) {\n\t _inherits(Playback, _UIObject);\n\t\n\t _createClass(Playback, [{\n\t key: 'isAudioOnly',\n\t\n\t /**\n\t * Determine if the playback does not contain video/has video but video should be ignored.\n\t * @property isAudioOnly\n\t * @type Boolean\n\t */\n\t get: function get() {\n\t return false;\n\t }\n\t\n\t /**\n\t * Determine if the playback has ended.\n\t * @property ended\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'ended',\n\t get: function get() {\n\t return false;\n\t }\n\t\n\t /**\n\t * The internationalization plugin.\n\t * @property i18n\n\t * @type {Strings}\n\t */\n\t\n\t }, {\n\t key: 'i18n',\n\t get: function get() {\n\t return this._i18n;\n\t }\n\t\n\t /**\n\t * Determine if the playback is having to buffer in order for\n\t * playback to be smooth.\n\t * (i.e if a live stream is playing smoothly, this will be false)\n\t * @property buffering\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'buffering',\n\t get: function get() {\n\t return false;\n\t }\n\t\n\t /**\n\t * @method constructor\n\t * @param {Object} options the options object\n\t * @param {Strings} i18n the internationalization component\n\t */\n\t\n\t }]);\n\t\n\t function Playback(options, i18n) {\n\t _classCallCheck(this, Playback);\n\t\n\t var _this = _possibleConstructorReturn(this, _UIObject.call(this, options));\n\t\n\t _this.settings = {};\n\t _this._i18n = i18n;\n\t return _this;\n\t }\n\t\n\t /**\n\t * plays the playback.\n\t * @method play\n\t */\n\t\n\t\n\t Playback.prototype.play = function play() {};\n\t\n\t /**\n\t * pauses the playback.\n\t * @method pause\n\t */\n\t\n\t\n\t Playback.prototype.pause = function pause() {};\n\t\n\t /**\n\t * stops the playback.\n\t * @method stop\n\t */\n\t\n\t\n\t Playback.prototype.stop = function stop() {};\n\t\n\t /**\n\t * seeks the playback to a given `time` in seconds\n\t * @method seek\n\t * @param {Number} time should be a number between 0 and the video duration\n\t */\n\t\n\t\n\t Playback.prototype.seek = function seek(time) {}; // eslint-disable-line no-unused-vars\n\t\n\t /**\n\t * seeks the playback to a given `percentage` in percentage\n\t * @method seekPercentage\n\t * @param {Number} time should be a number between 0 and 100\n\t */\n\t\n\t\n\t Playback.prototype.seekPercentage = function seekPercentage(percentage) {}; // eslint-disable-line no-unused-vars\n\t\n\t\n\t /**\n\t * The time that \"0\" now represents relative to when playback started.\n\t * For a stream with a sliding window this will increase as content is\n\t * removed from the beginning.\n\t * @method getStartTimeOffset\n\t * @return {Number} time (in seconds) that time \"0\" represents.\n\t */\n\t\n\t\n\t Playback.prototype.getStartTimeOffset = function getStartTimeOffset() {\n\t return 0;\n\t };\n\t\n\t /**\n\t * gets the duration in seconds\n\t * @method getDuration\n\t * @return {Number} duration (in seconds) of the current source\n\t */\n\t\n\t\n\t Playback.prototype.getDuration = function getDuration() {\n\t return 0;\n\t };\n\t\n\t /**\n\t * checks if the playback is playing.\n\t * @method isPlaying\n\t * @return {Boolean} `true` if the current playback is playing, otherwise `false`\n\t */\n\t\n\t\n\t Playback.prototype.isPlaying = function isPlaying() {\n\t return false;\n\t };\n\t\n\t /**\n\t * checks if the playback is ready.\n\t * @property isReady\n\t * @type {Boolean} `true` if the current playback is ready, otherwise `false`\n\t */\n\t\n\t\n\t /**\n\t * gets the playback type (`'vod', 'live', 'aod'`)\n\t * @method getPlaybackType\n\t * @return {String} you should write the playback type otherwise it'll assume `'no_op'`\n\t * @example\n\t * ```javascript\n\t * html5VideoPlayback.getPlaybackType() //vod\n\t * html5AudioPlayback.getPlaybackType() //aod\n\t * html5VideoPlayback.getPlaybackType() //live\n\t * flashHlsPlayback.getPlaybackType() //live\n\t * ```\n\t */\n\t Playback.prototype.getPlaybackType = function getPlaybackType() {\n\t return Playback.NO_OP;\n\t };\n\t\n\t /**\n\t * checks if the playback is in HD.\n\t * @method isHighDefinitionInUse\n\t * @return {Boolean} `true` if the playback is playing in HD, otherwise `false`\n\t */\n\t\n\t\n\t Playback.prototype.isHighDefinitionInUse = function isHighDefinitionInUse() {\n\t return false;\n\t };\n\t\n\t /**\n\t * sets the volume for the playback\n\t * @method volume\n\t * @param {Number} value a number between 0 (`muted`) to 100 (`max`)\n\t */\n\t\n\t\n\t Playback.prototype.volume = function volume(value) {}; // eslint-disable-line no-unused-vars\n\t\n\t /**\n\t * destroys the playback, removing it from DOM\n\t * @method destroy\n\t */\n\t\n\t\n\t Playback.prototype.destroy = function destroy() {\n\t this.$el.remove();\n\t };\n\t\n\t _createClass(Playback, [{\n\t key: 'isReady',\n\t get: function get() {\n\t return false;\n\t }\n\t }]);\n\t\n\t return Playback;\n\t}(_ui_object2.default);\n\t\n\texports.default = Playback;\n\t\n\t\n\tPlayback.extend = function (properties) {\n\t return (0, _utils.extend)(Playback, properties);\n\t};\n\t\n\t/**\n\t * checks if the playback can play a given `source`\n\t * If a mimeType is provided then this will be used instead of inferring the mimetype\n\t * from the source extension.\n\t * @method canPlay\n\t * @static\n\t * @param {String} source the given source ex: `http://example.com/play.mp4`\n\t * @param {String} [mimeType] the given mime type, ex: `'application/vnd.apple.mpegurl'`\n\t * @return {Boolean} `true` if the playback is playable, otherwise `false`\n\t */\n\tPlayback.canPlay = function (source, mimeType) {\n\t // eslint-disable-line no-unused-vars\n\t return false;\n\t};\n\t\n\t/**\n\t * a playback type for video on demand\n\t *\n\t * @property VOD\n\t * @static\n\t * @type String\n\t */\n\tPlayback.VOD = 'vod';\n\t/**\n\t * a playback type for audio on demand\n\t *\n\t * @property AOD\n\t * @static\n\t * @type String\n\t */\n\tPlayback.AOD = 'aod';\n\t/**\n\t * a playback type for live video\n\t *\n\t * @property LIVE\n\t * @static\n\t * @type String\n\t */\n\tPlayback.LIVE = 'live';\n\t/**\n\t * a default playback type\n\t *\n\t * @property NO_OP\n\t * @static\n\t * @type String\n\t */\n\tPlayback.NO_OP = 'no_op';\n\t/**\n\t * the plugin type\n\t *\n\t * @property type\n\t * @static\n\t * @type String\n\t */\n\tPlayback.type = 'playback';\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 4 */\n/*!****************************!*\\\n !*** ./src/base/styler.js ***!\n \\****************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tvar _template = __webpack_require__(/*! ./template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t// Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar Styler = {\n\t getStyleFor: function getStyleFor(style) {\n\t var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { baseUrl: '' };\n\t\n\t return (0, _clapprZepto2.default)('<style class=\"clappr-style\"></style>').html((0, _template2.default)(style.toString())(options));\n\t }\n\t};\n\t\n\texports.default = Styler;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 5 */\n/*!*************************************!*\\\n !*** ./~/clappr-zepto/zepto.min.js ***!\n \\*************************************/\n/***/ function(module, exports) {\n\n\t/* Zepto v1.1.4-80-ga9184b2 - zepto event ajax callbacks deferred touch selector ie - zeptojs.com/license */\n\tvar Zepto=function(){function D(t){return null==t?String(t):j[S.call(t)]||\"object\"}function L(t){return\"function\"==D(t)}function k(t){return null!=t&&t==t.window}function Z(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function $(t){return\"object\"==D(t)}function F(t){return $(t)&&!k(t)&&Object.getPrototypeOf(t)==Object.prototype}function R(t){return\"number\"==typeof t.length}function q(t){return s.call(t,function(t){return null!=t})}function W(t){return t.length>0?n.fn.concat.apply([],t):t}function z(t){return t.replace(/::/g,\"/\").replace(/([A-Z]+)([A-Z][a-z])/g,\"$1_$2\").replace(/([a-z\\d])([A-Z])/g,\"$1_$2\").replace(/_/g,\"-\").toLowerCase()}function H(t){return t in c?c[t]:c[t]=new RegExp(\"(^|\\\\s)\"+t+\"(\\\\s|$)\")}function _(t,e){return\"number\"!=typeof e||l[z(t)]?e:e+\"px\"}function I(t){var e,n;return f[t]||(e=u.createElement(t),u.body.appendChild(e),n=getComputedStyle(e,\"\").getPropertyValue(\"display\"),e.parentNode.removeChild(e),\"none\"==n&&(n=\"block\"),f[t]=n),f[t]}function U(t){return\"children\"in t?a.call(t.children):n.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function X(t,e){var n,i=t?t.length:0;for(n=0;i>n;n++)this[n]=t[n];this.length=i,this.selector=e||\"\"}function B(n,i,r){for(e in i)r&&(F(i[e])||A(i[e]))?(F(i[e])&&!F(n[e])&&(n[e]={}),A(i[e])&&!A(n[e])&&(n[e]=[]),B(n[e],i[e],r)):i[e]!==t&&(n[e]=i[e])}function V(t,e){return null==e?n(t):n(t).filter(e)}function Y(t,e,n,i){return L(e)?e.call(t,n,i):e}function J(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function G(e,n){var i=e.className||\"\",r=i&&i.baseVal!==t;return n===t?r?i.baseVal:i:void(r?i.baseVal=n:e.className=n)}function K(t){try{return t?\"true\"==t||(\"false\"==t?!1:\"null\"==t?null:+t+\"\"==t?+t:/^[\\[\\{]/.test(t)?n.parseJSON(t):t):t}catch(e){return t}}function Q(t,e){e(t);for(var n=0,i=t.childNodes.length;i>n;n++)Q(t.childNodes[n],e)}var t,e,n,i,N,P,r=[],o=r.concat,s=r.filter,a=r.slice,u=window.document,f={},c={},l={\"column-count\":1,columns:1,\"font-weight\":1,\"line-height\":1,opacity:1,\"z-index\":1,zoom:1},h=/^\\s*<(\\w+|!)[^>]*>/,p=/^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,d=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi,m=/^(?:body|html)$/i,g=/([A-Z])/g,v=[\"val\",\"css\",\"html\",\"text\",\"data\",\"width\",\"height\",\"offset\"],y=[\"after\",\"prepend\",\"before\",\"append\"],w=u.createElement(\"table\"),x=u.createElement(\"tr\"),b={tr:u.createElement(\"tbody\"),tbody:w,thead:w,tfoot:w,td:x,th:x,\"*\":u.createElement(\"div\")},E=/complete|loaded|interactive/,T=/^[\\w-]*$/,j={},S=j.toString,C={},O=u.createElement(\"div\"),M={tabindex:\"tabIndex\",readonly:\"readOnly\",\"for\":\"htmlFor\",\"class\":\"className\",maxlength:\"maxLength\",cellspacing:\"cellSpacing\",cellpadding:\"cellPadding\",rowspan:\"rowSpan\",colspan:\"colSpan\",usemap:\"useMap\",frameborder:\"frameBorder\",contenteditable:\"contentEditable\"},A=Array.isArray||function(t){return t instanceof Array};return C.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var i,r=t.parentNode,o=!r;return o&&(r=O).appendChild(t),i=~C.qsa(r,e).indexOf(t),o&&O.removeChild(t),i},N=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():\"\"})},P=function(t){return s.call(t,function(e,n){return t.indexOf(e)==n})},C.fragment=function(e,i,r){var o,s,f;return p.test(e)&&(o=n(u.createElement(RegExp.$1))),o||(e.replace&&(e=e.replace(d,\"<$1></$2>\")),i===t&&(i=h.test(e)&&RegExp.$1),i in b||(i=\"*\"),f=b[i],f.innerHTML=\"\"+e,o=n.each(a.call(f.childNodes),function(){f.removeChild(this)})),F(r)&&(s=n(o),n.each(r,function(t,e){v.indexOf(t)>-1?s[t](e):s.attr(t,e)})),o},C.Z=function(t,e){return new X(t,e)},C.isZ=function(t){return t instanceof C.Z},C.init=function(e,i){var r;if(!e)return C.Z();if(\"string\"==typeof e)if(e=e.trim(),\"<\"==e[0]&&h.test(e))r=C.fragment(e,RegExp.$1,i),e=null;else{if(i!==t)return n(i).find(e);r=C.qsa(u,e)}else{if(L(e))return n(u).ready(e);if(C.isZ(e))return e;if(A(e))r=q(e);else if($(e))r=[e],e=null;else if(h.test(e))r=C.fragment(e.trim(),RegExp.$1,i),e=null;else{if(i!==t)return n(i).find(e);r=C.qsa(u,e)}}return C.Z(r,e)},n=function(t,e){return C.init(t,e)},n.extend=function(t){var e,n=a.call(arguments,1);return\"boolean\"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){B(t,n,e)}),t},C.qsa=function(t,e){var n,i=\"#\"==e[0],r=!i&&\".\"==e[0],o=i||r?e.slice(1):e,s=T.test(o);return t.getElementById&&s&&i?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:a.call(s&&!i&&t.getElementsByClassName?r?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},n.contains=u.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},n.type=D,n.isFunction=L,n.isWindow=k,n.isArray=A,n.isPlainObject=F,n.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},n.inArray=function(t,e,n){return r.indexOf.call(e,t,n)},n.camelCase=N,n.trim=function(t){return null==t?\"\":String.prototype.trim.call(t)},n.uuid=0,n.support={},n.expr={},n.noop=function(){},n.map=function(t,e){var n,r,o,i=[];if(R(t))for(r=0;r<t.length;r++)n=e(t[r],r),null!=n&&i.push(n);else for(o in t)n=e(t[o],o),null!=n&&i.push(n);return W(i)},n.each=function(t,e){var n,i;if(R(t)){for(n=0;n<t.length;n++)if(e.call(t[n],n,t[n])===!1)return t}else for(i in t)if(e.call(t[i],i,t[i])===!1)return t;return t},n.grep=function(t,e){return s.call(t,e)},window.JSON&&(n.parseJSON=JSON.parse),n.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"),function(t,e){j[\"[object \"+e+\"]\"]=e.toLowerCase()}),n.fn={constructor:C.Z,length:0,forEach:r.forEach,reduce:r.reduce,push:r.push,sort:r.sort,splice:r.splice,indexOf:r.indexOf,concat:function(){var t,e,n=[];for(t=0;t<arguments.length;t++)e=arguments[t],n[t]=C.isZ(e)?e.toArray():e;return o.apply(C.isZ(this)?this.toArray():this,n)},map:function(t){return n(n.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return n(a.apply(this,arguments))},ready:function(t){return E.test(u.readyState)&&u.body?t(n):u.addEventListener(\"DOMContentLoaded\",function(){t(n)},!1),this},get:function(e){return e===t?a.call(this):this[e>=0?e:e+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return r.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return L(t)?this.not(this.not(t)):n(s.call(this,function(e){return C.matches(e,t)}))},add:function(t,e){return n(P(this.concat(n(t,e))))},is:function(t){return this.length>0&&C.matches(this[0],t)},not:function(e){var i=[];if(L(e)&&e.call!==t)this.each(function(t){e.call(this,t)||i.push(this)});else{var r=\"string\"==typeof e?this.filter(e):R(e)&&L(e.item)?a.call(e):n(e);this.forEach(function(t){r.indexOf(t)<0&&i.push(t)})}return n(i)},has:function(t){return this.filter(function(){return $(t)?n.contains(this,t):n(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!$(t)?t:n(t)},last:function(){var t=this[this.length-1];return t&&!$(t)?t:n(t)},find:function(t){var e,i=this;return e=t?\"object\"==typeof t?n(t).filter(function(){var t=this;return r.some.call(i,function(e){return n.contains(e,t)})}):1==this.length?n(C.qsa(this[0],t)):this.map(function(){return C.qsa(this,t)}):n()},closest:function(t,e){var i=this[0],r=!1;for(\"object\"==typeof t&&(r=n(t));i&&!(r?r.indexOf(i)>=0:C.matches(i,t));)i=i!==e&&!Z(i)&&i.parentNode;return n(i)},parents:function(t){for(var e=[],i=this;i.length>0;)i=n.map(i,function(t){return(t=t.parentNode)&&!Z(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return V(e,t)},parent:function(t){return V(P(this.pluck(\"parentNode\")),t)},children:function(t){return V(this.map(function(){return U(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||a.call(this.childNodes)})},siblings:function(t){return V(this.map(function(t,e){return s.call(U(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=\"\"})},pluck:function(t){return n.map(this,function(e){return e[t]})},show:function(){return this.each(function(){\"none\"==this.style.display&&(this.style.display=\"\"),\"none\"==getComputedStyle(this,\"\").getPropertyValue(\"display\")&&(this.style.display=I(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var e=L(t);if(this[0]&&!e)var i=n(t).get(0),r=i.parentNode||this.length>1;return this.each(function(o){n(this).wrapAll(e?t.call(this,o):r?i.cloneNode(!0):i)})},wrapAll:function(t){if(this[0]){n(this[0]).before(t=n(t));for(var e;(e=t.children()).length;)t=e.first();n(t).append(this)}return this},wrapInner:function(t){var e=L(t);return this.each(function(i){var r=n(this),o=r.contents(),s=e?t.call(this,i):t;o.length?o.wrapAll(s):r.append(s)})},unwrap:function(){return this.parent().each(function(){n(this).replaceWith(n(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css(\"display\",\"none\")},toggle:function(e){return this.each(function(){var i=n(this);(e===t?\"none\"==i.css(\"display\"):e)?i.show():i.hide()})},prev:function(t){return n(this.pluck(\"previousElementSibling\")).filter(t||\"*\")},next:function(t){return n(this.pluck(\"nextElementSibling\")).filter(t||\"*\")},html:function(t){return 0 in arguments?this.each(function(e){var i=this.innerHTML;n(this).empty().append(Y(this,t,e,i))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=Y(this,t,e,this.textContent);this.textContent=null==n?\"\":\"\"+n}):0 in this?this[0].textContent:null},attr:function(n,i){var r;return\"string\"!=typeof n||1 in arguments?this.each(function(t){if(1===this.nodeType)if($(n))for(e in n)J(this,e,n[e]);else J(this,n,Y(this,i,t,this.getAttribute(n)))}):this.length&&1===this[0].nodeType?!(r=this[0].getAttribute(n))&&n in this[0]?this[0][n]:r:t},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(\" \").forEach(function(t){J(this,t)},this)})},prop:function(t,e){return t=M[t]||t,1 in arguments?this.each(function(n){this[t]=Y(this,e,n,this[t])}):this[0]&&this[0][t]},data:function(e,n){var i=\"data-\"+e.replace(g,\"-$1\").toLowerCase(),r=1 in arguments?this.attr(i,n):this.attr(i);return null!==r?K(r):t},val:function(t){return 0 in arguments?this.each(function(e){this.value=Y(this,t,e,this.value)}):this[0]&&(this[0].multiple?n(this[0]).find(\"option\").filter(function(){return this.selected}).pluck(\"value\"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var i=n(this),r=Y(this,t,e,i.offset()),o=i.offsetParent().offset(),s={top:r.top-o.top,left:r.left-o.left};\"static\"==i.css(\"position\")&&(s.position=\"relative\"),i.css(s)});if(!this.length)return null;if(!n.contains(u.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(t,i){if(arguments.length<2){var r,o=this[0];if(!o)return;if(r=getComputedStyle(o,\"\"),\"string\"==typeof t)return o.style[N(t)]||r.getPropertyValue(t);if(A(t)){var s={};return n.each(t,function(t,e){s[e]=o.style[N(e)]||r.getPropertyValue(e)}),s}}var a=\"\";if(\"string\"==D(t))i||0===i?a=z(t)+\":\"+_(t,i):this.each(function(){this.style.removeProperty(z(t))});else for(e in t)t[e]||0===t[e]?a+=z(e)+\":\"+_(e,t[e])+\";\":this.each(function(){this.style.removeProperty(z(e))});return this.each(function(){this.style.cssText+=\";\"+a})},index:function(t){return t?this.indexOf(n(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?r.some.call(this,function(t){return this.test(G(t))},H(t)):!1},addClass:function(t){return t?this.each(function(e){if(\"className\"in this){i=[];var r=G(this),o=Y(this,t,e,r);o.split(/\\s+/g).forEach(function(t){n(this).hasClass(t)||i.push(t)},this),i.length&&G(this,r+(r?\" \":\"\")+i.join(\" \"))}}):this},removeClass:function(e){return this.each(function(n){if(\"className\"in this){if(e===t)return G(this,\"\");i=G(this),Y(this,e,n,i).split(/\\s+/g).forEach(function(t){i=i.replace(H(t),\" \")}),G(this,i.trim())}})},toggleClass:function(e,i){return e?this.each(function(r){var o=n(this),s=Y(this,e,r,G(this));s.split(/\\s+/g).forEach(function(e){(i===t?!o.hasClass(e):i)?o.addClass(e):o.removeClass(e)})}):this},scrollTop:function(e){if(this.length){var n=\"scrollTop\"in this[0];return e===t?n?this[0].scrollTop:this[0].pageYOffset:this.each(n?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var n=\"scrollLeft\"in this[0];return e===t?n?this[0].scrollLeft:this[0].pageXOffset:this.each(n?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),i=this.offset(),r=m.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat(n(t).css(\"margin-top\"))||0,i.left-=parseFloat(n(t).css(\"margin-left\"))||0,r.top+=parseFloat(n(e[0]).css(\"border-top-width\"))||0,r.left+=parseFloat(n(e[0]).css(\"border-left-width\"))||0,{top:i.top-r.top,left:i.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||u.body;t&&!m.test(t.nodeName)&&\"static\"==n(t).css(\"position\");)t=t.offsetParent;return t})}},n.fn.detach=n.fn.remove,[\"width\",\"height\"].forEach(function(e){var i=e.replace(/./,function(t){return t[0].toUpperCase()});n.fn[e]=function(r){var o,s=this[0];return r===t?k(s)?s[\"inner\"+i]:Z(s)?s.documentElement[\"scroll\"+i]:(o=this.offset())&&o[e]:this.each(function(t){s=n(this),s.css(e,Y(this,r,t,s[e]()))})}}),y.forEach(function(t,e){var i=e%2;n.fn[t]=function(){var t,o,r=n.map(arguments,function(e){return t=D(e),\"object\"==t||\"array\"==t||null==e?e:C.fragment(e)}),s=this.length>1;return r.length<1?this:this.each(function(t,a){o=i?a:a.parentNode,a=0==e?a.nextSibling:1==e?a.firstChild:2==e?a:null;var f=n.contains(u.documentElement,o);r.forEach(function(t){if(s)t=t.cloneNode(!0);else if(!o)return n(t).remove();o.insertBefore(t,a),f&&Q(t,function(t){null==t.nodeName||\"SCRIPT\"!==t.nodeName.toUpperCase()||t.type&&\"text/javascript\"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},n.fn[i?t+\"To\":\"insert\"+(e?\"Before\":\"After\")]=function(e){return n(e)[t](this),this}}),C.Z.prototype=X.prototype=n.fn,C.uniq=P,C.deserializeValue=K,n.zepto=C,n}();window.Zepto=Zepto,void 0===window.$&&(window.$=Zepto),function(t){function l(t){return t._zid||(t._zid=e++)}function h(t,e,n,i){if(e=p(e),e.ns)var r=d(e.ns);return(s[l(t)]||[]).filter(function(t){return!(!t||e.e&&t.e!=e.e||e.ns&&!r.test(t.ns)||n&&l(t.fn)!==l(n)||i&&t.sel!=i)})}function p(t){var e=(\"\"+t).split(\".\");return{e:e[0],ns:e.slice(1).sort().join(\" \")}}function d(t){return new RegExp(\"(?:^| )\"+t.replace(\" \",\" .* ?\")+\"(?: |$)\")}function m(t,e){return t.del&&!u&&t.e in f||!!e}function g(t){return c[t]||u&&f[t]||t}function v(e,i,r,o,a,u,f){var h=l(e),d=s[h]||(s[h]=[]);i.split(/\\s/).forEach(function(i){if(\"ready\"==i)return t(document).ready(r);var s=p(i);s.fn=r,s.sel=a,s.e in c&&(r=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?s.fn.apply(this,arguments):void 0}),s.del=u;var l=u||r;s.proxy=function(t){if(t=T(t),!t.isImmediatePropagationStopped()){t.data=o;var i=l.apply(e,t._args==n?[t]:[t].concat(t._args));return i===!1&&(t.preventDefault(),t.stopPropagation()),i}},s.i=d.length,d.push(s),\"addEventListener\"in e&&e.addEventListener(g(s.e),s.proxy,m(s,f))})}function y(t,e,n,i,r){var o=l(t);(e||\"\").split(/\\s/).forEach(function(e){h(t,e,n,i).forEach(function(e){delete s[o][e.i],\"removeEventListener\"in t&&t.removeEventListener(g(e.e),e.proxy,m(e,r))})})}function T(e,i){return(i||!e.isDefaultPrevented)&&(i||(i=e),t.each(E,function(t,n){var r=i[t];e[t]=function(){return this[n]=w,r&&r.apply(i,arguments)},e[n]=x}),(i.defaultPrevented!==n?i.defaultPrevented:\"returnValue\"in i?i.returnValue===!1:i.getPreventDefault&&i.getPreventDefault())&&(e.isDefaultPrevented=w)),e}function j(t){var e,i={originalEvent:t};for(e in t)b.test(e)||t[e]===n||(i[e]=t[e]);return T(i,t)}var n,e=1,i=Array.prototype.slice,r=t.isFunction,o=function(t){return\"string\"==typeof t},s={},a={},u=\"onfocusin\"in window,f={focus:\"focusin\",blur:\"focusout\"},c={mouseenter:\"mouseover\",mouseleave:\"mouseout\"};a.click=a.mousedown=a.mouseup=a.mousemove=\"MouseEvents\",t.event={add:v,remove:y},t.proxy=function(e,n){var s=2 in arguments&&i.call(arguments,2);if(r(e)){var a=function(){return e.apply(n,s?s.concat(i.call(arguments)):arguments)};return a._zid=l(e),a}if(o(n))return s?(s.unshift(e[n],e),t.proxy.apply(null,s)):t.proxy(e[n],e);throw new TypeError(\"expected function\")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,i){return this.on(t,e,n,i,1)};var w=function(){return!0},x=function(){return!1},b=/^([A-Z]|returnValue$|layer[XY]$)/,E={preventDefault:\"isDefaultPrevented\",stopImmediatePropagation:\"isImmediatePropagationStopped\",stopPropagation:\"isPropagationStopped\"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,s,a,u,f){var c,l,h=this;return e&&!o(e)?(t.each(e,function(t,e){h.on(t,s,a,e,f)}),h):(o(s)||r(u)||u===!1||(u=a,a=s,s=n),(u===n||a===!1)&&(u=a,a=n),u===!1&&(u=x),h.each(function(n,r){f&&(c=function(t){return y(r,t.type,u),u.apply(this,arguments)}),s&&(l=function(e){var n,o=t(e.target).closest(s,r).get(0);return o&&o!==r?(n=t.extend(j(e),{currentTarget:o,liveFired:r}),(c||u).apply(o,[n].concat(i.call(arguments,1)))):void 0}),v(r,e,u,a,s,l||c)}))},t.fn.off=function(e,i,s){var a=this;return e&&!o(e)?(t.each(e,function(t,e){a.off(t,i,e)}),a):(o(i)||r(s)||s===!1||(s=i,i=n),s===!1&&(s=x),a.each(function(){y(this,e,s,i)}))},t.fn.trigger=function(e,n){return e=o(e)||t.isPlainObject(e)?t.Event(e):T(e),e._args=n,this.each(function(){e.type in f&&\"function\"==typeof this[e.type]?this[e.type]():\"dispatchEvent\"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,n){var i,r;return this.each(function(s,a){i=j(o(e)?t.Event(e):e),i._args=n,i.target=a,t.each(h(a,e.type||e),function(t,e){return r=e.proxy(i),i.isImmediatePropagationStopped()?!1:void 0})}),r},\"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error\".split(\" \").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){o(t)||(e=t,t=e.type);var n=document.createEvent(a[t]||\"Events\"),i=!0;if(e)for(var r in e)\"bubbles\"==r?i=!!e[r]:n[r]=e[r];return n.initEvent(t,i,!0),T(n)}}(Zepto),function(t){function h(e,n,i){var r=t.Event(n);return t(e).trigger(r,i),!r.isDefaultPrevented()}function p(t,e,i,r){return t.global?h(e||n,i,r):void 0}function d(e){e.global&&0===t.active++&&p(e,null,\"ajaxStart\")}function m(e){e.global&&!--t.active&&p(e,null,\"ajaxStop\")}function g(t,e){var n=e.context;return e.beforeSend.call(n,t,e)===!1||p(e,n,\"ajaxBeforeSend\",[t,e])===!1?!1:void p(e,n,\"ajaxSend\",[t,e])}function v(t,e,n,i){var r=n.context,o=\"success\";n.success.call(r,t,o,e),i&&i.resolveWith(r,[t,o,e]),p(n,r,\"ajaxSuccess\",[e,n,t]),w(o,e,n)}function y(t,e,n,i,r){var o=i.context;i.error.call(o,n,e,t),r&&r.rejectWith(o,[n,e,t]),p(i,o,\"ajaxError\",[n,i,t||e]),w(e,n,i)}function w(t,e,n){var i=n.context;n.complete.call(i,e,t),p(n,i,\"ajaxComplete\",[e,n]),m(n)}function x(){}function b(t){return t&&(t=t.split(\";\",2)[0]),t&&(t==f?\"html\":t==u?\"json\":s.test(t)?\"script\":a.test(t)&&\"xml\")||\"text\"}function E(t,e){return\"\"==e?t:(t+\"&\"+e).replace(/[&?]{1,2}/,\"?\")}function T(e){e.processData&&e.data&&\"string\"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&\"GET\"!=e.type.toUpperCase()||(e.url=E(e.url,e.data),e.data=void 0)}function j(e,n,i,r){return t.isFunction(n)&&(r=i,i=n,n=void 0),t.isFunction(i)||(r=i,i=void 0),{url:e,data:n,success:i,dataType:r}}function C(e,n,i,r){var o,s=t.isArray(n),a=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),r&&(n=i?r:r+\"[\"+(a||\"object\"==o||\"array\"==o?n:\"\")+\"]\"),!r&&s?e.add(u.name,u.value):\"array\"==o||!i&&\"object\"==o?C(e,u,i,n):e.add(n,u)})}var i,r,e=0,n=window.document,o=/<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi,s=/^(?:text|application)\\/javascript/i,a=/^(?:text|application)\\/xml/i,u=\"application/json\",f=\"text/html\",c=/^\\s*$/,l=n.createElement(\"a\");l.href=window.location.href,t.active=0,t.ajaxJSONP=function(i,r){if(!(\"type\"in i))return t.ajax(i);var f,h,o=i.jsonpCallback,s=(t.isFunction(o)?o():o)||\"jsonp\"+ ++e,a=n.createElement(\"script\"),u=window[s],c=function(e){t(a).triggerHandler(\"error\",e||\"abort\")},l={abort:c};return r&&r.promise(l),t(a).on(\"load error\",function(e,n){clearTimeout(h),t(a).off().remove(),\"error\"!=e.type&&f?v(f[0],l,i,r):y(null,n||\"error\",l,i,r),window[s]=u,f&&t.isFunction(u)&&u(f[0]),u=f=void 0}),g(l,i)===!1?(c(\"abort\"),l):(window[s]=function(){f=arguments},a.src=i.url.replace(/\\?(.+)=\\?/,\"?$1=\"+s),n.head.appendChild(a),i.timeout>0&&(h=setTimeout(function(){c(\"timeout\")},i.timeout)),l)},t.ajaxSettings={type:\"GET\",beforeSend:x,success:x,error:x,complete:x,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:\"text/javascript, application/javascript, application/x-javascript\",json:u,xml:\"application/xml, text/xml\",html:f,text:\"text/plain\"},crossDomain:!1,timeout:0,processData:!0,cache:!0},t.ajax=function(e){var a,u,o=t.extend({},e||{}),s=t.Deferred&&t.Deferred();for(i in t.ajaxSettings)void 0===o[i]&&(o[i]=t.ajaxSettings[i]);d(o),o.crossDomain||(a=n.createElement(\"a\"),a.href=o.url,a.href=a.href,o.crossDomain=l.protocol+\"//\"+l.host!=a.protocol+\"//\"+a.host),o.url||(o.url=window.location.toString()),(u=o.url.indexOf(\"#\"))>-1&&(o.url=o.url.slice(0,u)),T(o);var f=o.dataType,h=/\\?.+=\\?/.test(o.url);if(h&&(f=\"jsonp\"),o.cache!==!1&&(e&&e.cache===!0||\"script\"!=f&&\"jsonp\"!=f)||(o.url=E(o.url,\"_=\"+Date.now())),\"jsonp\"==f)return h||(o.url=E(o.url,o.jsonp?o.jsonp+\"=?\":o.jsonp===!1?\"\":\"callback=?\")),t.ajaxJSONP(o,s);var N,p=o.accepts[f],m={},w=function(t,e){m[t.toLowerCase()]=[t,e]},j=/^([\\w-]+:)\\/\\//.test(o.url)?RegExp.$1:window.location.protocol,S=o.xhr(),C=S.setRequestHeader;if(s&&s.promise(S),o.crossDomain||w(\"X-Requested-With\",\"XMLHttpRequest\"),w(\"Accept\",p||\"*/*\"),(p=o.mimeType||p)&&(p.indexOf(\",\")>-1&&(p=p.split(\",\",2)[0]),S.overrideMimeType&&S.overrideMimeType(p)),(o.contentType||o.contentType!==!1&&o.data&&\"GET\"!=o.type.toUpperCase())&&w(\"Content-Type\",o.contentType||\"application/x-www-form-urlencoded\"),o.headers)for(r in o.headers)w(r,o.headers[r]);if(S.setRequestHeader=w,S.onreadystatechange=function(){if(4==S.readyState){S.onreadystatechange=x,clearTimeout(N);var e,n=!1;if(S.status>=200&&S.status<300||304==S.status||0==S.status&&\"file:\"==j){f=f||b(o.mimeType||S.getResponseHeader(\"content-type\")),e=S.responseText;try{\"script\"==f?(1,eval)(e):\"xml\"==f?e=S.responseXML:\"json\"==f&&(e=c.test(e)?null:t.parseJSON(e))}catch(i){n=i}n?y(n,\"parsererror\",S,o,s):v(e,S,o,s)}else y(S.statusText||null,S.status?\"error\":\"abort\",S,o,s)}},g(S,o)===!1)return S.abort(),y(null,\"abort\",S,o,s),S;if(o.xhrFields)for(r in o.xhrFields)S[r]=o.xhrFields[r];var P=\"async\"in o?o.async:!0;S.open(o.type,o.url,P,o.username,o.password);for(r in m)C.apply(S,m[r]);return o.timeout>0&&(N=setTimeout(function(){S.onreadystatechange=x,S.abort(),y(null,\"timeout\",S,o,s)},o.timeout)),S.send(o.data?o.data:null),S},t.get=function(){return t.ajax(j.apply(null,arguments))},t.post=function(){var e=j.apply(null,arguments);return e.type=\"POST\",t.ajax(e)},t.getJSON=function(){var e=j.apply(null,arguments);return e.dataType=\"json\",t.ajax(e)},t.fn.load=function(e,n,i){if(!this.length)return this;var a,r=this,s=e.split(/\\s/),u=j(e,n,i),f=u.success;return s.length>1&&(u.url=s[0],a=s[1]),u.success=function(e){r.html(a?t(\"<div>\").html(e.replace(o,\"\")).find(a):e),f&&f.apply(r,arguments)},t.ajax(u),this};var S=encodeURIComponent;t.param=function(e,n){var i=[];return i.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=\"\"),this.push(S(e)+\"=\"+S(n))},C(i,e,n),i.join(\"&\").replace(/%20/g,\"+\")}}(Zepto),function(t){t.Callbacks=function(e){e=t.extend({},e);var n,i,r,o,s,a,u=[],f=!e.once&&[],c=function(t){for(n=e.memory&&t,i=!0,a=o||0,o=0,s=u.length,r=!0;u&&s>a;++a)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}r=!1,u&&(f?f.length&&c(f.shift()):n?u.length=0:l.disable())},l={add:function(){if(u){var i=u.length,a=function(n){t.each(n,function(t,n){\"function\"==typeof n?e.unique&&l.has(n)||u.push(n):n&&n.length&&\"string\"!=typeof n&&a(n)})};a(arguments),r?s=u.length:n&&(o=i,c(n))}return this},remove:function(){return u&&t.each(arguments,function(e,n){for(var i;(i=t.inArray(n,u,i))>-1;)u.splice(i,1),r&&(s>=i&&--s,a>=i&&--a)}),this},has:function(e){return!(!u||!(e?t.inArray(e,u)>-1:u.length))},empty:function(){return s=u.length=0,this},disable:function(){return u=f=n=void 0,this},disabled:function(){return!u},lock:function(){return f=void 0,n||l.disable(),this},locked:function(){return!f},fireWith:function(t,e){return!u||i&&!f||(e=e||[],e=[t,e.slice?e.slice():e],r?f.push(e):c(e)),this},fire:function(){return l.fireWith(this,arguments)},fired:function(){return!!i}};return l}}(Zepto),function(t){function n(e){var i=[[\"resolve\",\"done\",t.Callbacks({once:1,memory:1}),\"resolved\"],[\"reject\",\"fail\",t.Callbacks({once:1,memory:1}),\"rejected\"],[\"notify\",\"progress\",t.Callbacks({memory:1})]],r=\"pending\",o={state:function(){return r},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var e=arguments;return n(function(n){t.each(i,function(i,r){var a=t.isFunction(e[i])&&e[i];s[r[1]](function(){var e=a&&a.apply(this,arguments);if(e&&t.isFunction(e.promise))e.promise().done(n.resolve).fail(n.reject).progress(n.notify);else{var i=this===o?n.promise():this,s=a?[e]:arguments;n[r[0]+\"With\"](i,s)}})}),e=null}).promise()},promise:function(e){return null!=e?t.extend(e,o):o}},s={};return t.each(i,function(t,e){var n=e[2],a=e[3];o[e[1]]=n.add,a&&n.add(function(){r=a},i[1^t][2].disable,i[2][2].lock),s[e[0]]=function(){return s[e[0]+\"With\"](this===s?o:this,arguments),this},s[e[0]+\"With\"]=n.fireWith}),o.promise(s),e&&e.call(s,s),s}var e=Array.prototype.slice;t.when=function(i){var f,c,l,r=e.call(arguments),o=r.length,s=0,a=1!==o||i&&t.isFunction(i.promise)?o:0,u=1===a?i:n(),h=function(t,n,i){return function(r){n[t]=this,i[t]=arguments.length>1?e.call(arguments):r,i===f?u.notifyWith(n,i):--a||u.resolveWith(n,i)}};if(o>1)for(f=new Array(o),c=new Array(o),l=new Array(o);o>s;++s)r[s]&&t.isFunction(r[s].promise)?r[s].promise().done(h(s,l,r)).fail(u.reject).progress(h(s,c,f)):--a;return a||u.resolveWith(l,r),u.promise()},t.Deferred=n}(Zepto),function(t){function u(t,e,n,i){return Math.abs(t-e)>=Math.abs(n-i)?t-e>0?\"Left\":\"Right\":n-i>0?\"Up\":\"Down\"}function f(){o=null,e.last&&(e.el.trigger(\"longTap\"),e={})}function c(){o&&clearTimeout(o),o=null}function l(){n&&clearTimeout(n),i&&clearTimeout(i),r&&clearTimeout(r),o&&clearTimeout(o),n=i=r=o=null,e={}}function h(t){return(\"touch\"==t.pointerType||t.pointerType==t.MSPOINTER_TYPE_TOUCH)&&t.isPrimary}function p(t,e){return t.type==\"pointer\"+e||t.type.toLowerCase()==\"mspointer\"+e}var n,i,r,o,a,e={},s=750;t(document).ready(function(){var d,m,y,w,g=0,v=0;\"MSGesture\"in window&&(a=new MSGesture,a.target=document.body),t(document).bind(\"MSGestureEnd\",function(t){var n=t.velocityX>1?\"Right\":t.velocityX<-1?\"Left\":t.velocityY>1?\"Down\":t.velocityY<-1?\"Up\":null;n&&(e.el.trigger(\"swipe\"),e.el.trigger(\"swipe\"+n))}).on(\"touchstart MSPointerDown pointerdown\",function(i){(!(w=p(i,\"down\"))||h(i))&&(y=w?i:i.touches[0],i.touches&&1===i.touches.length&&e.x2&&(e.x2=void 0,e.y2=void 0),d=Date.now(),m=d-(e.last||d),e.el=t(\"tagName\"in y.target?y.target:y.target.parentNode),n&&clearTimeout(n),e.x1=y.pageX,e.y1=y.pageY,m>0&&250>=m&&(e.isDoubleTap=!0),e.last=d,o=setTimeout(f,s),a&&w&&a.addPointer(i.pointerId))}).on(\"touchmove MSPointerMove pointermove\",function(t){(!(w=p(t,\"move\"))||h(t))&&(y=w?t:t.touches[0],c(),e.x2=y.pageX,e.y2=y.pageY,g+=Math.abs(e.x1-e.x2),v+=Math.abs(e.y1-e.y2))}).on(\"touchend MSPointerUp pointerup\",function(o){(!(w=p(o,\"up\"))||h(o))&&(c(),e.x2&&Math.abs(e.x1-e.x2)>30||e.y2&&Math.abs(e.y1-e.y2)>30?r=setTimeout(function(){e.el.trigger(\"swipe\"),e.el.trigger(\"swipe\"+u(e.x1,e.x2,e.y1,e.y2)),e={}},0):\"last\"in e&&(30>g&&30>v?i=setTimeout(function(){var i=t.Event(\"tap\");i.cancelTouch=l,e.el.trigger(i),e.isDoubleTap?(e.el&&e.el.trigger(\"doubleTap\"),e={}):n=setTimeout(function(){n=null,e.el&&e.el.trigger(\"singleTap\"),e={}},250)},0):e={}),g=v=0)}).on(\"touchcancel MSPointerCancel pointercancel\",l),t(window).on(\"scroll\",l)}),[\"swipe\",\"swipeLeft\",\"swipeRight\",\"swipeUp\",\"swipeDown\",\"doubleTap\",\"tap\",\"singleTap\",\"longTap\"].forEach(function(e){t.fn[e]=function(t){return this.on(e,t)}})}(Zepto),function(t){function r(e){return e=t(e),!(!e.width()&&!e.height())&&\"none\"!==e.css(\"display\")}function f(t,e){t=t.replace(/=#\\]/g,'=\"#\"]');var n,i,r=s.exec(t);if(r&&r[2]in o&&(n=o[r[2]],i=r[3],t=r[1],i)){var a=Number(i);i=isNaN(a)?i.replace(/^[\"']|[\"']$/g,\"\"):a}return e(t,n,i)}var e=t.zepto,n=e.qsa,i=e.matches,o=t.expr[\":\"]={visible:function(){return r(this)?this:void 0},hidden:function(){return r(this)?void 0:this},selected:function(){return this.selected?this:void 0},checked:function(){return this.checked?this:void 0},parent:function(){return this.parentNode},first:function(t){return 0===t?this:void 0},last:function(t,e){return t===e.length-1?this:void 0},eq:function(t,e,n){return t===n?this:void 0},contains:function(e,n,i){return t(this).text().indexOf(i)>-1?this:void 0},has:function(t,n,i){return e.qsa(this,i).length?this:void 0}},s=new RegExp(\"(.*):(\\\\w+)(?:\\\\(([^)]+)\\\\))?$\\\\s*\"),a=/^\\s*>/,u=\"Zepto\"+ +new Date;e.qsa=function(i,r){return f(r,function(o,s,f){try{var c;!o&&s?o=\"*\":a.test(o)&&(c=t(i).addClass(u),o=\".\"+u+\" \"+o);var l=n(i,o)}catch(h){throw console.error(\"error performing selector: %o\",r),h}finally{c&&c.removeClass(u)}return s?e.uniq(t.map(l,function(t,e){return s.call(t,e,l,f)})):l})},e.matches=function(t,e){return f(e,function(e,n,r){return!(e&&!i(t,e)||n&&n.call(t,null,r)!==t)})}}(Zepto),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t){try{return e(t)}catch(n){return null}}}}();\n\tmodule.exports = Zepto;\n\n\n/***/ },\n/* 6 */\n/*!******************************!*\\\n !*** ./src/base/template.js ***!\n \\******************************/\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t/* eslint-disable no-var */\n\t// Simple JavaScript Templating\n\t// Paul Miller (http://paulmillr.com)\n\t// http://underscorejs.org\n\t// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t\n\t// By default, Underscore uses ERB-style template delimiters, change the\n\t// following template settings to use alternative delimiters.\n\tvar settings = {\n\t evaluate: /<%([\\s\\S]+?)%>/g,\n\t interpolate: /<%=([\\s\\S]+?)%>/g,\n\t escape: /<%-([\\s\\S]+?)%>/g\n\t};\n\t\n\t// When customizing `templateSettings`, if you don't want to define an\n\t// interpolation, evaluation or escaping regex, we need one that is\n\t// guaranteed not to match.\n\tvar noMatch = /(.)^/;\n\t\n\t// Certain characters need to be escaped so that they can be put into a\n\t// string literal.\n\tvar escapes = {\n\t '\\'': '\\'',\n\t '\\\\': '\\\\',\n\t '\\r': 'r',\n\t '\\n': 'n',\n\t '\\t': 't',\n\t '\\u2028': 'u2028',\n\t '\\u2029': 'u2029'\n\t};\n\t\n\tvar escaper = /\\\\|'|\\r|\\n|\\t|\\u2028|\\u2029/g;\n\t\n\t// List of HTML entities for escaping.\n\tvar htmlEntities = {\n\t '&': '&amp;',\n\t '<': '&lt;',\n\t '>': '&gt;',\n\t '\"': '&quot;',\n\t '\\'': '&#x27;'\n\t};\n\t\n\tvar entityRe = new RegExp('[&<>\"\\']', 'g');\n\t\n\tvar escapeExpr = function escapeExpr(string) {\n\t if (string === null) {\n\t return '';\n\t }\n\t return ('' + string).replace(entityRe, function (match) {\n\t return htmlEntities[match];\n\t });\n\t};\n\t\n\tvar counter = 0;\n\t\n\t// JavaScript micro-templating, similar to John Resig's implementation.\n\t// Underscore templating handles arbitrary delimiters, preserves whitespace,\n\t// and correctly escapes quotes within interpolated code.\n\tvar tmpl = function tmpl(text, data) {\n\t var render;\n\t\n\t // Combine delimiters into one regular expression via alternation.\n\t var matcher = new RegExp([(settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source].join('|') + '|$', 'g');\n\t\n\t // Compile the template source, escaping string literals appropriately.\n\t var index = 0;\n\t var source = '__p+=\\'';\n\t text.replace(matcher, function (match, escape, interpolate, evaluate, offset) {\n\t source += text.slice(index, offset).replace(escaper, function (match) {\n\t return '\\\\' + escapes[match];\n\t });\n\t\n\t if (escape) {\n\t source += '\\'+\\n((__t=(' + escape + '))==null?\\'\\':escapeExpr(__t))+\\n\\'';\n\t }\n\t if (interpolate) {\n\t source += '\\'+\\n((__t=(' + interpolate + '))==null?\\'\\':__t)+\\n\\'';\n\t }\n\t if (evaluate) {\n\t source += '\\';\\n' + evaluate + '\\n__p+=\\'';\n\t }\n\t index = offset + match.length;\n\t return match;\n\t });\n\t source += '\\';\\n';\n\t\n\t // If a variable is not specified, place data values in local scope.\n\t if (!settings.variable) {\n\t source = 'with(obj||{}){\\n' + source + '}\\n';\n\t }\n\t\n\t source = 'var __t,__p=\\'\\',__j=Array.prototype.join,' + 'print=function(){__p+=__j.call(arguments,\\'\\');};\\n' + source + 'return __p;\\n//# sourceURL=/microtemplates/source[' + counter++ + ']';\n\t\n\t try {\n\t /*jshint -W054 */\n\t // TODO: find a way to avoid eval\n\t render = new Function(settings.variable || 'obj', 'escapeExpr', source);\n\t } catch (e) {\n\t e.source = source;\n\t throw e;\n\t }\n\t\n\t if (data) {\n\t return render(data, escapeExpr);\n\t }\n\t var template = function template(data) {\n\t return render.call(this, data, escapeExpr);\n\t };\n\t\n\t // Provide the compiled function source as a convenience for precompilation.\n\t template.source = 'function(' + (settings.variable || 'obj') + '){\\n' + source + '}';\n\t\n\t return template;\n\t};\n\ttmpl.settings = settings;\n\t\n\tmodule.exports = tmpl;\n\n/***/ },\n/* 7 */\n/*!**************************************!*\\\n !*** ./~/css-loader/lib/css-base.js ***!\n \\**************************************/\n/***/ function(module, exports) {\n\n\t/*\r\n\t\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\t\tAuthor Tobias Koppers @sokra\r\n\t*/\r\n\t// css base code, injected by the css-loader\r\n\tmodule.exports = function() {\r\n\t\tvar list = [];\r\n\t\r\n\t\t// return the list of modules as css string\r\n\t\tlist.toString = function toString() {\r\n\t\t\tvar result = [];\r\n\t\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\t\tvar item = this[i];\r\n\t\t\t\tif(item[2]) {\r\n\t\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.push(item[1]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn result.join(\"\");\r\n\t\t};\r\n\t\r\n\t\t// import a list of modules into the list\r\n\t\tlist.i = function(modules, mediaQuery) {\r\n\t\t\tif(typeof modules === \"string\")\r\n\t\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\t\tvar alreadyImportedModules = {};\r\n\t\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\t\tvar id = this[i][0];\r\n\t\t\t\tif(typeof id === \"number\")\r\n\t\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t\t}\r\n\t\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\t\tvar item = modules[i];\r\n\t\t\t\t// skip already imported module\r\n\t\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlist.push(item);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn list;\r\n\t};\r\n\n\n/***/ },\n/* 8 */\n/*!***********************************!*\\\n !*** ./src/components/browser.js ***!\n \\***********************************/\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t// Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar Browser = {};\n\t\n\tvar hasLocalstorage = function hasLocalstorage() {\n\t try {\n\t localStorage.setItem('clappr', 'clappr');\n\t localStorage.removeItem('clappr');\n\t return true;\n\t } catch (e) {\n\t return false;\n\t }\n\t};\n\t\n\tvar hasFlash = function hasFlash() {\n\t try {\n\t var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');\n\t return !!fo;\n\t } catch (e) {\n\t return !!(navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash'] !== undefined && navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin);\n\t }\n\t};\n\t\n\tvar getBrowserInfo = function getBrowserInfo() {\n\t var ua = navigator.userAgent;\n\t var parts = ua.match(/\\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [],\n\t extra = void 0;\n\t if (/trident/i.test(parts[1])) {\n\t extra = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n\t return { name: 'IE', version: parseInt(extra[1] || '') };\n\t } else if (parts[1] === 'Chrome') {\n\t extra = ua.match(/\\bOPR\\/(\\d+)/);\n\t if (extra != null) {\n\t return { name: 'Opera', version: parseInt(extra[1]) };\n\t }\n\t }\n\t parts = parts[2] ? [parts[1], parts[2]] : [navigator.appName, navigator.appVersion, '-?'];\n\t\n\t if (extra = ua.match(/version\\/(\\d+)/i)) {\n\t parts.splice(1, 1, extra[1]);\n\t }\n\t return { name: parts[0], version: parseInt(parts[1]) };\n\t};\n\t\n\tvar browserInfo = getBrowserInfo();\n\t\n\tBrowser.isSafari = /safari/i.test(navigator.userAgent) && navigator.userAgent.indexOf('Chrome') === -1;\n\tBrowser.isChrome = /chrome/i.test(navigator.userAgent);\n\tBrowser.isFirefox = /firefox/i.test(navigator.userAgent);\n\tBrowser.isLegacyIE = !!window.ActiveXObject;\n\tBrowser.isIE = Browser.isLegacyIE || /trident.*rv:1\\d/i.test(navigator.userAgent);\n\tBrowser.isIE11 = /trident.*rv:11/i.test(navigator.userAgent);\n\tBrowser.isChromecast = Browser.isChrome && /CrKey/i.test(navigator.userAgent);\n\tBrowser.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone|IEMobile|Opera Mini/i.test(navigator.userAgent);\n\tBrowser.isiOS = /iPad|iPhone|iPod/i.test(navigator.userAgent);\n\tBrowser.isAndroid = /Android/i.test(navigator.userAgent);\n\tBrowser.isWindowsPhone = /Windows Phone/i.test(navigator.userAgent);\n\tBrowser.isWin8App = /MSAppHost/i.test(navigator.userAgent);\n\tBrowser.isWiiU = /WiiU/i.test(navigator.userAgent);\n\tBrowser.isPS4 = /PlayStation 4/i.test(navigator.userAgent);\n\tBrowser.hasLocalstorage = hasLocalstorage();\n\tBrowser.hasFlash = hasFlash();\n\t\n\tBrowser.name = browserInfo.name;\n\tBrowser.version = browserInfo.version;\n\t\n\texports.default = Browser;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 9 */\n/*!*********************************!*\\\n !*** ./src/base/base_object.js ***!\n \\*********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! ./utils */ 2);\n\t\n\tvar _events = __webpack_require__(/*! ./events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\t/**\n\t * @class BaseObject\n\t * @constructor\n\t * @extends Events\n\t * @module base\n\t */\n\tvar BaseObject = function (_Events) {\n\t _inherits(BaseObject, _Events);\n\t\n\t _createClass(BaseObject, [{\n\t key: 'options',\n\t\n\t /**\n\t * returns the object options\n\t * @property options\n\t * @type Object\n\t */\n\t get: function get() {\n\t return this._options;\n\t }\n\t\n\t /**\n\t * @method constructor\n\t * @param {Object} options\n\t */\n\t\n\t }]);\n\t\n\t function BaseObject() {\n\t var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\t\n\t _classCallCheck(this, BaseObject);\n\t\n\t var _this = _possibleConstructorReturn(this, _Events.call(this, options));\n\t\n\t _this._options = options;\n\t _this.uniqueId = (0, _utils.uniqueId)('o');\n\t return _this;\n\t }\n\t /**\n\t * a unique id prefixed with `'o'`, `o1, o232`\n\t *\n\t * @property uniqueId\n\t * @type String\n\t */\n\t\n\t\n\t return BaseObject;\n\t}(_events2.default);\n\t\n\texports.default = BaseObject;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 10 */\n/*!*******************************!*\\\n !*** ./src/base/ui_object.js ***!\n \\*******************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! ./utils */ 2);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tvar _lodash = __webpack_require__(/*! lodash.result */ 102);\n\t\n\tvar _lodash2 = _interopRequireDefault(_lodash);\n\t\n\tvar _base_object = __webpack_require__(/*! ./base_object */ 9);\n\t\n\tvar _base_object2 = _interopRequireDefault(_base_object);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar delegateEventSplitter = /^(\\S+)\\s*(.*)$/;\n\t\n\t/**\n\t * A base class to create ui object.\n\t * @class UIObject\n\t * @constructor\n\t * @extends BaseObject\n\t * @module base\n\t */\n\t\n\tvar UIObject = function (_BaseObject) {\n\t _inherits(UIObject, _BaseObject);\n\t\n\t _createClass(UIObject, [{\n\t key: 'tagName',\n\t\n\t /**\n\t * a unique id prefixed with `'c'`, `c1, c232`\n\t *\n\t * @property cid\n\t * @type String\n\t */\n\t /**\n\t * the dom element itself\n\t *\n\t * @property el\n\t * @type HTMLElement\n\t */\n\t /**\n\t * the dom element wrapped by `$`\n\t *\n\t * @property $el\n\t * @type HTMLElement\n\t */\n\t\n\t /**\n\t * gets the tag name for the ui component\n\t * @method tagName\n\t * @default div\n\t * @return {String} tag's name\n\t */\n\t get: function get() {\n\t return 'div';\n\t }\n\t /**\n\t * a literal object mapping element's events to methods\n\t * @property events\n\t * @type Object\n\t * @example\n\t *\n\t *```javascript\n\t *\n\t * class MyButton extends UIObject {\n\t * constructor(options) {\n\t * super(options)\n\t * this.myId = 0\n\t * }\n\t * get events() { return { 'click': 'myClick' } }\n\t * myClick(){ this.myId = 42 }\n\t * }\n\t *\n\t * // when you click on MyButton the method `myClick` will be called\n\t *```\n\t */\n\t\n\t }, {\n\t key: 'events',\n\t get: function get() {\n\t return {};\n\t }\n\t /**\n\t * a literal object mapping attributes and values to the element\n\t * element's attribute name and the value the attribute value\n\t * @property attributes\n\t * @type Object\n\t * @example\n\t *\n\t *```javascript\n\t *\n\t * class MyButton extends UIObject {\n\t * constructor(options) { super(options) }\n\t * get attributes() { return { class: 'my-button'} }\n\t * }\n\t *\n\t * // MyButton.el.className will be 'my-button'\n\t * ```\n\t */\n\t\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t return {};\n\t }\n\t\n\t /**\n\t * it builds an ui component by:\n\t * * creating an id for the component `cid`\n\t * * making sure the element is created `$el`\n\t * * delegating all `events` to the element\n\t * @method constructor\n\t * @param {Object} options the options object\n\t */\n\t\n\t }]);\n\t\n\t function UIObject(options) {\n\t _classCallCheck(this, UIObject);\n\t\n\t var _this = _possibleConstructorReturn(this, _BaseObject.call(this, options));\n\t\n\t _this.cid = (0, _utils.uniqueId)('c');\n\t _this._ensureElement();\n\t _this.delegateEvents();\n\t return _this;\n\t }\n\t\n\t /**\n\t * selects within the component.\n\t * @method $\n\t * @param {String} selector a selector to find within the component.\n\t * @return {HTMLElement} an element, if it exists.\n\t * @example\n\t * ```javascript\n\t * fullScreenBarUIComponent.$('.button-full') //will return only `.button-full` within the component\n\t * ```\n\t */\n\t\n\t\n\t UIObject.prototype.$ = function $(selector) {\n\t return this.$el.find(selector);\n\t };\n\t\n\t /**\n\t * render the component, usually attach it to a real existent `element`\n\t * @method render\n\t * @return {UIObject} itself\n\t */\n\t\n\t\n\t UIObject.prototype.render = function render() {\n\t return this;\n\t };\n\t\n\t /**\n\t * removes the ui component from DOM\n\t * @method remove\n\t * @return {UIObject} itself\n\t */\n\t\n\t\n\t UIObject.prototype.remove = function remove() {\n\t this.$el.remove();\n\t this.stopListening();\n\t this.undelegateEvents();\n\t return this;\n\t };\n\t\n\t /**\n\t * set element to `el` and `$el`\n\t * @method setElement\n\t * @param {HTMLElement} element\n\t * @param {Boolean} delegate whether is delegate or not\n\t * @return {UIObject} itself\n\t */\n\t\n\t\n\t UIObject.prototype.setElement = function setElement(element, delegate) {\n\t if (this.$el) {\n\t this.undelegateEvents();\n\t }\n\t this.$el = element instanceof _clapprZepto2.default ? element : (0, _clapprZepto2.default)(element);\n\t this.el = this.$el[0];\n\t if (delegate !== false) {\n\t this.delegateEvents();\n\t }\n\t return this;\n\t };\n\t\n\t /**\n\t * delegates all the original `events` on `element` to its callbacks\n\t * @method delegateEvents\n\t * @param {Object} events\n\t * @return {UIObject} itself\n\t */\n\t\n\t\n\t UIObject.prototype.delegateEvents = function delegateEvents(events) {\n\t if (!(events || (events = (0, _lodash2.default)(this, 'events')))) {\n\t return this;\n\t }\n\t this.undelegateEvents();\n\t for (var key in events) {\n\t var method = events[key];\n\t if (method && method.constructor !== Function) {\n\t method = this[events[key]];\n\t }\n\t if (!method) {\n\t continue;\n\t }\n\t\n\t var match = key.match(delegateEventSplitter);\n\t var eventName = match[1],\n\t selector = match[2];\n\t //method = _.bind(method, this)\n\t eventName += '.delegateEvents' + this.cid;\n\t if (selector === '') {\n\t this.$el.on(eventName, method.bind(this));\n\t } else {\n\t this.$el.on(eventName, selector, method.bind(this));\n\t }\n\t }\n\t return this;\n\t };\n\t\n\t /**\n\t * undelegats all the `events`\n\t * @method undelegateEvents\n\t * @return {UIObject} itself\n\t */\n\t\n\t\n\t UIObject.prototype.undelegateEvents = function undelegateEvents() {\n\t this.$el.off('.delegateEvents' + this.cid);\n\t return this;\n\t };\n\t\n\t /**\n\t * ensures the creation of this ui component\n\t * @method _ensureElement\n\t * @private\n\t */\n\t\n\t\n\t UIObject.prototype._ensureElement = function _ensureElement() {\n\t if (!this.el) {\n\t var attrs = _clapprZepto2.default.extend({}, (0, _lodash2.default)(this, 'attributes'));\n\t if (this.id) {\n\t attrs.id = (0, _lodash2.default)(this, 'id');\n\t }\n\t if (this.className) {\n\t attrs['class'] = (0, _lodash2.default)(this, 'className');\n\t }\n\t var $el = (0, _clapprZepto2.default)('<' + (0, _lodash2.default)(this, 'tagName') + '>').attr(attrs);\n\t this.setElement($el, false);\n\t } else {\n\t this.setElement((0, _lodash2.default)(this, 'el'), false);\n\t }\n\t };\n\t\n\t return UIObject;\n\t}(_base_object2.default);\n\t\n\texports.default = UIObject;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 11 */\n/*!************************************!*\\\n !*** ./src/components/mediator.js ***!\n \\************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\t/**\n\t * The mediator is a singleton for handling global events.\n\t */\n\t\n\tvar events = new _events2.default();\n\t\n\tvar Mediator = function Mediator() {\n\t _classCallCheck(this, Mediator);\n\t};\n\t\n\texports.default = Mediator;\n\t\n\t\n\tMediator.on = function (name, callback, context) {\n\t events.on(name, callback, context);\n\t return;\n\t};\n\t\n\tMediator.once = function (name, callback, context) {\n\t events.once(name, callback, context);\n\t return;\n\t};\n\t\n\tMediator.off = function (name, callback, context) {\n\t events.off(name, callback, context);\n\t return;\n\t};\n\t\n\tMediator.trigger = function (name) {\n\t for (var _len = arguments.length, opts = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t opts[_key - 1] = arguments[_key];\n\t }\n\t\n\t events.trigger.apply(events, [name].concat(opts));\n\t return;\n\t};\n\t\n\tMediator.stopListening = function (obj, name, callback) {\n\t events.stopListening(obj, name, callback);\n\t return;\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 12 */\n/*!*********************************!*\\\n !*** ./src/base/core_plugin.js ***!\n \\*********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _utils = __webpack_require__(/*! ./utils */ 2);\n\t\n\tvar _base_object = __webpack_require__(/*! ./base_object */ 9);\n\t\n\tvar _base_object2 = _interopRequireDefault(_base_object);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar CorePlugin = function (_BaseObject) {\n\t _inherits(CorePlugin, _BaseObject);\n\t\n\t function CorePlugin(core) {\n\t _classCallCheck(this, CorePlugin);\n\t\n\t var _this = _possibleConstructorReturn(this, _BaseObject.call(this, core.options));\n\t\n\t _this.core = core;\n\t _this.enabled = true;\n\t _this.bindEvents();\n\t return _this;\n\t }\n\t\n\t CorePlugin.prototype.bindEvents = function bindEvents() {};\n\t\n\t CorePlugin.prototype.enable = function enable() {\n\t if (!this.enabled) {\n\t this.bindEvents();\n\t this.enabled = true;\n\t }\n\t };\n\t\n\t CorePlugin.prototype.disable = function disable() {\n\t if (this.enabled) {\n\t this.stopListening();\n\t this.enabled = false;\n\t }\n\t };\n\t\n\t CorePlugin.prototype.getExternalInterface = function getExternalInterface() {\n\t return {};\n\t };\n\t\n\t CorePlugin.prototype.destroy = function destroy() {\n\t this.stopListening();\n\t };\n\t\n\t return CorePlugin;\n\t}(_base_object2.default);\n\t\n\texports.default = CorePlugin;\n\t\n\t\n\tCorePlugin.extend = function (properties) {\n\t return (0, _utils.extend)(CorePlugin, properties);\n\t};\n\t\n\tCorePlugin.type = 'core';\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 13 */\n/*!**************************************!*\\\n !*** ./src/base/container_plugin.js ***!\n \\**************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _base_object = __webpack_require__(/*! ./base_object */ 9);\n\t\n\tvar _base_object2 = _interopRequireDefault(_base_object);\n\t\n\tvar _utils = __webpack_require__(/*! ./utils */ 2);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\t/**\n\t * The base class for a container plugin\n\t * @class ContainerPlugin\n\t * @constructor\n\t * @extends UIObject\n\t * @module base\n\t */\n\tvar ContainerPlugin = function (_BaseObject) {\n\t _inherits(ContainerPlugin, _BaseObject);\n\t\n\t function ContainerPlugin(container) {\n\t _classCallCheck(this, ContainerPlugin);\n\t\n\t var _this = _possibleConstructorReturn(this, _BaseObject.call(this, container.options));\n\t\n\t _this.container = container;\n\t _this.enabled = true;\n\t _this.bindEvents();\n\t return _this;\n\t }\n\t\n\t ContainerPlugin.prototype.enable = function enable() {\n\t if (!this.enabled) {\n\t this.bindEvents();\n\t this.enabled = true;\n\t }\n\t };\n\t\n\t ContainerPlugin.prototype.disable = function disable() {\n\t if (this.enabled) {\n\t this.stopListening();\n\t this.enabled = false;\n\t }\n\t };\n\t\n\t ContainerPlugin.prototype.bindEvents = function bindEvents() {};\n\t\n\t ContainerPlugin.prototype.destroy = function destroy() {\n\t this.stopListening();\n\t };\n\t\n\t return ContainerPlugin;\n\t}(_base_object2.default);\n\t\n\texports.default = ContainerPlugin;\n\t\n\t\n\tContainerPlugin.extend = function (properties) {\n\t return (0, _utils.extend)(ContainerPlugin, properties);\n\t};\n\t\n\tContainerPlugin.type = 'container';\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 14 */\n/*!*****************************************!*\\\n !*** ./src/base/ui_container_plugin.js ***!\n \\*****************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _utils = __webpack_require__(/*! ./utils */ 2);\n\t\n\tvar _ui_object = __webpack_require__(/*! ./ui_object */ 10);\n\t\n\tvar _ui_object2 = _interopRequireDefault(_ui_object);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\t/**\n\t * The base class for an ui container plugin\n\t * @class UIContainerPlugin\n\t * @constructor\n\t * @extends UIObject\n\t * @module base\n\t */\n\tvar UIContainerPlugin = function (_UIObject) {\n\t _inherits(UIContainerPlugin, _UIObject);\n\t\n\t function UIContainerPlugin(container) {\n\t _classCallCheck(this, UIContainerPlugin);\n\t\n\t var _this = _possibleConstructorReturn(this, _UIObject.call(this, container.options));\n\t\n\t _this.container = container;\n\t _this.enabled = true;\n\t _this.bindEvents();\n\t return _this;\n\t }\n\t\n\t UIContainerPlugin.prototype.enable = function enable() {\n\t if (!this.enabled) {\n\t this.bindEvents();\n\t this.$el.show();\n\t this.enabled = true;\n\t }\n\t };\n\t\n\t UIContainerPlugin.prototype.disable = function disable() {\n\t this.stopListening();\n\t this.$el.hide();\n\t this.enabled = false;\n\t };\n\t\n\t UIContainerPlugin.prototype.bindEvents = function bindEvents() {};\n\t\n\t UIContainerPlugin.prototype.destroy = function destroy() {\n\t this.remove();\n\t };\n\t\n\t return UIContainerPlugin;\n\t}(_ui_object2.default);\n\t\n\texports.default = UIContainerPlugin;\n\t\n\t\n\tUIContainerPlugin.extend = function (properties) {\n\t return (0, _utils.extend)(UIContainerPlugin, properties);\n\t};\n\t\n\tUIContainerPlugin.type = 'container';\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 15 */\n/*!***************************************!*\\\n !*** ./src/components/player_info.js ***!\n \\***************************************/\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t// Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar PlayerInfo = function PlayerInfo() {\n\t _classCallCheck(this, PlayerInfo);\n\t\n\t this.options = {};\n\t this.playbackPlugins = [];\n\t this.currentSize = { width: 0, height: 0 };\n\t};\n\t\n\tPlayerInfo._players = {};\n\t\n\tPlayerInfo.getInstance = function (playerId) {\n\t return PlayerInfo._players[playerId] || (PlayerInfo._players[playerId] = new PlayerInfo());\n\t};\n\t\n\texports.default = PlayerInfo;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 16 */\n/*!********************************************!*\\\n !*** ./src/playbacks/html5_video/index.js ***!\n \\********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./html5_video */ 53);\n\n/***/ },\n/* 17 */\n/*!************************************!*\\\n !*** ./src/base/ui_core_plugin.js ***!\n \\************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _utils = __webpack_require__(/*! ./utils */ 2);\n\t\n\tvar _ui_object = __webpack_require__(/*! ./ui_object */ 10);\n\t\n\tvar _ui_object2 = _interopRequireDefault(_ui_object);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar UICorePlugin = function (_UIObject) {\n\t _inherits(UICorePlugin, _UIObject);\n\t\n\t function UICorePlugin(core) {\n\t _classCallCheck(this, UICorePlugin);\n\t\n\t var _this = _possibleConstructorReturn(this, _UIObject.call(this, core.options));\n\t\n\t _this.core = core;\n\t _this.enabled = true;\n\t _this.bindEvents();\n\t _this.render();\n\t return _this;\n\t }\n\t\n\t UICorePlugin.prototype.bindEvents = function bindEvents() {};\n\t\n\t UICorePlugin.prototype.getExternalInterface = function getExternalInterface() {\n\t return {};\n\t };\n\t\n\t UICorePlugin.prototype.enable = function enable() {\n\t if (!this.enabled) {\n\t this.bindEvents();\n\t this.$el.show();\n\t this.enabled = true;\n\t }\n\t };\n\t\n\t UICorePlugin.prototype.disable = function disable() {\n\t this.stopListening();\n\t this.$el.hide();\n\t this.enabled = false;\n\t };\n\t\n\t UICorePlugin.prototype.destroy = function destroy() {\n\t this.remove();\n\t };\n\t\n\t UICorePlugin.prototype.render = function render() {\n\t return this;\n\t };\n\t\n\t return UICorePlugin;\n\t}(_ui_object2.default);\n\t\n\texports.default = UICorePlugin;\n\t\n\t\n\tUICorePlugin.extend = function (properties) {\n\t return (0, _utils.extend)(UICorePlugin, properties);\n\t};\n\t\n\tUICorePlugin.type = 'core';\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 18 */\n/*!****************************************************!*\\\n !*** ./src/playbacks/base_flash_playback/index.js ***!\n \\****************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = __webpack_require__(/*! ./base_flash_playback */ 47);\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 19 */\n/*!**********************************!*\\\n !*** ./src/plugins/log/index.js ***!\n \\**********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./log */ 65);\n\n/***/ },\n/* 20 */\n/*!*****************************!*\\\n !*** ./src/vendor/index.js ***!\n \\*****************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _kibo = __webpack_require__(/*! ./kibo */ 77);\n\t\n\tvar _kibo2 = _interopRequireDefault(_kibo);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\texports.default = { Kibo: _kibo2.default };\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 21 */\n/*!******************************!*\\\n !*** ./~/process/browser.js ***!\n \\******************************/\n/***/ function(module, exports) {\n\n\t// shim for using process in browser\n\tvar process = module.exports = {};\n\t\n\t// cached from whatever global is present so that test runners that stub it\n\t// don't break things. But we need to wrap it in a try catch in case it is\n\t// wrapped in strict mode code which doesn't define any globals. It's inside a\n\t// function because try/catches deoptimize in certain engines.\n\t\n\tvar cachedSetTimeout;\n\tvar cachedClearTimeout;\n\t\n\tfunction defaultSetTimout() {\n\t throw new Error('setTimeout has not been defined');\n\t}\n\tfunction defaultClearTimeout () {\n\t throw new Error('clearTimeout has not been defined');\n\t}\n\t(function () {\n\t try {\n\t if (typeof setTimeout === 'function') {\n\t cachedSetTimeout = setTimeout;\n\t } else {\n\t cachedSetTimeout = defaultSetTimout;\n\t }\n\t } catch (e) {\n\t cachedSetTimeout = defaultSetTimout;\n\t }\n\t try {\n\t if (typeof clearTimeout === 'function') {\n\t cachedClearTimeout = clearTimeout;\n\t } else {\n\t cachedClearTimeout = defaultClearTimeout;\n\t }\n\t } catch (e) {\n\t cachedClearTimeout = defaultClearTimeout;\n\t }\n\t} ())\n\tfunction runTimeout(fun) {\n\t if (cachedSetTimeout === setTimeout) {\n\t //normal enviroments in sane situations\n\t return setTimeout(fun, 0);\n\t }\n\t // if setTimeout wasn't available but was latter defined\n\t if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n\t cachedSetTimeout = setTimeout;\n\t return setTimeout(fun, 0);\n\t }\n\t try {\n\t // when when somebody has screwed with setTimeout but no I.E. maddness\n\t return cachedSetTimeout(fun, 0);\n\t } catch(e){\n\t try {\n\t // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t return cachedSetTimeout.call(null, fun, 0);\n\t } catch(e){\n\t // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n\t return cachedSetTimeout.call(this, fun, 0);\n\t }\n\t }\n\t\n\t\n\t}\n\tfunction runClearTimeout(marker) {\n\t if (cachedClearTimeout === clearTimeout) {\n\t //normal enviroments in sane situations\n\t return clearTimeout(marker);\n\t }\n\t // if clearTimeout wasn't available but was latter defined\n\t if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n\t cachedClearTimeout = clearTimeout;\n\t return clearTimeout(marker);\n\t }\n\t try {\n\t // when when somebody has screwed with setTimeout but no I.E. maddness\n\t return cachedClearTimeout(marker);\n\t } catch (e){\n\t try {\n\t // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t return cachedClearTimeout.call(null, marker);\n\t } catch (e){\n\t // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n\t // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n\t return cachedClearTimeout.call(this, marker);\n\t }\n\t }\n\t\n\t\n\t\n\t}\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\t\n\tfunction cleanUpNextTick() {\n\t if (!draining || !currentQueue) {\n\t return;\n\t }\n\t draining = false;\n\t if (currentQueue.length) {\n\t queue = currentQueue.concat(queue);\n\t } else {\n\t queueIndex = -1;\n\t }\n\t if (queue.length) {\n\t drainQueue();\n\t }\n\t}\n\t\n\tfunction drainQueue() {\n\t if (draining) {\n\t return;\n\t }\n\t var timeout = runTimeout(cleanUpNextTick);\n\t draining = true;\n\t\n\t var len = queue.length;\n\t while(len) {\n\t currentQueue = queue;\n\t queue = [];\n\t while (++queueIndex < len) {\n\t if (currentQueue) {\n\t currentQueue[queueIndex].run();\n\t }\n\t }\n\t queueIndex = -1;\n\t len = queue.length;\n\t }\n\t currentQueue = null;\n\t draining = false;\n\t runClearTimeout(timeout);\n\t}\n\t\n\tprocess.nextTick = function (fun) {\n\t var args = new Array(arguments.length - 1);\n\t if (arguments.length > 1) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t args[i - 1] = arguments[i];\n\t }\n\t }\n\t queue.push(new Item(fun, args));\n\t if (queue.length === 1 && !draining) {\n\t runTimeout(drainQueue);\n\t }\n\t};\n\t\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\t\n\tfunction noop() {}\n\t\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\t\n\tprocess.binding = function (name) {\n\t throw new Error('process.binding is not supported');\n\t};\n\t\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\n\n/***/ },\n/* 22 */\n/*!*******************************!*\\\n !*** ./src/icons/01-play.svg ***!\n \\*******************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill=\\\"#010101\\\" d=\\\"M1.425.35L14.575 8l-13.15 7.65V.35z\\\"></path></svg>\"\n\n/***/ },\n/* 23 */\n/*!***********************************!*\\\n !*** (webpack)/buildin/module.js ***!\n \\***********************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\n\t\tif(!module.webpackPolyfill) {\n\t\t\tmodule.deprecate = function() {};\n\t\t\tmodule.paths = [];\n\t\t\t// module.parent = undefined by default\n\t\t\tmodule.children = [];\n\t\t\tmodule.webpackPolyfill = 1;\n\t\t}\n\t\treturn module;\n\t}\n\n\n/***/ },\n/* 24 */\n/*!*******************************************!*\\\n !*** ./src/components/container/index.js ***!\n \\*******************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./container */ 38);\n\n/***/ },\n/* 25 */\n/*!**************************************!*\\\n !*** ./src/components/core/index.js ***!\n \\**************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./core */ 41);\n\n/***/ },\n/* 26 */\n/*!****************************************!*\\\n !*** ./src/components/loader/index.js ***!\n \\****************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./loader */ 44);\n\n/***/ },\n/* 27 */\n/*!***********************************************!*\\\n !*** ./src/components/media_control/index.js ***!\n \\***********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./media_control */ 45);\n\n/***/ },\n/* 28 */\n/*!**************************************!*\\\n !*** ./src/playbacks/flash/index.js ***!\n \\**************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./flash */ 48);\n\n/***/ },\n/* 29 */\n/*!****************************************!*\\\n !*** ./src/playbacks/flashls/index.js ***!\n \\****************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./flashls */ 49);\n\n/***/ },\n/* 30 */\n/*!************************************!*\\\n !*** ./src/playbacks/hls/index.js ***!\n \\************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./hls */ 51);\n\n/***/ },\n/* 31 */\n/*!********************************************!*\\\n !*** ./src/playbacks/html5_audio/index.js ***!\n \\********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./html5_audio */ 52);\n\n/***/ },\n/* 32 */\n/*!*****************************************!*\\\n !*** ./src/playbacks/html_img/index.js ***!\n \\*****************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./html_img */ 54);\n\n/***/ },\n/* 33 */\n/*!**************************************!*\\\n !*** ./src/playbacks/no_op/index.js ***!\n \\**************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./no_op */ 55);\n\n/***/ },\n/* 34 */\n/*!*************************************!*\\\n !*** ./src/plugins/poster/index.js ***!\n \\*************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./poster */ 66);\n\n/***/ },\n/* 35 */\n/*!*********************************!*\\\n !*** ./~/lodash.merge/index.js ***!\n \\*********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global, module) {/**\n\t * lodash (Custom Build) <https://lodash.com/>\n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n\t * Released under MIT license <https://lodash.com/license>\n\t * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n\t * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t */\n\t\n\t/** Used as the size to enable large array optimizations. */\n\tvar LARGE_ARRAY_SIZE = 200;\n\t\n\t/** Used to stand-in for `undefined` hash values. */\n\tvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar MAX_SAFE_INTEGER = 9007199254740991;\n\t\n\t/** `Object#toString` result references. */\n\tvar argsTag = '[object Arguments]',\n\t arrayTag = '[object Array]',\n\t boolTag = '[object Boolean]',\n\t dateTag = '[object Date]',\n\t errorTag = '[object Error]',\n\t funcTag = '[object Function]',\n\t genTag = '[object GeneratorFunction]',\n\t mapTag = '[object Map]',\n\t numberTag = '[object Number]',\n\t objectTag = '[object Object]',\n\t promiseTag = '[object Promise]',\n\t regexpTag = '[object RegExp]',\n\t setTag = '[object Set]',\n\t stringTag = '[object String]',\n\t symbolTag = '[object Symbol]',\n\t weakMapTag = '[object WeakMap]';\n\t\n\tvar arrayBufferTag = '[object ArrayBuffer]',\n\t dataViewTag = '[object DataView]',\n\t float32Tag = '[object Float32Array]',\n\t float64Tag = '[object Float64Array]',\n\t int8Tag = '[object Int8Array]',\n\t int16Tag = '[object Int16Array]',\n\t int32Tag = '[object Int32Array]',\n\t uint8Tag = '[object Uint8Array]',\n\t uint8ClampedTag = '[object Uint8ClampedArray]',\n\t uint16Tag = '[object Uint16Array]',\n\t uint32Tag = '[object Uint32Array]';\n\t\n\t/**\n\t * Used to match `RegExp`\n\t * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n\t */\n\tvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\t\n\t/** Used to match `RegExp` flags from their coerced string values. */\n\tvar reFlags = /\\w*$/;\n\t\n\t/** Used to detect host constructors (Safari). */\n\tvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\t\n\t/** Used to detect unsigned integer values. */\n\tvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\t\n\t/** Used to identify `toStringTag` values of typed arrays. */\n\tvar typedArrayTags = {};\n\ttypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n\ttypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n\ttypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n\ttypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n\ttypedArrayTags[uint32Tag] = true;\n\ttypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n\ttypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n\ttypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n\ttypedArrayTags[errorTag] = typedArrayTags[funcTag] =\n\ttypedArrayTags[mapTag] = typedArrayTags[numberTag] =\n\ttypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n\ttypedArrayTags[setTag] = typedArrayTags[stringTag] =\n\ttypedArrayTags[weakMapTag] = false;\n\t\n\t/** Used to identify `toStringTag` values supported by `_.clone`. */\n\tvar cloneableTags = {};\n\tcloneableTags[argsTag] = cloneableTags[arrayTag] =\n\tcloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n\tcloneableTags[boolTag] = cloneableTags[dateTag] =\n\tcloneableTags[float32Tag] = cloneableTags[float64Tag] =\n\tcloneableTags[int8Tag] = cloneableTags[int16Tag] =\n\tcloneableTags[int32Tag] = cloneableTags[mapTag] =\n\tcloneableTags[numberTag] = cloneableTags[objectTag] =\n\tcloneableTags[regexpTag] = cloneableTags[setTag] =\n\tcloneableTags[stringTag] = cloneableTags[symbolTag] =\n\tcloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n\tcloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n\tcloneableTags[errorTag] = cloneableTags[funcTag] =\n\tcloneableTags[weakMapTag] = false;\n\t\n\t/** Detect free variable `global` from Node.js. */\n\tvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\t\n\t/** Detect free variable `self`. */\n\tvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\t\n\t/** Used as a reference to the global object. */\n\tvar root = freeGlobal || freeSelf || Function('return this')();\n\t\n\t/** Detect free variable `exports`. */\n\tvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\t\n\t/** Detect free variable `module`. */\n\tvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\t\n\t/** Detect the popular CommonJS extension `module.exports`. */\n\tvar moduleExports = freeModule && freeModule.exports === freeExports;\n\t\n\t/** Detect free variable `process` from Node.js. */\n\tvar freeProcess = moduleExports && freeGlobal.process;\n\t\n\t/** Used to access faster Node.js helpers. */\n\tvar nodeUtil = (function() {\n\t try {\n\t return freeProcess && freeProcess.binding('util');\n\t } catch (e) {}\n\t}());\n\t\n\t/* Node.js helper references. */\n\tvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\t\n\t/**\n\t * Adds the key-value `pair` to `map`.\n\t *\n\t * @private\n\t * @param {Object} map The map to modify.\n\t * @param {Array} pair The key-value pair to add.\n\t * @returns {Object} Returns `map`.\n\t */\n\tfunction addMapEntry(map, pair) {\n\t // Don't return `map.set` because it's not chainable in IE 11.\n\t map.set(pair[0], pair[1]);\n\t return map;\n\t}\n\t\n\t/**\n\t * Adds `value` to `set`.\n\t *\n\t * @private\n\t * @param {Object} set The set to modify.\n\t * @param {*} value The value to add.\n\t * @returns {Object} Returns `set`.\n\t */\n\tfunction addSetEntry(set, value) {\n\t // Don't return `set.add` because it's not chainable in IE 11.\n\t set.add(value);\n\t return set;\n\t}\n\t\n\t/**\n\t * A faster alternative to `Function#apply`, this function invokes `func`\n\t * with the `this` binding of `thisArg` and the arguments of `args`.\n\t *\n\t * @private\n\t * @param {Function} func The function to invoke.\n\t * @param {*} thisArg The `this` binding of `func`.\n\t * @param {Array} args The arguments to invoke `func` with.\n\t * @returns {*} Returns the result of `func`.\n\t */\n\tfunction apply(func, thisArg, args) {\n\t switch (args.length) {\n\t case 0: return func.call(thisArg);\n\t case 1: return func.call(thisArg, args[0]);\n\t case 2: return func.call(thisArg, args[0], args[1]);\n\t case 3: return func.call(thisArg, args[0], args[1], args[2]);\n\t }\n\t return func.apply(thisArg, args);\n\t}\n\t\n\t/**\n\t * A specialized version of `_.forEach` for arrays without support for\n\t * iteratee shorthands.\n\t *\n\t * @private\n\t * @param {Array} [array] The array to iterate over.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @returns {Array} Returns `array`.\n\t */\n\tfunction arrayEach(array, iteratee) {\n\t var index = -1,\n\t length = array ? array.length : 0;\n\t\n\t while (++index < length) {\n\t if (iteratee(array[index], index, array) === false) {\n\t break;\n\t }\n\t }\n\t return array;\n\t}\n\t\n\t/**\n\t * Appends the elements of `values` to `array`.\n\t *\n\t * @private\n\t * @param {Array} array The array to modify.\n\t * @param {Array} values The values to append.\n\t * @returns {Array} Returns `array`.\n\t */\n\tfunction arrayPush(array, values) {\n\t var index = -1,\n\t length = values.length,\n\t offset = array.length;\n\t\n\t while (++index < length) {\n\t array[offset + index] = values[index];\n\t }\n\t return array;\n\t}\n\t\n\t/**\n\t * A specialized version of `_.reduce` for arrays without support for\n\t * iteratee shorthands.\n\t *\n\t * @private\n\t * @param {Array} [array] The array to iterate over.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @param {*} [accumulator] The initial value.\n\t * @param {boolean} [initAccum] Specify using the first element of `array` as\n\t * the initial value.\n\t * @returns {*} Returns the accumulated value.\n\t */\n\tfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n\t var index = -1,\n\t length = array ? array.length : 0;\n\t\n\t if (initAccum && length) {\n\t accumulator = array[++index];\n\t }\n\t while (++index < length) {\n\t accumulator = iteratee(accumulator, array[index], index, array);\n\t }\n\t return accumulator;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.times` without support for iteratee shorthands\n\t * or max array length checks.\n\t *\n\t * @private\n\t * @param {number} n The number of times to invoke `iteratee`.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @returns {Array} Returns the array of results.\n\t */\n\tfunction baseTimes(n, iteratee) {\n\t var index = -1,\n\t result = Array(n);\n\t\n\t while (++index < n) {\n\t result[index] = iteratee(index);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.unary` without support for storing metadata.\n\t *\n\t * @private\n\t * @param {Function} func The function to cap arguments for.\n\t * @returns {Function} Returns the new capped function.\n\t */\n\tfunction baseUnary(func) {\n\t return function(value) {\n\t return func(value);\n\t };\n\t}\n\t\n\t/**\n\t * Gets the value at `key` of `object`.\n\t *\n\t * @private\n\t * @param {Object} [object] The object to query.\n\t * @param {string} key The key of the property to get.\n\t * @returns {*} Returns the property value.\n\t */\n\tfunction getValue(object, key) {\n\t return object == null ? undefined : object[key];\n\t}\n\t\n\t/**\n\t * Checks if `value` is a host object in IE < 9.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n\t */\n\tfunction isHostObject(value) {\n\t // Many host objects are `Object` objects that can coerce to strings\n\t // despite having improperly defined `toString` methods.\n\t var result = false;\n\t if (value != null && typeof value.toString != 'function') {\n\t try {\n\t result = !!(value + '');\n\t } catch (e) {}\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Converts `map` to its key-value pairs.\n\t *\n\t * @private\n\t * @param {Object} map The map to convert.\n\t * @returns {Array} Returns the key-value pairs.\n\t */\n\tfunction mapToArray(map) {\n\t var index = -1,\n\t result = Array(map.size);\n\t\n\t map.forEach(function(value, key) {\n\t result[++index] = [key, value];\n\t });\n\t return result;\n\t}\n\t\n\t/**\n\t * Creates a unary function that invokes `func` with its argument transformed.\n\t *\n\t * @private\n\t * @param {Function} func The function to wrap.\n\t * @param {Function} transform The argument transform.\n\t * @returns {Function} Returns the new function.\n\t */\n\tfunction overArg(func, transform) {\n\t return function(arg) {\n\t return func(transform(arg));\n\t };\n\t}\n\t\n\t/**\n\t * Converts `set` to an array of its values.\n\t *\n\t * @private\n\t * @param {Object} set The set to convert.\n\t * @returns {Array} Returns the values.\n\t */\n\tfunction setToArray(set) {\n\t var index = -1,\n\t result = Array(set.size);\n\t\n\t set.forEach(function(value) {\n\t result[++index] = value;\n\t });\n\t return result;\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar arrayProto = Array.prototype,\n\t funcProto = Function.prototype,\n\t objectProto = Object.prototype;\n\t\n\t/** Used to detect overreaching core-js shims. */\n\tvar coreJsData = root['__core-js_shared__'];\n\t\n\t/** Used to detect methods masquerading as native. */\n\tvar maskSrcKey = (function() {\n\t var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n\t return uid ? ('Symbol(src)_1.' + uid) : '';\n\t}());\n\t\n\t/** Used to resolve the decompiled source of functions. */\n\tvar funcToString = funcProto.toString;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/** Used to infer the `Object` constructor. */\n\tvar objectCtorString = funcToString.call(Object);\n\t\n\t/**\n\t * Used to resolve the\n\t * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/** Used to detect if a method is native. */\n\tvar reIsNative = RegExp('^' +\n\t funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n\t .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n\t);\n\t\n\t/** Built-in value references. */\n\tvar Buffer = moduleExports ? root.Buffer : undefined,\n\t Symbol = root.Symbol,\n\t Uint8Array = root.Uint8Array,\n\t getPrototype = overArg(Object.getPrototypeOf, Object),\n\t objectCreate = Object.create,\n\t propertyIsEnumerable = objectProto.propertyIsEnumerable,\n\t splice = arrayProto.splice;\n\t\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeGetSymbols = Object.getOwnPropertySymbols,\n\t nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n\t nativeKeys = overArg(Object.keys, Object),\n\t nativeMax = Math.max;\n\t\n\t/* Built-in method references that are verified to be native. */\n\tvar DataView = getNative(root, 'DataView'),\n\t Map = getNative(root, 'Map'),\n\t Promise = getNative(root, 'Promise'),\n\t Set = getNative(root, 'Set'),\n\t WeakMap = getNative(root, 'WeakMap'),\n\t nativeCreate = getNative(Object, 'create');\n\t\n\t/** Used to detect maps, sets, and weakmaps. */\n\tvar dataViewCtorString = toSource(DataView),\n\t mapCtorString = toSource(Map),\n\t promiseCtorString = toSource(Promise),\n\t setCtorString = toSource(Set),\n\t weakMapCtorString = toSource(WeakMap);\n\t\n\t/** Used to convert symbols to primitives and strings. */\n\tvar symbolProto = Symbol ? Symbol.prototype : undefined,\n\t symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\t\n\t/**\n\t * Creates a hash object.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction Hash(entries) {\n\t var index = -1,\n\t length = entries ? entries.length : 0;\n\t\n\t this.clear();\n\t while (++index < length) {\n\t var entry = entries[index];\n\t this.set(entry[0], entry[1]);\n\t }\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the hash.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf Hash\n\t */\n\tfunction hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the hash.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf Hash\n\t * @param {Object} hash The hash to modify.\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction hashDelete(key) {\n\t return this.has(key) && delete this.__data__[key];\n\t}\n\t\n\t/**\n\t * Gets the hash value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf Hash\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction hashGet(key) {\n\t var data = this.__data__;\n\t if (nativeCreate) {\n\t var result = data[key];\n\t return result === HASH_UNDEFINED ? undefined : result;\n\t }\n\t return hasOwnProperty.call(data, key) ? data[key] : undefined;\n\t}\n\t\n\t/**\n\t * Checks if a hash value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf Hash\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction hashHas(key) {\n\t var data = this.__data__;\n\t return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n\t}\n\t\n\t/**\n\t * Sets the hash `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf Hash\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the hash instance.\n\t */\n\tfunction hashSet(key, value) {\n\t var data = this.__data__;\n\t data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n\t return this;\n\t}\n\t\n\t// Add methods to `Hash`.\n\tHash.prototype.clear = hashClear;\n\tHash.prototype['delete'] = hashDelete;\n\tHash.prototype.get = hashGet;\n\tHash.prototype.has = hashHas;\n\tHash.prototype.set = hashSet;\n\t\n\t/**\n\t * Creates an list cache object.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction ListCache(entries) {\n\t var index = -1,\n\t length = entries ? entries.length : 0;\n\t\n\t this.clear();\n\t while (++index < length) {\n\t var entry = entries[index];\n\t this.set(entry[0], entry[1]);\n\t }\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the list cache.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf ListCache\n\t */\n\tfunction listCacheClear() {\n\t this.__data__ = [];\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the list cache.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction listCacheDelete(key) {\n\t var data = this.__data__,\n\t index = assocIndexOf(data, key);\n\t\n\t if (index < 0) {\n\t return false;\n\t }\n\t var lastIndex = data.length - 1;\n\t if (index == lastIndex) {\n\t data.pop();\n\t } else {\n\t splice.call(data, index, 1);\n\t }\n\t return true;\n\t}\n\t\n\t/**\n\t * Gets the list cache value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction listCacheGet(key) {\n\t var data = this.__data__,\n\t index = assocIndexOf(data, key);\n\t\n\t return index < 0 ? undefined : data[index][1];\n\t}\n\t\n\t/**\n\t * Checks if a list cache value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf ListCache\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction listCacheHas(key) {\n\t return assocIndexOf(this.__data__, key) > -1;\n\t}\n\t\n\t/**\n\t * Sets the list cache `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the list cache instance.\n\t */\n\tfunction listCacheSet(key, value) {\n\t var data = this.__data__,\n\t index = assocIndexOf(data, key);\n\t\n\t if (index < 0) {\n\t data.push([key, value]);\n\t } else {\n\t data[index][1] = value;\n\t }\n\t return this;\n\t}\n\t\n\t// Add methods to `ListCache`.\n\tListCache.prototype.clear = listCacheClear;\n\tListCache.prototype['delete'] = listCacheDelete;\n\tListCache.prototype.get = listCacheGet;\n\tListCache.prototype.has = listCacheHas;\n\tListCache.prototype.set = listCacheSet;\n\t\n\t/**\n\t * Creates a map cache object to store key-value pairs.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction MapCache(entries) {\n\t var index = -1,\n\t length = entries ? entries.length : 0;\n\t\n\t this.clear();\n\t while (++index < length) {\n\t var entry = entries[index];\n\t this.set(entry[0], entry[1]);\n\t }\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the map.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf MapCache\n\t */\n\tfunction mapCacheClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': new (Map || ListCache),\n\t 'string': new Hash\n\t };\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the map.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction mapCacheDelete(key) {\n\t return getMapData(this, key)['delete'](key);\n\t}\n\t\n\t/**\n\t * Gets the map value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction mapCacheGet(key) {\n\t return getMapData(this, key).get(key);\n\t}\n\t\n\t/**\n\t * Checks if a map value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf MapCache\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction mapCacheHas(key) {\n\t return getMapData(this, key).has(key);\n\t}\n\t\n\t/**\n\t * Sets the map `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the map cache instance.\n\t */\n\tfunction mapCacheSet(key, value) {\n\t getMapData(this, key).set(key, value);\n\t return this;\n\t}\n\t\n\t// Add methods to `MapCache`.\n\tMapCache.prototype.clear = mapCacheClear;\n\tMapCache.prototype['delete'] = mapCacheDelete;\n\tMapCache.prototype.get = mapCacheGet;\n\tMapCache.prototype.has = mapCacheHas;\n\tMapCache.prototype.set = mapCacheSet;\n\t\n\t/**\n\t * Creates a stack cache object to store key-value pairs.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction Stack(entries) {\n\t this.__data__ = new ListCache(entries);\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the stack.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf Stack\n\t */\n\tfunction stackClear() {\n\t this.__data__ = new ListCache;\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the stack.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf Stack\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction stackDelete(key) {\n\t return this.__data__['delete'](key);\n\t}\n\t\n\t/**\n\t * Gets the stack value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf Stack\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction stackGet(key) {\n\t return this.__data__.get(key);\n\t}\n\t\n\t/**\n\t * Checks if a stack value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf Stack\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction stackHas(key) {\n\t return this.__data__.has(key);\n\t}\n\t\n\t/**\n\t * Sets the stack `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf Stack\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the stack cache instance.\n\t */\n\tfunction stackSet(key, value) {\n\t var cache = this.__data__;\n\t if (cache instanceof ListCache) {\n\t var pairs = cache.__data__;\n\t if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n\t pairs.push([key, value]);\n\t return this;\n\t }\n\t cache = this.__data__ = new MapCache(pairs);\n\t }\n\t cache.set(key, value);\n\t return this;\n\t}\n\t\n\t// Add methods to `Stack`.\n\tStack.prototype.clear = stackClear;\n\tStack.prototype['delete'] = stackDelete;\n\tStack.prototype.get = stackGet;\n\tStack.prototype.has = stackHas;\n\tStack.prototype.set = stackSet;\n\t\n\t/**\n\t * Creates an array of the enumerable property names of the array-like `value`.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @param {boolean} inherited Specify returning inherited property names.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction arrayLikeKeys(value, inherited) {\n\t // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n\t // Safari 9 makes `arguments.length` enumerable in strict mode.\n\t var result = (isArray(value) || isArguments(value))\n\t ? baseTimes(value.length, String)\n\t : [];\n\t\n\t var length = result.length,\n\t skipIndexes = !!length;\n\t\n\t for (var key in value) {\n\t if ((inherited || hasOwnProperty.call(value, key)) &&\n\t !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * This function is like `assignValue` except that it doesn't assign\n\t * `undefined` values.\n\t *\n\t * @private\n\t * @param {Object} object The object to modify.\n\t * @param {string} key The key of the property to assign.\n\t * @param {*} value The value to assign.\n\t */\n\tfunction assignMergeValue(object, key, value) {\n\t if ((value !== undefined && !eq(object[key], value)) ||\n\t (typeof key == 'number' && value === undefined && !(key in object))) {\n\t object[key] = value;\n\t }\n\t}\n\t\n\t/**\n\t * Assigns `value` to `key` of `object` if the existing value is not equivalent\n\t * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n\t * for equality comparisons.\n\t *\n\t * @private\n\t * @param {Object} object The object to modify.\n\t * @param {string} key The key of the property to assign.\n\t * @param {*} value The value to assign.\n\t */\n\tfunction assignValue(object, key, value) {\n\t var objValue = object[key];\n\t if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n\t (value === undefined && !(key in object))) {\n\t object[key] = value;\n\t }\n\t}\n\t\n\t/**\n\t * Gets the index at which the `key` is found in `array` of key-value pairs.\n\t *\n\t * @private\n\t * @param {Array} array The array to inspect.\n\t * @param {*} key The key to search for.\n\t * @returns {number} Returns the index of the matched value, else `-1`.\n\t */\n\tfunction assocIndexOf(array, key) {\n\t var length = array.length;\n\t while (length--) {\n\t if (eq(array[length][0], key)) {\n\t return length;\n\t }\n\t }\n\t return -1;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.assign` without support for multiple sources\n\t * or `customizer` functions.\n\t *\n\t * @private\n\t * @param {Object} object The destination object.\n\t * @param {Object} source The source object.\n\t * @returns {Object} Returns `object`.\n\t */\n\tfunction baseAssign(object, source) {\n\t return object && copyObject(source, keys(source), object);\n\t}\n\t\n\t/**\n\t * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n\t * traversed objects.\n\t *\n\t * @private\n\t * @param {*} value The value to clone.\n\t * @param {boolean} [isDeep] Specify a deep clone.\n\t * @param {boolean} [isFull] Specify a clone including symbols.\n\t * @param {Function} [customizer] The function to customize cloning.\n\t * @param {string} [key] The key of `value`.\n\t * @param {Object} [object] The parent object of `value`.\n\t * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n\t * @returns {*} Returns the cloned value.\n\t */\n\tfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n\t var result;\n\t if (customizer) {\n\t result = object ? customizer(value, key, object, stack) : customizer(value);\n\t }\n\t if (result !== undefined) {\n\t return result;\n\t }\n\t if (!isObject(value)) {\n\t return value;\n\t }\n\t var isArr = isArray(value);\n\t if (isArr) {\n\t result = initCloneArray(value);\n\t if (!isDeep) {\n\t return copyArray(value, result);\n\t }\n\t } else {\n\t var tag = getTag(value),\n\t isFunc = tag == funcTag || tag == genTag;\n\t\n\t if (isBuffer(value)) {\n\t return cloneBuffer(value, isDeep);\n\t }\n\t if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n\t if (isHostObject(value)) {\n\t return object ? value : {};\n\t }\n\t result = initCloneObject(isFunc ? {} : value);\n\t if (!isDeep) {\n\t return copySymbols(value, baseAssign(result, value));\n\t }\n\t } else {\n\t if (!cloneableTags[tag]) {\n\t return object ? value : {};\n\t }\n\t result = initCloneByTag(value, tag, baseClone, isDeep);\n\t }\n\t }\n\t // Check for circular references and return its corresponding clone.\n\t stack || (stack = new Stack);\n\t var stacked = stack.get(value);\n\t if (stacked) {\n\t return stacked;\n\t }\n\t stack.set(value, result);\n\t\n\t if (!isArr) {\n\t var props = isFull ? getAllKeys(value) : keys(value);\n\t }\n\t arrayEach(props || value, function(subValue, key) {\n\t if (props) {\n\t key = subValue;\n\t subValue = value[key];\n\t }\n\t // Recursively populate clone (susceptible to call stack limits).\n\t assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n\t });\n\t return result;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.create` without support for assigning\n\t * properties to the created object.\n\t *\n\t * @private\n\t * @param {Object} prototype The object to inherit from.\n\t * @returns {Object} Returns the new object.\n\t */\n\tfunction baseCreate(proto) {\n\t return isObject(proto) ? objectCreate(proto) : {};\n\t}\n\t\n\t/**\n\t * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n\t * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n\t * symbols of `object`.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @param {Function} keysFunc The function to get the keys of `object`.\n\t * @param {Function} symbolsFunc The function to get the symbols of `object`.\n\t * @returns {Array} Returns the array of property names and symbols.\n\t */\n\tfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n\t var result = keysFunc(object);\n\t return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n\t}\n\t\n\t/**\n\t * The base implementation of `getTag`.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @returns {string} Returns the `toStringTag`.\n\t */\n\tfunction baseGetTag(value) {\n\t return objectToString.call(value);\n\t}\n\t\n\t/**\n\t * The base implementation of `_.isNative` without bad shim checks.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a native function,\n\t * else `false`.\n\t */\n\tfunction baseIsNative(value) {\n\t if (!isObject(value) || isMasked(value)) {\n\t return false;\n\t }\n\t var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n\t return pattern.test(toSource(value));\n\t}\n\t\n\t/**\n\t * The base implementation of `_.isTypedArray` without Node.js optimizations.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n\t */\n\tfunction baseIsTypedArray(value) {\n\t return isObjectLike(value) &&\n\t isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n\t}\n\t\n\t/**\n\t * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction baseKeys(object) {\n\t if (!isPrototype(object)) {\n\t return nativeKeys(object);\n\t }\n\t var result = [];\n\t for (var key in Object(object)) {\n\t if (hasOwnProperty.call(object, key) && key != 'constructor') {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction baseKeysIn(object) {\n\t if (!isObject(object)) {\n\t return nativeKeysIn(object);\n\t }\n\t var isProto = isPrototype(object),\n\t result = [];\n\t\n\t for (var key in object) {\n\t if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.merge` without support for multiple sources.\n\t *\n\t * @private\n\t * @param {Object} object The destination object.\n\t * @param {Object} source The source object.\n\t * @param {number} srcIndex The index of `source`.\n\t * @param {Function} [customizer] The function to customize merged values.\n\t * @param {Object} [stack] Tracks traversed source values and their merged\n\t * counterparts.\n\t */\n\tfunction baseMerge(object, source, srcIndex, customizer, stack) {\n\t if (object === source) {\n\t return;\n\t }\n\t if (!(isArray(source) || isTypedArray(source))) {\n\t var props = baseKeysIn(source);\n\t }\n\t arrayEach(props || source, function(srcValue, key) {\n\t if (props) {\n\t key = srcValue;\n\t srcValue = source[key];\n\t }\n\t if (isObject(srcValue)) {\n\t stack || (stack = new Stack);\n\t baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n\t }\n\t else {\n\t var newValue = customizer\n\t ? customizer(object[key], srcValue, (key + ''), object, source, stack)\n\t : undefined;\n\t\n\t if (newValue === undefined) {\n\t newValue = srcValue;\n\t }\n\t assignMergeValue(object, key, newValue);\n\t }\n\t });\n\t}\n\t\n\t/**\n\t * A specialized version of `baseMerge` for arrays and objects which performs\n\t * deep merges and tracks traversed objects enabling objects with circular\n\t * references to be merged.\n\t *\n\t * @private\n\t * @param {Object} object The destination object.\n\t * @param {Object} source The source object.\n\t * @param {string} key The key of the value to merge.\n\t * @param {number} srcIndex The index of `source`.\n\t * @param {Function} mergeFunc The function to merge values.\n\t * @param {Function} [customizer] The function to customize assigned values.\n\t * @param {Object} [stack] Tracks traversed source values and their merged\n\t * counterparts.\n\t */\n\tfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n\t var objValue = object[key],\n\t srcValue = source[key],\n\t stacked = stack.get(srcValue);\n\t\n\t if (stacked) {\n\t assignMergeValue(object, key, stacked);\n\t return;\n\t }\n\t var newValue = customizer\n\t ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n\t : undefined;\n\t\n\t var isCommon = newValue === undefined;\n\t\n\t if (isCommon) {\n\t newValue = srcValue;\n\t if (isArray(srcValue) || isTypedArray(srcValue)) {\n\t if (isArray(objValue)) {\n\t newValue = objValue;\n\t }\n\t else if (isArrayLikeObject(objValue)) {\n\t newValue = copyArray(objValue);\n\t }\n\t else {\n\t isCommon = false;\n\t newValue = baseClone(srcValue, true);\n\t }\n\t }\n\t else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n\t if (isArguments(objValue)) {\n\t newValue = toPlainObject(objValue);\n\t }\n\t else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {\n\t isCommon = false;\n\t newValue = baseClone(srcValue, true);\n\t }\n\t else {\n\t newValue = objValue;\n\t }\n\t }\n\t else {\n\t isCommon = false;\n\t }\n\t }\n\t if (isCommon) {\n\t // Recursively merge objects and arrays (susceptible to call stack limits).\n\t stack.set(srcValue, newValue);\n\t mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n\t stack['delete'](srcValue);\n\t }\n\t assignMergeValue(object, key, newValue);\n\t}\n\t\n\t/**\n\t * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n\t *\n\t * @private\n\t * @param {Function} func The function to apply a rest parameter to.\n\t * @param {number} [start=func.length-1] The start position of the rest parameter.\n\t * @returns {Function} Returns the new function.\n\t */\n\tfunction baseRest(func, start) {\n\t start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n\t return function() {\n\t var args = arguments,\n\t index = -1,\n\t length = nativeMax(args.length - start, 0),\n\t array = Array(length);\n\t\n\t while (++index < length) {\n\t array[index] = args[start + index];\n\t }\n\t index = -1;\n\t var otherArgs = Array(start + 1);\n\t while (++index < start) {\n\t otherArgs[index] = args[index];\n\t }\n\t otherArgs[start] = array;\n\t return apply(func, this, otherArgs);\n\t };\n\t}\n\t\n\t/**\n\t * Creates a clone of `buffer`.\n\t *\n\t * @private\n\t * @param {Buffer} buffer The buffer to clone.\n\t * @param {boolean} [isDeep] Specify a deep clone.\n\t * @returns {Buffer} Returns the cloned buffer.\n\t */\n\tfunction cloneBuffer(buffer, isDeep) {\n\t if (isDeep) {\n\t return buffer.slice();\n\t }\n\t var result = new buffer.constructor(buffer.length);\n\t buffer.copy(result);\n\t return result;\n\t}\n\t\n\t/**\n\t * Creates a clone of `arrayBuffer`.\n\t *\n\t * @private\n\t * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n\t * @returns {ArrayBuffer} Returns the cloned array buffer.\n\t */\n\tfunction cloneArrayBuffer(arrayBuffer) {\n\t var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n\t new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n\t return result;\n\t}\n\t\n\t/**\n\t * Creates a clone of `dataView`.\n\t *\n\t * @private\n\t * @param {Object} dataView The data view to clone.\n\t * @param {boolean} [isDeep] Specify a deep clone.\n\t * @returns {Object} Returns the cloned data view.\n\t */\n\tfunction cloneDataView(dataView, isDeep) {\n\t var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n\t return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n\t}\n\t\n\t/**\n\t * Creates a clone of `map`.\n\t *\n\t * @private\n\t * @param {Object} map The map to clone.\n\t * @param {Function} cloneFunc The function to clone values.\n\t * @param {boolean} [isDeep] Specify a deep clone.\n\t * @returns {Object} Returns the cloned map.\n\t */\n\tfunction cloneMap(map, isDeep, cloneFunc) {\n\t var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n\t return arrayReduce(array, addMapEntry, new map.constructor);\n\t}\n\t\n\t/**\n\t * Creates a clone of `regexp`.\n\t *\n\t * @private\n\t * @param {Object} regexp The regexp to clone.\n\t * @returns {Object} Returns the cloned regexp.\n\t */\n\tfunction cloneRegExp(regexp) {\n\t var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n\t result.lastIndex = regexp.lastIndex;\n\t return result;\n\t}\n\t\n\t/**\n\t * Creates a clone of `set`.\n\t *\n\t * @private\n\t * @param {Object} set The set to clone.\n\t * @param {Function} cloneFunc The function to clone values.\n\t * @param {boolean} [isDeep] Specify a deep clone.\n\t * @returns {Object} Returns the cloned set.\n\t */\n\tfunction cloneSet(set, isDeep, cloneFunc) {\n\t var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n\t return arrayReduce(array, addSetEntry, new set.constructor);\n\t}\n\t\n\t/**\n\t * Creates a clone of the `symbol` object.\n\t *\n\t * @private\n\t * @param {Object} symbol The symbol object to clone.\n\t * @returns {Object} Returns the cloned symbol object.\n\t */\n\tfunction cloneSymbol(symbol) {\n\t return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n\t}\n\t\n\t/**\n\t * Creates a clone of `typedArray`.\n\t *\n\t * @private\n\t * @param {Object} typedArray The typed array to clone.\n\t * @param {boolean} [isDeep] Specify a deep clone.\n\t * @returns {Object} Returns the cloned typed array.\n\t */\n\tfunction cloneTypedArray(typedArray, isDeep) {\n\t var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n\t return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n\t}\n\t\n\t/**\n\t * Copies the values of `source` to `array`.\n\t *\n\t * @private\n\t * @param {Array} source The array to copy values from.\n\t * @param {Array} [array=[]] The array to copy values to.\n\t * @returns {Array} Returns `array`.\n\t */\n\tfunction copyArray(source, array) {\n\t var index = -1,\n\t length = source.length;\n\t\n\t array || (array = Array(length));\n\t while (++index < length) {\n\t array[index] = source[index];\n\t }\n\t return array;\n\t}\n\t\n\t/**\n\t * Copies properties of `source` to `object`.\n\t *\n\t * @private\n\t * @param {Object} source The object to copy properties from.\n\t * @param {Array} props The property identifiers to copy.\n\t * @param {Object} [object={}] The object to copy properties to.\n\t * @param {Function} [customizer] The function to customize copied values.\n\t * @returns {Object} Returns `object`.\n\t */\n\tfunction copyObject(source, props, object, customizer) {\n\t object || (object = {});\n\t\n\t var index = -1,\n\t length = props.length;\n\t\n\t while (++index < length) {\n\t var key = props[index];\n\t\n\t var newValue = customizer\n\t ? customizer(object[key], source[key], key, object, source)\n\t : undefined;\n\t\n\t assignValue(object, key, newValue === undefined ? source[key] : newValue);\n\t }\n\t return object;\n\t}\n\t\n\t/**\n\t * Copies own symbol properties of `source` to `object`.\n\t *\n\t * @private\n\t * @param {Object} source The object to copy symbols from.\n\t * @param {Object} [object={}] The object to copy symbols to.\n\t * @returns {Object} Returns `object`.\n\t */\n\tfunction copySymbols(source, object) {\n\t return copyObject(source, getSymbols(source), object);\n\t}\n\t\n\t/**\n\t * Creates a function like `_.assign`.\n\t *\n\t * @private\n\t * @param {Function} assigner The function to assign values.\n\t * @returns {Function} Returns the new assigner function.\n\t */\n\tfunction createAssigner(assigner) {\n\t return baseRest(function(object, sources) {\n\t var index = -1,\n\t length = sources.length,\n\t customizer = length > 1 ? sources[length - 1] : undefined,\n\t guard = length > 2 ? sources[2] : undefined;\n\t\n\t customizer = (assigner.length > 3 && typeof customizer == 'function')\n\t ? (length--, customizer)\n\t : undefined;\n\t\n\t if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n\t customizer = length < 3 ? undefined : customizer;\n\t length = 1;\n\t }\n\t object = Object(object);\n\t while (++index < length) {\n\t var source = sources[index];\n\t if (source) {\n\t assigner(object, source, index, customizer);\n\t }\n\t }\n\t return object;\n\t });\n\t}\n\t\n\t/**\n\t * Creates an array of own enumerable property names and symbols of `object`.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names and symbols.\n\t */\n\tfunction getAllKeys(object) {\n\t return baseGetAllKeys(object, keys, getSymbols);\n\t}\n\t\n\t/**\n\t * Gets the data for `map`.\n\t *\n\t * @private\n\t * @param {Object} map The map to query.\n\t * @param {string} key The reference key.\n\t * @returns {*} Returns the map data.\n\t */\n\tfunction getMapData(map, key) {\n\t var data = map.__data__;\n\t return isKeyable(key)\n\t ? data[typeof key == 'string' ? 'string' : 'hash']\n\t : data.map;\n\t}\n\t\n\t/**\n\t * Gets the native function at `key` of `object`.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @param {string} key The key of the method to get.\n\t * @returns {*} Returns the function if it's native, else `undefined`.\n\t */\n\tfunction getNative(object, key) {\n\t var value = getValue(object, key);\n\t return baseIsNative(value) ? value : undefined;\n\t}\n\t\n\t/**\n\t * Creates an array of the own enumerable symbol properties of `object`.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of symbols.\n\t */\n\tvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\t\n\t/**\n\t * Gets the `toStringTag` of `value`.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @returns {string} Returns the `toStringTag`.\n\t */\n\tvar getTag = baseGetTag;\n\t\n\t// Fallback for data views, maps, sets, and weak maps in IE 11,\n\t// for data views in Edge < 14, and promises in Node.js.\n\tif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n\t (Map && getTag(new Map) != mapTag) ||\n\t (Promise && getTag(Promise.resolve()) != promiseTag) ||\n\t (Set && getTag(new Set) != setTag) ||\n\t (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n\t getTag = function(value) {\n\t var result = objectToString.call(value),\n\t Ctor = result == objectTag ? value.constructor : undefined,\n\t ctorString = Ctor ? toSource(Ctor) : undefined;\n\t\n\t if (ctorString) {\n\t switch (ctorString) {\n\t case dataViewCtorString: return dataViewTag;\n\t case mapCtorString: return mapTag;\n\t case promiseCtorString: return promiseTag;\n\t case setCtorString: return setTag;\n\t case weakMapCtorString: return weakMapTag;\n\t }\n\t }\n\t return result;\n\t };\n\t}\n\t\n\t/**\n\t * Initializes an array clone.\n\t *\n\t * @private\n\t * @param {Array} array The array to clone.\n\t * @returns {Array} Returns the initialized clone.\n\t */\n\tfunction initCloneArray(array) {\n\t var length = array.length,\n\t result = array.constructor(length);\n\t\n\t // Add properties assigned by `RegExp#exec`.\n\t if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n\t result.index = array.index;\n\t result.input = array.input;\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Initializes an object clone.\n\t *\n\t * @private\n\t * @param {Object} object The object to clone.\n\t * @returns {Object} Returns the initialized clone.\n\t */\n\tfunction initCloneObject(object) {\n\t return (typeof object.constructor == 'function' && !isPrototype(object))\n\t ? baseCreate(getPrototype(object))\n\t : {};\n\t}\n\t\n\t/**\n\t * Initializes an object clone based on its `toStringTag`.\n\t *\n\t * **Note:** This function only supports cloning values with tags of\n\t * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n\t *\n\t * @private\n\t * @param {Object} object The object to clone.\n\t * @param {string} tag The `toStringTag` of the object to clone.\n\t * @param {Function} cloneFunc The function to clone values.\n\t * @param {boolean} [isDeep] Specify a deep clone.\n\t * @returns {Object} Returns the initialized clone.\n\t */\n\tfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n\t var Ctor = object.constructor;\n\t switch (tag) {\n\t case arrayBufferTag:\n\t return cloneArrayBuffer(object);\n\t\n\t case boolTag:\n\t case dateTag:\n\t return new Ctor(+object);\n\t\n\t case dataViewTag:\n\t return cloneDataView(object, isDeep);\n\t\n\t case float32Tag: case float64Tag:\n\t case int8Tag: case int16Tag: case int32Tag:\n\t case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n\t return cloneTypedArray(object, isDeep);\n\t\n\t case mapTag:\n\t return cloneMap(object, isDeep, cloneFunc);\n\t\n\t case numberTag:\n\t case stringTag:\n\t return new Ctor(object);\n\t\n\t case regexpTag:\n\t return cloneRegExp(object);\n\t\n\t case setTag:\n\t return cloneSet(object, isDeep, cloneFunc);\n\t\n\t case symbolTag:\n\t return cloneSymbol(object);\n\t }\n\t}\n\t\n\t/**\n\t * Checks if `value` is a valid array-like index.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n\t * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n\t */\n\tfunction isIndex(value, length) {\n\t length = length == null ? MAX_SAFE_INTEGER : length;\n\t return !!length &&\n\t (typeof value == 'number' || reIsUint.test(value)) &&\n\t (value > -1 && value % 1 == 0 && value < length);\n\t}\n\t\n\t/**\n\t * Checks if the given arguments are from an iteratee call.\n\t *\n\t * @private\n\t * @param {*} value The potential iteratee value argument.\n\t * @param {*} index The potential iteratee index or key argument.\n\t * @param {*} object The potential iteratee object argument.\n\t * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n\t * else `false`.\n\t */\n\tfunction isIterateeCall(value, index, object) {\n\t if (!isObject(object)) {\n\t return false;\n\t }\n\t var type = typeof index;\n\t if (type == 'number'\n\t ? (isArrayLike(object) && isIndex(index, object.length))\n\t : (type == 'string' && index in object)\n\t ) {\n\t return eq(object[index], value);\n\t }\n\t return false;\n\t}\n\t\n\t/**\n\t * Checks if `value` is suitable for use as unique object key.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n\t */\n\tfunction isKeyable(value) {\n\t var type = typeof value;\n\t return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n\t ? (value !== '__proto__')\n\t : (value === null);\n\t}\n\t\n\t/**\n\t * Checks if `func` has its source masked.\n\t *\n\t * @private\n\t * @param {Function} func The function to check.\n\t * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n\t */\n\tfunction isMasked(func) {\n\t return !!maskSrcKey && (maskSrcKey in func);\n\t}\n\t\n\t/**\n\t * Checks if `value` is likely a prototype object.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n\t */\n\tfunction isPrototype(value) {\n\t var Ctor = value && value.constructor,\n\t proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\t\n\t return value === proto;\n\t}\n\t\n\t/**\n\t * This function is like\n\t * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n\t * except that it includes inherited enumerable properties.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction nativeKeysIn(object) {\n\t var result = [];\n\t if (object != null) {\n\t for (var key in Object(object)) {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Converts `func` to its source code.\n\t *\n\t * @private\n\t * @param {Function} func The function to process.\n\t * @returns {string} Returns the source code.\n\t */\n\tfunction toSource(func) {\n\t if (func != null) {\n\t try {\n\t return funcToString.call(func);\n\t } catch (e) {}\n\t try {\n\t return (func + '');\n\t } catch (e) {}\n\t }\n\t return '';\n\t}\n\t\n\t/**\n\t * Performs a\n\t * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n\t * comparison between two values to determine if they are equivalent.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to compare.\n\t * @param {*} other The other value to compare.\n\t * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n\t * @example\n\t *\n\t * var object = { 'a': 1 };\n\t * var other = { 'a': 1 };\n\t *\n\t * _.eq(object, object);\n\t * // => true\n\t *\n\t * _.eq(object, other);\n\t * // => false\n\t *\n\t * _.eq('a', 'a');\n\t * // => true\n\t *\n\t * _.eq('a', Object('a'));\n\t * // => false\n\t *\n\t * _.eq(NaN, NaN);\n\t * // => true\n\t */\n\tfunction eq(value, other) {\n\t return value === other || (value !== value && other !== other);\n\t}\n\t\n\t/**\n\t * Checks if `value` is likely an `arguments` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n\t * else `false`.\n\t * @example\n\t *\n\t * _.isArguments(function() { return arguments; }());\n\t * // => true\n\t *\n\t * _.isArguments([1, 2, 3]);\n\t * // => false\n\t */\n\tfunction isArguments(value) {\n\t // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n\t return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n\t (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as an `Array` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n\t * @example\n\t *\n\t * _.isArray([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArray(document.body.children);\n\t * // => false\n\t *\n\t * _.isArray('abc');\n\t * // => false\n\t *\n\t * _.isArray(_.noop);\n\t * // => false\n\t */\n\tvar isArray = Array.isArray;\n\t\n\t/**\n\t * Checks if `value` is array-like. A value is considered array-like if it's\n\t * not a function and has a `value.length` that's an integer greater than or\n\t * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n\t * @example\n\t *\n\t * _.isArrayLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLike(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLike('abc');\n\t * // => true\n\t *\n\t * _.isArrayLike(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLike(value) {\n\t return value != null && isLength(value.length) && !isFunction(value);\n\t}\n\t\n\t/**\n\t * This method is like `_.isArrayLike` except that it also checks if `value`\n\t * is an object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an array-like object,\n\t * else `false`.\n\t * @example\n\t *\n\t * _.isArrayLikeObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLikeObject(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLikeObject('abc');\n\t * // => false\n\t *\n\t * _.isArrayLikeObject(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLikeObject(value) {\n\t return isObjectLike(value) && isArrayLike(value);\n\t}\n\t\n\t/**\n\t * Checks if `value` is a buffer.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.3.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n\t * @example\n\t *\n\t * _.isBuffer(new Buffer(2));\n\t * // => true\n\t *\n\t * _.isBuffer(new Uint8Array(2));\n\t * // => false\n\t */\n\tvar isBuffer = nativeIsBuffer || stubFalse;\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 8-9 which returns 'object' for typed array and other constructors.\n\t var tag = isObject(value) ? objectToString.call(value) : '';\n\t return tag == funcTag || tag == genTag;\n\t}\n\t\n\t/**\n\t * Checks if `value` is a valid array-like length.\n\t *\n\t * **Note:** This method is loosely based on\n\t * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n\t * @example\n\t *\n\t * _.isLength(3);\n\t * // => true\n\t *\n\t * _.isLength(Number.MIN_VALUE);\n\t * // => false\n\t *\n\t * _.isLength(Infinity);\n\t * // => false\n\t *\n\t * _.isLength('3');\n\t * // => false\n\t */\n\tfunction isLength(value) {\n\t return typeof value == 'number' &&\n\t value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n\t}\n\t\n\t/**\n\t * Checks if `value` is the\n\t * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n\t * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\t/**\n\t * Checks if `value` is object-like. A value is object-like if it's not `null`\n\t * and has a `typeof` result of \"object\".\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n\t * @example\n\t *\n\t * _.isObjectLike({});\n\t * // => true\n\t *\n\t * _.isObjectLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObjectLike(_.noop);\n\t * // => false\n\t *\n\t * _.isObjectLike(null);\n\t * // => false\n\t */\n\tfunction isObjectLike(value) {\n\t return !!value && typeof value == 'object';\n\t}\n\t\n\t/**\n\t * Checks if `value` is a plain object, that is, an object created by the\n\t * `Object` constructor or one with a `[[Prototype]]` of `null`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.8.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.a = 1;\n\t * }\n\t *\n\t * _.isPlainObject(new Foo);\n\t * // => false\n\t *\n\t * _.isPlainObject([1, 2, 3]);\n\t * // => false\n\t *\n\t * _.isPlainObject({ 'x': 0, 'y': 0 });\n\t * // => true\n\t *\n\t * _.isPlainObject(Object.create(null));\n\t * // => true\n\t */\n\tfunction isPlainObject(value) {\n\t if (!isObjectLike(value) ||\n\t objectToString.call(value) != objectTag || isHostObject(value)) {\n\t return false;\n\t }\n\t var proto = getPrototype(value);\n\t if (proto === null) {\n\t return true;\n\t }\n\t var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n\t return (typeof Ctor == 'function' &&\n\t Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a typed array.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 3.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n\t * @example\n\t *\n\t * _.isTypedArray(new Uint8Array);\n\t * // => true\n\t *\n\t * _.isTypedArray([]);\n\t * // => false\n\t */\n\tvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\t\n\t/**\n\t * Converts `value` to a plain object flattening inherited enumerable string\n\t * keyed properties of `value` to own properties of the plain object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 3.0.0\n\t * @category Lang\n\t * @param {*} value The value to convert.\n\t * @returns {Object} Returns the converted plain object.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.b = 2;\n\t * }\n\t *\n\t * Foo.prototype.c = 3;\n\t *\n\t * _.assign({ 'a': 1 }, new Foo);\n\t * // => { 'a': 1, 'b': 2 }\n\t *\n\t * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n\t * // => { 'a': 1, 'b': 2, 'c': 3 }\n\t */\n\tfunction toPlainObject(value) {\n\t return copyObject(value, keysIn(value));\n\t}\n\t\n\t/**\n\t * Creates an array of the own enumerable property names of `object`.\n\t *\n\t * **Note:** Non-object values are coerced to objects. See the\n\t * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n\t * for more details.\n\t *\n\t * @static\n\t * @since 0.1.0\n\t * @memberOf _\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.a = 1;\n\t * this.b = 2;\n\t * }\n\t *\n\t * Foo.prototype.c = 3;\n\t *\n\t * _.keys(new Foo);\n\t * // => ['a', 'b'] (iteration order is not guaranteed)\n\t *\n\t * _.keys('hi');\n\t * // => ['0', '1']\n\t */\n\tfunction keys(object) {\n\t return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n\t}\n\t\n\t/**\n\t * Creates an array of the own and inherited enumerable property names of `object`.\n\t *\n\t * **Note:** Non-object values are coerced to objects.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 3.0.0\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.a = 1;\n\t * this.b = 2;\n\t * }\n\t *\n\t * Foo.prototype.c = 3;\n\t *\n\t * _.keysIn(new Foo);\n\t * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n\t */\n\tfunction keysIn(object) {\n\t return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n\t}\n\t\n\t/**\n\t * This method is like `_.assign` except that it recursively merges own and\n\t * inherited enumerable string keyed properties of source objects into the\n\t * destination object. Source properties that resolve to `undefined` are\n\t * skipped if a destination value exists. Array and plain object properties\n\t * are merged recursively. Other objects and value types are overridden by\n\t * assignment. Source objects are applied from left to right. Subsequent\n\t * sources overwrite property assignments of previous sources.\n\t *\n\t * **Note:** This method mutates `object`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.5.0\n\t * @category Object\n\t * @param {Object} object The destination object.\n\t * @param {...Object} [sources] The source objects.\n\t * @returns {Object} Returns `object`.\n\t * @example\n\t *\n\t * var object = {\n\t * 'a': [{ 'b': 2 }, { 'd': 4 }]\n\t * };\n\t *\n\t * var other = {\n\t * 'a': [{ 'c': 3 }, { 'e': 5 }]\n\t * };\n\t *\n\t * _.merge(object, other);\n\t * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n\t */\n\tvar merge = createAssigner(function(object, source, srcIndex) {\n\t baseMerge(object, source, srcIndex);\n\t});\n\t\n\t/**\n\t * This method returns a new empty array.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.13.0\n\t * @category Util\n\t * @returns {Array} Returns the new empty array.\n\t * @example\n\t *\n\t * var arrays = _.times(2, _.stubArray);\n\t *\n\t * console.log(arrays);\n\t * // => [[], []]\n\t *\n\t * console.log(arrays[0] === arrays[1]);\n\t * // => false\n\t */\n\tfunction stubArray() {\n\t return [];\n\t}\n\t\n\t/**\n\t * This method returns `false`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.13.0\n\t * @category Util\n\t * @returns {boolean} Returns `false`.\n\t * @example\n\t *\n\t * _.times(2, _.stubFalse);\n\t * // => [false, false]\n\t */\n\tfunction stubFalse() {\n\t return false;\n\t}\n\t\n\tmodule.exports = merge;\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(/*! ./../webpack/buildin/module.js */ 23)(module)))\n\n/***/ },\n/* 36 */\n/*!********************************!*\\\n !*** ./src/icons/02-pause.svg ***!\n \\********************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" fill=\\\"#010101\\\" d=\\\"M1.712 14.76H6.43V1.24H1.71v13.52zm7.86-13.52v13.52h4.716V1.24H9.573z\\\"></path></svg>\"\n\n/***/ },\n/* 37 */\n/*!*************************************************************!*\\\n !*** ./src/components/media_control/public/closed-hand.cur ***!\n \\*************************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__.p + \"a8c874b93b3d848f39a71260c57e3863.cur\";\n\n/***/ },\n/* 38 */\n/*!***********************************************!*\\\n !*** ./src/components/container/container.js ***!\n \\***********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _ui_object = __webpack_require__(/*! base/ui_object */ 10);\n\t\n\tvar _ui_object2 = _interopRequireDefault(_ui_object);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _style = __webpack_require__(/*! ./public/style.scss */ 78);\n\t\n\tvar _style2 = _interopRequireDefault(_style);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\t/**\n\t * Container is responsible for the video rendering and state\n\t */\n\t\n\t/**\n\t * An abstraction to represent a container for a given playback\n\t * TODO: describe its responsabilities\n\t * @class Container\n\t * @constructor\n\t * @extends UIObject\n\t * @module base\n\t */\n\tvar Container = function (_UIObject) {\n\t _inherits(Container, _UIObject);\n\t\n\t _createClass(Container, [{\n\t key: 'name',\n\t\n\t /**\n\t * container's name\n\t * @method name\n\t * @default Container\n\t * @return {String} container's name\n\t */\n\t get: function get() {\n\t return 'Container';\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t return { class: 'container', 'data-container': '' };\n\t }\n\t }, {\n\t key: 'events',\n\t get: function get() {\n\t return {\n\t 'click': 'clicked',\n\t 'dblclick': 'dblClicked',\n\t 'doubleTap': 'dblClicked',\n\t 'contextmenu': 'onContextMenu',\n\t 'mouseenter': 'mouseEnter',\n\t 'mouseleave': 'mouseLeave'\n\t };\n\t }\n\t\n\t /**\n\t * Determine if the playback has ended.\n\t * @property ended\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'ended',\n\t get: function get() {\n\t return this.playback.ended;\n\t }\n\t\n\t /**\n\t * Determine if the playback is having to buffer in order for\n\t * playback to be smooth.\n\t * (i.e if a live stream is playing smoothly, this will be false)\n\t * @property buffering\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'buffering',\n\t get: function get() {\n\t return this.playback.buffering;\n\t }\n\t\n\t /**\n\t * The internationalization plugin.\n\t * @property i18n\n\t * @type {Strings}\n\t */\n\t\n\t }, {\n\t key: 'i18n',\n\t get: function get() {\n\t return this._i18n;\n\t }\n\t\n\t /**\n\t * it builds a container\n\t * @method constructor\n\t * @param {Object} options the options object\n\t * @param {Strings} i18n the internationalization component\n\t */\n\t\n\t }]);\n\t\n\t function Container(options, i18n) {\n\t _classCallCheck(this, Container);\n\t\n\t var _this = _possibleConstructorReturn(this, _UIObject.call(this, options));\n\t\n\t _this._i18n = i18n;\n\t _this.currentTime = 0;\n\t _this.volume = 100;\n\t _this.playback = options.playback;\n\t _this.settings = _clapprZepto2.default.extend({}, _this.playback.settings);\n\t _this.isReady = false;\n\t _this.mediaControlDisabled = false;\n\t _this.plugins = [_this.playback];\n\t _this.bindEvents();\n\t return _this;\n\t }\n\t\n\t /**\n\t * binds playback events to the methods of the container.\n\t * it listens to playback's events and triggers them as container events.\n\t *\n\t * | Playback |\n\t * |----------|\n\t * | progress |\n\t * | timeupdate |\n\t * | ready |\n\t * | buffering |\n\t * | bufferfull |\n\t * | settingsupdate |\n\t * | loadedmetadata |\n\t * | highdefinitionupdate |\n\t * | bitrate |\n\t * | playbackstate |\n\t * | dvr |\n\t * | mediacontrol_disable |\n\t * | mediacontrol_enable |\n\t * | ended |\n\t * | play |\n\t * | pause |\n\t * | error |\n\t *\n\t * ps: the events usually translate from PLABACK_x to CONTAINER_x, you can check all the events at `Event` class.\n\t *\n\t * @method bindEvents\n\t */\n\t\n\t\n\t Container.prototype.bindEvents = function bindEvents() {\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_PROGRESS, this.progress);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_TIMEUPDATE, this.timeUpdated);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_READY, this.ready);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_BUFFERING, this.onBuffering);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_BUFFERFULL, this.bufferfull);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_SETTINGSUPDATE, this.settingsUpdate);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_LOADEDMETADATA, this.loadedMetadata);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_BITRATE, this.updateBitrate);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_PLAYBACKSTATE, this.playbackStateChanged);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_DVR, this.playbackDvrStateChanged);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_MEDIACONTROL_DISABLE, this.disableMediaControl);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_MEDIACONTROL_ENABLE, this.enableMediaControl);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_ENDED, this.onEnded);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_PLAY, this.playing);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_PAUSE, this.paused);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_STOP, this.stopped);\n\t this.listenTo(this.playback, _events2.default.PLAYBACK_ERROR, this.error);\n\t };\n\t\n\t Container.prototype.playbackStateChanged = function playbackStateChanged(state) {\n\t this.trigger(_events2.default.CONTAINER_PLAYBACKSTATE, state);\n\t };\n\t\n\t Container.prototype.playbackDvrStateChanged = function playbackDvrStateChanged(dvrInUse) {\n\t this.settings = this.playback.settings;\n\t this.dvrInUse = dvrInUse;\n\t this.trigger(_events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, dvrInUse);\n\t };\n\t\n\t Container.prototype.updateBitrate = function updateBitrate(newBitrate) {\n\t this.trigger(_events2.default.CONTAINER_BITRATE, newBitrate);\n\t };\n\t\n\t Container.prototype.statsReport = function statsReport(metrics) {\n\t this.trigger(_events2.default.CONTAINER_STATS_REPORT, metrics);\n\t };\n\t\n\t Container.prototype.getPlaybackType = function getPlaybackType() {\n\t return this.playback.getPlaybackType();\n\t };\n\t\n\t /**\n\t * returns `true` if DVR is enable otherwise `false`.\n\t * @method isDvrEnabled\n\t * @return {Boolean}\n\t */\n\t\n\t\n\t Container.prototype.isDvrEnabled = function isDvrEnabled() {\n\t return !!this.playback.dvrEnabled;\n\t };\n\t\n\t /**\n\t * returns `true` if DVR is in use otherwise `false`.\n\t * @method isDvrInUse\n\t * @return {Boolean}\n\t */\n\t\n\t\n\t Container.prototype.isDvrInUse = function isDvrInUse() {\n\t return !!this.dvrInUse;\n\t };\n\t\n\t /**\n\t * destroys the container\n\t * @method destroy\n\t */\n\t\n\t\n\t Container.prototype.destroy = function destroy() {\n\t this.trigger(_events2.default.CONTAINER_DESTROYED, this, this.name);\n\t this.stopListening();\n\t this.plugins.forEach(function (plugin) {\n\t return plugin.destroy();\n\t });\n\t this.$el.remove();\n\t };\n\t\n\t Container.prototype.setStyle = function setStyle(style) {\n\t this.$el.css(style);\n\t };\n\t\n\t Container.prototype.animate = function animate(style, duration) {\n\t return this.$el.animate(style, duration).promise();\n\t };\n\t\n\t Container.prototype.ready = function ready() {\n\t this.isReady = true;\n\t this.trigger(_events2.default.CONTAINER_READY, this.name);\n\t };\n\t\n\t Container.prototype.isPlaying = function isPlaying() {\n\t return this.playback.isPlaying();\n\t };\n\t\n\t Container.prototype.getStartTimeOffset = function getStartTimeOffset() {\n\t return this.playback.getStartTimeOffset();\n\t };\n\t\n\t Container.prototype.getCurrentTime = function getCurrentTime() {\n\t return this.currentTime;\n\t };\n\t\n\t Container.prototype.getDuration = function getDuration() {\n\t return this.playback.getDuration();\n\t };\n\t\n\t Container.prototype.error = function error(errorObj) {\n\t if (!this.isReady) {\n\t this.ready();\n\t }\n\t this.trigger(_events2.default.CONTAINER_ERROR, { error: errorObj, container: this }, this.name);\n\t };\n\t\n\t Container.prototype.loadedMetadata = function loadedMetadata(metadata) {\n\t this.trigger(_events2.default.CONTAINER_LOADEDMETADATA, metadata);\n\t };\n\t\n\t Container.prototype.timeUpdated = function timeUpdated(timeProgress) {\n\t this.currentTime = timeProgress.current;\n\t this.trigger(_events2.default.CONTAINER_TIMEUPDATE, timeProgress, this.name);\n\t };\n\t\n\t Container.prototype.progress = function progress() {\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t this.trigger.apply(this, [_events2.default.CONTAINER_PROGRESS].concat(args, [this.name]));\n\t };\n\t\n\t Container.prototype.playing = function playing() {\n\t this.trigger(_events2.default.CONTAINER_PLAY, this.name);\n\t };\n\t\n\t Container.prototype.paused = function paused() {\n\t this.trigger(_events2.default.CONTAINER_PAUSE, this.name);\n\t };\n\t\n\t /**\n\t * plays the playback\n\t * @method play\n\t */\n\t\n\t\n\t Container.prototype.play = function play() {\n\t this.playback.play();\n\t };\n\t\n\t /**\n\t * stops the playback\n\t * @method stop\n\t */\n\t\n\t\n\t Container.prototype.stop = function stop() {\n\t this.playback.stop();\n\t this.currentTime = 0;\n\t };\n\t\n\t /**\n\t * pauses the playback\n\t * @method pause\n\t */\n\t\n\t\n\t Container.prototype.pause = function pause() {\n\t this.playback.pause();\n\t };\n\t\n\t Container.prototype.onEnded = function onEnded() {\n\t this.trigger(_events2.default.CONTAINER_ENDED, this, this.name);\n\t this.currentTime = 0;\n\t };\n\t\n\t Container.prototype.stopped = function stopped() {\n\t this.trigger(_events2.default.CONTAINER_STOP);\n\t };\n\t\n\t Container.prototype.clicked = function clicked() {\n\t if (!this.options.chromeless || this.options.allowUserInteraction) {\n\t this.trigger(_events2.default.CONTAINER_CLICK, this, this.name);\n\t }\n\t };\n\t\n\t Container.prototype.dblClicked = function dblClicked() {\n\t if (!this.options.chromeless || this.options.allowUserInteraction) {\n\t this.trigger(_events2.default.CONTAINER_DBLCLICK, this, this.name);\n\t }\n\t };\n\t\n\t Container.prototype.onContextMenu = function onContextMenu() {\n\t if (!this.options.chromeless || this.options.allowUserInteraction) {\n\t this.trigger(_events2.default.CONTAINER_CONTEXTMENU, this, this.name);\n\t }\n\t };\n\t\n\t Container.prototype.seek = function seek(time) {\n\t this.trigger(_events2.default.CONTAINER_SEEK, time, this.name);\n\t this.playback.seek(time);\n\t };\n\t\n\t Container.prototype.seekPercentage = function seekPercentage(percentage) {\n\t var duration = this.getDuration();\n\t if (percentage >= 0 && percentage <= 100) {\n\t var time = duration * (percentage / 100);\n\t this.seek(time);\n\t }\n\t };\n\t\n\t Container.prototype.setVolume = function setVolume(value) {\n\t this.volume = parseInt(value, 10);\n\t this.trigger(_events2.default.CONTAINER_VOLUME, value, this.name);\n\t this.playback.volume(value);\n\t };\n\t\n\t Container.prototype.fullscreen = function fullscreen() {\n\t this.trigger(_events2.default.CONTAINER_FULLSCREEN, this.name);\n\t };\n\t\n\t Container.prototype.onBuffering = function onBuffering() {\n\t this.trigger(_events2.default.CONTAINER_STATE_BUFFERING, this.name);\n\t };\n\t\n\t Container.prototype.bufferfull = function bufferfull() {\n\t this.trigger(_events2.default.CONTAINER_STATE_BUFFERFULL, this.name);\n\t };\n\t\n\t /**\n\t * adds plugin to the container\n\t * @method addPlugin\n\t * @param {Object} plugin\n\t */\n\t\n\t\n\t Container.prototype.addPlugin = function addPlugin(plugin) {\n\t this.plugins.push(plugin);\n\t };\n\t\n\t /**\n\t * checks if a plugin, given its name, exist\n\t * @method hasPlugin\n\t * @param {String} name\n\t * @return {Boolean}\n\t */\n\t\n\t\n\t Container.prototype.hasPlugin = function hasPlugin(name) {\n\t return !!this.getPlugin(name);\n\t };\n\t\n\t /**\n\t * get the plugin given its name\n\t * @method getPlugin\n\t * @param {String} name\n\t */\n\t\n\t\n\t Container.prototype.getPlugin = function getPlugin(name) {\n\t return this.plugins.filter(function (plugin) {\n\t return plugin.name === name;\n\t })[0];\n\t };\n\t\n\t Container.prototype.mouseEnter = function mouseEnter() {\n\t if (!this.options.chromeless || this.options.allowUserInteraction) {\n\t this.trigger(_events2.default.CONTAINER_MOUSE_ENTER);\n\t }\n\t };\n\t\n\t Container.prototype.mouseLeave = function mouseLeave() {\n\t if (!this.options.chromeless || this.options.allowUserInteraction) {\n\t this.trigger(_events2.default.CONTAINER_MOUSE_LEAVE);\n\t }\n\t };\n\t\n\t Container.prototype.settingsUpdate = function settingsUpdate() {\n\t this.settings = this.playback.settings;\n\t this.trigger(_events2.default.CONTAINER_SETTINGSUPDATE);\n\t };\n\t\n\t Container.prototype.highDefinitionUpdate = function highDefinitionUpdate(isHD) {\n\t this.trigger(_events2.default.CONTAINER_HIGHDEFINITIONUPDATE, isHD);\n\t };\n\t\n\t Container.prototype.isHighDefinitionInUse = function isHighDefinitionInUse() {\n\t return this.playback.isHighDefinitionInUse();\n\t };\n\t\n\t Container.prototype.disableMediaControl = function disableMediaControl() {\n\t if (!this.mediaControlDisabled) {\n\t this.mediaControlDisabled = true;\n\t this.trigger(_events2.default.CONTAINER_MEDIACONTROL_DISABLE);\n\t }\n\t };\n\t\n\t Container.prototype.enableMediaControl = function enableMediaControl() {\n\t if (this.mediaControlDisabled) {\n\t this.mediaControlDisabled = false;\n\t this.trigger(_events2.default.CONTAINER_MEDIACONTROL_ENABLE);\n\t }\n\t };\n\t\n\t Container.prototype.updateStyle = function updateStyle() {\n\t if (!this.options.chromeless || this.options.allowUserInteraction) {\n\t this.$el.removeClass('chromeless');\n\t } else {\n\t this.$el.addClass('chromeless');\n\t }\n\t };\n\t\n\t /**\n\t * enables to configure the container after its creation\n\t * @method configure\n\t * @param {Object} options all the options to change in form of a javascript object\n\t */\n\t\n\t\n\t Container.prototype.configure = function configure(options) {\n\t this._options = _clapprZepto2.default.extend(this._options, options);\n\t this.updateStyle();\n\t this.trigger(_events2.default.CONTAINER_OPTIONS_CHANGE);\n\t };\n\t\n\t Container.prototype.render = function render() {\n\t var s = _styler2.default.getStyleFor(_style2.default);\n\t this.$el.append(s);\n\t this.$el.append(this.playback.render().el);\n\t this.updateStyle();\n\t return this;\n\t };\n\t\n\t return Container;\n\t}(_ui_object2.default);\n\t\n\texports.default = Container;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 39 */\n/*!***************************************************************!*\\\n !*** ./src/components/container_factory/container_factory.js ***!\n \\***************************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _base_object = __webpack_require__(/*! base/base_object */ 9);\n\t\n\tvar _base_object2 = _interopRequireDefault(_base_object);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _container = __webpack_require__(/*! components/container */ 24);\n\t\n\tvar _container2 = _interopRequireDefault(_container);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tvar _lodash = __webpack_require__(/*! lodash.isplainobject */ 100);\n\t\n\tvar _lodash2 = _interopRequireDefault(_lodash);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\t/**\n\t * The ContainerFactory is responsible for manage playback bootstrap and create containers.\n\t */\n\t\n\tvar ContainerFactory = function (_BaseObject) {\n\t _inherits(ContainerFactory, _BaseObject);\n\t\n\t _createClass(ContainerFactory, [{\n\t key: 'options',\n\t get: function get() {\n\t return this._options;\n\t },\n\t set: function set(options) {\n\t this._options = options;\n\t }\n\t }]);\n\t\n\t function ContainerFactory(options, loader, i18n) {\n\t _classCallCheck(this, ContainerFactory);\n\t\n\t var _this = _possibleConstructorReturn(this, _BaseObject.call(this, options));\n\t\n\t _this._i18n = i18n;\n\t _this.loader = loader;\n\t return _this;\n\t }\n\t\n\t ContainerFactory.prototype.createContainers = function createContainers() {\n\t var _this2 = this;\n\t\n\t return _clapprZepto2.default.Deferred(function (promise) {\n\t promise.resolve(_this2.options.sources.map(function (source) {\n\t return _this2.createContainer(source);\n\t }));\n\t });\n\t };\n\t\n\t ContainerFactory.prototype.findPlaybackPlugin = function findPlaybackPlugin(source, mimeType) {\n\t return this.loader.playbackPlugins.filter(function (p) {\n\t return p.canPlay(source, mimeType);\n\t })[0];\n\t };\n\t\n\t ContainerFactory.prototype.createContainer = function createContainer(source) {\n\t var resolvedSource = null,\n\t mimeType = this.options.mimeType;\n\t if ((0, _lodash2.default)(source)) {\n\t resolvedSource = source.source.toString();\n\t if (source.mimeType) {\n\t mimeType = source.mimeType;\n\t }\n\t } else {\n\t resolvedSource = source.toString();\n\t }\n\t\n\t if (resolvedSource.match(/^\\/\\//)) resolvedSource = window.location.protocol + resolvedSource;\n\t\n\t var options = _clapprZepto2.default.extend({}, this.options, {\n\t src: resolvedSource,\n\t mimeType: mimeType\n\t });\n\t var playbackPlugin = this.findPlaybackPlugin(resolvedSource, mimeType);\n\t var playback = new playbackPlugin(options, this._i18n);\n\t\n\t options = _clapprZepto2.default.extend({}, options, { playback: playback });\n\t\n\t var container = new _container2.default(options, this._i18n);\n\t var defer = _clapprZepto2.default.Deferred();\n\t defer.promise(container);\n\t this.addContainerPlugins(container);\n\t this.listenToOnce(container, _events2.default.CONTAINER_READY, function () {\n\t return defer.resolve(container);\n\t });\n\t return container;\n\t };\n\t\n\t ContainerFactory.prototype.addContainerPlugins = function addContainerPlugins(container) {\n\t this.loader.containerPlugins.forEach(function (Plugin) {\n\t container.addPlugin(new Plugin(container));\n\t });\n\t };\n\t\n\t return ContainerFactory;\n\t}(_base_object2.default);\n\t\n\texports.default = ContainerFactory;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 40 */\n/*!***************************************************!*\\\n !*** ./src/components/container_factory/index.js ***!\n \\***************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./container_factory */ 39);\n\n/***/ },\n/* 41 */\n/*!*************************************!*\\\n !*** ./src/components/core/core.js ***!\n \\*************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _ui_object = __webpack_require__(/*! base/ui_object */ 10);\n\t\n\tvar _ui_object2 = _interopRequireDefault(_ui_object);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _container_factory = __webpack_require__(/*! components/container_factory */ 40);\n\t\n\tvar _container_factory2 = _interopRequireDefault(_container_factory);\n\t\n\tvar _media_control = __webpack_require__(/*! components/media_control */ 27);\n\t\n\tvar _media_control2 = _interopRequireDefault(_media_control);\n\t\n\tvar _mediator = __webpack_require__(/*! components/mediator */ 11);\n\t\n\tvar _mediator2 = _interopRequireDefault(_mediator);\n\t\n\tvar _player_info = __webpack_require__(/*! components/player_info */ 15);\n\t\n\tvar _player_info2 = _interopRequireDefault(_player_info);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tvar _style = __webpack_require__(/*! ./public/style.scss */ 79);\n\t\n\tvar _style2 = _interopRequireDefault(_style);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\t/**\n\t * The Core is responsible to manage Containers, the mediator, MediaControl\n\t * and the player state.\n\t * @class Core\n\t * @constructor\n\t * @extends UIObject\n\t * @module components\n\t */\n\tvar Core = function (_UIObject) {\n\t _inherits(Core, _UIObject);\n\t\n\t _createClass(Core, [{\n\t key: 'events',\n\t get: function get() {\n\t return {\n\t 'webkitfullscreenchange': 'handleFullscreenChange',\n\t 'mousemove': 'showMediaControl',\n\t 'mouseleave': 'hideMediaControl'\n\t };\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t return {\n\t 'data-player': '',\n\t tabindex: 9999\n\t };\n\t }\n\t\n\t /**\n\t * checks if the core is ready.\n\t * @property isReady\n\t * @type {Boolean} `true` if the core is ready, otherwise `false`\n\t */\n\t\n\t }, {\n\t key: 'isReady',\n\t get: function get() {\n\t return !!this.ready;\n\t }\n\t\n\t /**\n\t * The internationalization plugin.\n\t * @property i18n\n\t * @type {Strings}\n\t */\n\t\n\t }, {\n\t key: 'i18n',\n\t get: function get() {\n\t return this.getPlugin('strings') || { t: function t(key) {\n\t return key;\n\t } };\n\t }\n\t }]);\n\t\n\t function Core(options) {\n\t _classCallCheck(this, Core);\n\t\n\t var _this = _possibleConstructorReturn(this, _UIObject.call(this, options));\n\t\n\t _this.playerInfo = _player_info2.default.getInstance(options.playerId);\n\t _this.firstResize = true;\n\t _this.plugins = [];\n\t _this.containers = [];\n\t _this.setupMediaControl(null);\n\t //FIXME fullscreen api sucks\n\t _this._boundFullscreenHandler = function () {\n\t return _this.handleFullscreenChange();\n\t };\n\t (0, _clapprZepto2.default)(document).bind('fullscreenchange', _this._boundFullscreenHandler);\n\t (0, _clapprZepto2.default)(document).bind('MSFullscreenChange', _this._boundFullscreenHandler);\n\t (0, _clapprZepto2.default)(document).bind('mozfullscreenchange', _this._boundFullscreenHandler);\n\t return _this;\n\t }\n\t\n\t Core.prototype.createContainers = function createContainers(options) {\n\t var _this2 = this;\n\t\n\t this.defer = _clapprZepto2.default.Deferred();\n\t this.defer.promise(this);\n\t this.containerFactory = new _container_factory2.default(options, options.loader, this.i18n);\n\t this.containerFactory.createContainers().then(function (containers) {\n\t return _this2.setupContainers(containers);\n\t }).then(function (containers) {\n\t return _this2.resolveOnContainersReady(containers);\n\t });\n\t };\n\t\n\t Core.prototype.updateSize = function updateSize() {\n\t if (_utils.Fullscreen.isFullscreen()) {\n\t this.setFullscreen();\n\t } else {\n\t this.setPlayerSize();\n\t }\n\t };\n\t\n\t Core.prototype.setFullscreen = function setFullscreen() {\n\t if (!_browser2.default.isiOS) {\n\t this.$el.addClass('fullscreen');\n\t this.$el.removeAttr('style');\n\t this.playerInfo.previousSize = { width: this.options.width, height: this.options.height };\n\t this.playerInfo.currentSize = { width: (0, _clapprZepto2.default)(window).width(), height: (0, _clapprZepto2.default)(window).height() };\n\t }\n\t };\n\t\n\t Core.prototype.setPlayerSize = function setPlayerSize() {\n\t this.$el.removeClass('fullscreen');\n\t this.playerInfo.currentSize = this.playerInfo.previousSize;\n\t this.playerInfo.previousSize = { width: (0, _clapprZepto2.default)(window).width(), height: (0, _clapprZepto2.default)(window).height() };\n\t this.resize(this.playerInfo.currentSize);\n\t };\n\t\n\t Core.prototype.resize = function resize(options) {\n\t if (!(0, _utils.isNumber)(options.height) && !(0, _utils.isNumber)(options.width)) {\n\t this.el.style.height = '' + options.height;\n\t this.el.style.width = '' + options.width;\n\t } else {\n\t this.el.style.height = options.height + 'px';\n\t this.el.style.width = options.width + 'px';\n\t }\n\t this.playerInfo.previousSize = { width: this.options.width, height: this.options.height };\n\t this.options.width = options.width;\n\t this.options.height = options.height;\n\t this.playerInfo.currentSize = options;\n\t this.triggerResize(this.playerInfo.currentSize);\n\t };\n\t\n\t Core.prototype.enableResizeObserver = function enableResizeObserver() {\n\t var _this3 = this;\n\t\n\t var checkSizeCallback = function checkSizeCallback() {\n\t if (_this3.playerInfo.computedSize.width != _this3.el.clientWidth || _this3.playerInfo.computedSize.height != _this3.el.clientHeight) {\n\t _this3.playerInfo.computedSize = { width: _this3.el.clientWidth, height: _this3.el.clientHeight };\n\t _this3.triggerResize(_this3.playerInfo.computedSize);\n\t }\n\t };\n\t this.resizeObserverInterval = setInterval(checkSizeCallback, 500);\n\t };\n\t\n\t Core.prototype.triggerResize = function triggerResize(newSize) {\n\t var thereWasChange = this.firstResize || this.oldHeight !== newSize.height || this.oldWidth !== newSize.width;\n\t if (thereWasChange) {\n\t _mediator2.default.trigger(this.options.playerId + ':' + _events2.default.PLAYER_RESIZE, newSize);\n\t this.oldHeight = newSize.height;\n\t this.oldWidth = newSize.width;\n\t this.firstResize = false;\n\t }\n\t };\n\t\n\t Core.prototype.disableResizeObserver = function disableResizeObserver() {\n\t if (this.resizeObserverInterval) clearInterval(this.resizeObserverInterval);\n\t };\n\t\n\t Core.prototype.resolveOnContainersReady = function resolveOnContainersReady(containers) {\n\t var _this4 = this;\n\t\n\t _clapprZepto2.default.when.apply(_clapprZepto2.default, containers).done(function () {\n\t _this4.defer.resolve(_this4);\n\t _this4.ready = true;\n\t _this4.trigger(_events2.default.CORE_READY);\n\t });\n\t };\n\t\n\t Core.prototype.addPlugin = function addPlugin(plugin) {\n\t this.plugins.push(plugin);\n\t };\n\t\n\t Core.prototype.hasPlugin = function hasPlugin(name) {\n\t return !!this.getPlugin(name);\n\t };\n\t\n\t Core.prototype.getPlugin = function getPlugin(name) {\n\t return this.plugins.filter(function (plugin) {\n\t return plugin.name === name;\n\t })[0];\n\t };\n\t\n\t Core.prototype.load = function load(sources, mimeType) {\n\t var _this5 = this;\n\t\n\t this.options.mimeType = mimeType;\n\t sources = sources && sources.constructor === Array ? sources : [sources];\n\t this.containers.forEach(function (container) {\n\t return container.destroy();\n\t });\n\t this.mediaControl.container = null;\n\t this.containerFactory.options = _clapprZepto2.default.extend(this.options, { sources: sources });\n\t this.containerFactory.createContainers().then(function (containers) {\n\t _this5.setupContainers(containers);\n\t });\n\t };\n\t\n\t Core.prototype.destroy = function destroy() {\n\t this.disableResizeObserver();\n\t this.containers.forEach(function (container) {\n\t return container.destroy();\n\t });\n\t this.plugins.forEach(function (plugin) {\n\t return plugin.destroy();\n\t });\n\t this.$el.remove();\n\t this.mediaControl.destroy();\n\t (0, _clapprZepto2.default)(document).unbind('fullscreenchange', this._boundFullscreenHandler);\n\t (0, _clapprZepto2.default)(document).unbind('MSFullscreenChange', this._boundFullscreenHandler);\n\t (0, _clapprZepto2.default)(document).unbind('mozfullscreenchange', this._boundFullscreenHandler);\n\t };\n\t\n\t Core.prototype.handleFullscreenChange = function handleFullscreenChange() {\n\t this.trigger(_events2.default.CORE_FULLSCREEN, _utils.Fullscreen.isFullscreen());\n\t this.updateSize();\n\t this.mediaControl.show();\n\t };\n\t\n\t Core.prototype.setMediaControlContainer = function setMediaControlContainer(container) {\n\t this.mediaControl.setContainer(container);\n\t this.mediaControl.render();\n\t };\n\t\n\t Core.prototype.disableMediaControl = function disableMediaControl() {\n\t this.mediaControl.disable();\n\t this.$el.removeClass('nocursor');\n\t };\n\t\n\t Core.prototype.enableMediaControl = function enableMediaControl() {\n\t this.mediaControl.enable();\n\t };\n\t\n\t Core.prototype.removeContainer = function removeContainer(container) {\n\t this.stopListening(container);\n\t this.containers = this.containers.filter(function (c) {\n\t return c !== container;\n\t });\n\t };\n\t\n\t Core.prototype.appendContainer = function appendContainer(container) {\n\t this.listenTo(container, _events2.default.CONTAINER_DESTROYED, this.removeContainer);\n\t this.containers.push(container);\n\t };\n\t\n\t Core.prototype.setupContainers = function setupContainers(containers) {\n\t containers.map(this.appendContainer.bind(this));\n\t this.trigger(_events2.default.CORE_CONTAINERS_CREATED);\n\t this.renderContainers();\n\t this.setupMediaControl(this.getCurrentContainer());\n\t this.render();\n\t this.$el.appendTo(this.options.parentElement);\n\t return this.containers;\n\t };\n\t\n\t Core.prototype.renderContainers = function renderContainers() {\n\t var _this6 = this;\n\t\n\t this.containers.map(function (container) {\n\t return _this6.el.appendChild(container.render().el);\n\t });\n\t };\n\t\n\t Core.prototype.createContainer = function createContainer(source, options) {\n\t var container = this.containerFactory.createContainer(source, options);\n\t this.appendContainer(container);\n\t this.el.appendChild(container.render().el);\n\t return container;\n\t };\n\t\n\t Core.prototype.setupMediaControl = function setupMediaControl(container) {\n\t if (this.mediaControl) {\n\t this.mediaControl.setContainer(container);\n\t } else {\n\t this.mediaControl = this.createMediaControl(_clapprZepto2.default.extend({ container: container, focusElement: this.el }, this.options));\n\t this.listenTo(this.mediaControl, _events2.default.MEDIACONTROL_FULLSCREEN, this.toggleFullscreen);\n\t this.listenTo(this.mediaControl, _events2.default.MEDIACONTROL_SHOW, this.onMediaControlShow.bind(this, true));\n\t this.listenTo(this.mediaControl, _events2.default.MEDIACONTROL_HIDE, this.onMediaControlShow.bind(this, false));\n\t }\n\t };\n\t\n\t Core.prototype.createMediaControl = function createMediaControl(options) {\n\t if (options.mediacontrol && options.mediacontrol.external) {\n\t return new options.mediacontrol.external(options).render();\n\t } else {\n\t return new _media_control2.default(options).render();\n\t }\n\t };\n\t\n\t Core.prototype.getCurrentContainer = function getCurrentContainer() {\n\t if (!this.mediaControl || !this.mediaControl.container) {\n\t return this.containers[0];\n\t }\n\t return this.mediaControl.container;\n\t };\n\t\n\t Core.prototype.getCurrentPlayback = function getCurrentPlayback() {\n\t var container = this.getCurrentContainer();\n\t return container && container.playback;\n\t };\n\t\n\t Core.prototype.getPlaybackType = function getPlaybackType() {\n\t var container = this.getCurrentContainer();\n\t return container && container.getPlaybackType();\n\t };\n\t\n\t Core.prototype.toggleFullscreen = function toggleFullscreen() {\n\t if (!_utils.Fullscreen.isFullscreen()) {\n\t _utils.Fullscreen.requestFullscreen(this.el);\n\t if (!_browser2.default.isiOS) {\n\t this.$el.addClass('fullscreen');\n\t }\n\t } else {\n\t _utils.Fullscreen.cancelFullscreen();\n\t if (!_browser2.default.isiOS) {\n\t this.$el.removeClass('fullscreen nocursor');\n\t }\n\t }\n\t this.mediaControl.show();\n\t };\n\t\n\t Core.prototype.showMediaControl = function showMediaControl(event) {\n\t this.mediaControl.show(event);\n\t };\n\t\n\t Core.prototype.hideMediaControl = function hideMediaControl() {\n\t this.mediaControl.hide(this.options.hideMediaControlDelay);\n\t };\n\t\n\t Core.prototype.onMediaControlShow = function onMediaControlShow(showing) {\n\t this.getCurrentContainer().trigger(showing ? _events2.default.CONTAINER_MEDIACONTROL_SHOW : _events2.default.CONTAINER_MEDIACONTROL_HIDE);\n\t\n\t if (showing) this.$el.removeClass('nocursor');else if (_utils.Fullscreen.isFullscreen()) this.$el.addClass('nocursor');\n\t };\n\t\n\t /**\n\t * enables to configure the container after its creation\n\t * @method configure\n\t * @param {Object} options all the options to change in form of a javascript object\n\t */\n\t\n\t\n\t Core.prototype.configure = function configure(options) {\n\t var _this7 = this;\n\t\n\t this._options = _clapprZepto2.default.extend(this._options, options);\n\t var sources = options.source || options.sources;\n\t\n\t if (sources) {\n\t this.load(sources, options.mimeType || this.options.mimeType);\n\t } else {\n\t this.trigger(_events2.default.CORE_OPTIONS_CHANGE);\n\t\n\t this.containers.forEach(function (container) {\n\t container.configure(_this7.options);\n\t });\n\t }\n\t };\n\t\n\t Core.prototype.render = function render() {\n\t var style = _styler2.default.getStyleFor(_style2.default, { baseUrl: this.options.baseUrl });\n\t this.$el.append(style);\n\t this.$el.append(this.mediaControl.render().el);\n\t\n\t this.options.width = this.options.width || this.$el.width();\n\t this.options.height = this.options.height || this.$el.height();\n\t var size = { width: this.options.width, height: this.options.height };\n\t this.playerInfo.previousSize = this.playerInfo.currentSize = this.playerInfo.computedSize = size;\n\t this.updateSize();\n\t\n\t this.previousSize = { width: this.$el.width(), height: this.$el.height() };\n\t\n\t this.enableResizeObserver();\n\t\n\t return this;\n\t };\n\t\n\t return Core;\n\t}(_ui_object2.default);\n\t\n\texports.default = Core;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 42 */\n/*!*****************************************************!*\\\n !*** ./src/components/core_factory/core_factory.js ***!\n \\*****************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _base_object = __webpack_require__(/*! base/base_object */ 9);\n\t\n\tvar _base_object2 = _interopRequireDefault(_base_object);\n\t\n\tvar _core = __webpack_require__(/*! components/core */ 25);\n\t\n\tvar _core2 = _interopRequireDefault(_core);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\t/**\n\t * The Core Factory is responsible for instantiate the core and it's plugins.\n\t * @class CoreFactory\n\t * @constructor\n\t * @extends BaseObject\n\t * @module components\n\t */\n\tvar CoreFactory = function (_BaseObject) {\n\t _inherits(CoreFactory, _BaseObject);\n\t\n\t _createClass(CoreFactory, [{\n\t key: 'loader',\n\t get: function get() {\n\t return this.player.loader;\n\t }\n\t\n\t /**\n\t * it builds the core factory\n\t * @method constructor\n\t * @param {Player} player the player object\n\t */\n\t\n\t }]);\n\t\n\t function CoreFactory(player) {\n\t _classCallCheck(this, CoreFactory);\n\t\n\t var _this = _possibleConstructorReturn(this, _BaseObject.call(this));\n\t\n\t _this.player = player;\n\t _this._options = player.options;\n\t return _this;\n\t }\n\t\n\t /**\n\t * creates a core and its plugins\n\t * @method create\n\t * @return {Core} created core\n\t */\n\t\n\t\n\t CoreFactory.prototype.create = function create() {\n\t this.options.loader = this.loader;\n\t this.core = new _core2.default(this.options);\n\t this.addCorePlugins();\n\t this.core.createContainers(this.options);\n\t return this.core;\n\t };\n\t\n\t /**\n\t * given the core plugins (`loader.corePlugins`) it builds each one\n\t * @method addCorePlugins\n\t * @return {Core} the core with all plugins\n\t */\n\t\n\t\n\t CoreFactory.prototype.addCorePlugins = function addCorePlugins() {\n\t var _this2 = this;\n\t\n\t this.loader.corePlugins.forEach(function (Plugin) {\n\t var plugin = new Plugin(_this2.core);\n\t _this2.core.addPlugin(plugin);\n\t _this2.setupExternalInterface(plugin);\n\t });\n\t return this.core;\n\t };\n\t\n\t CoreFactory.prototype.setupExternalInterface = function setupExternalInterface(plugin) {\n\t var externalFunctions = plugin.getExternalInterface();\n\t for (var key in externalFunctions) {\n\t this.player[key] = externalFunctions[key].bind(plugin);\n\t }\n\t };\n\t\n\t return CoreFactory;\n\t}(_base_object2.default);\n\t\n\texports.default = CoreFactory;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 43 */\n/*!**********************************************!*\\\n !*** ./src/components/core_factory/index.js ***!\n \\**********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./core_factory */ 42);\n\n/***/ },\n/* 44 */\n/*!*****************************************!*\\\n !*** ./src/components/loader/loader.js ***!\n \\*****************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _base_object = __webpack_require__(/*! base/base_object */ 9);\n\t\n\tvar _base_object2 = _interopRequireDefault(_base_object);\n\t\n\tvar _player_info = __webpack_require__(/*! components/player_info */ 15);\n\t\n\tvar _player_info2 = _interopRequireDefault(_player_info);\n\t\n\tvar _lodash = __webpack_require__(/*! lodash.uniqby */ 103);\n\t\n\tvar _lodash2 = _interopRequireDefault(_lodash);\n\t\n\tvar _html5_video = __webpack_require__(/*! playbacks/html5_video */ 16);\n\t\n\tvar _html5_video2 = _interopRequireDefault(_html5_video);\n\t\n\tvar _flash = __webpack_require__(/*! playbacks/flash */ 28);\n\t\n\tvar _flash2 = _interopRequireDefault(_flash);\n\t\n\tvar _html5_audio = __webpack_require__(/*! playbacks/html5_audio */ 31);\n\t\n\tvar _html5_audio2 = _interopRequireDefault(_html5_audio);\n\t\n\tvar _flashls = __webpack_require__(/*! playbacks/flashls */ 29);\n\t\n\tvar _flashls2 = _interopRequireDefault(_flashls);\n\t\n\tvar _hls = __webpack_require__(/*! playbacks/hls */ 30);\n\t\n\tvar _hls2 = _interopRequireDefault(_hls);\n\t\n\tvar _html_img = __webpack_require__(/*! playbacks/html_img */ 32);\n\t\n\tvar _html_img2 = _interopRequireDefault(_html_img);\n\t\n\tvar _no_op = __webpack_require__(/*! playbacks/no_op */ 33);\n\t\n\tvar _no_op2 = _interopRequireDefault(_no_op);\n\t\n\tvar _spinner_three_bounce = __webpack_require__(/*! plugins/spinner_three_bounce */ 70);\n\t\n\tvar _spinner_three_bounce2 = _interopRequireDefault(_spinner_three_bounce);\n\t\n\tvar _stats = __webpack_require__(/*! plugins/stats */ 72);\n\t\n\tvar _stats2 = _interopRequireDefault(_stats);\n\t\n\tvar _watermark = __webpack_require__(/*! plugins/watermark */ 75);\n\t\n\tvar _watermark2 = _interopRequireDefault(_watermark);\n\t\n\tvar _poster = __webpack_require__(/*! plugins/poster */ 34);\n\t\n\tvar _poster2 = _interopRequireDefault(_poster);\n\t\n\tvar _google_analytics = __webpack_require__(/*! plugins/google_analytics */ 64);\n\t\n\tvar _google_analytics2 = _interopRequireDefault(_google_analytics);\n\t\n\tvar _click_to_pause = __webpack_require__(/*! plugins/click_to_pause */ 57);\n\t\n\tvar _click_to_pause2 = _interopRequireDefault(_click_to_pause);\n\t\n\tvar _dvr_controls = __webpack_require__(/*! plugins/dvr_controls */ 59);\n\t\n\tvar _dvr_controls2 = _interopRequireDefault(_dvr_controls);\n\t\n\tvar _favicon = __webpack_require__(/*! plugins/favicon */ 62);\n\t\n\tvar _favicon2 = _interopRequireDefault(_favicon);\n\t\n\tvar _seek_time = __webpack_require__(/*! plugins/seek_time */ 67);\n\t\n\tvar _seek_time2 = _interopRequireDefault(_seek_time);\n\t\n\tvar _sources = __webpack_require__(/*! plugins/sources */ 69);\n\t\n\tvar _sources2 = _interopRequireDefault(_sources);\n\t\n\tvar _end_video = __webpack_require__(/*! plugins/end_video */ 60);\n\t\n\tvar _end_video2 = _interopRequireDefault(_end_video);\n\t\n\tvar _strings = __webpack_require__(/*! plugins/strings */ 74);\n\t\n\tvar _strings2 = _interopRequireDefault(_strings);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\t/* Playback Plugins */\n\t\n\t\n\t/* Container Plugins */\n\t\n\t\n\t/* Core Plugins */\n\t\n\t\n\t/**\n\t * It keeps a list of the default plugins (playback, container, core) and it merges external plugins with its internals.\n\t * @class Loader\n\t * @constructor\n\t * @extends BaseObject\n\t * @module components\n\t */\n\tvar Loader = function (_BaseObject) {\n\t _inherits(Loader, _BaseObject);\n\t\n\t /**\n\t * builds the loader\n\t * @method constructor\n\t * @param {Object} externalPlugins the external plugins\n\t * @param {Number} playerId you can embed multiple instances of clappr, therefore this is the unique id of each one.\n\t */\n\t function Loader(externalPlugins, playerId) {\n\t _classCallCheck(this, Loader);\n\t\n\t var _this = _possibleConstructorReturn(this, _BaseObject.call(this));\n\t\n\t _this.playerId = playerId;\n\t _this.playbackPlugins = [_hls2.default, _html5_video2.default, _html5_audio2.default, _flash2.default, _flashls2.default, _html_img2.default, _no_op2.default];\n\t _this.containerPlugins = [_spinner_three_bounce2.default, _watermark2.default, _poster2.default, _stats2.default, _google_analytics2.default, _click_to_pause2.default];\n\t _this.corePlugins = [_dvr_controls2.default, _favicon2.default, _seek_time2.default, _sources2.default, _end_video2.default, _strings2.default];\n\t if (externalPlugins) {\n\t if (!Array.isArray(externalPlugins)) {\n\t _this.validateExternalPluginsType(externalPlugins);\n\t }\n\t _this.addExternalPlugins(externalPlugins);\n\t }\n\t return _this;\n\t }\n\t\n\t /**\n\t * groups by type the external plugins that were passed through `options.plugins` it they're on a flat array\n\t * @method addExternalPlugins\n\t * @private\n\t * @param {Object} an config object or an array of plugins\n\t * @return {Object} plugins the config object with the plugins separated by type\n\t */\n\t\n\t\n\t Loader.prototype.groupPluginsByType = function groupPluginsByType(plugins) {\n\t if (Array.isArray(plugins)) {\n\t plugins = plugins.reduce(function (memo, plugin) {\n\t memo[plugin.type] || (memo[plugin.type] = []);\n\t memo[plugin.type].push(plugin);\n\t return memo;\n\t }, {});\n\t }\n\t return plugins;\n\t };\n\t\n\t /**\n\t * adds all the external plugins that were passed through `options.plugins`\n\t * @method addExternalPlugins\n\t * @private\n\t * @param {Object} plugins the config object with all plugins\n\t */\n\t\n\t\n\t Loader.prototype.addExternalPlugins = function addExternalPlugins(plugins) {\n\t plugins = this.groupPluginsByType(plugins);\n\t var pluginName = function pluginName(plugin) {\n\t return plugin.prototype.name;\n\t };\n\t if (plugins.playback) {\n\t this.playbackPlugins = (0, _lodash2.default)(plugins.playback.concat(this.playbackPlugins), pluginName);\n\t }\n\t if (plugins.container) {\n\t this.containerPlugins = (0, _lodash2.default)(plugins.container.concat(this.containerPlugins), pluginName);\n\t }\n\t if (plugins.core) {\n\t this.corePlugins = (0, _lodash2.default)(plugins.core.concat(this.corePlugins), pluginName);\n\t }\n\t _player_info2.default.getInstance(this.playerId).playbackPlugins = this.playbackPlugins;\n\t };\n\t\n\t /**\n\t * validate if the external plugins that were passed through `options.plugins` are associated to the correct type\n\t * @method validateExternalPluginsType\n\t * @private\n\t * @param {Object} plugins the config object with all plugins\n\t */\n\t\n\t\n\t Loader.prototype.validateExternalPluginsType = function validateExternalPluginsType(plugins) {\n\t var plugintypes = ['playback', 'container', 'core'];\n\t plugintypes.forEach(function (type) {\n\t (plugins[type] || []).forEach(function (el) {\n\t var errorMessage = 'external ' + el.type + ' plugin on ' + type + ' array';\n\t if (el.type !== type) {\n\t throw new ReferenceError(errorMessage);\n\t }\n\t });\n\t });\n\t };\n\t\n\t return Loader;\n\t}(_base_object2.default);\n\t\n\texports.default = Loader;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 45 */\n/*!*******************************************************!*\\\n !*** ./src/components/media_control/media_control.js ***!\n \\*******************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _vendor = __webpack_require__(/*! vendor */ 20);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _ui_object = __webpack_require__(/*! base/ui_object */ 10);\n\t\n\tvar _ui_object2 = _interopRequireDefault(_ui_object);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _mediator = __webpack_require__(/*! components/mediator */ 11);\n\t\n\tvar _mediator2 = _interopRequireDefault(_mediator);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tvar _lodash = __webpack_require__(/*! lodash.merge */ 35);\n\t\n\tvar _lodash2 = _interopRequireDefault(_lodash);\n\t\n\tvar _mediaControl = __webpack_require__(/*! ./public/media-control.scss */ 80);\n\t\n\tvar _mediaControl2 = _interopRequireDefault(_mediaControl);\n\t\n\tvar _mediaControl3 = __webpack_require__(/*! ./public/media-control.html */ 91);\n\t\n\tvar _mediaControl4 = _interopRequireDefault(_mediaControl3);\n\t\n\tvar _play = __webpack_require__(/*! icons/01-play.svg */ 22);\n\t\n\tvar _play2 = _interopRequireDefault(_play);\n\t\n\tvar _pause = __webpack_require__(/*! icons/02-pause.svg */ 36);\n\t\n\tvar _pause2 = _interopRequireDefault(_pause);\n\t\n\tvar _stop = __webpack_require__(/*! icons/03-stop.svg */ 104);\n\t\n\tvar _stop2 = _interopRequireDefault(_stop);\n\t\n\tvar _volume = __webpack_require__(/*! icons/04-volume.svg */ 105);\n\t\n\tvar _volume2 = _interopRequireDefault(_volume);\n\t\n\tvar _mute = __webpack_require__(/*! icons/05-mute.svg */ 106);\n\t\n\tvar _mute2 = _interopRequireDefault(_mute);\n\t\n\tvar _expand = __webpack_require__(/*! icons/06-expand.svg */ 107);\n\t\n\tvar _expand2 = _interopRequireDefault(_expand);\n\t\n\tvar _shrink = __webpack_require__(/*! icons/07-shrink.svg */ 108);\n\t\n\tvar _shrink2 = _interopRequireDefault(_shrink);\n\t\n\tvar _hd = __webpack_require__(/*! icons/08-hd.svg */ 109);\n\t\n\tvar _hd2 = _interopRequireDefault(_hd);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\t/**\n\t * The MediaControl is responsible for displaying the Player controls.\n\t */\n\t\n\tvar MediaControl = function (_UIObject) {\n\t _inherits(MediaControl, _UIObject);\n\t\n\t _createClass(MediaControl, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'MediaControl';\n\t }\n\t }, {\n\t key: 'disabled',\n\t get: function get() {\n\t return this.userDisabled || this.container && this.container.getPlaybackType() === _playback2.default.NO_OP;\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t return {\n\t 'class': 'media-control',\n\t 'data-media-control': ''\n\t };\n\t }\n\t }, {\n\t key: 'events',\n\t get: function get() {\n\t return {\n\t 'click [data-play]': 'play',\n\t 'click [data-pause]': 'pause',\n\t 'click [data-playpause]': 'togglePlayPause',\n\t 'click [data-stop]': 'stop',\n\t 'click [data-playstop]': 'togglePlayStop',\n\t 'click [data-fullscreen]': 'toggleFullscreen',\n\t 'click .bar-container[data-seekbar]': 'seek',\n\t 'click .bar-container[data-volume]': 'onVolumeClick',\n\t 'click .drawer-icon[data-volume]': 'toggleMute',\n\t 'mouseenter .drawer-container[data-volume]': 'showVolumeBar',\n\t 'mouseleave .drawer-container[data-volume]': 'hideVolumeBar',\n\t 'mousedown .bar-container[data-volume]': 'startVolumeDrag',\n\t 'mousemove .bar-container[data-volume]': 'mousemoveOnVolumeBar',\n\t 'mousedown .bar-scrubber[data-seekbar]': 'startSeekDrag',\n\t 'mousemove .bar-container[data-seekbar]': 'mousemoveOnSeekBar',\n\t 'mouseleave .bar-container[data-seekbar]': 'mouseleaveOnSeekBar',\n\t 'mouseenter .media-control-layer[data-controls]': 'setUserKeepVisible',\n\t 'mouseleave .media-control-layer[data-controls]': 'resetUserKeepVisible'\n\t };\n\t }\n\t }, {\n\t key: 'template',\n\t get: function get() {\n\t return (0, _template2.default)(_mediaControl4.default);\n\t }\n\t }, {\n\t key: 'stylesheet',\n\t get: function get() {\n\t return _styler2.default.getStyleFor(_mediaControl2.default, { baseUrl: this.options.baseUrl });\n\t }\n\t }, {\n\t key: 'volume',\n\t get: function get() {\n\t return this.container && this.container.isReady ? this.container.volume : this.intendedVolume;\n\t }\n\t }, {\n\t key: 'muted',\n\t get: function get() {\n\t return this.volume === 0;\n\t }\n\t }]);\n\t\n\t function MediaControl(options) {\n\t _classCallCheck(this, MediaControl);\n\t\n\t var _this = _possibleConstructorReturn(this, _UIObject.call(this, options));\n\t\n\t _this.persistConfig = _this.options.persistConfig;\n\t _this.container = options.container;\n\t _this.currentPositionValue = null;\n\t _this.currentDurationValue = null;\n\t var initialVolume = _this.persistConfig ? _utils.Config.restore('volume') : 100;\n\t _this.setVolume(_this.options.mute ? 0 : initialVolume);\n\t _this.keepVisible = false;\n\t _this.fullScreenOnVideoTagSupported = null; // unknown\n\t _this.addEventListeners();\n\t _this.settings = {\n\t left: ['play', 'stop', 'pause'],\n\t right: ['volume'],\n\t default: ['position', 'seekbar', 'duration']\n\t };\n\t\n\t if (_this.container) {\n\t if (!_clapprZepto2.default.isEmptyObject(_this.container.settings)) {\n\t _this.settings = _clapprZepto2.default.extend({}, _this.container.settings);\n\t }\n\t } else {\n\t _this.settings = {};\n\t }\n\t\n\t _this.userDisabled = false;\n\t if (_this.container && _this.container.mediaControlDisabled || _this.options.chromeless) {\n\t _this.disable();\n\t }\n\t _this.stopDragHandler = function (event) {\n\t return _this.stopDrag(event);\n\t };\n\t _this.updateDragHandler = function (event) {\n\t return _this.updateDrag(event);\n\t };\n\t (0, _clapprZepto2.default)(document).bind('mouseup', _this.stopDragHandler);\n\t (0, _clapprZepto2.default)(document).bind('mousemove', _this.updateDragHandler);\n\t return _this;\n\t }\n\t\n\t MediaControl.prototype.addEventListeners = function addEventListeners() {\n\t if (this.container) {\n\t _mediator2.default.on(this.options.playerId + ':' + _events2.default.PLAYER_RESIZE, this.playerResize, this);\n\t this.listenTo(this.container, _events2.default.CONTAINER_PLAY, this.changeTogglePlay);\n\t this.listenTo(this.container, _events2.default.CONTAINER_PAUSE, this.changeTogglePlay);\n\t this.listenTo(this.container, _events2.default.CONTAINER_DBLCLICK, this.toggleFullscreen);\n\t this.listenTo(this.container, _events2.default.CONTAINER_TIMEUPDATE, this.onTimeUpdate);\n\t this.listenTo(this.container, _events2.default.CONTAINER_PROGRESS, this.updateProgressBar);\n\t this.listenTo(this.container, _events2.default.CONTAINER_SETTINGSUPDATE, this.settingsUpdate);\n\t this.listenTo(this.container, _events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, this.settingsUpdate);\n\t this.listenTo(this.container, _events2.default.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);\n\t this.listenTo(this.container, _events2.default.CONTAINER_MEDIACONTROL_DISABLE, this.disable);\n\t this.listenTo(this.container, _events2.default.CONTAINER_MEDIACONTROL_ENABLE, this.enable);\n\t this.listenTo(this.container, _events2.default.CONTAINER_ENDED, this.ended);\n\t this.listenTo(this.container, _events2.default.CONTAINER_VOLUME, this.onVolumeChanged);\n\t if (this.container.playback.el.nodeName.toLowerCase() === 'video') {\n\t // wait until the metadata has loaded and then check if fullscreen on video tag is supported\n\t this.listenToOnce(this.container, _events2.default.CONTAINER_LOADEDMETADATA, this.onLoadedMetadataOnVideoTag);\n\t }\n\t }\n\t };\n\t\n\t MediaControl.prototype.disable = function disable() {\n\t this.userDisabled = true;\n\t this.hide();\n\t this.$el.hide();\n\t };\n\t\n\t MediaControl.prototype.enable = function enable() {\n\t if (this.options.chromeless) return;\n\t this.userDisabled = false;\n\t this.show();\n\t };\n\t\n\t MediaControl.prototype.play = function play() {\n\t this.container.play();\n\t };\n\t\n\t MediaControl.prototype.pause = function pause() {\n\t this.container.pause();\n\t };\n\t\n\t MediaControl.prototype.stop = function stop() {\n\t this.container.stop();\n\t };\n\t\n\t MediaControl.prototype.onVolumeChanged = function onVolumeChanged() {\n\t this.updateVolumeUI();\n\t };\n\t\n\t MediaControl.prototype.onLoadedMetadataOnVideoTag = function onLoadedMetadataOnVideoTag() {\n\t var video = this.container.playback.el;\n\t // video.webkitSupportsFullscreen is deprecated but iOS appears to only use this\n\t // see https://github.com/clappr/clappr/issues/1127\n\t if (!_utils.Fullscreen.fullscreenEnabled() && video.webkitSupportsFullscreen) {\n\t this.fullScreenOnVideoTagSupported = true;\n\t this.settingsUpdate();\n\t }\n\t };\n\t\n\t MediaControl.prototype.updateVolumeUI = function updateVolumeUI() {\n\t if (!this.rendered) {\n\t // this will be called after a render\n\t return;\n\t }\n\t // update volume bar scrubber/fill on bar mode\n\t this.$volumeBarContainer.find('.bar-fill-2').css({});\n\t var containerWidth = this.$volumeBarContainer.width();\n\t var barWidth = this.$volumeBarBackground.width();\n\t var offset = (containerWidth - barWidth) / 2.0;\n\t var pos = barWidth * this.volume / 100.0 + offset;\n\t this.$volumeBarFill.css({ width: this.volume + '%' });\n\t this.$volumeBarScrubber.css({ left: pos });\n\t\n\t // update volume bar segments on segmented bar mode\n\t this.$volumeBarContainer.find('.segmented-bar-element').removeClass('fill');\n\t var item = Math.ceil(this.volume / 10.0);\n\t this.$volumeBarContainer.find('.segmented-bar-element').slice(0, item).addClass('fill');\n\t this.$volumeIcon.html('');\n\t this.$volumeIcon.removeClass('muted');\n\t if (!this.muted) {\n\t this.$volumeIcon.append(_volume2.default);\n\t } else {\n\t this.$volumeIcon.append(_mute2.default);\n\t this.$volumeIcon.addClass('muted');\n\t }\n\t this.applyButtonStyle(this.$volumeIcon);\n\t };\n\t\n\t MediaControl.prototype.changeTogglePlay = function changeTogglePlay() {\n\t this.$playPauseToggle.html('');\n\t this.$playStopToggle.html('');\n\t if (this.container && this.container.isPlaying()) {\n\t this.$playPauseToggle.append(_pause2.default);\n\t this.$playStopToggle.append(_stop2.default);\n\t this.trigger(_events2.default.MEDIACONTROL_PLAYING);\n\t } else {\n\t this.$playPauseToggle.append(_play2.default);\n\t this.$playStopToggle.append(_play2.default);\n\t this.trigger(_events2.default.MEDIACONTROL_NOTPLAYING);\n\t if (_browser2.default.isMobile) {\n\t this.show();\n\t }\n\t }\n\t this.applyButtonStyle(this.$playPauseToggle);\n\t this.applyButtonStyle(this.$playStopToggle);\n\t };\n\t\n\t MediaControl.prototype.mousemoveOnSeekBar = function mousemoveOnSeekBar(event) {\n\t if (this.settings.seekEnabled) {\n\t var offsetX = event.pageX - this.$seekBarContainer.offset().left - this.$seekBarHover.width() / 2;\n\t this.$seekBarHover.css({ left: offsetX });\n\t }\n\t this.trigger(_events2.default.MEDIACONTROL_MOUSEMOVE_SEEKBAR, event);\n\t };\n\t\n\t MediaControl.prototype.mouseleaveOnSeekBar = function mouseleaveOnSeekBar(event) {\n\t this.trigger(_events2.default.MEDIACONTROL_MOUSELEAVE_SEEKBAR, event);\n\t };\n\t\n\t MediaControl.prototype.onVolumeClick = function onVolumeClick(event) {\n\t this.setVolume(this.getVolumeFromUIEvent(event));\n\t };\n\t\n\t MediaControl.prototype.mousemoveOnVolumeBar = function mousemoveOnVolumeBar(event) {\n\t if (this.draggingVolumeBar) {\n\t this.setVolume(this.getVolumeFromUIEvent(event));\n\t }\n\t };\n\t\n\t MediaControl.prototype.playerResize = function playerResize(size) {\n\t this.$fullscreenToggle.html('');\n\t if (_utils.Fullscreen.isFullscreen()) {\n\t this.$fullscreenToggle.append(_shrink2.default);\n\t } else {\n\t this.$fullscreenToggle.append(_expand2.default);\n\t }\n\t this.applyButtonStyle(this.$fullscreenToggle);\n\t this.$el.removeClass('w320');\n\t if (size.width <= 320 || this.options.hideVolumeBar) {\n\t this.$el.addClass('w320');\n\t }\n\t };\n\t\n\t MediaControl.prototype.togglePlayPause = function togglePlayPause() {\n\t if (this.container.isPlaying()) {\n\t this.container.pause();\n\t } else {\n\t this.container.play();\n\t }\n\t return false;\n\t };\n\t\n\t MediaControl.prototype.togglePlayStop = function togglePlayStop() {\n\t if (this.container.isPlaying()) {\n\t this.container.stop();\n\t } else {\n\t this.container.play();\n\t }\n\t };\n\t\n\t MediaControl.prototype.startSeekDrag = function startSeekDrag(event) {\n\t if (!this.settings.seekEnabled) return;\n\t this.draggingSeekBar = true;\n\t this.$el.addClass('dragging');\n\t this.$seekBarLoaded.addClass('media-control-notransition');\n\t this.$seekBarPosition.addClass('media-control-notransition');\n\t this.$seekBarScrubber.addClass('media-control-notransition');\n\t if (event) {\n\t event.preventDefault();\n\t }\n\t };\n\t\n\t MediaControl.prototype.startVolumeDrag = function startVolumeDrag(event) {\n\t this.draggingVolumeBar = true;\n\t this.$el.addClass('dragging');\n\t if (event) {\n\t event.preventDefault();\n\t }\n\t };\n\t\n\t MediaControl.prototype.stopDrag = function stopDrag(event) {\n\t if (this.draggingSeekBar) {\n\t this.seek(event);\n\t }\n\t this.$el.removeClass('dragging');\n\t this.$seekBarLoaded.removeClass('media-control-notransition');\n\t this.$seekBarPosition.removeClass('media-control-notransition');\n\t this.$seekBarScrubber.removeClass('media-control-notransition dragging');\n\t this.draggingSeekBar = false;\n\t this.draggingVolumeBar = false;\n\t };\n\t\n\t MediaControl.prototype.updateDrag = function updateDrag(event) {\n\t if (this.draggingSeekBar) {\n\t event.preventDefault();\n\t var offsetX = event.pageX - this.$seekBarContainer.offset().left;\n\t var pos = offsetX / this.$seekBarContainer.width() * 100;\n\t pos = Math.min(100, Math.max(pos, 0));\n\t this.setSeekPercentage(pos);\n\t } else if (this.draggingVolumeBar) {\n\t event.preventDefault();\n\t this.setVolume(this.getVolumeFromUIEvent(event));\n\t }\n\t };\n\t\n\t MediaControl.prototype.getVolumeFromUIEvent = function getVolumeFromUIEvent(event) {\n\t var offsetY = event.pageX - this.$volumeBarContainer.offset().left;\n\t var volumeFromUI = offsetY / this.$volumeBarContainer.width() * 100;\n\t return volumeFromUI;\n\t };\n\t\n\t MediaControl.prototype.toggleMute = function toggleMute() {\n\t this.setVolume(this.muted ? 100 : 0);\n\t };\n\t\n\t MediaControl.prototype.setVolume = function setVolume(value) {\n\t var _this2 = this;\n\t\n\t value = Math.min(100, Math.max(value, 0));\n\t // this will hold the intended volume\n\t // it may not actually get set to this straight away\n\t // if the container is not ready etc\n\t this.intendedVolume = value;\n\t this.persistConfig && _utils.Config.persist('volume', value);\n\t var setWhenContainerReady = function setWhenContainerReady() {\n\t if (_this2.container.isReady) {\n\t _this2.container.setVolume(value);\n\t } else {\n\t _this2.listenToOnce(_this2.container, _events2.default.CONTAINER_READY, function () {\n\t _this2.container.setVolume(value);\n\t });\n\t }\n\t };\n\t\n\t if (!this.container) {\n\t this.listenToOnce(this, _events2.default.MEDIACONTROL_CONTAINERCHANGED, function () {\n\t setWhenContainerReady();\n\t });\n\t } else {\n\t setWhenContainerReady();\n\t }\n\t };\n\t\n\t MediaControl.prototype.toggleFullscreen = function toggleFullscreen() {\n\t this.trigger(_events2.default.MEDIACONTROL_FULLSCREEN, this.name);\n\t this.container.fullscreen();\n\t this.resetUserKeepVisible();\n\t };\n\t\n\t MediaControl.prototype.setContainer = function setContainer(container) {\n\t if (this.container) {\n\t this.stopListening(this.container);\n\t this.fullScreenOnVideoTagSupported = null;\n\t }\n\t _mediator2.default.off(this.options.playerId + ':' + _events2.default.PLAYER_RESIZE, this.playerResize, this);\n\t this.container = container;\n\t // set the new container to match the volume of the last one\n\t this.setVolume(this.intendedVolume);\n\t this.changeTogglePlay();\n\t this.addEventListeners();\n\t this.settingsUpdate();\n\t this.container.trigger(_events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, this.container.isDvrInUse());\n\t if (this.container.mediaControlDisabled) {\n\t this.disable();\n\t }\n\t this.trigger(_events2.default.MEDIACONTROL_CONTAINERCHANGED);\n\t };\n\t\n\t MediaControl.prototype.showVolumeBar = function showVolumeBar() {\n\t if (this.hideVolumeId) {\n\t clearTimeout(this.hideVolumeId);\n\t }\n\t this.$volumeBarContainer.removeClass('volume-bar-hide');\n\t };\n\t\n\t MediaControl.prototype.hideVolumeBar = function hideVolumeBar() {\n\t var _this3 = this;\n\t\n\t var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 400;\n\t\n\t if (!this.$volumeBarContainer) return;\n\t if (this.draggingVolumeBar) {\n\t this.hideVolumeId = setTimeout(function () {\n\t return _this3.hideVolumeBar();\n\t }, timeout);\n\t } else {\n\t if (this.hideVolumeId) {\n\t clearTimeout(this.hideVolumeId);\n\t }\n\t this.hideVolumeId = setTimeout(function () {\n\t return _this3.$volumeBarContainer.addClass('volume-bar-hide');\n\t }, timeout);\n\t }\n\t };\n\t\n\t MediaControl.prototype.ended = function ended() {\n\t this.changeTogglePlay();\n\t };\n\t\n\t MediaControl.prototype.updateProgressBar = function updateProgressBar(progress) {\n\t var loadedStart = progress.start / progress.total * 100;\n\t var loadedEnd = progress.current / progress.total * 100;\n\t this.$seekBarLoaded.css({ left: loadedStart + '%', width: loadedEnd - loadedStart + '%' });\n\t };\n\t\n\t MediaControl.prototype.onTimeUpdate = function onTimeUpdate(timeProgress) {\n\t if (this.draggingSeekBar) return;\n\t // TODO why should current time ever be negative?\n\t var position = timeProgress.current < 0 ? timeProgress.total : timeProgress.current;\n\t\n\t this.currentPositionValue = position;\n\t this.currentDurationValue = timeProgress.total;\n\t this.renderSeekBar();\n\t };\n\t\n\t MediaControl.prototype.renderSeekBar = function renderSeekBar() {\n\t if (this.currentPositionValue === null || this.currentDurationValue === null) {\n\t // this will be triggered as soon as these beocome available\n\t return;\n\t }\n\t\n\t // default to 100%\n\t this.currentSeekBarPercentage = 100;\n\t if (this.container.getPlaybackType() !== _playback2.default.LIVE || this.container.isDvrInUse()) {\n\t this.currentSeekBarPercentage = this.currentPositionValue / this.currentDurationValue * 100;\n\t }\n\t this.setSeekPercentage(this.currentSeekBarPercentage);\n\t\n\t var newPosition = (0, _utils.formatTime)(this.currentPositionValue);\n\t var newDuration = (0, _utils.formatTime)(this.currentDurationValue);\n\t if (newPosition !== this.displayedPosition) {\n\t this.$position.text(newPosition);\n\t this.displayedPosition = newPosition;\n\t }\n\t if (newDuration !== this.displayedDuration) {\n\t this.$duration.text(newDuration);\n\t this.displayedDuration = newDuration;\n\t }\n\t };\n\t\n\t MediaControl.prototype.seek = function seek(event) {\n\t if (!this.settings.seekEnabled) return;\n\t var offsetX = event.pageX - this.$seekBarContainer.offset().left;\n\t var pos = offsetX / this.$seekBarContainer.width() * 100;\n\t pos = Math.min(100, Math.max(pos, 0));\n\t this.container.seekPercentage(pos);\n\t this.setSeekPercentage(pos);\n\t return false;\n\t };\n\t\n\t MediaControl.prototype.setKeepVisible = function setKeepVisible() {\n\t this.keepVisible = true;\n\t };\n\t\n\t MediaControl.prototype.resetKeepVisible = function resetKeepVisible() {\n\t this.keepVisible = false;\n\t };\n\t\n\t MediaControl.prototype.setUserKeepVisible = function setUserKeepVisible() {\n\t this.userKeepVisible = true;\n\t };\n\t\n\t MediaControl.prototype.resetUserKeepVisible = function resetUserKeepVisible() {\n\t this.userKeepVisible = false;\n\t };\n\t\n\t MediaControl.prototype.isVisible = function isVisible() {\n\t return !this.$el.hasClass('media-control-hide');\n\t };\n\t\n\t MediaControl.prototype.show = function show(event) {\n\t var _this4 = this;\n\t\n\t if (this.disabled) {\n\t return;\n\t }\n\t var timeout = 2000;\n\t if (!event || event.clientX !== this.lastMouseX && event.clientY !== this.lastMouseY || navigator.userAgent.match(/firefox/i)) {\n\t clearTimeout(this.hideId);\n\t this.$el.show();\n\t this.trigger(_events2.default.MEDIACONTROL_SHOW, this.name);\n\t this.$el.removeClass('media-control-hide');\n\t this.hideId = setTimeout(function () {\n\t return _this4.hide();\n\t }, timeout);\n\t if (event) {\n\t this.lastMouseX = event.clientX;\n\t this.lastMouseY = event.clientY;\n\t }\n\t }\n\t };\n\t\n\t MediaControl.prototype.hide = function hide() {\n\t var _this5 = this;\n\t\n\t var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\t\n\t if (!this.isVisible() || _browser2.default.isMobile && !this.container.isPlaying()) {\n\t return;\n\t }\n\t var timeout = delay || 2000;\n\t clearTimeout(this.hideId);\n\t if (!this.disabled && this.options.hideMediaControl === false) {\n\t return;\n\t }\n\t if (!this.disabled && (delay || this.userKeepVisible || this.keepVisible || this.draggingSeekBar || this.draggingVolumeBar)) {\n\t this.hideId = setTimeout(function () {\n\t return _this5.hide();\n\t }, timeout);\n\t } else {\n\t this.trigger(_events2.default.MEDIACONTROL_HIDE, this.name);\n\t this.$el.addClass('media-control-hide');\n\t this.hideVolumeBar(0);\n\t }\n\t };\n\t\n\t MediaControl.prototype.settingsUpdate = function settingsUpdate() {\n\t var newSettings = this.getSettings();\n\t if (newSettings && !this.fullScreenOnVideoTagSupported && !_utils.Fullscreen.fullscreenEnabled()) {\n\t // remove fullscreen from settings if it is present\n\t newSettings.default && (0, _utils.removeArrayItem)(newSettings.default, 'fullscreen');\n\t newSettings.left && (0, _utils.removeArrayItem)(newSettings.left, 'fullscreen');\n\t newSettings.right && (0, _utils.removeArrayItem)(newSettings.right, 'fullscreen');\n\t }\n\t var settingsChanged = JSON.stringify(this.settings) !== JSON.stringify(newSettings);\n\t if (settingsChanged) {\n\t this.settings = newSettings;\n\t this.render();\n\t }\n\t };\n\t\n\t MediaControl.prototype.getSettings = function getSettings() {\n\t return (0, _lodash2.default)({}, this.container.settings);\n\t };\n\t\n\t MediaControl.prototype.highDefinitionUpdate = function highDefinitionUpdate(isHD) {\n\t var method = isHD ? 'addClass' : 'removeClass';\n\t this.$hdIndicator[method]('enabled');\n\t };\n\t\n\t MediaControl.prototype.createCachedElements = function createCachedElements() {\n\t var $layer = this.$el.find('.media-control-layer');\n\t this.$duration = $layer.find('.media-control-indicator[data-duration]');\n\t this.$fullscreenToggle = $layer.find('button.media-control-button[data-fullscreen]');\n\t this.$playPauseToggle = $layer.find('button.media-control-button[data-playpause]');\n\t this.$playStopToggle = $layer.find('button.media-control-button[data-playstop]');\n\t this.$position = $layer.find('.media-control-indicator[data-position]');\n\t this.$seekBarContainer = $layer.find('.bar-container[data-seekbar]');\n\t this.$seekBarHover = $layer.find('.bar-hover[data-seekbar]');\n\t this.$seekBarLoaded = $layer.find('.bar-fill-1[data-seekbar]');\n\t this.$seekBarPosition = $layer.find('.bar-fill-2[data-seekbar]');\n\t this.$seekBarScrubber = $layer.find('.bar-scrubber[data-seekbar]');\n\t this.$volumeBarContainer = $layer.find('.bar-container[data-volume]');\n\t this.$volumeContainer = $layer.find('.drawer-container[data-volume]');\n\t this.$volumeIcon = $layer.find('.drawer-icon[data-volume]');\n\t this.$volumeBarBackground = this.$el.find('.bar-background[data-volume]');\n\t this.$volumeBarFill = this.$el.find('.bar-fill-1[data-volume]');\n\t this.$volumeBarScrubber = this.$el.find('.bar-scrubber[data-volume]');\n\t this.$hdIndicator = this.$el.find('button.media-control-button[data-hd-indicator]');\n\t this.resetIndicators();\n\t this.initializeIcons();\n\t };\n\t\n\t MediaControl.prototype.resetIndicators = function resetIndicators() {\n\t this.displayedPosition = this.$position.text();\n\t this.displayedDuration = this.$duration.text();\n\t };\n\t\n\t MediaControl.prototype.initializeIcons = function initializeIcons() {\n\t var $layer = this.$el.find('.media-control-layer');\n\t $layer.find('button.media-control-button[data-play]').append(_play2.default);\n\t $layer.find('button.media-control-button[data-pause]').append(_pause2.default);\n\t $layer.find('button.media-control-button[data-stop]').append(_stop2.default);\n\t this.$playPauseToggle.append(_play2.default);\n\t this.$playStopToggle.append(_play2.default);\n\t this.$volumeIcon.append(_volume2.default);\n\t this.$fullscreenToggle.append(_expand2.default);\n\t this.$hdIndicator.append(_hd2.default);\n\t };\n\t\n\t MediaControl.prototype.setSeekPercentage = function setSeekPercentage(value) {\n\t value = Math.max(Math.min(value, 100.0), 0);\n\t if (this.displayedSeekBarPercentage === value) {\n\t // not changed since last update\n\t return;\n\t }\n\t this.displayedSeekBarPercentage = value;\n\t\n\t this.$seekBarPosition.removeClass('media-control-notransition');\n\t this.$seekBarScrubber.removeClass('media-control-notransition');\n\t this.$seekBarPosition.css({ width: value + '%' });\n\t this.$seekBarScrubber.css({ left: value + '%' });\n\t };\n\t\n\t MediaControl.prototype.seekRelative = function seekRelative(delta) {\n\t if (!this.settings.seekEnabled) return;\n\t var currentTime = this.container.getCurrentTime();\n\t var duration = this.container.getDuration();\n\t var position = Math.min(Math.max(currentTime + delta, 0), duration);\n\t position = Math.min(position * 100 / duration, 100);\n\t this.container.seekPercentage(position);\n\t };\n\t\n\t MediaControl.prototype.bindKeyEvents = function bindKeyEvents() {\n\t var _this6 = this;\n\t\n\t this.unbindKeyEvents();\n\t this.kibo = new _vendor.Kibo(this.options.focusElement);\n\t this.kibo.down(['space'], function () {\n\t return _this6.togglePlayPause();\n\t });\n\t this.kibo.down(['left'], function () {\n\t return _this6.seekRelative(-15);\n\t });\n\t this.kibo.down(['right'], function () {\n\t return _this6.seekRelative(15);\n\t });\n\t var keys = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];\n\t keys.forEach(function (i) {\n\t _this6.kibo.down(i.toString(), function () {\n\t return _this6.settings.seekEnabled && _this6.container.seekPercentage(i * 10);\n\t });\n\t });\n\t };\n\t\n\t MediaControl.prototype.unbindKeyEvents = function unbindKeyEvents() {\n\t if (this.kibo) {\n\t this.kibo.off('space');\n\t this.kibo.off('left');\n\t this.kibo.off('right');\n\t this.kibo.off([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]);\n\t }\n\t };\n\t\n\t MediaControl.prototype.parseColors = function parseColors() {\n\t if (this.options.mediacontrol) {\n\t this.buttonsColor = this.options.mediacontrol.buttons;\n\t var seekbarColor = this.options.mediacontrol.seekbar;\n\t this.$el.find('.bar-fill-2[data-seekbar]').css('background-color', seekbarColor);\n\t this.$el.find('.media-control-icon svg path').css('fill', this.buttonsColor);\n\t this.$el.find('.segmented-bar-element[data-volume]').css('boxShadow', 'inset 2px 0 0 ' + this.buttonsColor);\n\t }\n\t };\n\t\n\t MediaControl.prototype.applyButtonStyle = function applyButtonStyle(element) {\n\t if (this.buttonsColor && element) {\n\t (0, _clapprZepto2.default)(element).find('svg path').css('fill', this.buttonsColor);\n\t }\n\t };\n\t\n\t MediaControl.prototype.destroy = function destroy() {\n\t this.remove();\n\t (0, _clapprZepto2.default)(document).unbind('mouseup', this.stopDragHandler);\n\t (0, _clapprZepto2.default)(document).unbind('mousemove', this.updateDragHandler);\n\t this.unbindKeyEvents();\n\t };\n\t\n\t MediaControl.prototype.render = function render() {\n\t var _this7 = this;\n\t\n\t var timeout = 1000;\n\t this.$el.html(this.template({ settings: this.settings }));\n\t this.$el.append(this.stylesheet);\n\t this.createCachedElements();\n\t this.$playPauseToggle.addClass('paused');\n\t this.$playStopToggle.addClass('stopped');\n\t\n\t this.changeTogglePlay();\n\t this.hideId = setTimeout(function () {\n\t return _this7.hide();\n\t }, timeout);\n\t if (this.disabled) {\n\t this.hide();\n\t }\n\t\n\t if (_browser2.default.isSafari && _browser2.default.isMobile) {\n\t this.$volumeContainer.css('display', 'none');\n\t }\n\t\n\t this.$seekBarPosition.addClass('media-control-notransition');\n\t this.$seekBarScrubber.addClass('media-control-notransition');\n\t\n\t var previousSeekPercentage = 0;\n\t if (this.displayedSeekBarPercentage) {\n\t previousSeekPercentage = this.displayedSeekBarPercentage;\n\t }\n\t this.displayedSeekBarPercentage = null;\n\t this.setSeekPercentage(previousSeekPercentage);\n\t\n\t process.nextTick(function () {\n\t if (!_this7.settings.seekEnabled) {\n\t _this7.$seekBarContainer.addClass('seek-disabled');\n\t }\n\t if (!_this7.options.disableKeyboardShortcuts) {\n\t _this7.bindKeyEvents();\n\t }\n\t _this7.playerResize({ width: _this7.options.width, height: _this7.options.height });\n\t _this7.hideVolumeBar(0);\n\t });\n\t\n\t this.parseColors();\n\t this.highDefinitionUpdate();\n\t\n\t this.rendered = true;\n\t this.updateVolumeUI();\n\t this.trigger(_events2.default.MEDIACONTROL_RENDERED);\n\t return this;\n\t };\n\t\n\t return MediaControl;\n\t}(_ui_object2.default);\n\t\n\texports.default = MediaControl;\n\t\n\t\n\tMediaControl.extend = function (properties) {\n\t return (0, _utils.extend)(MediaControl, properties);\n\t};\n\tmodule.exports = exports['default'];\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./~/process/browser.js */ 21)))\n\n/***/ },\n/* 46 */\n/*!**********************************!*\\\n !*** ./src/components/player.js ***!\n \\**********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _base_object = __webpack_require__(/*! base/base_object */ 9);\n\t\n\tvar _base_object2 = _interopRequireDefault(_base_object);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _core_factory = __webpack_require__(/*! components/core_factory */ 43);\n\t\n\tvar _core_factory2 = _interopRequireDefault(_core_factory);\n\t\n\tvar _loader = __webpack_require__(/*! components/loader */ 26);\n\t\n\tvar _loader2 = _interopRequireDefault(_loader);\n\t\n\tvar _player_info = __webpack_require__(/*! components/player_info */ 15);\n\t\n\tvar _player_info2 = _interopRequireDefault(_player_info);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar baseUrl = (0, _utils.currentScriptUrl)().replace(/\\/[^\\/]+$/, '');\n\t\n\t/**\n\t * @class Player\n\t * @constructor\n\t * @extends BaseObject\n\t * @module components\n\t * @example\n\t * ### Using the Player\n\t *\n\t * Add the following script on your HTML:\n\t * ```html\n\t * <head>\n\t * <script type=\"text/javascript\" src=\"http://cdn.clappr.io/latest/clappr.min.js\"></script>\n\t * </head>\n\t * ```\n\t * Now, create the player:\n\t * ```html\n\t * <body>\n\t * <div id=\"player\"></div>\n\t * <script>\n\t * var player = new Clappr.Player({source: \"http://your.video/here.mp4\", parentId: \"#player\"});\n\t * </script>\n\t * </body>\n\t * ```\n\t */\n\t\n\tvar Player = function (_BaseObject) {\n\t _inherits(Player, _BaseObject);\n\t\n\t _createClass(Player, [{\n\t key: 'loader',\n\t set: function set(loader) {\n\t this._loader = loader;\n\t },\n\t get: function get() {\n\t if (!this._loader) {\n\t this._loader = new _loader2.default(this.options.plugins || {}, this.options.playerId);\n\t }\n\t return this._loader;\n\t }\n\t\n\t /**\n\t * Determine if the playback has ended.\n\t * @property ended\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'ended',\n\t get: function get() {\n\t return this.core.mediaControl.container.ended;\n\t }\n\t\n\t /**\n\t * Determine if the playback is having to buffer in order for\n\t * playback to be smooth.\n\t * (i.e if a live stream is playing smoothly, this will be false)\n\t * @property buffering\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'buffering',\n\t get: function get() {\n\t return this.core.mediaControl.container.buffering;\n\t }\n\t\n\t /*\n\t * determine if the player is ready.\n\t * @property isReady\n\t * @type {Boolean} `true` if the player is ready. ie PLAYER_READY event has fired\n\t */\n\t\n\t }, {\n\t key: 'isReady',\n\t get: function get() {\n\t return !!this._ready;\n\t }\n\t\n\t /**\n\t * An events map that allows the user to add custom callbacks in player's options.\n\t * @property eventsMapping\n\t * @type {Object}\n\t */\n\t\n\t }, {\n\t key: 'eventsMapping',\n\t get: function get() {\n\t return {\n\t onReady: _events2.default.PLAYER_READY,\n\t onResize: _events2.default.PLAYER_RESIZE,\n\t onPlay: _events2.default.PLAYER_PLAY,\n\t onPause: _events2.default.PLAYER_PAUSE,\n\t onStop: _events2.default.PLAYER_STOP,\n\t onEnded: _events2.default.PLAYER_ENDED,\n\t onSeek: _events2.default.PLAYER_SEEK,\n\t onError: _events2.default.PLAYER_ERROR,\n\t onTimeUpdate: _events2.default.PLAYER_TIMEUPDATE,\n\t onVolumeUpdate: _events2.default.PLAYER_VOLUMEUPDATE\n\t };\n\t }\n\t\n\t /**\n\t * ## Player's constructor\n\t *\n\t * You might pass the options object to build the player.\n\t * ```javascript\n\t * var options = {source: \"http://example.com/video.mp4\", param1: \"val1\"};\n\t * var player = new Clappr.Player(options);\n\t * ```\n\t *\n\t * @method constructor\n\t * @param {Object} options Data\n\t * options to build a player instance\n\t * @param {Number} [options.width]\n\t * player's width **default**: `640`\n\t * @param {Number} [options.height]\n\t * player's height **default**: `360`\n\t * @param {String} [options.parentId]\n\t * the id of the element on the page that the player should be inserted into\n\t * @param {Object} [options.parent]\n\t * a reference to a dom element that the player should be inserted into\n\t * @param {String} [options.source]\n\t * The media source URL, or {source: <<source URL>>, mimeType: <<source mime type>>}\n\t * @param {Object} [options.sources]\n\t * An array of media source URL's, or an array of {source: <<source URL>>, mimeType: <<source mime type>>}\n\t * @param {Boolean} [options.autoPlay]\n\t * automatically play after page load **default**: `false`\n\t * @param {Boolean} [options.loop]\n\t * automatically replay after it ends **default**: `false`\n\t * @param {Boolean} [options.chromeless]\n\t * player acts in chromeless mode **default**: `false`\n\t * @param {Boolean} [options.allowUserInteraction]\n\t * whether or not the player should handle click events when in chromeless mode **default**: `false` on desktops browsers, `true` on mobile.\n\t * @param {Boolean} [options.disableKeyboardShortcuts]\n\t * disable keyboard shortcuts. **default**: `false`. `true` if `allowUserInteraction` is `false`.\n\t * @param {Boolean} [options.muted]\n\t * start the video muted **default**: `false`\n\t * @param {String} [options.mimeType]\n\t * add `mimeType: \"application/vnd.apple.mpegurl\"` if you need to use a url without extension.\n\t * @param {String} [options.actualLiveTime]\n\t * show duration and seek time relative to actual time.\n\t * @param {String} [options.actualLiveServerTime]\n\t * specify server time as a string, format: \"2015/11/26 06:01:03\". This option is meant to be used with actualLiveTime.\n\t * @param {Boolean} [options.persistConfig]\n\t * persist player's settings (volume) through the same domain **default**: `true`\n\t * @param {String} [options.preload]\n\t * video will be preloaded according to `preload` attribute options **default**: `'metadata'`\n\t * @param {Number} [options.maxBufferLength]\n\t * the default behavior for the **HLS playback** is to keep buffering indefinitely, even on VoD.\n\t * This replicates the behavior for progressive download, which continues buffering when pausing the video, thus making the video available for playback even on slow networks.\n\t * To change this behavior use `maxBufferLength` where **value is in seconds**.\n\t * @param {String} [options.gaAccount]\n\t * enable Google Analytics events dispatch **(play/pause/stop/buffering/etc)** by adding your `gaAccount`\n\t * @param {String} [options.gaTrackerName]\n\t * besides `gaAccount` you can optionally, pass your favorite trackerName as `gaTrackerName`\n\t * @param {Object} [options.mediacontrol]\n\t * customize control bar colors, example: `mediacontrol: {seekbar: \"#E113D3\", buttons: \"#66B2FF\"}`\n\t * @param {Boolean} [options.hideMediaControl]\n\t * control media control auto hide **default**: `true`\n\t * @param {Boolean} [options.hideVolumeBar]\n\t * when embedded with width less than 320, volume bar will hide. You can force this behavior for all sizes by adding `true` **default**: `false`\n\t * @param {String} [options.watermark]\n\t * put `watermark: 'http://url/img.png'` on your embed parameters to automatically add watermark on your video.\n\t * You can customize corner position by defining position parameter. Positions can be `bottom-left`, `bottom-right`, `top-left` and `top-right`.\n\t * @param {String} [options.watermarkLink]\n\t * `watermarkLink: 'http://example.net/'` - define URL to open when the watermark is clicked. If not provided watermark will not be clickable.\n\t * @param {Boolean} [options.disableVideoTagContextMenu]\n\t * disables the context menu (right click) on the video element if a HTML5Video playback is used.\n\t * @param {Boolean} [options.autoSeekFromUrl]\n\t * Automatically seek to the seconds provided in the url (e.g example.com?t=100) **default**: `true`\n\t * @param {Boolean} [options.exitFullscreenOnEnd]\n\t * Automatically exit full screen when the media finishes. **default**: `true`\n\t * @param {String} [options.poster]\n\t * define a poster by adding its address `poster: 'http://url/img.png'`. It will appear after video embed, disappear on play and go back when user stops the video.\n\t * @param {String} [options.playbackNotSupportedMessage]\n\t * define a custom message to be displayed when a playback is not supported.\n\t * @param {Object} [options.events]\n\t * Specify listeners which will be registered with their corresponding player events.\n\t * E.g. onReady -> \"PLAYER_READY\", onTimeUpdate -> \"PLAYER_TIMEUPDATE\"\n\t */\n\t\n\t }]);\n\t\n\t function Player(options) {\n\t _classCallCheck(this, Player);\n\t\n\t var _this = _possibleConstructorReturn(this, _BaseObject.call(this, options));\n\t\n\t var defaultOptions = { playerId: (0, _utils.uniqueId)(''), persistConfig: true, width: 640, height: 360, baseUrl: baseUrl, allowUserInteraction: _browser2.default.isMobile };\n\t _this._options = _clapprZepto2.default.extend(defaultOptions, options);\n\t _this.options.sources = _this._normalizeSources(options);\n\t if (!_this.options.chromeless) {\n\t // \"allowUserInteraction\" cannot be false if not in chromeless mode.\n\t _this.options.allowUserInteraction = true;\n\t }\n\t if (!_this.options.allowUserInteraction) {\n\t // if user iteraction is not allowed ensure keyboard shortcuts are disabled\n\t _this.options.disableKeyboardShortcuts = true;\n\t }\n\t _this._registerOptionEventListeners();\n\t _this._coreFactory = new _core_factory2.default(_this);\n\t _this.playerInfo = _player_info2.default.getInstance(_this.options.playerId);\n\t _this.playerInfo.currentSize = { width: options.width, height: options.height };\n\t _this.playerInfo.options = _this.options;\n\t if (_this.options.parentId) {\n\t _this.setParentId(_this.options.parentId);\n\t } else if (_this.options.parent) {\n\t _this.attachTo(_this.options.parent);\n\t }\n\t return _this;\n\t }\n\t\n\t /**\n\t * Specify a `parentId` to the player.\n\t * @method setParentId\n\t * @param {String} parentId the element parent id.\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.setParentId = function setParentId(parentId) {\n\t var el = document.querySelector(parentId);\n\t if (el) {\n\t this.attachTo(el);\n\t }\n\t return this;\n\t };\n\t\n\t /**\n\t * You can use this method to attach the player to a given element. You don't need to do this when you specify it during the player instantiation passing the `parentId` param.\n\t * @method attachTo\n\t * @param {Object} element a given element.\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.attachTo = function attachTo(element) {\n\t this.options.parentElement = element;\n\t this.core = this._coreFactory.create();\n\t this._addEventListeners();\n\t return this;\n\t };\n\t\n\t Player.prototype._addEventListeners = function _addEventListeners() {\n\t if (!this.core.isReady) {\n\t this.listenToOnce(this.core, _events2.default.CORE_READY, this._onReady);\n\t } else {\n\t this._onReady();\n\t }\n\t this.listenTo(this.core.mediaControl, _events2.default.MEDIACONTROL_CONTAINERCHANGED, this._containerChanged);\n\t this.listenTo(this.core, _events2.default.CORE_FULLSCREEN, this._onFullscreenChange);\n\t return this;\n\t };\n\t\n\t Player.prototype._addContainerEventListeners = function _addContainerEventListeners() {\n\t var container = this.core.mediaControl.container;\n\t if (container) {\n\t this.listenTo(container, _events2.default.CONTAINER_PLAY, this._onPlay);\n\t this.listenTo(container, _events2.default.CONTAINER_PAUSE, this._onPause);\n\t this.listenTo(container, _events2.default.CONTAINER_STOP, this._onStop);\n\t this.listenTo(container, _events2.default.CONTAINER_ENDED, this._onEnded);\n\t this.listenTo(container, _events2.default.CONTAINER_SEEK, this._onSeek);\n\t this.listenTo(container, _events2.default.CONTAINER_ERROR, this._onError);\n\t this.listenTo(container, _events2.default.CONTAINER_TIMEUPDATE, this._onTimeUpdate);\n\t this.listenTo(container, _events2.default.CONTAINER_VOLUME, this._onVolumeUpdate);\n\t }\n\t return this;\n\t };\n\t\n\t Player.prototype._registerOptionEventListeners = function _registerOptionEventListeners() {\n\t var _this2 = this;\n\t\n\t var userEvents = this.options.events || {};\n\t Object.keys(userEvents).forEach(function (userEvent) {\n\t var eventType = _this2.eventsMapping[userEvent];\n\t if (eventType) {\n\t var eventFunction = userEvents[userEvent];\n\t eventFunction = typeof eventFunction === 'function' && eventFunction;\n\t eventFunction && _this2.on(eventType, eventFunction);\n\t }\n\t });\n\t return this;\n\t };\n\t\n\t Player.prototype._containerChanged = function _containerChanged() {\n\t this.stopListening();\n\t this._addEventListeners();\n\t };\n\t\n\t Player.prototype._onReady = function _onReady() {\n\t this._ready = true;\n\t this._addContainerEventListeners();\n\t this.trigger(_events2.default.PLAYER_READY);\n\t };\n\t\n\t Player.prototype._onFullscreenChange = function _onFullscreenChange(fullscreen) {\n\t this.trigger(_events2.default.PLAYER_FULLSCREEN, fullscreen);\n\t };\n\t\n\t Player.prototype._onVolumeUpdate = function _onVolumeUpdate(volume) {\n\t this.trigger(_events2.default.PLAYER_VOLUMEUPDATE, volume);\n\t };\n\t\n\t Player.prototype._onPlay = function _onPlay() {\n\t this.trigger(_events2.default.PLAYER_PLAY);\n\t };\n\t\n\t Player.prototype._onPause = function _onPause() {\n\t this.trigger(_events2.default.PLAYER_PAUSE);\n\t };\n\t\n\t Player.prototype._onStop = function _onStop() {\n\t this.trigger(_events2.default.PLAYER_STOP, this.getCurrentTime());\n\t };\n\t\n\t Player.prototype._onEnded = function _onEnded() {\n\t this.trigger(_events2.default.PLAYER_ENDED);\n\t };\n\t\n\t Player.prototype._onSeek = function _onSeek(time) {\n\t this.trigger(_events2.default.PLAYER_SEEK, time);\n\t };\n\t\n\t Player.prototype._onTimeUpdate = function _onTimeUpdate(timeProgress) {\n\t this.trigger(_events2.default.PLAYER_TIMEUPDATE, timeProgress);\n\t };\n\t\n\t Player.prototype._onError = function _onError(error) {\n\t this.trigger(_events2.default.PLAYER_ERROR, error);\n\t };\n\t\n\t Player.prototype._normalizeSources = function _normalizeSources(options) {\n\t var sources = options.sources || (options.source !== undefined ? [options.source] : []);\n\t return sources.length === 0 ? [{ source: '', mimeType: '' }] : sources;\n\t };\n\t\n\t /**\n\t * resizes the current player canvas.\n\t * @method resize\n\t * @param {Object} size should be a literal object with `height` and `width`.\n\t * @return {Player} itself\n\t * @example\n\t * ```javascript\n\t * player.resize({height: 360, width: 640})\n\t * ```\n\t */\n\t\n\t\n\t Player.prototype.resize = function resize(size) {\n\t this.core.resize(size);\n\t return this;\n\t };\n\t\n\t /**\n\t * loads a new source.\n\t * @method load\n\t * @param {Array|String} sources source or sources of video.\n\t * An array item can be a string or {source: <<source URL>>, mimeType: <<source mime type>>}\n\t * @param {String} mimeType a mime type, example: `'application/vnd.apple.mpegurl'`\n\t * @param {Boolean} [autoPlay=false] whether playing should be started immediately\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.load = function load(sources, mimeType, autoPlay) {\n\t if (autoPlay !== undefined) {\n\t this.configure({ autoPlay: !!autoPlay });\n\t }\n\t this.core.load(sources, mimeType);\n\t return this;\n\t };\n\t\n\t /**\n\t * destroys the current player and removes it from the DOM.\n\t * @method destroy\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.destroy = function destroy() {\n\t this.core.destroy();\n\t return this;\n\t };\n\t\n\t /**\n\t * plays the current video (`source`).\n\t * @method play\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.play = function play() {\n\t this.core.mediaControl.container.play();\n\t return this;\n\t };\n\t\n\t /**\n\t * pauses the current video (`source`).\n\t * @method pause\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.pause = function pause() {\n\t this.core.mediaControl.container.pause();\n\t return this;\n\t };\n\t\n\t /**\n\t * stops the current video (`source`).\n\t * @method stop\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.stop = function stop() {\n\t this.core.mediaControl.container.stop();\n\t return this;\n\t };\n\t\n\t /**\n\t * seeks the current video (`source`). For example, `player.seek(120)` will seek to second 120 (2minutes) of the current video.\n\t * @method seek\n\t * @param {Number} time should be a number between 0 and the video duration.\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.seek = function seek(time) {\n\t this.core.mediaControl.container.seek(time);\n\t return this;\n\t };\n\t\n\t /**\n\t * seeks the current video (`source`). For example, `player.seek(50)` will seek to the middle of the current video.\n\t * @method seekPercentage\n\t * @param {Number} time should be a number between 0 and 100.\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.seekPercentage = function seekPercentage(percentage) {\n\t this.core.mediaControl.container.seekPercentage(percentage);\n\t return this;\n\t };\n\t\n\t /**\n\t * Set the volume for the current video (`source`).\n\t * @method setVolume\n\t * @param {Number} volume should be a number between 0 and 100, 0 being mute and 100 the max volume.\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.setVolume = function setVolume(volume) {\n\t if (this.core && this.core.mediaControl) {\n\t this.core.mediaControl.setVolume(volume);\n\t }\n\t return this;\n\t };\n\t\n\t /**\n\t * Get the volume for the current video\n\t * @method getVolume\n\t * @return {Number} volume should be a number between 0 and 100, 0 being mute and 100 the max volume.\n\t */\n\t\n\t\n\t Player.prototype.getVolume = function getVolume() {\n\t return this.core && this.core.mediaControl ? this.core.mediaControl.volume : 0;\n\t };\n\t\n\t /**\n\t * mutes the current video (`source`).\n\t * @method mute\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.mute = function mute() {\n\t this._mutedVolume = this.getVolume();\n\t this.setVolume(0);\n\t return this;\n\t };\n\t\n\t /**\n\t * unmutes the current video (`source`).\n\t * @method unmute\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.unmute = function unmute() {\n\t this.setVolume(typeof this._mutedVolume === 'number' ? this._mutedVolume : 100);\n\t this._mutedVolume = null;\n\t return this;\n\t };\n\t\n\t /**\n\t * checks if the player is playing.\n\t * @method isPlaying\n\t * @return {Boolean} `true` if the current source is playing, otherwise `false`\n\t */\n\t\n\t\n\t Player.prototype.isPlaying = function isPlaying() {\n\t return this.core.mediaControl.container.isPlaying();\n\t };\n\t\n\t /**\n\t * returns `true` if DVR is enable otherwise `false`.\n\t * @method isDvrEnabled\n\t * @return {Boolean}\n\t */\n\t\n\t\n\t Player.prototype.isDvrEnabled = function isDvrEnabled() {\n\t return this.core.mediaControl.container.isDvrEnabled();\n\t };\n\t\n\t /**\n\t * returns `true` if DVR is in use otherwise `false`.\n\t * @method isDvrInUse\n\t * @return {Boolean}\n\t */\n\t\n\t\n\t Player.prototype.isDvrInUse = function isDvrInUse() {\n\t return this.core.mediaControl.container.isDvrInUse();\n\t };\n\t\n\t /**\n\t * enables to configure a player after its creation\n\t * @method configure\n\t * @param {Object} options all the options to change in form of a javascript object\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.configure = function configure(options) {\n\t this.core.configure(options);\n\t return this;\n\t };\n\t\n\t /**\n\t * get a plugin by its name.\n\t * @method getPlugin\n\t * @param {String} name of the plugin.\n\t * @return {Object} the plugin instance\n\t * @example\n\t * ```javascript\n\t * var poster = player.getPlugin('poster');\n\t * poster.hidePlayButton();\n\t * ```\n\t */\n\t\n\t\n\t Player.prototype.getPlugin = function getPlugin(name) {\n\t var plugins = this.core.plugins.concat(this.core.mediaControl.container.plugins);\n\t return plugins.filter(function (plugin) {\n\t return plugin.name === name;\n\t })[0];\n\t };\n\t\n\t /**\n\t * the current time in seconds.\n\t * @method getCurrentTime\n\t * @return {Number} current time (in seconds) of the current source\n\t */\n\t\n\t\n\t Player.prototype.getCurrentTime = function getCurrentTime() {\n\t return this.core.mediaControl.container.getCurrentTime();\n\t };\n\t\n\t /**\n\t * The time that \"0\" now represents relative to when playback started.\n\t * For a stream with a sliding window this will increase as content is\n\t * removed from the beginning.\n\t * @method getStartTimeOffset\n\t * @return {Number} time (in seconds) that time \"0\" represents.\n\t */\n\t\n\t\n\t Player.prototype.getStartTimeOffset = function getStartTimeOffset() {\n\t return this.core.mediaControl.container.getStartTimeOffset();\n\t };\n\t\n\t /**\n\t * the duration time in seconds.\n\t * @method getDuration\n\t * @return {Number} duration time (in seconds) of the current source\n\t */\n\t\n\t\n\t Player.prototype.getDuration = function getDuration() {\n\t return this.core.mediaControl.container.getDuration();\n\t };\n\t\n\t return Player;\n\t}(_base_object2.default);\n\t\n\texports.default = Player;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 47 */\n/*!******************************************************************!*\\\n !*** ./src/playbacks/base_flash_playback/base_flash_playback.js ***!\n \\******************************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _flash = __webpack_require__(/*! ./public/flash.html */ 92);\n\t\n\tvar _flash2 = _interopRequireDefault(_flash);\n\t\n\tvar _flash3 = __webpack_require__(/*! ./public/flash.scss */ 81);\n\t\n\tvar _flash4 = _interopRequireDefault(_flash3);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2015 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar IE_CLASSID = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';\n\t\n\tvar BaseFlashPlayback = function (_Playback) {\n\t _inherits(BaseFlashPlayback, _Playback);\n\t\n\t function BaseFlashPlayback() {\n\t _classCallCheck(this, BaseFlashPlayback);\n\t\n\t return _possibleConstructorReturn(this, _Playback.apply(this, arguments));\n\t }\n\t\n\t BaseFlashPlayback.prototype.setElement = function setElement(element) {\n\t this.$el = element;\n\t this.el = element[0];\n\t };\n\t\n\t BaseFlashPlayback.prototype._setupFirefox = function _setupFirefox() {\n\t var $el = this.$('embed');\n\t $el.attr('data-flash-playback', this.name);\n\t $el.addClass(this.attributes.class);\n\t this.setElement($el);\n\t };\n\t\n\t BaseFlashPlayback.prototype.render = function render() {\n\t this.$el.html(this.template({\n\t cid: this.cid,\n\t swfPath: this.swfPath,\n\t baseUrl: this.baseUrl,\n\t playbackId: this.uniqueId,\n\t wmode: this.wmode,\n\t callbackName: 'window.Clappr.flashlsCallbacks.' + this.cid }));\n\t\n\t if (_browser2.default.isIE) {\n\t this.$('embed').remove();\n\t\n\t if (_browser2.default.isLegacyIE) {\n\t this.$el.attr('classid', IE_CLASSID);\n\t }\n\t }\n\t\n\t if (_browser2.default.isFirefox) {\n\t this._setupFirefox();\n\t }\n\t\n\t this.el.id = this.cid;\n\t this.$el.append(_styler2.default.getStyleFor(_flash4.default));\n\t\n\t return this;\n\t };\n\t\n\t _createClass(BaseFlashPlayback, [{\n\t key: 'tagName',\n\t get: function get() {\n\t return 'object';\n\t }\n\t }, {\n\t key: 'swfPath',\n\t get: function get() {\n\t return '';\n\t }\n\t }, {\n\t key: 'wmode',\n\t get: function get() {\n\t return 'transparent';\n\t }\n\t }, {\n\t key: 'template',\n\t get: function get() {\n\t return (0, _template2.default)(_flash2.default);\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t var type = 'application/x-shockwave-flash';\n\t\n\t if (_browser2.default.isLegacyIE) {\n\t type = '';\n\t }\n\t\n\t return {\n\t class: 'clappr-flash-playback',\n\t type: type,\n\t width: '100%',\n\t height: '100%',\n\t 'data-flash-playback': this.name\n\t };\n\t }\n\t }]);\n\t\n\t return BaseFlashPlayback;\n\t}(_playback2.default);\n\t\n\texports.default = BaseFlashPlayback;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 48 */\n/*!**************************************!*\\\n !*** ./src/playbacks/flash/flash.js ***!\n \\**************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _base_flash_playback = __webpack_require__(/*! playbacks/base_flash_playback */ 18);\n\t\n\tvar _base_flash_playback2 = _interopRequireDefault(_base_flash_playback);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _mediator = __webpack_require__(/*! components/mediator */ 11);\n\t\n\tvar _mediator2 = _interopRequireDefault(_mediator);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _Player = __webpack_require__(/*! ./public/Player.swf */ 111);\n\t\n\tvar _Player2 = _interopRequireDefault(_Player);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar MAX_ATTEMPTS = 60;\n\t\n\tvar Flash = function (_BaseFlashPlayback) {\n\t _inherits(Flash, _BaseFlashPlayback);\n\t\n\t _createClass(Flash, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'flash';\n\t }\n\t }, {\n\t key: 'swfPath',\n\t get: function get() {\n\t return (0, _template2.default)(_Player2.default)({ baseUrl: this._baseUrl });\n\t }\n\t\n\t /**\n\t * Determine if the playback has ended.\n\t * @property ended\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'ended',\n\t get: function get() {\n\t return this._currentState === 'ENDED';\n\t }\n\t\n\t /**\n\t * Determine if the playback is buffering.\n\t * This is related to the PLAYBACK_BUFFERING and PLAYBACK_BUFFERFULL events\n\t * @property buffering\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'buffering',\n\t get: function get() {\n\t return !!this._bufferingState && this._currentState !== 'ENDED';\n\t }\n\t }]);\n\t\n\t function Flash() {\n\t _classCallCheck(this, Flash);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var _this = _possibleConstructorReturn(this, _BaseFlashPlayback.call.apply(_BaseFlashPlayback, [this].concat(args)));\n\t\n\t _this._src = _this.options.src;\n\t _this._baseUrl = _this.options.baseUrl;\n\t _this._autoPlay = _this.options.autoPlay;\n\t _this.settings = { default: ['seekbar'] };\n\t _this.settings.left = ['playpause', 'position', 'duration'];\n\t _this.settings.right = ['fullscreen', 'volume'];\n\t _this.settings.seekEnabled = true;\n\t _this._isReadyState = false;\n\t _this._addListeners();\n\t return _this;\n\t }\n\t\n\t Flash.prototype._bootstrap = function _bootstrap() {\n\t var _this2 = this;\n\t\n\t if (this.el.playerPlay) {\n\t this.el.width = '100%';\n\t this.el.height = '100%';\n\t if (this._currentState === 'PLAYING') {\n\t this._firstPlay();\n\t } else {\n\t this._currentState = 'IDLE';\n\t this._autoPlay && this.play();\n\t }\n\t (0, _clapprZepto2.default)('<div style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%\" />').insertAfter(this.$el);\n\t if (this.getDuration() > 0) {\n\t this._metadataLoaded();\n\t } else {\n\t _mediator2.default.once(this.uniqueId + ':timeupdate', this._metadataLoaded, this);\n\t }\n\t } else {\n\t this._attempts = this._attempts || 0;\n\t if (++this._attempts <= MAX_ATTEMPTS) {\n\t setTimeout(function () {\n\t return _this2._bootstrap();\n\t }, 50);\n\t } else {\n\t this.trigger(_events2.default.PLAYBACK_ERROR, { message: 'Max number of attempts reached' }, this.name);\n\t }\n\t }\n\t };\n\t\n\t Flash.prototype._metadataLoaded = function _metadataLoaded() {\n\t this._isReadyState = true;\n\t this.trigger(_events2.default.PLAYBACK_READY, this.name);\n\t this.trigger(_events2.default.PLAYBACK_SETTINGSUPDATE, this.name);\n\t };\n\t\n\t Flash.prototype.getPlaybackType = function getPlaybackType() {\n\t return _playback2.default.VOD;\n\t };\n\t\n\t Flash.prototype.isHighDefinitionInUse = function isHighDefinitionInUse() {\n\t return false;\n\t };\n\t\n\t Flash.prototype._updateTime = function _updateTime() {\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: this.el.getPosition(), total: this.el.getDuration() }, this.name);\n\t };\n\t\n\t Flash.prototype._addListeners = function _addListeners() {\n\t _mediator2.default.on(this.uniqueId + ':progress', this._progress, this);\n\t _mediator2.default.on(this.uniqueId + ':timeupdate', this._updateTime, this);\n\t _mediator2.default.on(this.uniqueId + ':statechanged', this._checkState, this);\n\t _mediator2.default.on(this.uniqueId + ':flashready', this._bootstrap, this);\n\t };\n\t\n\t Flash.prototype.stopListening = function stopListening() {\n\t _BaseFlashPlayback.prototype.stopListening.call(this);\n\t _mediator2.default.off(this.uniqueId + ':progress');\n\t _mediator2.default.off(this.uniqueId + ':timeupdate');\n\t _mediator2.default.off(this.uniqueId + ':statechanged');\n\t _mediator2.default.off(this.uniqueId + ':flashready');\n\t };\n\t\n\t Flash.prototype._checkState = function _checkState() {\n\t if (this._isIdle || this._currentState === 'PAUSED') {\n\t return;\n\t } else if (this._currentState !== 'PLAYING_BUFFERING' && this.el.getState() === 'PLAYING_BUFFERING') {\n\t this._bufferingState = true;\n\t this.trigger(_events2.default.PLAYBACK_BUFFERING, this.name);\n\t this._currentState = 'PLAYING_BUFFERING';\n\t } else if (this.el.getState() === 'PLAYING') {\n\t this._bufferingState = false;\n\t this.trigger(_events2.default.PLAYBACK_BUFFERFULL, this.name);\n\t this._currentState = 'PLAYING';\n\t } else if (this.el.getState() === 'IDLE') {\n\t this._currentState = 'IDLE';\n\t } else if (this.el.getState() === 'ENDED') {\n\t this.trigger(_events2.default.PLAYBACK_ENDED, this.name);\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: 0, total: this.el.getDuration() }, this.name);\n\t this._currentState = 'ENDED';\n\t this._isIdle = true;\n\t }\n\t };\n\t\n\t Flash.prototype._progress = function _progress() {\n\t if (this._currentState !== 'IDLE' && this._currentState !== 'ENDED') {\n\t this.trigger(_events2.default.PLAYBACK_PROGRESS, {\n\t start: 0,\n\t current: this.el.getBytesLoaded(),\n\t total: this.el.getBytesTotal()\n\t });\n\t }\n\t };\n\t\n\t Flash.prototype._firstPlay = function _firstPlay() {\n\t var _this3 = this;\n\t\n\t if (this.el.playerPlay) {\n\t this._isIdle = false;\n\t this.el.playerPlay(this._src);\n\t this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {\n\t return _this3._checkInitialSeek();\n\t });\n\t this._currentState = 'PLAYING';\n\t } else {\n\t this.listenToOnce(this, _events2.default.PLAYBACK_READY, this._firstPlay);\n\t }\n\t };\n\t\n\t Flash.prototype._checkInitialSeek = function _checkInitialSeek() {\n\t var seekTime = (0, _utils.seekStringToSeconds)(window.location.href);\n\t if (seekTime !== 0) {\n\t this.seekSeconds(seekTime);\n\t }\n\t };\n\t\n\t Flash.prototype.play = function play() {\n\t this.trigger(_events2.default.PLAYBACK_PLAY_INTENT);\n\t if (this._currentState === 'PAUSED' || this._currentState === 'PLAYING_BUFFERING') {\n\t this._currentState = 'PLAYING';\n\t this.el.playerResume();\n\t this.trigger(_events2.default.PLAYBACK_PLAY, this.name);\n\t } else if (this._currentState !== 'PLAYING') {\n\t this._firstPlay();\n\t this.trigger(_events2.default.PLAYBACK_PLAY, this.name);\n\t }\n\t };\n\t\n\t Flash.prototype.volume = function volume(value) {\n\t var _this4 = this;\n\t\n\t if (this.isReady) {\n\t this.el.playerVolume(value);\n\t } else {\n\t this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {\n\t return _this4.volume(value);\n\t });\n\t }\n\t };\n\t\n\t Flash.prototype.pause = function pause() {\n\t this._currentState = 'PAUSED';\n\t this.el.playerPause();\n\t this.trigger(_events2.default.PLAYBACK_PAUSE, this.name);\n\t };\n\t\n\t Flash.prototype.stop = function stop() {\n\t this.el.playerStop();\n\t this.trigger(_events2.default.PLAYBACK_STOP);\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: 0, total: 0 }, this.name);\n\t };\n\t\n\t Flash.prototype.isPlaying = function isPlaying() {\n\t return !!(this.isReady && this._currentState.indexOf('PLAYING') > -1);\n\t };\n\t\n\t Flash.prototype.getDuration = function getDuration() {\n\t return this.el.getDuration();\n\t };\n\t\n\t Flash.prototype.seekPercentage = function seekPercentage(percentage) {\n\t var _this5 = this;\n\t\n\t if (this.el.getDuration() > 0) {\n\t var seekSeconds = this.el.getDuration() * (percentage / 100);\n\t this.seek(seekSeconds);\n\t } else {\n\t this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {\n\t return _this5.seekPercentage(percentage);\n\t });\n\t }\n\t };\n\t\n\t Flash.prototype.seek = function seek(time) {\n\t var _this6 = this;\n\t\n\t if (this.isReady && this.el.playerSeek) {\n\t this.el.playerSeek(time);\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: time, total: this.el.getDuration() }, this.name);\n\t if (this._currentState === 'PAUSED') {\n\t this.el.playerPause();\n\t }\n\t } else {\n\t this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {\n\t return _this6.seek(time);\n\t });\n\t }\n\t };\n\t\n\t Flash.prototype.destroy = function destroy() {\n\t clearInterval(this.bootstrapId);\n\t _BaseFlashPlayback.prototype.stopListening.call(this);\n\t this.$el.remove();\n\t };\n\t\n\t _createClass(Flash, [{\n\t key: 'isReady',\n\t get: function get() {\n\t return this._isReadyState;\n\t }\n\t }]);\n\t\n\t return Flash;\n\t}(_base_flash_playback2.default);\n\t\n\texports.default = Flash;\n\t\n\t\n\tFlash.canPlay = function (resource) {\n\t if (!_browser2.default.hasFlash || !resource || resource.constructor !== String) {\n\t return false;\n\t } else {\n\t var resourceParts = resource.split('?')[0].match(/.*\\.(.*)$/) || [];\n\t return resourceParts.length > 1 && !_browser2.default.isMobile && resourceParts[1].toLowerCase().match(/^(mp4|mov|f4v|3gpp|3gp)$/);\n\t }\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 49 */\n/*!******************************************!*\\\n !*** ./src/playbacks/flashls/flashls.js ***!\n \\******************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _base_flash_playback = __webpack_require__(/*! playbacks/base_flash_playback */ 18);\n\t\n\tvar _base_flash_playback2 = _interopRequireDefault(_base_flash_playback);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _mediator = __webpack_require__(/*! components/mediator */ 11);\n\t\n\tvar _mediator2 = _interopRequireDefault(_mediator);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _flashls_events = __webpack_require__(/*! ./flashls_events */ 50);\n\t\n\tvar _flashls_events2 = _interopRequireDefault(_flashls_events);\n\t\n\tvar _HLSPlayer = __webpack_require__(/*! ./public/HLSPlayer.swf */ 112);\n\t\n\tvar _HLSPlayer2 = _interopRequireDefault(_HLSPlayer);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar MAX_ATTEMPTS = 60;\n\tvar AUTO = -1;\n\t\n\tvar FlasHLS = function (_BaseFlashPlayback) {\n\t _inherits(FlasHLS, _BaseFlashPlayback);\n\t\n\t _createClass(FlasHLS, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'flashls';\n\t }\n\t }, {\n\t key: 'swfPath',\n\t get: function get() {\n\t return (0, _template2.default)(_HLSPlayer2.default)({ baseUrl: this._baseUrl });\n\t }\n\t }, {\n\t key: 'levels',\n\t get: function get() {\n\t return this._levels || [];\n\t }\n\t }, {\n\t key: 'currentLevel',\n\t get: function get() {\n\t if (this._currentLevel === null || this._currentLevel === undefined) {\n\t return AUTO;\n\t } else {\n\t return this._currentLevel; //0 is a valid level ID\n\t }\n\t },\n\t set: function set(id) {\n\t this._currentLevel = id;\n\t this.trigger(_events2.default.PLAYBACK_LEVEL_SWITCH_START);\n\t this.el.playerSetCurrentLevel(id);\n\t }\n\t\n\t /**\n\t * Determine if the playback has ended.\n\t * @property ended\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'ended',\n\t get: function get() {\n\t return this._hasEnded;\n\t }\n\t\n\t /**\n\t * Determine if the playback is buffering.\n\t * This is related to the PLAYBACK_BUFFERING and PLAYBACK_BUFFERFULL events\n\t * @property buffering\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'buffering',\n\t get: function get() {\n\t return !!this._bufferingState && !this._hasEnded;\n\t }\n\t }]);\n\t\n\t function FlasHLS() {\n\t _classCallCheck(this, FlasHLS);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var _this = _possibleConstructorReturn(this, _BaseFlashPlayback.call.apply(_BaseFlashPlayback, [this].concat(args)));\n\t\n\t _this._src = _this.options.src;\n\t _this._baseUrl = _this.options.baseUrl;\n\t _this._initHlsParameters(_this.options);\n\t // TODO can this be private?\n\t _this.highDefinition = false;\n\t _this._autoPlay = _this.options.autoPlay;\n\t _this._loop = _this.options.loop;\n\t _this._defaultSettings = {\n\t left: ['playstop'],\n\t default: ['seekbar'],\n\t right: ['fullscreen', 'volume', 'hd-indicator'],\n\t seekEnabled: false\n\t };\n\t _this.settings = _clapprZepto2.default.extend({}, _this._defaultSettings);\n\t _this._playbackType = _playback2.default.LIVE;\n\t _this._hasEnded = false;\n\t _this._addListeners();\n\t return _this;\n\t }\n\t\n\t FlasHLS.prototype._initHlsParameters = function _initHlsParameters(options) {\n\t this._autoStartLoad = options.autoStartLoad === undefined ? true : options.autoStartLoad;\n\t this._capLevelToStage = options.capLevelToStage === undefined ? false : options.capLevelToStage;\n\t this._maxLevelCappingMode = options.maxLevelCappingMode === undefined ? 'downscale' : options.maxLevelCappingMode;\n\t this._minBufferLength = options.minBufferLength === undefined ? -1 : options.minBufferLength;\n\t this._minBufferLengthCapping = options.minBufferLengthCapping === undefined ? -1 : options.minBufferLengthCapping;\n\t this._maxBufferLength = options.maxBufferLength === undefined ? 120 : options.maxBufferLength;\n\t this._maxBackBufferLength = options.maxBackBufferLength === undefined ? 30 : options.maxBackBufferLength;\n\t this._lowBufferLength = options.lowBufferLength === undefined ? 3 : options.lowBufferLength;\n\t this._mediaTimePeriod = options.mediaTimePeriod === undefined ? 100 : options.mediaTimePeriod;\n\t this._fpsDroppedMonitoringPeriod = options.fpsDroppedMonitoringPeriod === undefined ? 5000 : options.fpsDroppedMonitoringPeriod;\n\t this._fpsDroppedMonitoringThreshold = options.fpsDroppedMonitoringThreshold === undefined ? 0.2 : options.fpsDroppedMonitoringThreshold;\n\t this._capLevelonFPSDrop = options.capLevelonFPSDrop === undefined ? false : options.capLevelonFPSDrop;\n\t this._smoothAutoSwitchonFPSDrop = options.smoothAutoSwitchonFPSDrop === undefined ? this.capLevelonFPSDrop : options.smoothAutoSwitchonFPSDrop;\n\t this._switchDownOnLevelError = options.switchDownOnLevelError === undefined ? true : options.switchDownOnLevelError;\n\t this._seekMode = options.seekMode === undefined ? 'ACCURATE' : options.seekMode;\n\t this._keyLoadMaxRetry = options.keyLoadMaxRetry === undefined ? 3 : options.keyLoadMaxRetry;\n\t this._keyLoadMaxRetryTimeout = options.keyLoadMaxRetryTimeout === undefined ? 64000 : options.keyLoadMaxRetryTimeout;\n\t this._fragmentLoadMaxRetry = options.fragmentLoadMaxRetry === undefined ? 3 : options.fragmentLoadMaxRetry;\n\t this._fragmentLoadMaxRetryTimeout = options.fragmentLoadMaxRetryTimeout === undefined ? 4000 : options.fragmentLoadMaxRetryTimeout;\n\t this._fragmentLoadSkipAfterMaxRetry = options.fragmentLoadSkipAfterMaxRetry === undefined ? true : options.fragmentLoadSkipAfterMaxRetry;\n\t this._maxSkippedFragments = options.maxSkippedFragments === undefined ? 5 : options.maxSkippedFragments;\n\t this._flushLiveURLCache = options.flushLiveURLCache === undefined ? false : options.flushLiveURLCache;\n\t this._initialLiveManifestSize = options.initialLiveManifestSize === undefined ? 1 : options.initialLiveManifestSize;\n\t this._manifestLoadMaxRetry = options.manifestLoadMaxRetry === undefined ? 3 : options.manifestLoadMaxRetry;\n\t this._manifestLoadMaxRetryTimeout = options.manifestLoadMaxRetryTimeout === undefined ? 64000 : options.manifestLoadMaxRetryTimeout;\n\t this._manifestRedundantLoadmaxRetry = options.manifestRedundantLoadmaxRetry === undefined ? 3 : options.manifestRedundantLoadmaxRetry;\n\t this._startFromBitrate = options.startFromBitrate === undefined ? -1 : options.startFromBitrate;\n\t this._startFromLevel = options.startFromLevel === undefined ? -1 : options.startFromLevel;\n\t this._autoStartMaxDuration = options.autoStartMaxDuration === undefined ? -1 : options.autoStartMaxDuration;\n\t this._seekFromLevel = options.seekFromLevel === undefined ? -1 : options.seekFromLevel;\n\t this._useHardwareVideoDecoder = options.useHardwareVideoDecoder === undefined ? false : options.useHardwareVideoDecoder;\n\t this._hlsLogEnabled = options.hlsLogEnabled === undefined ? true : options.hlsLogEnabled;\n\t this._logDebug = options.logDebug === undefined ? false : options.logDebug;\n\t this._logDebug2 = options.logDebug2 === undefined ? false : options.logDebug2;\n\t this._logWarn = options.logWarn === undefined ? true : options.logWarn;\n\t this._logError = options.logError === undefined ? true : options.logError;\n\t this._hlsMinimumDvrSize = options.hlsMinimumDvrSize === undefined ? 60 : options.hlsMinimumDvrSize;\n\t };\n\t\n\t FlasHLS.prototype._addListeners = function _addListeners() {\n\t var _this2 = this;\n\t\n\t _mediator2.default.on(this.cid + ':flashready', function () {\n\t return _this2._bootstrap();\n\t });\n\t _mediator2.default.on(this.cid + ':timeupdate', function (timeMetrics) {\n\t return _this2._updateTime(timeMetrics);\n\t });\n\t _mediator2.default.on(this.cid + ':playbackstate', function (state) {\n\t return _this2._setPlaybackState(state);\n\t });\n\t _mediator2.default.on(this.cid + ':levelchanged', function (level) {\n\t return _this2._levelChanged(level);\n\t });\n\t _mediator2.default.on(this.cid + ':error', function (code, url, message) {\n\t return _this2._flashPlaybackError(code, url, message);\n\t });\n\t _mediator2.default.on(this.cid + ':fragmentloaded', function (loadmetrics) {\n\t return _this2._onFragmentLoaded(loadmetrics);\n\t });\n\t _mediator2.default.on(this.cid + ':levelendlist', function (level) {\n\t return _this2._onLevelEndlist(level);\n\t });\n\t };\n\t\n\t FlasHLS.prototype.stopListening = function stopListening() {\n\t _BaseFlashPlayback.prototype.stopListening.call(this);\n\t _mediator2.default.off(this.cid + ':flashready');\n\t _mediator2.default.off(this.cid + ':timeupdate');\n\t _mediator2.default.off(this.cid + ':playbackstate');\n\t _mediator2.default.off(this.cid + ':levelchanged');\n\t _mediator2.default.off(this.cid + ':playbackerror');\n\t _mediator2.default.off(this.cid + ':fragmentloaded');\n\t _mediator2.default.off(this.cid + ':manifestloaded');\n\t _mediator2.default.off(this.cid + ':levelendlist');\n\t };\n\t\n\t FlasHLS.prototype._bootstrap = function _bootstrap() {\n\t var _this3 = this;\n\t\n\t if (this.el.playerLoad) {\n\t this.el.width = '100%';\n\t this.el.height = '100%';\n\t this._isReadyState = true;\n\t this._srcLoaded = false;\n\t this._currentState = 'IDLE';\n\t this._setFlashSettings();\n\t this._updatePlaybackType();\n\t if (this._autoPlay || this._shouldPlayOnManifestLoaded) {\n\t this.play();\n\t }\n\t this.trigger(_events2.default.PLAYBACK_READY, this.name);\n\t } else {\n\t this._bootstrapAttempts = this._bootstrapAttempts || 0;\n\t if (++this._bootstrapAttempts <= MAX_ATTEMPTS) {\n\t setTimeout(function () {\n\t return _this3._bootstrap();\n\t }, 50);\n\t } else {\n\t this.trigger(_events2.default.PLAYBACK_ERROR, { message: 'Max number of attempts reached' }, this.name);\n\t }\n\t }\n\t };\n\t\n\t FlasHLS.prototype._setFlashSettings = function _setFlashSettings() {\n\t this.el.playerSetAutoStartLoad(this._autoStartLoad);\n\t this.el.playerSetCapLevelToStage(this._capLevelToStage);\n\t this.el.playerSetMaxLevelCappingMode(this._maxLevelCappingMode);\n\t this.el.playerSetMinBufferLength(this._minBufferLength);\n\t this.el.playerSetMinBufferLengthCapping(this._minBufferLengthCapping);\n\t this.el.playerSetMaxBufferLength(this._maxBufferLength);\n\t this.el.playerSetMaxBackBufferLength(this._maxBackBufferLength);\n\t this.el.playerSetLowBufferLength(this._lowBufferLength);\n\t this.el.playerSetMediaTimePeriod(this._mediaTimePeriod);\n\t this.el.playerSetFpsDroppedMonitoringPeriod(this._fpsDroppedMonitoringPeriod);\n\t this.el.playerSetFpsDroppedMonitoringThreshold(this._fpsDroppedMonitoringThreshold);\n\t this.el.playerSetCapLevelonFPSDrop(this._capLevelonFPSDrop);\n\t this.el.playerSetSmoothAutoSwitchonFPSDrop(this._smoothAutoSwitchonFPSDrop);\n\t this.el.playerSetSwitchDownOnLevelError(this._switchDownOnLevelError);\n\t this.el.playerSetSeekMode(this._seekMode);\n\t this.el.playerSetKeyLoadMaxRetry(this._keyLoadMaxRetry);\n\t this.el.playerSetKeyLoadMaxRetryTimeout(this._keyLoadMaxRetryTimeout);\n\t this.el.playerSetFragmentLoadMaxRetry(this._fragmentLoadMaxRetry);\n\t this.el.playerSetFragmentLoadMaxRetryTimeout(this._fragmentLoadMaxRetryTimeout);\n\t this.el.playerSetFragmentLoadSkipAfterMaxRetry(this._fragmentLoadSkipAfterMaxRetry);\n\t this.el.playerSetMaxSkippedFragments(this._maxSkippedFragments);\n\t this.el.playerSetFlushLiveURLCache(this._flushLiveURLCache);\n\t this.el.playerSetInitialLiveManifestSize(this._initialLiveManifestSize);\n\t this.el.playerSetManifestLoadMaxRetry(this._manifestLoadMaxRetry);\n\t this.el.playerSetManifestLoadMaxRetryTimeout(this._manifestLoadMaxRetryTimeout);\n\t this.el.playerSetManifestRedundantLoadmaxRetry(this._manifestRedundantLoadmaxRetry);\n\t this.el.playerSetStartFromBitrate(this._startFromBitrate);\n\t this.el.playerSetStartFromLevel(this._startFromLevel);\n\t this.el.playerSetAutoStartMaxDuration(this._autoStartMaxDuration);\n\t this.el.playerSetSeekFromLevel(this._seekFromLevel);\n\t this.el.playerSetUseHardwareVideoDecoder(this._useHardwareVideoDecoder);\n\t this.el.playerSetLogInfo(this._hlsLogEnabled);\n\t this.el.playerSetLogDebug(this._logDebug);\n\t this.el.playerSetLogDebug2(this._logDebug2);\n\t this.el.playerSetLogWarn(this._logWarn);\n\t this.el.playerSetLogError(this._logError);\n\t };\n\t\n\t FlasHLS.prototype.setAutoStartLoad = function setAutoStartLoad(autoStartLoad) {\n\t this._autoStartLoad = autoStartLoad;\n\t this.el.playerSetAutoStartLoad(this._autoStartLoad);\n\t };\n\t\n\t FlasHLS.prototype.setCapLevelToStage = function setCapLevelToStage(capLevelToStage) {\n\t this._capLevelToStage = capLevelToStage;\n\t this.el.playerSetCapLevelToStage(this._capLevelToStage);\n\t };\n\t\n\t FlasHLS.prototype.setMaxLevelCappingMode = function setMaxLevelCappingMode(maxLevelCappingMode) {\n\t this._maxLevelCappingMode = maxLevelCappingMode;\n\t this.el.playerSetMaxLevelCappingMode(this._maxLevelCappingMode);\n\t };\n\t\n\t FlasHLS.prototype.setSetMinBufferLength = function setSetMinBufferLength(minBufferLength) {\n\t this._minBufferLength = minBufferLength;\n\t this.el.playerSetMinBufferLength(this._minBufferLength);\n\t };\n\t\n\t FlasHLS.prototype.setMinBufferLengthCapping = function setMinBufferLengthCapping(minBufferLengthCapping) {\n\t this._minBufferLengthCapping = minBufferLengthCapping;\n\t this.el.playerSetMinBufferLengthCapping(this._minBufferLengthCapping);\n\t };\n\t\n\t FlasHLS.prototype.setMaxBufferLength = function setMaxBufferLength(maxBufferLength) {\n\t this._maxBufferLength = maxBufferLength;\n\t this.el.playerSetMaxBufferLength(this._maxBufferLength);\n\t };\n\t\n\t FlasHLS.prototype.setMaxBackBufferLength = function setMaxBackBufferLength(maxBackBufferLength) {\n\t this._maxBackBufferLength = maxBackBufferLength;\n\t this.el.playerSetMaxBackBufferLength(this._maxBackBufferLength);\n\t };\n\t\n\t FlasHLS.prototype.setLowBufferLength = function setLowBufferLength(lowBufferLength) {\n\t this._lowBufferLength = lowBufferLength;\n\t this.el.playerSetLowBufferLength(this._lowBufferLength);\n\t };\n\t\n\t FlasHLS.prototype.setMediaTimePeriod = function setMediaTimePeriod(mediaTimePeriod) {\n\t this._mediaTimePeriod = mediaTimePeriod;\n\t this.el.playerSetMediaTimePeriod(this._mediaTimePeriod);\n\t };\n\t\n\t FlasHLS.prototype.setFpsDroppedMonitoringPeriod = function setFpsDroppedMonitoringPeriod(fpsDroppedMonitoringPeriod) {\n\t this._fpsDroppedMonitoringPeriod = fpsDroppedMonitoringPeriod;\n\t this.el.playerSetFpsDroppedMonitoringPeriod(this._fpsDroppedMonitoringPeriod);\n\t };\n\t\n\t FlasHLS.prototype.setFpsDroppedMonitoringThreshold = function setFpsDroppedMonitoringThreshold(fpsDroppedMonitoringThreshold) {\n\t this._fpsDroppedMonitoringThreshold = fpsDroppedMonitoringThreshold;\n\t this.el.playerSetFpsDroppedMonitoringThreshold(this._fpsDroppedMonitoringThreshold);\n\t };\n\t\n\t FlasHLS.prototype.setCapLevelonFPSDrop = function setCapLevelonFPSDrop(capLevelonFPSDrop) {\n\t this._capLevelonFPSDrop = capLevelonFPSDrop;\n\t this.el.playerSetCapLevelonFPSDrop(this._capLevelonFPSDrop);\n\t };\n\t\n\t FlasHLS.prototype.setSmoothAutoSwitchonFPSDrop = function setSmoothAutoSwitchonFPSDrop(smoothAutoSwitchonFPSDrop) {\n\t this._smoothAutoSwitchonFPSDrop = smoothAutoSwitchonFPSDrop;\n\t this.el.playerSetSmoothAutoSwitchonFPSDrop(this._smoothAutoSwitchonFPSDrop);\n\t };\n\t\n\t FlasHLS.prototype.setSwitchDownOnLevelError = function setSwitchDownOnLevelError(switchDownOnLevelError) {\n\t this._switchDownOnLevelError = switchDownOnLevelError;\n\t this.el.playerSetSwitchDownOnLevelError(this._switchDownOnLevelError);\n\t };\n\t\n\t FlasHLS.prototype.setSeekMode = function setSeekMode(seekMode) {\n\t this._seekMode = seekMode;\n\t this.el.playerSetSeekMode(this._seekMode);\n\t };\n\t\n\t FlasHLS.prototype.setKeyLoadMaxRetry = function setKeyLoadMaxRetry(keyLoadMaxRetry) {\n\t this._keyLoadMaxRetry = keyLoadMaxRetry;\n\t this.el.playerSetKeyLoadMaxRetry(this._keyLoadMaxRetry);\n\t };\n\t\n\t FlasHLS.prototype.setKeyLoadMaxRetryTimeout = function setKeyLoadMaxRetryTimeout(keyLoadMaxRetryTimeout) {\n\t this._keyLoadMaxRetryTimeout = keyLoadMaxRetryTimeout;\n\t this.el.playerSetKeyLoadMaxRetryTimeout(this._keyLoadMaxRetryTimeout);\n\t };\n\t\n\t FlasHLS.prototype.setFragmentLoadMaxRetry = function setFragmentLoadMaxRetry(fragmentLoadMaxRetry) {\n\t this._fragmentLoadMaxRetry = fragmentLoadMaxRetry;\n\t this.el.playerSetFragmentLoadMaxRetry(this._fragmentLoadMaxRetry);\n\t };\n\t\n\t FlasHLS.prototype.setFragmentLoadMaxRetryTimeout = function setFragmentLoadMaxRetryTimeout(fragmentLoadMaxRetryTimeout) {\n\t this._fragmentLoadMaxRetryTimeout = fragmentLoadMaxRetryTimeout;\n\t this.el.playerSetFragmentLoadMaxRetryTimeout(this._fragmentLoadMaxRetryTimeout);\n\t };\n\t\n\t FlasHLS.prototype.setFragmentLoadSkipAfterMaxRetry = function setFragmentLoadSkipAfterMaxRetry(fragmentLoadSkipAfterMaxRetry) {\n\t this._fragmentLoadSkipAfterMaxRetry = fragmentLoadSkipAfterMaxRetry;\n\t this.el.playerSetFragmentLoadSkipAfterMaxRetry(this._fragmentLoadSkipAfterMaxRetry);\n\t };\n\t\n\t FlasHLS.prototype.setMaxSkippedFragments = function setMaxSkippedFragments(maxSkippedFragments) {\n\t this._maxSkippedFragments = maxSkippedFragments;\n\t this.el.playerSetMaxSkippedFragments(this._maxSkippedFragments);\n\t };\n\t\n\t FlasHLS.prototype.setFlushLiveURLCache = function setFlushLiveURLCache(flushLiveURLCache) {\n\t this._flushLiveURLCache = flushLiveURLCache;\n\t this.el.playerSetFlushLiveURLCache(this._flushLiveURLCache);\n\t };\n\t\n\t FlasHLS.prototype.setInitialLiveManifestSize = function setInitialLiveManifestSize(initialLiveManifestSize) {\n\t this._initialLiveManifestSize = initialLiveManifestSize;\n\t this.el.playerSetInitialLiveManifestSize(this._initialLiveManifestSize);\n\t };\n\t\n\t FlasHLS.prototype.setManifestLoadMaxRetry = function setManifestLoadMaxRetry(manifestLoadMaxRetry) {\n\t this._manifestLoadMaxRetry = manifestLoadMaxRetry;\n\t this.el.playerSetManifestLoadMaxRetry(this._manifestLoadMaxRetry);\n\t };\n\t\n\t FlasHLS.prototype.setManifestLoadMaxRetryTimeout = function setManifestLoadMaxRetryTimeout(manifestLoadMaxRetryTimeout) {\n\t this._manifestLoadMaxRetryTimeout = manifestLoadMaxRetryTimeout;\n\t this.el.playerSetManifestLoadMaxRetryTimeout(this._manifestLoadMaxRetryTimeout);\n\t };\n\t\n\t FlasHLS.prototype.setManifestRedundantLoadmaxRetry = function setManifestRedundantLoadmaxRetry(manifestRedundantLoadmaxRetry) {\n\t this._manifestRedundantLoadmaxRetry = manifestRedundantLoadmaxRetry;\n\t this.el.playerSetManifestRedundantLoadmaxRetry(this._manifestRedundantLoadmaxRetry);\n\t };\n\t\n\t FlasHLS.prototype.setStartFromBitrate = function setStartFromBitrate(startFromBitrate) {\n\t this._startFromBitrate = startFromBitrate;\n\t this.el.playerSetStartFromBitrate(this._startFromBitrate);\n\t };\n\t\n\t FlasHLS.prototype.setStartFromLevel = function setStartFromLevel(startFromLevel) {\n\t this._startFromLevel = startFromLevel;\n\t this.el.playerSetStartFromLevel(this._startFromLevel);\n\t };\n\t\n\t FlasHLS.prototype.setAutoStartMaxDuration = function setAutoStartMaxDuration(autoStartMaxDuration) {\n\t this._autoStartMaxDuration = autoStartMaxDuration;\n\t this.el.playerSetAutoStartMaxDuration(this._autoStartMaxDuration);\n\t };\n\t\n\t FlasHLS.prototype.setSeekFromLevel = function setSeekFromLevel(seekFromLevel) {\n\t this._seekFromLevel = seekFromLevel;\n\t this.el.playerSetSeekFromLevel(this._seekFromLevel);\n\t };\n\t\n\t FlasHLS.prototype.setUseHardwareVideoDecoder = function setUseHardwareVideoDecoder(useHardwareVideoDecoder) {\n\t this._useHardwareVideoDecoder = useHardwareVideoDecoder;\n\t this.el.playerSetUseHardwareVideoDecoder(this._useHardwareVideoDecoder);\n\t };\n\t\n\t FlasHLS.prototype.setSetLogInfo = function setSetLogInfo(hlsLogEnabled) {\n\t this._hlsLogEnabled = hlsLogEnabled;\n\t this.el.playerSetLogInfo(this._hlsLogEnabled);\n\t };\n\t\n\t FlasHLS.prototype.setLogDebug = function setLogDebug(logDebug) {\n\t this._logDebug = logDebug;\n\t this.el.playerSetLogDebug(this._logDebug);\n\t };\n\t\n\t FlasHLS.prototype.setLogDebug2 = function setLogDebug2(logDebug2) {\n\t this._logDebug2 = logDebug2;\n\t this.el.playerSetLogDebug2(this._logDebug2);\n\t };\n\t\n\t FlasHLS.prototype.setLogWarn = function setLogWarn(logWarn) {\n\t this._logWarn = logWarn;\n\t this.el.playerSetLogWarn(this._logWarn);\n\t };\n\t\n\t FlasHLS.prototype.setLogError = function setLogError(logError) {\n\t this._logError = logError;\n\t this.el.playerSetLogError(this._logError);\n\t };\n\t\n\t FlasHLS.prototype._levelChanged = function _levelChanged(level) {\n\t var currentLevel = this.el.getLevels()[level];\n\t if (currentLevel) {\n\t this.highDefinition = currentLevel.height >= 720 || currentLevel.bitrate / 1000 >= 2000;\n\t this.trigger(_events2.default.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinition);\n\t\n\t if (!this._levels || this._levels.length === 0) this._fillLevels();\n\t\n\t this.trigger(_events2.default.PLAYBACK_BITRATE, {\n\t height: currentLevel.height,\n\t width: currentLevel.width,\n\t bandwidth: currentLevel.bitrate,\n\t bitrate: currentLevel.bitrate,\n\t level: level\n\t });\n\t this.trigger(_events2.default.PLAYBACK_LEVEL_SWITCH_END);\n\t }\n\t };\n\t\n\t FlasHLS.prototype._updateTime = function _updateTime(timeMetrics) {\n\t if (this._currentState === 'IDLE') {\n\t return;\n\t }\n\t\n\t var duration = this._normalizeDuration(timeMetrics.duration);\n\t var position = Math.min(Math.max(timeMetrics.position, 0), duration);\n\t var previousDVRStatus = this._dvrEnabled;\n\t var livePlayback = this._playbackType === _playback2.default.LIVE;\n\t this._dvrEnabled = livePlayback && duration > this._hlsMinimumDvrSize;\n\t\n\t if (duration === 100 || livePlayback === undefined) {\n\t return;\n\t }\n\t\n\t if (this._dvrEnabled !== previousDVRStatus) {\n\t this._updateSettings();\n\t this.trigger(_events2.default.PLAYBACK_SETTINGSUPDATE, this.name);\n\t }\n\t\n\t if (livePlayback && (!this._dvrEnabled || !this._dvrInUse)) {\n\t position = duration;\n\t }\n\t\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: position, total: duration }, this.name);\n\t };\n\t\n\t FlasHLS.prototype.play = function play() {\n\t this.trigger(_events2.default.PLAYBACK_PLAY_INTENT);\n\t if (this._currentState === 'PAUSED') {\n\t this.el.playerResume();\n\t } else if (!this._srcLoaded && this._currentState !== 'PLAYING') {\n\t this._firstPlay();\n\t } else {\n\t this.el.playerPlay();\n\t }\n\t };\n\t\n\t FlasHLS.prototype.getPlaybackType = function getPlaybackType() {\n\t return this._playbackType ? this._playbackType : null;\n\t };\n\t\n\t FlasHLS.prototype.getCurrentLevelIndex = function getCurrentLevelIndex() {\n\t return this._currentLevel;\n\t };\n\t\n\t FlasHLS.prototype.getCurrentLevel = function getCurrentLevel() {\n\t return this.levels[this.currentLevel];\n\t };\n\t\n\t FlasHLS.prototype.getCurrentBitrate = function getCurrentBitrate() {\n\t return this.levels[this.currentLevel].bitrate;\n\t };\n\t\n\t FlasHLS.prototype.setCurrentLevel = function setCurrentLevel(level) {\n\t this.currentLevel = level;\n\t };\n\t\n\t FlasHLS.prototype.isHighDefinitionInUse = function isHighDefinitionInUse() {\n\t return this.highDefinition;\n\t };\n\t\n\t FlasHLS.prototype.getLevels = function getLevels() {\n\t return this.levels;\n\t };\n\t\n\t FlasHLS.prototype._setPlaybackState = function _setPlaybackState(state) {\n\t if (['PLAYING_BUFFERING', 'PAUSED_BUFFERING'].indexOf(state) >= 0) {\n\t this._bufferingState = true;\n\t this.trigger(_events2.default.PLAYBACK_BUFFERING, this.name);\n\t this._updateCurrentState(state);\n\t } else if (['PLAYING', 'PAUSED'].indexOf(state) >= 0) {\n\t if (['PLAYING_BUFFERING', 'PAUSED_BUFFERING', 'IDLE'].indexOf(this._currentState) >= 0) {\n\t this._bufferingState = false;\n\t this.trigger(_events2.default.PLAYBACK_BUFFERFULL, this.name);\n\t }\n\t this._updateCurrentState(state);\n\t } else if (state === 'IDLE') {\n\t this._srcLoaded = false;\n\t if (this._loop && ['PLAYING_BUFFERING', 'PLAYING'].indexOf(this._currentState) >= 0) {\n\t this.play();\n\t this.seek(0);\n\t } else {\n\t this._updateCurrentState(state);\n\t this._hasEnded = true;\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: 0, total: this.getDuration() }, this.name);\n\t this.trigger(_events2.default.PLAYBACK_ENDED, this.name);\n\t }\n\t }\n\t };\n\t\n\t FlasHLS.prototype._updateCurrentState = function _updateCurrentState(state) {\n\t this._currentState = state;\n\t if (state !== 'IDLE') {\n\t this._hasEnded = false;\n\t }\n\t this._updatePlaybackType();\n\t if (state === 'PLAYING') {\n\t this.trigger(_events2.default.PLAYBACK_PLAY, this.name);\n\t } else if (state === 'PAUSED') {\n\t this.trigger(_events2.default.PLAYBACK_PAUSE, this.name);\n\t }\n\t };\n\t\n\t FlasHLS.prototype._updatePlaybackType = function _updatePlaybackType() {\n\t this._playbackType = this.el.getType();\n\t if (this._playbackType) {\n\t this._playbackType = this._playbackType.toLowerCase();\n\t if (this._playbackType === _playback2.default.VOD) {\n\t this._startReportingProgress();\n\t } else {\n\t this._stopReportingProgress();\n\t }\n\t }\n\t this.trigger(_events2.default.PLAYBACK_PLAYBACKSTATE, { type: this._playbackType });\n\t };\n\t\n\t FlasHLS.prototype._startReportingProgress = function _startReportingProgress() {\n\t if (!this._reportingProgress) {\n\t this._reportingProgress = true;\n\t }\n\t };\n\t\n\t FlasHLS.prototype._stopReportingProgress = function _stopReportingProgress() {\n\t this._reportingProgress = false;\n\t };\n\t\n\t FlasHLS.prototype._onFragmentLoaded = function _onFragmentLoaded(loadmetrics) {\n\t this.trigger(_events2.default.PLAYBACK_FRAGMENT_LOADED, loadmetrics);\n\t if (this._reportingProgress && this.el.getPosition) {\n\t var buffered = this.el.getPosition() + this.el.getbufferLength();\n\t this.trigger(_events2.default.PLAYBACK_PROGRESS, {\n\t start: this.el.getPosition(),\n\t current: buffered,\n\t total: this.el.getDuration()\n\t });\n\t }\n\t };\n\t\n\t FlasHLS.prototype._onLevelEndlist = function _onLevelEndlist() {\n\t this._updatePlaybackType();\n\t };\n\t\n\t FlasHLS.prototype._firstPlay = function _firstPlay() {\n\t var _this4 = this;\n\t\n\t this._shouldPlayOnManifestLoaded = true;\n\t if (this.el.playerLoad) {\n\t _mediator2.default.once(this.cid + ':manifestloaded', function (duration, loadmetrics) {\n\t return _this4._manifestLoaded(duration, loadmetrics);\n\t });\n\t this._setFlashSettings(); //ensure flushLiveURLCache will work (#327)\n\t this.el.playerLoad(this._src);\n\t this._srcLoaded = true;\n\t }\n\t };\n\t\n\t FlasHLS.prototype.volume = function volume(value) {\n\t var _this5 = this;\n\t\n\t if (this.isReady) {\n\t this.el.playerVolume(value);\n\t } else {\n\t this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {\n\t return _this5.volume(value);\n\t });\n\t }\n\t };\n\t\n\t FlasHLS.prototype.pause = function pause() {\n\t if (this._playbackType !== _playback2.default.LIVE || this._dvrEnabled) {\n\t this.el.playerPause();\n\t if (this._playbackType === _playback2.default.LIVE && this._dvrEnabled) {\n\t this._updateDvr(true);\n\t }\n\t }\n\t };\n\t\n\t FlasHLS.prototype.stop = function stop() {\n\t this._srcLoaded = false;\n\t this.el.playerStop();\n\t this.trigger(_events2.default.PLAYBACK_STOP);\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: 0, total: 0 }, this.name);\n\t };\n\t\n\t FlasHLS.prototype.isPlaying = function isPlaying() {\n\t if (this._currentState) {\n\t return !!this._currentState.match(/playing/i);\n\t }\n\t return false;\n\t };\n\t\n\t FlasHLS.prototype.getDuration = function getDuration() {\n\t return this._normalizeDuration(this.el.getDuration());\n\t };\n\t\n\t FlasHLS.prototype._normalizeDuration = function _normalizeDuration(duration) {\n\t if (this._playbackType === _playback2.default.LIVE) {\n\t // estimate 10 seconds of buffer time for live streams for seek positions\n\t duration = Math.max(0, duration - 10);\n\t }\n\t return duration;\n\t };\n\t\n\t FlasHLS.prototype.seekPercentage = function seekPercentage(percentage) {\n\t var duration = this.el.getDuration();\n\t var time = 0;\n\t if (percentage > 0) {\n\t time = duration * percentage / 100;\n\t }\n\t this.seek(time);\n\t };\n\t\n\t FlasHLS.prototype.seek = function seek(time) {\n\t var duration = this.getDuration();\n\t if (this._playbackType === _playback2.default.LIVE) {\n\t // seek operations to a time within 3 seconds from live stream will position playhead back to live\n\t var dvrInUse = duration - time > 3;\n\t this._updateDvr(dvrInUse);\n\t }\n\t this.el.playerSeek(time);\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: time, total: duration }, this.name);\n\t };\n\t\n\t FlasHLS.prototype._updateDvr = function _updateDvr(dvrInUse) {\n\t var previousDvrInUse = !!this._dvrInUse;\n\t this._dvrInUse = dvrInUse;\n\t if (this._dvrInUse !== previousDvrInUse) {\n\t this._updateSettings();\n\t this.trigger(_events2.default.PLAYBACK_DVR, this._dvrInUse);\n\t this.trigger(_events2.default.PLAYBACK_STATS_ADD, { 'dvr': this._dvrInUse });\n\t }\n\t };\n\t\n\t FlasHLS.prototype._flashPlaybackError = function _flashPlaybackError(code, url, message) {\n\t this.trigger(_events2.default.PLAYBACK_ERROR, { code: code, url: url, message: message });\n\t this.trigger(_events2.default.PLAYBACK_STOP);\n\t };\n\t\n\t FlasHLS.prototype._manifestLoaded = function _manifestLoaded(duration, loadmetrics) {\n\t if (this._shouldPlayOnManifestLoaded) {\n\t this._shouldPlayOnManifestLoaded = false;\n\t // this method initialises the player (and starts playback)\n\t // this needs to happen before PLAYBACK_LOADEDMETADATA is fired\n\t // as the user may call seek() in a LOADEDMETADATA listener.\n\t /// when playerPlay() is called the player seeks to 0\n\t this.el.playerPlay();\n\t }\n\t\n\t this._fillLevels();\n\t this.trigger(_events2.default.PLAYBACK_LOADEDMETADATA, { duration: duration, data: loadmetrics });\n\t };\n\t\n\t FlasHLS.prototype._fillLevels = function _fillLevels() {\n\t var levels = this.el.getLevels();\n\t var levelsLength = levels.length;\n\t this._levels = [];\n\t\n\t for (var index = 0; index < levelsLength; index++) {\n\t this._levels.push({ id: index, label: levels[index].height + 'p', level: levels[index] });\n\t }\n\t this.trigger(_events2.default.PLAYBACK_LEVELS_AVAILABLE, this._levels);\n\t };\n\t\n\t FlasHLS.prototype.destroy = function destroy() {\n\t this.stopListening();\n\t this.$el.remove();\n\t };\n\t\n\t FlasHLS.prototype._updateSettings = function _updateSettings() {\n\t this.settings = _clapprZepto2.default.extend({}, this._defaultSettings);\n\t if (this._playbackType === _playback2.default.VOD || this._dvrInUse) {\n\t this.settings.left = ['playpause', 'position', 'duration'];\n\t this.settings.seekEnabled = true;\n\t } else if (this._dvrEnabled) {\n\t this.settings.left = ['playpause'];\n\t this.settings.seekEnabled = true;\n\t } else {\n\t this.settings.seekEnabled = false;\n\t }\n\t };\n\t\n\t FlasHLS.prototype._createCallbacks = function _createCallbacks() {\n\t var _this6 = this;\n\t\n\t if (!window.Clappr) {\n\t window.Clappr = {};\n\t }\n\t if (!window.Clappr.flashlsCallbacks) {\n\t window.Clappr.flashlsCallbacks = {};\n\t }\n\t this.flashlsEvents = new _flashls_events2.default(this.cid);\n\t window.Clappr.flashlsCallbacks[this.cid] = function (eventName, args) {\n\t _this6.flashlsEvents[eventName].apply(_this6.flashlsEvents, args);\n\t };\n\t };\n\t\n\t FlasHLS.prototype.render = function render() {\n\t _BaseFlashPlayback.prototype.render.call(this);\n\t this._createCallbacks();\n\t return this;\n\t };\n\t\n\t _createClass(FlasHLS, [{\n\t key: 'isReady',\n\t get: function get() {\n\t return this._isReadyState;\n\t }\n\t }, {\n\t key: 'dvrEnabled',\n\t get: function get() {\n\t return !!this._dvrEnabled;\n\t }\n\t }]);\n\t\n\t return FlasHLS;\n\t}(_base_flash_playback2.default);\n\t\n\texports.default = FlasHLS;\n\t\n\t\n\tFlasHLS.canPlay = function (resource, mimeType) {\n\t var resourceParts = resource.split('?')[0].match(/.*\\.(.*)$/) || [];\n\t return _browser2.default.hasFlash && (resourceParts.length > 1 && resourceParts[1].toLowerCase() === 'm3u8' || mimeType === 'application/x-mpegURL' || mimeType === 'application/vnd.apple.mpegurl');\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 50 */\n/*!*************************************************!*\\\n !*** ./src/playbacks/flashls/flashls_events.js ***!\n \\*************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _mediator = __webpack_require__(/*! ../../components/mediator */ 11);\n\t\n\tvar _mediator2 = _interopRequireDefault(_mediator);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar HLSEvents = function () {\n\t function HLSEvents(instanceId) {\n\t _classCallCheck(this, HLSEvents);\n\t\n\t this.instanceId = instanceId;\n\t }\n\t\n\t HLSEvents.prototype.ready = function ready() {\n\t _mediator2.default.trigger(this.instanceId + ':flashready');\n\t };\n\t\n\t HLSEvents.prototype.videoSize = function videoSize(width, height) {\n\t _mediator2.default.trigger(this.instanceId + ':videosizechanged', width, height);\n\t };\n\t\n\t HLSEvents.prototype.complete = function complete() {\n\t _mediator2.default.trigger(this.instanceId + ':complete');\n\t };\n\t\n\t HLSEvents.prototype.error = function error(code, url, message) {\n\t _mediator2.default.trigger(this.instanceId + ':error', code, url, message);\n\t };\n\t\n\t HLSEvents.prototype.manifest = function manifest(duration, loadmetrics) {\n\t _mediator2.default.trigger(this.instanceId + ':manifestloaded', duration, loadmetrics);\n\t };\n\t\n\t HLSEvents.prototype.audioLevelLoaded = function audioLevelLoaded(loadmetrics) {\n\t _mediator2.default.trigger(this.instanceId + ':audiolevelloaded', loadmetrics);\n\t };\n\t\n\t HLSEvents.prototype.levelLoaded = function levelLoaded(loadmetrics) {\n\t _mediator2.default.trigger(this.instanceId + ':levelloaded', loadmetrics);\n\t };\n\t\n\t HLSEvents.prototype.levelEndlist = function levelEndlist(level) {\n\t _mediator2.default.trigger(this.instanceId + ':levelendlist', level);\n\t };\n\t\n\t HLSEvents.prototype.fragmentLoaded = function fragmentLoaded(loadmetrics) {\n\t _mediator2.default.trigger(this.instanceId + ':fragmentloaded', loadmetrics);\n\t };\n\t\n\t HLSEvents.prototype.fragmentPlaying = function fragmentPlaying(playmetrics) {\n\t _mediator2.default.trigger(this.instanceId + ':fragmentplaying', playmetrics);\n\t };\n\t\n\t HLSEvents.prototype.position = function position(timemetrics) {\n\t _mediator2.default.trigger(this.instanceId + ':timeupdate', timemetrics);\n\t };\n\t\n\t HLSEvents.prototype.state = function state(newState) {\n\t _mediator2.default.trigger(this.instanceId + ':playbackstate', newState);\n\t };\n\t\n\t HLSEvents.prototype.seekState = function seekState(newState) {\n\t _mediator2.default.trigger(this.instanceId + ':seekstate', newState);\n\t };\n\t\n\t HLSEvents.prototype.switch = function _switch(newLevel) {\n\t _mediator2.default.trigger(this.instanceId + ':levelchanged', newLevel);\n\t };\n\t\n\t HLSEvents.prototype.audioTracksListChange = function audioTracksListChange(trackList) {\n\t _mediator2.default.trigger(this.instanceId + ':audiotracklistchanged', trackList);\n\t };\n\t\n\t HLSEvents.prototype.audioTrackChange = function audioTrackChange(trackId) {\n\t _mediator2.default.trigger(this.instanceId + ':audiotrackchanged', trackId);\n\t };\n\t\n\t return HLSEvents;\n\t}();\n\t\n\texports.default = HLSEvents;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 51 */\n/*!**********************************!*\\\n !*** ./src/playbacks/hls/hls.js ***!\n \\**********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _html5_video = __webpack_require__(/*! playbacks/html5_video */ 16);\n\t\n\tvar _html5_video2 = _interopRequireDefault(_html5_video);\n\t\n\tvar _hls = __webpack_require__(/*! hls.js */ 90);\n\t\n\tvar _hls2 = _interopRequireDefault(_hls);\n\t\n\tvar _lodash = __webpack_require__(/*! lodash.isequal */ 99);\n\t\n\tvar _lodash2 = _interopRequireDefault(_lodash);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _log = __webpack_require__(/*! plugins/log */ 19);\n\t\n\tvar _log2 = _interopRequireDefault(_log);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar AUTO = -1;\n\t\n\tvar HLS = function (_HTML5VideoPlayback) {\n\t _inherits(HLS, _HTML5VideoPlayback);\n\t\n\t _createClass(HLS, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'hls';\n\t }\n\t }, {\n\t key: 'levels',\n\t get: function get() {\n\t return this._levels || [];\n\t }\n\t }, {\n\t key: 'currentLevel',\n\t get: function get() {\n\t if (this._currentLevel === null || this._currentLevel === undefined) {\n\t return AUTO;\n\t } else {\n\t return this._currentLevel; //0 is a valid level ID\n\t }\n\t },\n\t set: function set(id) {\n\t this._currentLevel = id;\n\t this.trigger(_events2.default.PLAYBACK_LEVEL_SWITCH_START);\n\t this._hls.currentLevel = this._currentLevel;\n\t }\n\t }, {\n\t key: '_startTime',\n\t get: function get() {\n\t if (this._playbackType === _playback2.default.LIVE && this._playlistType !== 'EVENT') {\n\t return this._extrapolatedStartTime;\n\t }\n\t return this._playableRegionStartTime;\n\t }\n\t }, {\n\t key: '_now',\n\t get: function get() {\n\t return (0, _utils.now)();\n\t }\n\t\n\t // the time in the video element which should represent the start of the sliding window\n\t // extrapolated to increase in real time (instead of jumping as the early segments are removed)\n\t\n\t }, {\n\t key: '_extrapolatedStartTime',\n\t get: function get() {\n\t if (!this._localStartTimeCorrelation) {\n\t return this._playableRegionStartTime;\n\t }\n\t var corr = this._localStartTimeCorrelation;\n\t var timePassed = this._now - corr.local;\n\t var extrapolatedWindowStartTime = (corr.remote + timePassed) / 1000;\n\t // cap at the end of the extrapolated window duration\n\t return Math.min(extrapolatedWindowStartTime, this._playableRegionStartTime + this._extrapolatedWindowDuration);\n\t }\n\t\n\t // the time in the video element which should represent the end of the content\n\t // extrapolated to increase in real time (instead of jumping as segments are added)\n\t\n\t }, {\n\t key: '_extrapolatedEndTime',\n\t get: function get() {\n\t var actualEndTime = this._playableRegionStartTime + this._playableRegionDuration;\n\t if (!this._localEndTimeCorrelation) {\n\t return actualEndTime;\n\t }\n\t var corr = this._localEndTimeCorrelation;\n\t var timePassed = this._now - corr.local;\n\t var extrapolatedEndTime = (corr.remote + timePassed) / 1000;\n\t return Math.max(actualEndTime - this._extrapolatedWindowDuration, Math.min(extrapolatedEndTime, actualEndTime));\n\t }\n\t }, {\n\t key: '_duration',\n\t get: function get() {\n\t return this._extrapolatedEndTime - this._startTime;\n\t }\n\t\n\t // Returns the duration (seconds) of the window that the extrapolated start time is allowed\n\t // to move in before being capped.\n\t // The extrapolated start time should never reach the cap at the end of the window as the\n\t // window should slide as chunks are removed from the start.\n\t // This also applies to the extrapolated end time in the same way.\n\t //\n\t // If chunks aren't being removed for some reason that the start time will reach and remain fixed at\n\t // playableRegionStartTime + extrapolatedWindowDuration\n\t //\n\t // <-- window duration -->\n\t // I.e playableRegionStartTime |-----------------------|\n\t // | --> . . .\n\t // . --> | --> . .\n\t // . . --> | --> .\n\t // . . . --> |\n\t // . . . .\n\t // extrapolatedStartTime\n\t\n\t }, {\n\t key: '_extrapolatedWindowDuration',\n\t get: function get() {\n\t if (this._segmentTargetDuration === null) {\n\t return 0;\n\t }\n\t return this._extrapolatedWindowNumSegments * this._segmentTargetDuration;\n\t }\n\t }]);\n\t\n\t function HLS() {\n\t _classCallCheck(this, HLS);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t // backwards compatibility (TODO: remove on 0.3.0)\n\t var _this = _possibleConstructorReturn(this, _HTML5VideoPlayback.call.apply(_HTML5VideoPlayback, [this].concat(args)));\n\t\n\t _this.options.playback || (_this.options.playback = _this.options);\n\t _this._minDvrSize = typeof _this.options.hlsMinimumDvrSize === 'undefined' ? 60 : _this.options.hlsMinimumDvrSize;\n\t // The size of the start time extrapolation window measured as a multiple of segments.\n\t // Should be 2 or higher, or 0 to disable. Should only need to be increased above 2 if more than one segment is\n\t // removed from the start of the playlist at a time. E.g if the playlist is cached for 10 seconds and new chunks are\n\t // added/removed every 5.\n\t _this._extrapolatedWindowNumSegments = !_this.options.playback || typeof _this.options.playback.extrapolatedWindowNumSegments === 'undefined' ? 2 : _this.options.playback.extrapolatedWindowNumSegments;\n\t\n\t _this._playbackType = _playback2.default.VOD;\n\t _this._lastTimeUpdate = null;\n\t _this._lastDuration = null;\n\t // for hls streams which have dvr with a sliding window,\n\t // the content at the start of the playlist is removed as new\n\t // content is appended at the end.\n\t // this means the actual playable start time will increase as the\n\t // start content is deleted\n\t // For streams with dvr where the entire recording is kept from the\n\t // beginning this should stay as 0\n\t _this._playableRegionStartTime = 0;\n\t // {local, remote} remote is the time in the video element that should represent 0\n\t // local is the system time when the 'remote' measurment took place\n\t _this._localStartTimeCorrelation = null;\n\t // {local, remote} remote is the time in the video element that should represents the end\n\t // local is the system time when the 'remote' measurment took place\n\t _this._localEndTimeCorrelation = null;\n\t // if content is removed from the beginning then this empty area should\n\t // be ignored. \"playableRegionDuration\" excludes the empty area\n\t _this._playableRegionDuration = 0;\n\t // true when the actual duration is longer than hlsjs's live sync point\n\t // when this is false playableRegionDuration will be the actual duration\n\t // when this is true playableRegionDuration will exclude the time after the sync point\n\t _this._durationExcludesAfterLiveSyncPoint = false;\n\t // #EXT-X-TARGETDURATION\n\t _this._segmentTargetDuration = null;\n\t // #EXT-X-PLAYLIST-TYPE\n\t _this._playlistType = null;\n\t _this._recoverAttemptsRemaining = _this.options.hlsRecoverAttempts || 16;\n\t _this._startTimeUpdateTimer();\n\t return _this;\n\t }\n\t\n\t HLS.prototype._setupHls = function _setupHls() {\n\t var _this2 = this;\n\t\n\t this._hls = new _hls2.default(this.options.playback.hlsjsConfig || {});\n\t this._hls.on(_hls2.default.Events.MEDIA_ATTACHED, function () {\n\t return _this2._hls.loadSource(_this2.options.src);\n\t });\n\t this._hls.on(_hls2.default.Events.LEVEL_LOADED, function (evt, data) {\n\t return _this2._updatePlaybackType(evt, data);\n\t });\n\t this._hls.on(_hls2.default.Events.LEVEL_UPDATED, function (evt, data) {\n\t return _this2._onLevelUpdated(evt, data);\n\t });\n\t this._hls.on(_hls2.default.Events.LEVEL_SWITCH, function (evt, data) {\n\t return _this2._onLevelSwitch(evt, data);\n\t });\n\t this._hls.on(_hls2.default.Events.FRAG_LOADED, function (evt, data) {\n\t return _this2._onFragmentLoaded(evt, data);\n\t });\n\t this._hls.on(_hls2.default.Events.ERROR, function (evt, data) {\n\t return _this2._onHLSJSError(evt, data);\n\t });\n\t this._hls.attachMedia(this.el);\n\t };\n\t\n\t HLS.prototype._recover = function _recover(evt, data) {\n\t if (!this._recoveredDecodingError) {\n\t this._recoveredDecodingError = true;\n\t this._hls.recoverMediaError();\n\t } else if (!this._recoveredAudioCodecError) {\n\t this._recoveredAudioCodecError = true;\n\t this._hls.swapAudioCodec();\n\t this._hls.recoverMediaError();\n\t } else {\n\t _log2.default.error('hlsjs: failed to recover');\n\t this.trigger(_events2.default.PLAYBACK_ERROR, 'hlsjs: could not recover from error, evt ' + evt + ', data ' + data + ' ', this.name);\n\t }\n\t };\n\t\n\t // override\n\t\n\t\n\t HLS.prototype._setupSrc = function _setupSrc(srcUrl) {// eslint-disable-line no-unused-vars\n\t // this playback manages the src on the video element itself\n\t };\n\t\n\t HLS.prototype._startTimeUpdateTimer = function _startTimeUpdateTimer() {\n\t var _this3 = this;\n\t\n\t this._timeUpdateTimer = setInterval(function () {\n\t _this3._onDurationChange();\n\t _this3._onTimeUpdate();\n\t }, 100);\n\t };\n\t\n\t HLS.prototype._stopTimeUpdateTimer = function _stopTimeUpdateTimer() {\n\t clearInterval(this._timeUpdateTimer);\n\t };\n\t\n\t // the duration on the video element itself should not be used\n\t // as this does not necesarily represent the duration of the stream\n\t // https://github.com/clappr/clappr/issues/668#issuecomment-157036678\n\t\n\t\n\t HLS.prototype.getDuration = function getDuration() {\n\t return this._duration;\n\t };\n\t\n\t HLS.prototype.getCurrentTime = function getCurrentTime() {\n\t // e.g. can be < 0 if user pauses near the start\n\t // eventually they will then be kicked to the end by hlsjs if they run out of buffer\n\t // before the official start time\n\t return Math.max(0, this.el.currentTime - this._startTime);\n\t };\n\t\n\t // the time that \"0\" now represents relative to when playback started\n\t // for a stream with a sliding window this will increase as content is\n\t // removed from the beginning\n\t\n\t\n\t HLS.prototype.getStartTimeOffset = function getStartTimeOffset() {\n\t return this._startTime;\n\t };\n\t\n\t HLS.prototype.seekPercentage = function seekPercentage(percentage) {\n\t var seekTo = this._duration;\n\t if (percentage > 0) {\n\t seekTo = this._duration * (percentage / 100);\n\t }\n\t this.seek(seekTo);\n\t };\n\t\n\t HLS.prototype.seek = function seek(time) {\n\t if (time < 0) {\n\t _log2.default.warn('Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point.');\n\t time = this.getDuration();\n\t }\n\t // assume live if time within 3 seconds of end of stream\n\t this.dvrEnabled && this._updateDvr(time < this.getDuration() - 3);\n\t time += this._startTime;\n\t _HTML5VideoPlayback.prototype.seek.call(this, time);\n\t };\n\t\n\t HLS.prototype.seekToLivePoint = function seekToLivePoint() {\n\t this.seek(this.getDuration());\n\t };\n\t\n\t HLS.prototype._updateDvr = function _updateDvr(status) {\n\t this.trigger(_events2.default.PLAYBACK_DVR, status);\n\t this.trigger(_events2.default.PLAYBACK_STATS_ADD, { 'dvr': status });\n\t };\n\t\n\t HLS.prototype._updateSettings = function _updateSettings() {\n\t if (this._playbackType === _playback2.default.VOD) {\n\t this.settings.left = ['playpause', 'position', 'duration'];\n\t } else if (this.dvrEnabled) {\n\t this.settings.left = ['playpause'];\n\t } else {\n\t this.settings.left = ['playstop'];\n\t }\n\t this.settings.seekEnabled = this.isSeekEnabled();\n\t this.trigger(_events2.default.PLAYBACK_SETTINGSUPDATE);\n\t };\n\t\n\t HLS.prototype._onHLSJSError = function _onHLSJSError(evt, data) {\n\t // only report/handle errors if they are fatal\n\t // hlsjs should automatically handle non fatal errors\n\t if (data.fatal) {\n\t if (this._recoverAttemptsRemaining > 0) {\n\t this._recoverAttemptsRemaining -= 1;\n\t switch (data.type) {\n\t case _hls2.default.ErrorTypes.NETWORK_ERROR:\n\t _log2.default.warn('hlsjs: trying to recover from network error, evt ' + evt + ', data ' + data + ' ');\n\t this._hls.startLoad();\n\t break;\n\t case _hls2.default.ErrorTypes.MEDIA_ERROR:\n\t _log2.default.warn('hlsjs: trying to recover from media error, evt ' + evt + ', data ' + data + ' ');\n\t this._recover(evt, data);\n\t break;\n\t default:\n\t _log2.default.error('hlsjs: trying to recover from error, evt ' + evt + ', data ' + data + ' ');\n\t this.trigger(_events2.default.PLAYBACK_ERROR, 'hlsjs: could not recover from error, evt ' + evt + ', data ' + data + ' ', this.name);\n\t break;\n\t }\n\t } else {\n\t _log2.default.error('hlsjs: could not recover from error after maximum number of attempts, evt ' + evt + ', data ' + data + ' ');\n\t this.trigger(_events2.default.PLAYBACK_ERROR, { evt: evt, data: data }, this.name);\n\t }\n\t } else {\n\t _log2.default.warn('hlsjs: non-fatal error occurred, evt ' + evt + ', data ' + data + ' ');\n\t }\n\t };\n\t\n\t HLS.prototype._onTimeUpdate = function _onTimeUpdate() {\n\t var update = { current: this.getCurrentTime(), total: this.getDuration() };\n\t if ((0, _lodash2.default)(update, this._lastTimeUpdate)) {\n\t return;\n\t }\n\t this._lastTimeUpdate = update;\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, update, this.name);\n\t };\n\t\n\t HLS.prototype._onDurationChange = function _onDurationChange() {\n\t var duration = this.getDuration();\n\t if (this._lastDuration === duration) {\n\t return;\n\t }\n\t this._lastDuration = duration;\n\t _HTML5VideoPlayback.prototype._onDurationChange.call(this);\n\t };\n\t\n\t HLS.prototype._onProgress = function _onProgress() {\n\t if (!this.el.buffered.length) {\n\t return;\n\t }\n\t var buffered = [];\n\t var bufferedPos = 0;\n\t for (var i = 0; i < this.el.buffered.length; i++) {\n\t buffered = [].concat(_toConsumableArray(buffered), [{\n\t // for a stream with sliding window dvr something that is buffered my slide off the start of the timeline\n\t start: Math.max(0, this.el.buffered.start(i) - this._playableRegionStartTime),\n\t end: Math.max(0, this.el.buffered.end(i) - this._playableRegionStartTime)\n\t }]);\n\t if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) {\n\t bufferedPos = i;\n\t }\n\t }\n\t var progress = {\n\t start: buffered[bufferedPos].start,\n\t current: buffered[bufferedPos].end,\n\t total: this.getDuration()\n\t };\n\t this.trigger(_events2.default.PLAYBACK_PROGRESS, progress, buffered);\n\t };\n\t\n\t HLS.prototype.play = function play() {\n\t if (!this._hls) {\n\t this._setupHls();\n\t }\n\t _HTML5VideoPlayback.prototype.play.call(this);\n\t };\n\t\n\t HLS.prototype.pause = function pause() {\n\t if (!this._hls) {\n\t return;\n\t }\n\t _HTML5VideoPlayback.prototype.pause.call(this);\n\t if (this.dvrEnabled) {\n\t this._updateDvr(true);\n\t }\n\t };\n\t\n\t HLS.prototype.stop = function stop() {\n\t if (this._hls) {\n\t _HTML5VideoPlayback.prototype.stop.call(this);\n\t this._hls.destroy();\n\t delete this._hls;\n\t }\n\t };\n\t\n\t HLS.prototype.destroy = function destroy() {\n\t this._stopTimeUpdateTimer();\n\t if (this._hls) {\n\t this._hls.destroy();\n\t delete this._hls;\n\t }\n\t _HTML5VideoPlayback.prototype.destroy.call(this);\n\t };\n\t\n\t HLS.prototype._updatePlaybackType = function _updatePlaybackType(evt, data) {\n\t this._playbackType = data.details.live ? _playback2.default.LIVE : _playback2.default.VOD;\n\t this._fillLevels();\n\t this._onLevelUpdated(evt, data);\n\t };\n\t\n\t HLS.prototype._fillLevels = function _fillLevels() {\n\t this._levels = this._hls.levels.map(function (level, index) {\n\t return { id: index, level: level, label: level.bitrate / 1000 + 'Kbps' };\n\t });\n\t this.trigger(_events2.default.PLAYBACK_LEVELS_AVAILABLE, this._levels);\n\t };\n\t\n\t HLS.prototype._onLevelUpdated = function _onLevelUpdated(evt, data) {\n\t this._segmentTargetDuration = data.details.targetduration;\n\t this._playlistType = data.details.type || null;\n\t\n\t var startTimeChanged = false;\n\t var durationChanged = false;\n\t var fragments = data.details.fragments;\n\t var previousPlayableRegionStartTime = this._playableRegionStartTime;\n\t var previousPlayableRegionDuration = this._playableRegionDuration;\n\t\n\t if (fragments.length === 0) {\n\t return;\n\t }\n\t\n\t if (this._playableRegionStartTime !== fragments[0].start) {\n\t startTimeChanged = true;\n\t this._playableRegionStartTime = fragments[0].start;\n\t }\n\t\n\t if (startTimeChanged) {\n\t if (!this._localStartTimeCorrelation) {\n\t // set the correlation to map to middle of the extrapolation window\n\t this._localStartTimeCorrelation = {\n\t local: this._now,\n\t remote: (fragments[0].start + this._extrapolatedWindowDuration / 2) * 1000\n\t };\n\t } else {\n\t // check if the correlation still works\n\t var corr = this._localStartTimeCorrelation;\n\t var timePassed = this._now - corr.local;\n\t // this should point to a time within the extrapolation window\n\t var startTime = (corr.remote + timePassed) / 1000;\n\t if (startTime < fragments[0].start) {\n\t // our start time is now earlier than the first chunk\n\t // (maybe the chunk was removed early)\n\t // reset correlation so that it sits at the beginning of the first available chunk\n\t this._localStartTimeCorrelation = {\n\t local: this._now,\n\t remote: fragments[0].start * 1000\n\t };\n\t } else if (startTime > previousPlayableRegionStartTime + this._extrapolatedWindowDuration) {\n\t // start time was past the end of the old extrapolation window (so would have been capped)\n\t // see if now that time would be inside the window, and if it would be set the correlation\n\t // so that it resumes from the time it was at at the end of the old window\n\t // update the correlation so that the time starts counting again from the value it's on now\n\t this._localStartTimeCorrelation = {\n\t local: this._now,\n\t remote: Math.max(fragments[0].start, previousPlayableRegionStartTime + this._extrapolatedWindowDuration) * 1000\n\t };\n\t }\n\t }\n\t }\n\t\n\t var newDuration = data.details.totalduration;\n\t // if it's a live stream then shorten the duration to remove access\n\t // to the area after hlsjs's live sync point\n\t // seeks to areas after this point sometimes have issues\n\t if (this._playbackType === _playback2.default.LIVE) {\n\t var fragmentTargetDuration = data.details.targetduration;\n\t var hlsjsConfig = this.options.playback || {};\n\t var liveSyncDurationCount = hlsjsConfig.liveSyncDurationCount || _hls2.default.DefaultConfig.liveSyncDurationCount;\n\t var hiddenAreaDuration = fragmentTargetDuration * liveSyncDurationCount;\n\t if (hiddenAreaDuration <= newDuration) {\n\t newDuration -= hiddenAreaDuration;\n\t this._durationExcludesAfterLiveSyncPoint = true;\n\t } else {\n\t this._durationExcludesAfterLiveSyncPoint = false;\n\t }\n\t }\n\t\n\t if (newDuration !== this._playableRegionDuration) {\n\t durationChanged = true;\n\t this._playableRegionDuration = newDuration;\n\t }\n\t\n\t // Note the end time is not the playableRegionDuration\n\t // The end time will always increase even if content is removed from the beginning\n\t var endTime = fragments[0].start + newDuration;\n\t var previousEndTime = previousPlayableRegionStartTime + previousPlayableRegionDuration;\n\t var endTimeChanged = endTime !== previousEndTime;\n\t if (endTimeChanged) {\n\t if (!this._localEndTimeCorrelation) {\n\t // set the correlation to map to the end\n\t this._localEndTimeCorrelation = {\n\t local: this._now,\n\t remote: endTime * 1000\n\t };\n\t } else {\n\t // check if the correlation still works\n\t var _corr = this._localEndTimeCorrelation;\n\t var _timePassed = this._now - _corr.local;\n\t // this should point to a time within the extrapolation window from the end\n\t var extrapolatedEndTime = (_corr.remote + _timePassed) / 1000;\n\t if (extrapolatedEndTime > endTime) {\n\t this._localEndTimeCorrelation = {\n\t local: this._now,\n\t remote: endTime * 1000\n\t };\n\t } else if (extrapolatedEndTime < endTime - this._extrapolatedWindowDuration) {\n\t // our extrapolated end time is now earlier than the extrapolation window from the actual end time\n\t // (maybe a chunk became available early)\n\t // reset correlation so that it sits at the beginning of the extrapolation window from the end time\n\t this._localEndTimeCorrelation = {\n\t local: this._now,\n\t remote: (endTime - this._extrapolatedWindowDuration) * 1000\n\t };\n\t } else if (extrapolatedEndTime > previousEndTime) {\n\t // end time was past the old end time (so would have been capped)\n\t // set the correlation so that it resumes from the time it was at at the end of the old window\n\t this._localEndTimeCorrelation = {\n\t local: this._now,\n\t remote: previousEndTime * 1000\n\t };\n\t }\n\t }\n\t }\n\t\n\t // now that the values have been updated call any methods that use on them so they get the updated values\n\t // immediately\n\t durationChanged && this._onDurationChange();\n\t startTimeChanged && this._onProgress();\n\t };\n\t\n\t HLS.prototype._onFragmentLoaded = function _onFragmentLoaded(evt, data) {\n\t this.trigger(_events2.default.PLAYBACK_FRAGMENT_LOADED, data);\n\t };\n\t\n\t HLS.prototype._onLevelSwitch = function _onLevelSwitch(evt, data) {\n\t if (!this.levels.length) {\n\t this._fillLevels();\n\t }\n\t this.trigger(_events2.default.PLAYBACK_LEVEL_SWITCH_END);\n\t this.trigger(_events2.default.PLAYBACK_LEVEL_SWITCH, data);\n\t var currentLevel = this._hls.levels[data.level];\n\t if (currentLevel) {\n\t // TODO should highDefinition be private and maybe have a read only accessor if it's used somewhere\n\t this.highDefinition = currentLevel.height >= 720 || currentLevel.bitrate / 1000 >= 2000;\n\t this.trigger(_events2.default.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinition);\n\t this.trigger(_events2.default.PLAYBACK_BITRATE, {\n\t height: currentLevel.height,\n\t width: currentLevel.width,\n\t bandwidth: currentLevel.bitrate,\n\t bitrate: currentLevel.bitrate,\n\t level: data.level\n\t });\n\t }\n\t };\n\t\n\t HLS.prototype.getPlaybackType = function getPlaybackType() {\n\t return this._playbackType;\n\t };\n\t\n\t HLS.prototype.isSeekEnabled = function isSeekEnabled() {\n\t return this._playbackType === _playback2.default.VOD || this.dvrEnabled;\n\t };\n\t\n\t _createClass(HLS, [{\n\t key: 'dvrEnabled',\n\t get: function get() {\n\t // enabled when:\n\t // - the duration does not include content after hlsjs's live sync point\n\t // - the playable region duration is longer than the configured duration to enable dvr after\n\t // - the playback type is LIVE.\n\t return this._durationExcludesAfterLiveSyncPoint && this._duration >= this._minDvrSize && this.getPlaybackType() === _playback2.default.LIVE;\n\t }\n\t }]);\n\t\n\t return HLS;\n\t}(_html5_video2.default);\n\t\n\texports.default = HLS;\n\t\n\t\n\tHLS.canPlay = function (resource, mimeType) {\n\t var resourceParts = resource.split('?')[0].match(/.*\\.(.*)$/) || [];\n\t var isHls = resourceParts.length > 1 && resourceParts[1].toLowerCase() === 'm3u8' || mimeType === 'application/x-mpegURL' || mimeType === 'application/vnd.apple.mpegurl';\n\t\n\t return !!(_hls2.default.isSupported() && isHls && !_browser2.default.isSafari);\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 52 */\n/*!**************************************************!*\\\n !*** ./src/playbacks/html5_audio/html5_audio.js ***!\n \\**************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _html5_video = __webpack_require__(/*! playbacks/html5_video */ 16);\n\t\n\tvar _html5_video2 = _interopRequireDefault(_html5_video);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\t// TODO: remove this playback and change HTML5Video to HTML5Playback (breaking change, only after 0.3.0)\n\tvar HTML5Audio = function (_HTML5Video) {\n\t _inherits(HTML5Audio, _HTML5Video);\n\t\n\t function HTML5Audio() {\n\t _classCallCheck(this, HTML5Audio);\n\t\n\t return _possibleConstructorReturn(this, _HTML5Video.apply(this, arguments));\n\t }\n\t\n\t HTML5Audio.prototype.updateSettings = function updateSettings() {\n\t this.settings.left = ['playpause', 'position', 'duration'];\n\t this.settings.seekEnabled = this.isSeekEnabled();\n\t this.trigger(_events2.default.PLAYBACK_SETTINGSUPDATE);\n\t };\n\t\n\t HTML5Audio.prototype.getPlaybackType = function getPlaybackType() {\n\t return _playback2.default.AOD;\n\t };\n\t\n\t _createClass(HTML5Audio, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'html5_audio';\n\t }\n\t }, {\n\t key: 'tagName',\n\t get: function get() {\n\t return 'audio';\n\t }\n\t }, {\n\t key: 'isAudioOnly',\n\t get: function get() {\n\t return true;\n\t }\n\t }]);\n\t\n\t return HTML5Audio;\n\t}(_html5_video2.default);\n\t\n\texports.default = HTML5Audio;\n\t\n\t\n\tHTML5Audio.canPlay = function (resourceUrl, mimeType) {\n\t var mimetypes = {\n\t 'wav': ['audio/wav'],\n\t 'mp3': ['audio/mp3', 'audio/mpeg;codecs=\"mp3\"'],\n\t 'aac': ['audio/mp4;codecs=\"mp4a.40.5\"'],\n\t 'oga': ['audio/ogg']\n\t };\n\t return _html5_video2.default._canPlay('audio', mimetypes, resourceUrl, mimeType);\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 53 */\n/*!**************************************************!*\\\n !*** ./src/playbacks/html5_video/html5_video.js ***!\n \\**************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _style = __webpack_require__(/*! ./public/style.scss */ 82);\n\t\n\tvar _style2 = _interopRequireDefault(_style);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar MIMETYPES = {\n\t 'mp4': ['avc1.42E01E', 'avc1.58A01E', 'avc1.4D401E', 'avc1.64001E', 'mp4v.20.8', 'mp4v.20.240', 'mp4a.40.2'].map(function (codec) {\n\t return 'video/mp4; codecs=\"' + codec + ', mp4a.40.2\"';\n\t }),\n\t 'ogg': ['video/ogg; codecs=\"theora, vorbis\"', 'video/ogg; codecs=\"dirac\"', 'video/ogg; codecs=\"theora, speex\"'],\n\t '3gpp': ['video/3gpp; codecs=\"mp4v.20.8, samr\"'],\n\t 'webm': ['video/webm; codecs=\"vp8, vorbis\"'],\n\t 'mkv': ['video/x-matroska; codecs=\"theora, vorbis\"'],\n\t 'm3u8': ['application/x-mpegurl']\n\t};\n\tMIMETYPES['ogv'] = MIMETYPES['ogg'];\n\tMIMETYPES['3gp'] = MIMETYPES['3gpp'];\n\t\n\tvar AUDIO_MIMETYPES = {\n\t 'wav': ['audio/wav'],\n\t 'mp3': ['audio/mp3', 'audio/mpeg;codecs=\"mp3\"'],\n\t 'aac': ['audio/mp4;codecs=\"mp4a.40.5\"'],\n\t 'oga': ['audio/ogg']\n\t};\n\t\n\tvar KNOWN_AUDIO_MIMETYPES = Object.keys(AUDIO_MIMETYPES).reduce(function (acc, k) {\n\t return [].concat(_toConsumableArray(acc), _toConsumableArray(AUDIO_MIMETYPES[k]));\n\t}, []);\n\t\n\t// TODO: rename this Playback to HTML5Playback (breaking change, only after 0.3.0)\n\t\n\tvar HTML5Video = function (_Playback) {\n\t _inherits(HTML5Video, _Playback);\n\t\n\t _createClass(HTML5Video, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'html5_video';\n\t }\n\t }, {\n\t key: 'tagName',\n\t get: function get() {\n\t return this.isAudioOnly ? 'audio' : 'video';\n\t }\n\t }, {\n\t key: 'isAudioOnly',\n\t get: function get() {\n\t var resourceUrl = this.options.src;\n\t var mimeTypes = HTML5Video._mimeTypesForUrl(resourceUrl, AUDIO_MIMETYPES, this.options.mimeType);\n\t return this.options.playback && this.options.playback.audioOnly || this.options.audioOnly || KNOWN_AUDIO_MIMETYPES.indexOf(mimeTypes[0]) >= 0;\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t return {\n\t 'data-html5-video': ''\n\t };\n\t }\n\t }, {\n\t key: 'events',\n\t get: function get() {\n\t return {\n\t 'canplay': '_onCanPlay',\n\t 'canplaythrough': '_handleBufferingEvents',\n\t 'durationchange': '_onDurationChange',\n\t 'ended': '_onEnded',\n\t 'error': '_onError',\n\t 'loadeddata': '_onLoadedData',\n\t 'loadedmetadata': '_onLoadedMetadata',\n\t 'pause': '_onPause',\n\t 'playing': '_onPlaying',\n\t 'progress': '_onProgress',\n\t 'seeked': '_handleBufferingEvents',\n\t 'seeking': '_handleBufferingEvents',\n\t 'stalled': '_handleBufferingEvents',\n\t 'timeupdate': '_onTimeUpdate',\n\t 'waiting': '_onWaiting'\n\t };\n\t }\n\t\n\t /**\n\t * Determine if the playback has ended.\n\t * @property ended\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'ended',\n\t get: function get() {\n\t return this.el.ended;\n\t }\n\t\n\t /**\n\t * Determine if the playback is having to buffer in order for\n\t * playback to be smooth.\n\t * This is related to the PLAYBACK_BUFFERING and PLAYBACK_BUFFERFULL events\n\t * @property buffering\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'buffering',\n\t get: function get() {\n\t return !!this._bufferingState;\n\t }\n\t }]);\n\t\n\t function HTML5Video() {\n\t _classCallCheck(this, HTML5Video);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var _this = _possibleConstructorReturn(this, _Playback.call.apply(_Playback, [this].concat(args)));\n\t\n\t _this._loadStarted = false;\n\t _this._playheadMoving = false;\n\t _this._playheadMovingTimer = null;\n\t _this._stopped = false;\n\t _this._setupSrc(_this.options.src);\n\t // backwards compatibility (TODO: remove on 0.3.0)\n\t _this.options.playback || (_this.options.playback = _this.options || {});\n\t _this.options.playback.disableContextMenu = _this.options.playback.disableContextMenu || _this.options.disableVideoTagContextMenu;\n\t\n\t var playbackConfig = _this.options.playback;\n\t var preload = playbackConfig.preload || (_browser2.default.isSafari ? 'auto' : _this.options.preload);\n\t\n\t _clapprZepto2.default.extend(_this.el, {\n\t loop: _this.options.loop,\n\t poster: _this.options.poster,\n\t preload: preload || 'metadata',\n\t controls: (playbackConfig.controls || _this.options.useVideoTagDefaultControls) && 'controls',\n\t crossOrigin: playbackConfig.crossOrigin,\n\t 'x-webkit-playsinline': playbackConfig.playInline\n\t });\n\t\n\t // TODO should settings be private?\n\t _this.settings = { default: ['seekbar'] };\n\t _this.settings.left = ['playpause', 'position', 'duration'];\n\t _this.settings.right = ['fullscreen', 'volume', 'hd-indicator'];\n\t\n\t // https://github.com/clappr/clappr/issues/1076\n\t _this.options.autoPlay && process.nextTick(function () {\n\t return _this.play();\n\t });\n\t return _this;\n\t }\n\t\n\t /**\n\t * Sets the source url on the <video> element, and also the 'src' property.\n\t * @method setupSrc\n\t * @private\n\t * @param {String} srcUrl The source URL.\n\t */\n\t\n\t\n\t HTML5Video.prototype._setupSrc = function _setupSrc(srcUrl) {\n\t if (this.el.src === srcUrl) {\n\t return;\n\t }\n\t this._src = srcUrl;\n\t this.el.src = srcUrl;\n\t };\n\t\n\t HTML5Video.prototype._onLoadedMetadata = function _onLoadedMetadata(e) {\n\t this._handleBufferingEvents();\n\t this.trigger(_events2.default.PLAYBACK_LOADEDMETADATA, { duration: e.target.duration, data: e });\n\t this._updateSettings();\n\t var autoSeekFromUrl = typeof this._options.autoSeekFromUrl === 'undefined' || this._options.autoSeekFromUrl;\n\t if (this.getPlaybackType() !== _playback2.default.LIVE && autoSeekFromUrl) {\n\t this._checkInitialSeek();\n\t }\n\t };\n\t\n\t HTML5Video.prototype._onDurationChange = function _onDurationChange() {\n\t this._updateSettings();\n\t this._onTimeUpdate();\n\t // onProgress uses the duration\n\t this._onProgress();\n\t };\n\t\n\t HTML5Video.prototype._updateSettings = function _updateSettings() {\n\t // we can't figure out if hls resource is VoD or not until it is being loaded or duration has changed.\n\t // that's why we check it again and update media control accordingly.\n\t if (this.getPlaybackType() === _playback2.default.VOD || this.getPlaybackType() === _playback2.default.AOD) {\n\t this.settings.left = ['playpause', 'position', 'duration'];\n\t } else {\n\t this.settings.left = ['playstop'];\n\t }\n\t this.settings.seekEnabled = this.isSeekEnabled();\n\t this.trigger(_events2.default.PLAYBACK_SETTINGSUPDATE);\n\t };\n\t\n\t HTML5Video.prototype.isSeekEnabled = function isSeekEnabled() {\n\t return isFinite(this.getDuration());\n\t };\n\t\n\t HTML5Video.prototype.getPlaybackType = function getPlaybackType() {\n\t var onDemandType = this.tagName === 'audio' ? _playback2.default.AOD : _playback2.default.VOD;\n\t return [0, undefined, Infinity].indexOf(this.el.duration) >= 0 ? _playback2.default.LIVE : onDemandType;\n\t };\n\t\n\t HTML5Video.prototype.isHighDefinitionInUse = function isHighDefinitionInUse() {\n\t return false;\n\t };\n\t\n\t HTML5Video.prototype.play = function play() {\n\t this.trigger(_events2.default.PLAYBACK_PLAY_INTENT);\n\t this._stopped = false;\n\t this._setupSrc(this._src);\n\t this._handleBufferingEvents();\n\t this.el.play();\n\t };\n\t\n\t HTML5Video.prototype.pause = function pause() {\n\t this.el.pause();\n\t };\n\t\n\t HTML5Video.prototype.stop = function stop() {\n\t this.pause();\n\t this._stopped = true;\n\t // src will be added again in play()\n\t this.el.removeAttribute('src');\n\t this._stopPlayheadMovingChecks();\n\t this._handleBufferingEvents();\n\t this.trigger(_events2.default.PLAYBACK_STOP);\n\t };\n\t\n\t HTML5Video.prototype.volume = function volume(value) {\n\t this.el.volume = value / 100;\n\t };\n\t\n\t HTML5Video.prototype.mute = function mute() {\n\t this.el.volume = 0;\n\t };\n\t\n\t HTML5Video.prototype.unmute = function unmute() {\n\t this.el.volume = 1;\n\t };\n\t\n\t HTML5Video.prototype.isMuted = function isMuted() {\n\t return !!this.el.volume;\n\t };\n\t\n\t HTML5Video.prototype.isPlaying = function isPlaying() {\n\t return !this.el.paused && !this.el.ended;\n\t };\n\t\n\t HTML5Video.prototype._startPlayheadMovingChecks = function _startPlayheadMovingChecks() {\n\t if (this._playheadMovingTimer !== null) {\n\t return;\n\t }\n\t this._playheadMovingTimeOnCheck = null;\n\t this._determineIfPlayheadMoving();\n\t this._playheadMovingTimer = setInterval(this._determineIfPlayheadMoving.bind(this), 500);\n\t };\n\t\n\t HTML5Video.prototype._stopPlayheadMovingChecks = function _stopPlayheadMovingChecks() {\n\t if (this._playheadMovingTimer === null) {\n\t return;\n\t }\n\t clearInterval(this._playheadMovingTimer);\n\t this._playheadMovingTimer = null;\n\t this._playheadMoving = false;\n\t };\n\t\n\t HTML5Video.prototype._determineIfPlayheadMoving = function _determineIfPlayheadMoving() {\n\t var before = this._playheadMovingTimeOnCheck;\n\t var now = this.el.currentTime;\n\t this._playheadMoving = before !== now;\n\t this._playheadMovingTimeOnCheck = now;\n\t this._handleBufferingEvents();\n\t };\n\t\n\t // this seems to happen when the user is having to wait\n\t // for something to happen AFTER A USER INTERACTION\n\t // e.g the player might be buffering, but when `play()` is called\n\t // only at this point will this be called.\n\t // Or the user may seek somewhere but the new area requires buffering,\n\t // so it will fire then as well.\n\t // On devices where playing is blocked until requested with a user action,\n\t // buffering may start, but never finish until the user initiates a play,\n\t // but this only happens when play is actually requested\n\t\n\t\n\t HTML5Video.prototype._onWaiting = function _onWaiting() {\n\t this._loadStarted = true;\n\t this._handleBufferingEvents();\n\t };\n\t\n\t // called after the first frame has loaded\n\t // note this doesn't fire on ios before the user has requested play\n\t // ideally the \"loadstart\" event would be used instead, but this fires\n\t // before a user has requested play on iOS, and also this is always fired\n\t // even if the preload setting is \"none\". In both these cases this causes\n\t // infinite buffering until the user does something which isn't great.\n\t\n\t\n\t HTML5Video.prototype._onLoadedData = function _onLoadedData() {\n\t this._loadStarted = true;\n\t this._handleBufferingEvents();\n\t };\n\t\n\t // note this doesn't fire on ios before user has requested play\n\t\n\t\n\t HTML5Video.prototype._onCanPlay = function _onCanPlay() {\n\t this._handleBufferingEvents();\n\t };\n\t\n\t HTML5Video.prototype._onPlaying = function _onPlaying() {\n\t this._startPlayheadMovingChecks();\n\t this._handleBufferingEvents();\n\t this.trigger(_events2.default.PLAYBACK_PLAY);\n\t };\n\t\n\t HTML5Video.prototype._onPause = function _onPause() {\n\t this._stopPlayheadMovingChecks();\n\t this._handleBufferingEvents();\n\t this.trigger(_events2.default.PLAYBACK_PAUSE);\n\t };\n\t\n\t HTML5Video.prototype._onEnded = function _onEnded() {\n\t this._handleBufferingEvents();\n\t this.trigger(_events2.default.PLAYBACK_ENDED, this.name);\n\t };\n\t\n\t // The playback should be classed as buffering if the following are true:\n\t // - the ready state is less then HAVE_FUTURE_DATA or the playhead isn't moving and it should be\n\t // - the media hasn't \"ended\",\n\t // - the media hasn't been stopped\n\t // - loading has started\n\t\n\t\n\t HTML5Video.prototype._handleBufferingEvents = function _handleBufferingEvents() {\n\t var playheadShouldBeMoving = !this.el.ended && !this.el.paused;\n\t var buffering = this._loadStarted && !this.el.ended && !this._stopped && (playheadShouldBeMoving && !this._playheadMoving || this.el.readyState < this.el.HAVE_FUTURE_DATA);\n\t if (this._bufferingState !== buffering) {\n\t this._bufferingState = buffering;\n\t if (buffering) {\n\t this.trigger(_events2.default.PLAYBACK_BUFFERING, this.name);\n\t } else {\n\t this.trigger(_events2.default.PLAYBACK_BUFFERFULL, this.name);\n\t }\n\t }\n\t };\n\t\n\t HTML5Video.prototype._onError = function _onError() {\n\t this.trigger(_events2.default.PLAYBACK_ERROR, this.el.error, this.name);\n\t };\n\t\n\t HTML5Video.prototype.destroy = function destroy() {\n\t this.$el.remove();\n\t this.el.src = '';\n\t this._src = null;\n\t };\n\t\n\t HTML5Video.prototype.seek = function seek(time) {\n\t this.el.currentTime = time;\n\t };\n\t\n\t HTML5Video.prototype.seekPercentage = function seekPercentage(percentage) {\n\t var time = this.el.duration * (percentage / 100);\n\t this.seek(time);\n\t };\n\t\n\t HTML5Video.prototype._checkInitialSeek = function _checkInitialSeek() {\n\t var seekTime = (0, _utils.seekStringToSeconds)(window.location.href);\n\t if (seekTime !== 0) {\n\t this.seek(seekTime);\n\t }\n\t };\n\t\n\t HTML5Video.prototype.getCurrentTime = function getCurrentTime() {\n\t return this.el.currentTime;\n\t };\n\t\n\t HTML5Video.prototype.getDuration = function getDuration() {\n\t return this.el.duration;\n\t };\n\t\n\t HTML5Video.prototype._onTimeUpdate = function _onTimeUpdate() {\n\t this._handleBufferingEvents();\n\t if (this.getPlaybackType() === _playback2.default.LIVE) {\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: 1, total: 1 }, this.name);\n\t } else {\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: this.el.currentTime, total: this.el.duration }, this.name);\n\t }\n\t };\n\t\n\t HTML5Video.prototype._onProgress = function _onProgress() {\n\t if (!this.el.buffered.length) {\n\t return;\n\t }\n\t var buffered = [];\n\t var bufferedPos = 0;\n\t for (var i = 0; i < this.el.buffered.length; i++) {\n\t buffered = [].concat(_toConsumableArray(buffered), [{ start: this.el.buffered.start(i), end: this.el.buffered.end(i) }]);\n\t if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) {\n\t bufferedPos = i;\n\t }\n\t }\n\t var progress = {\n\t start: buffered[bufferedPos].start,\n\t current: buffered[bufferedPos].end,\n\t total: this.el.duration\n\t };\n\t this.trigger(_events2.default.PLAYBACK_PROGRESS, progress, buffered);\n\t };\n\t\n\t HTML5Video.prototype._typeFor = function _typeFor(src) {\n\t var mimeTypes = HTML5Video._mimeTypesForUrl(src, MIMETYPES, this.options.mimeType);\n\t if (mimeTypes.length == 0) {\n\t mimeTypes = HTML5Video._mimeTypesForUrl(src, AUDIO_MIMETYPES, this.options.mimeType);\n\t }\n\t var mimeType = mimeTypes[0] || '';\n\t return mimeType.split(';')[0];\n\t };\n\t\n\t HTML5Video.prototype._ready = function _ready() {\n\t if (this._isReadyState) {\n\t return;\n\t }\n\t this._isReadyState = true;\n\t this.trigger(_events2.default.PLAYBACK_READY, this.name);\n\t };\n\t\n\t HTML5Video.prototype.render = function render() {\n\t var style = _styler2.default.getStyleFor(_style2.default);\n\t\n\t if (this.options.playback.disableContextMenu) {\n\t this.$el.on('contextmenu', function () {\n\t return false;\n\t });\n\t }\n\t\n\t this.$el.append(style);\n\t this._ready();\n\t return this;\n\t };\n\t\n\t _createClass(HTML5Video, [{\n\t key: 'isReady',\n\t get: function get() {\n\t return this._isReadyState;\n\t }\n\t }]);\n\t\n\t return HTML5Video;\n\t}(_playback2.default);\n\t\n\texports.default = HTML5Video;\n\t\n\t\n\tHTML5Video._mimeTypesForUrl = function (resourceUrl, mimeTypesByExtension, mimeType) {\n\t var extension = (resourceUrl.split('?')[0].match(/.*\\.(.*)$/) || [])[1];\n\t var mimeTypes = mimeType || extension && mimeTypesByExtension[extension.toLowerCase()] || [];\n\t return mimeTypes.constructor === Array ? mimeTypes : [mimeTypes];\n\t};\n\t\n\tHTML5Video._canPlay = function (type, mimeTypesByExtension, resourceUrl, mimeType) {\n\t var mimeTypes = HTML5Video._mimeTypesForUrl(resourceUrl, mimeTypesByExtension, mimeType);\n\t var media = document.createElement(type);\n\t return !!mimeTypes.filter(function (mediaType) {\n\t return !!media.canPlayType(mediaType).replace(/no/, '');\n\t })[0];\n\t};\n\t\n\tHTML5Video.canPlay = function (resourceUrl, mimeType) {\n\t return HTML5Video._canPlay('audio', AUDIO_MIMETYPES, resourceUrl, mimeType) || HTML5Video._canPlay('video', MIMETYPES, resourceUrl, mimeType);\n\t};\n\t\n\tmodule.exports = HTML5Video;\n\tmodule.exports = exports['default'];\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./~/process/browser.js */ 21)))\n\n/***/ },\n/* 54 */\n/*!********************************************!*\\\n !*** ./src/playbacks/html_img/html_img.js ***!\n \\********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _style = __webpack_require__(/*! ./public/style.scss */ 83);\n\t\n\tvar _style2 = _interopRequireDefault(_style);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar HTMLImg = function (_Playback) {\n\t _inherits(HTMLImg, _Playback);\n\t\n\t HTMLImg.prototype.getPlaybackType = function getPlaybackType() {\n\t return _playback2.default.NO_OP;\n\t };\n\t\n\t _createClass(HTMLImg, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'html_img';\n\t }\n\t }, {\n\t key: 'tagName',\n\t get: function get() {\n\t return 'img';\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t return {\n\t 'data-html-img': ''\n\t };\n\t }\n\t }, {\n\t key: 'events',\n\t get: function get() {\n\t return {\n\t 'load': '_onLoad',\n\t 'abort': '_onError',\n\t 'error': '_onError'\n\t };\n\t }\n\t }]);\n\t\n\t function HTMLImg(params) {\n\t _classCallCheck(this, HTMLImg);\n\t\n\t var _this = _possibleConstructorReturn(this, _Playback.call(this, params));\n\t\n\t _this.el.src = params.src;\n\t return _this;\n\t }\n\t\n\t HTMLImg.prototype.render = function render() {\n\t var style = _styler2.default.getStyleFor(_style2.default);\n\t this.$el.append(style);\n\t this.trigger(_events2.default.PLAYBACK_READY, this.name);\n\t return this;\n\t };\n\t\n\t HTMLImg.prototype._onLoad = function _onLoad() {\n\t this.trigger(_events2.default.PLAYBACK_ENDED, this.name);\n\t };\n\t\n\t HTMLImg.prototype._onError = function _onError(evt) {\n\t var m = evt.type === 'error' ? 'load error' : 'loading aborted';\n\t this.trigger(_events2.default.PLAYBACK_ERROR, { message: m }, this.name);\n\t };\n\t\n\t return HTMLImg;\n\t}(_playback2.default);\n\t\n\texports.default = HTMLImg;\n\t\n\t\n\tHTMLImg.canPlay = function (resource) {\n\t return (/\\.(png|jpg|jpeg|gif|bmp|tiff|pgm|pnm|webp)(|\\?.*)$/i.test(resource)\n\t );\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 55 */\n/*!**************************************!*\\\n !*** ./src/playbacks/no_op/no_op.js ***!\n \\**************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _style = __webpack_require__(/*! ./public/style.scss */ 84);\n\t\n\tvar _style2 = _interopRequireDefault(_style);\n\t\n\tvar _error = __webpack_require__(/*! ./public/error.html */ 93);\n\t\n\tvar _error2 = _interopRequireDefault(_error);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar NoOp = function (_Playback) {\n\t _inherits(NoOp, _Playback);\n\t\n\t _createClass(NoOp, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'no_op';\n\t }\n\t }, {\n\t key: 'template',\n\t get: function get() {\n\t return (0, _template2.default)(_error2.default);\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t return { 'data-no-op': '' };\n\t }\n\t }]);\n\t\n\t function NoOp() {\n\t _classCallCheck(this, NoOp);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var _this = _possibleConstructorReturn(this, _Playback.call.apply(_Playback, [this].concat(args)));\n\t\n\t _this._noiseFrameNum = -1;\n\t _this._started = false;\n\t return _this;\n\t }\n\t\n\t NoOp.prototype.render = function render() {\n\t var style = _styler2.default.getStyleFor(_style2.default);\n\t var playbackNotSupported = this.options.playbackNotSupportedMessage || this.i18n.t('playback_not_supported');\n\t this.$el.html(this.template({ message: playbackNotSupported }));\n\t this.$el.append(style);\n\t this.trigger(_events2.default.PLAYBACK_READY, this.name);\n\t var showForNoOp = !!(this.options.poster && this.options.poster.showForNoOp);\n\t if (this.options.autoPlay || !showForNoOp) {\n\t this.play();\n\t }\n\t return this;\n\t };\n\t\n\t NoOp.prototype.play = function play() {\n\t if (!this._started) {\n\t this._started = true;\n\t this.trigger(_events2.default.PLAYBACK_PLAY);\n\t this._animate();\n\t }\n\t };\n\t\n\t NoOp.prototype._noise = function _noise() {\n\t this._noiseFrameNum = (this._noiseFrameNum + 1) % 5;\n\t if (this._noiseFrameNum) {\n\t // only update noise every 5 frames to save cpu\n\t return;\n\t }\n\t\n\t var idata = this.context.createImageData(this.context.canvas.width, this.context.canvas.height);\n\t var buffer32 = void 0;\n\t try {\n\t buffer32 = new Uint32Array(idata.data.buffer);\n\t } catch (err) {\n\t buffer32 = new Uint32Array(this.context.canvas.width * this.context.canvas.height * 4);\n\t var data = idata.data;\n\t for (var i = 0; i < data.length; i++) {\n\t buffer32[i] = data[i];\n\t }\n\t }\n\t\n\t var len = buffer32.length,\n\t m = Math.random() * 6 + 4;\n\t var run = 0,\n\t color = 0;\n\t for (var _i = 0; _i < len;) {\n\t if (run < 0) {\n\t run = m * Math.random();\n\t var p = Math.pow(Math.random(), 0.4);\n\t color = 255 * p << 24;\n\t }\n\t run -= 1;\n\t buffer32[_i++] = color;\n\t }\n\t this.context.putImageData(idata, 0, 0);\n\t };\n\t\n\t NoOp.prototype._loop = function _loop() {\n\t var _this2 = this;\n\t\n\t if (this._stop) {\n\t return;\n\t }\n\t this._noise();\n\t this._animationHandle = (0, _utils.requestAnimationFrame)(function () {\n\t return _this2._loop();\n\t });\n\t };\n\t\n\t NoOp.prototype.destroy = function destroy() {\n\t if (this._animationHandle) {\n\t (0, _utils.cancelAnimationFrame)(this._animationHandle);\n\t this._stop = true;\n\t }\n\t };\n\t\n\t NoOp.prototype._animate = function _animate() {\n\t this.canvas = this.$el.find('canvas[data-no-op-canvas]')[0];\n\t this.context = this.canvas.getContext('2d');\n\t this._loop();\n\t };\n\t\n\t return NoOp;\n\t}(_playback2.default);\n\t\n\texports.default = NoOp;\n\t\n\t\n\tNoOp.canPlay = function (source) {\n\t // eslint-disable-line no-unused-vars\n\t return true;\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 56 */\n/*!******************************************************!*\\\n !*** ./src/plugins/click_to_pause/click_to_pause.js ***!\n \\******************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _container_plugin = __webpack_require__(/*! base/container_plugin */ 13);\n\t\n\tvar _container_plugin2 = _interopRequireDefault(_container_plugin);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } //Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar ClickToPausePlugin = function (_ContainerPlugin) {\n\t _inherits(ClickToPausePlugin, _ContainerPlugin);\n\t\n\t _createClass(ClickToPausePlugin, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'click_to_pause';\n\t }\n\t }]);\n\t\n\t function ClickToPausePlugin(container) {\n\t _classCallCheck(this, ClickToPausePlugin);\n\t\n\t return _possibleConstructorReturn(this, _ContainerPlugin.call(this, container));\n\t }\n\t\n\t ClickToPausePlugin.prototype.bindEvents = function bindEvents() {\n\t this.listenTo(this.container, _events2.default.CONTAINER_CLICK, this.click);\n\t this.listenTo(this.container, _events2.default.CONTAINER_SETTINGSUPDATE, this.settingsUpdate);\n\t };\n\t\n\t ClickToPausePlugin.prototype.click = function click() {\n\t if (this.container.getPlaybackType() !== _playback2.default.LIVE || this.container.isDvrEnabled()) {\n\t if (this.container.isPlaying()) {\n\t this.container.pause();\n\t } else {\n\t this.container.play();\n\t }\n\t }\n\t };\n\t\n\t ClickToPausePlugin.prototype.settingsUpdate = function settingsUpdate() {\n\t this.container.$el.removeClass('pointer-enabled');\n\t if (this.container.getPlaybackType() !== _playback2.default.LIVE || this.container.isDvrEnabled()) {\n\t this.container.$el.addClass('pointer-enabled');\n\t }\n\t };\n\t\n\t return ClickToPausePlugin;\n\t}(_container_plugin2.default);\n\t\n\texports.default = ClickToPausePlugin;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 57 */\n/*!*********************************************!*\\\n !*** ./src/plugins/click_to_pause/index.js ***!\n \\*********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./click_to_pause */ 56);\n\n/***/ },\n/* 58 */\n/*!**************************************************!*\\\n !*** ./src/plugins/dvr_controls/dvr_controls.js ***!\n \\**************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _ui_core_plugin = __webpack_require__(/*! base/ui_core_plugin */ 17);\n\t\n\tvar _ui_core_plugin2 = _interopRequireDefault(_ui_core_plugin);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _dvr_controls = __webpack_require__(/*! ./public/dvr_controls.scss */ 85);\n\t\n\tvar _dvr_controls2 = _interopRequireDefault(_dvr_controls);\n\t\n\tvar _index = __webpack_require__(/*! ./public/index.html */ 94);\n\t\n\tvar _index2 = _interopRequireDefault(_index);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar DVRControls = function (_UICorePlugin) {\n\t _inherits(DVRControls, _UICorePlugin);\n\t\n\t _createClass(DVRControls, [{\n\t key: 'template',\n\t get: function get() {\n\t return (0, _template2.default)(_index2.default);\n\t }\n\t }, {\n\t key: 'name',\n\t get: function get() {\n\t return 'dvr_controls';\n\t }\n\t }, {\n\t key: 'events',\n\t get: function get() {\n\t return {\n\t 'click .live-button': 'click'\n\t };\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t return {\n\t 'class': 'dvr-controls',\n\t 'data-dvr-controls': ''\n\t };\n\t }\n\t }]);\n\t\n\t function DVRControls(core) {\n\t _classCallCheck(this, DVRControls);\n\t\n\t var _this = _possibleConstructorReturn(this, _UICorePlugin.call(this, core));\n\t\n\t _this.settingsUpdate();\n\t return _this;\n\t }\n\t\n\t DVRControls.prototype.bindEvents = function bindEvents() {\n\t this.listenTo(this.core.mediaControl, _events2.default.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged);\n\t this.listenTo(this.core.mediaControl, _events2.default.MEDIACONTROL_RENDERED, this.settingsUpdate);\n\t this.listenTo(this.core, _events2.default.CORE_OPTIONS_CHANGE, this.render);\n\t if (this.core.getCurrentContainer()) {\n\t this.listenToOnce(this.core.getCurrentContainer(), _events2.default.CONTAINER_TIMEUPDATE, this.render);\n\t this.listenTo(this.core.getCurrentContainer(), _events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, this.dvrChanged);\n\t }\n\t };\n\t\n\t DVRControls.prototype.containerChanged = function containerChanged() {\n\t this.stopListening();\n\t this.bindEvents();\n\t };\n\t\n\t DVRControls.prototype.dvrChanged = function dvrChanged(dvrEnabled) {\n\t this.settingsUpdate();\n\t this.core.mediaControl.$el.addClass('live');\n\t if (dvrEnabled) {\n\t this.core.mediaControl.$el.addClass('dvr');\n\t this.core.mediaControl.$el.find('.media-control-indicator[data-position], .media-control-indicator[data-duration]').hide();\n\t } else {\n\t this.core.mediaControl.$el.removeClass('dvr');\n\t }\n\t };\n\t\n\t DVRControls.prototype.click = function click() {\n\t var mediaControl = this.core.mediaControl;\n\t var container = mediaControl.container;\n\t if (!container.isPlaying()) {\n\t container.play();\n\t }\n\t if (mediaControl.$el.hasClass('dvr')) {\n\t container.seek(container.getDuration());\n\t }\n\t };\n\t\n\t DVRControls.prototype.settingsUpdate = function settingsUpdate() {\n\t var _this2 = this;\n\t\n\t this.stopListening();\n\t if (this.shouldRender()) {\n\t this.render();\n\t this.$el.click(function () {\n\t return _this2.click();\n\t });\n\t }\n\t this.bindEvents();\n\t };\n\t\n\t DVRControls.prototype.shouldRender = function shouldRender() {\n\t var useDvrControls = this.core.options.useDvrControls === undefined || !!this.core.options.useDvrControls;\n\t return useDvrControls && this.core.getPlaybackType() === _playback2.default.LIVE;\n\t };\n\t\n\t DVRControls.prototype.render = function render() {\n\t this.style = this.style || _styler2.default.getStyleFor(_dvr_controls2.default, { baseUrl: this.core.options.baseUrl });\n\t this.$el.html(this.template({\n\t live: this.core.i18n.t('live'),\n\t backToLive: this.core.i18n.t('back_to_live')\n\t }));\n\t this.$el.append(this.style);\n\t if (this.shouldRender()) {\n\t this.core.mediaControl.$el.addClass('live');\n\t this.core.mediaControl.$('.media-control-left-panel[data-media-control]').append(this.$el);\n\t }\n\t return this;\n\t };\n\t\n\t return DVRControls;\n\t}(_ui_core_plugin2.default);\n\t\n\texports.default = DVRControls;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 59 */\n/*!*******************************************!*\\\n !*** ./src/plugins/dvr_controls/index.js ***!\n \\*******************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./dvr_controls */ 58);\n\n/***/ },\n/* 60 */\n/*!**********************************!*\\\n !*** ./src/plugins/end_video.js ***!\n \\**********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _core_plugin = __webpack_require__(/*! base/core_plugin */ 12);\n\t\n\tvar _core_plugin2 = _interopRequireDefault(_core_plugin);\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar EndVideo = function (_CorePlugin) {\n\t _inherits(EndVideo, _CorePlugin);\n\t\n\t function EndVideo() {\n\t _classCallCheck(this, EndVideo);\n\t\n\t return _possibleConstructorReturn(this, _CorePlugin.apply(this, arguments));\n\t }\n\t\n\t EndVideo.prototype.bindEvents = function bindEvents() {\n\t this.listenTo(this.core.mediaControl, _events2.default.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged);\n\t var container = this.core.getCurrentContainer();\n\t if (container) {\n\t this.listenTo(container, _events2.default.CONTAINER_ENDED, this.ended);\n\t this.listenTo(container, _events2.default.CONTAINER_STOP, this.ended);\n\t }\n\t };\n\t\n\t EndVideo.prototype.containerChanged = function containerChanged() {\n\t this.stopListening();\n\t this.bindEvents();\n\t };\n\t\n\t EndVideo.prototype.ended = function ended() {\n\t var exitOnEnd = typeof this.core.options.exitFullscreenOnEnd === 'undefined' || this.core.options.exitFullscreenOnEnd;\n\t if (exitOnEnd && _utils.Fullscreen.isFullscreen()) {\n\t this.core.toggleFullscreen();\n\t }\n\t };\n\t\n\t _createClass(EndVideo, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'end_video';\n\t }\n\t }]);\n\t\n\t return EndVideo;\n\t}(_core_plugin2.default);\n\t\n\texports.default = EndVideo;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 61 */\n/*!****************************************!*\\\n !*** ./src/plugins/favicon/favicon.js ***!\n \\****************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _core_plugin = __webpack_require__(/*! base/core_plugin */ 12);\n\t\n\tvar _core_plugin2 = _interopRequireDefault(_core_plugin);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tvar _play = __webpack_require__(/*! icons/01-play.svg */ 22);\n\t\n\tvar _play2 = _interopRequireDefault(_play);\n\t\n\tvar _pause = __webpack_require__(/*! icons/02-pause.svg */ 36);\n\t\n\tvar _pause2 = _interopRequireDefault(_pause);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar oldIcon = (0, _clapprZepto2.default)('link[rel=\"shortcut icon\"]');\n\t\n\tvar Favicon = function (_CorePlugin) {\n\t _inherits(Favicon, _CorePlugin);\n\t\n\t _createClass(Favicon, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'favicon';\n\t }\n\t }, {\n\t key: 'oldIcon',\n\t get: function get() {\n\t return oldIcon;\n\t }\n\t }]);\n\t\n\t function Favicon(core) {\n\t _classCallCheck(this, Favicon);\n\t\n\t var _this = _possibleConstructorReturn(this, _CorePlugin.call(this, core));\n\t\n\t _this._container = null;\n\t _this.configure();\n\t return _this;\n\t }\n\t\n\t Favicon.prototype.configure = function configure() {\n\t if (this.core.options.changeFavicon) {\n\t if (!this.enabled) {\n\t this.stopListening(this.core, _events2.default.CORE_OPTIONS_CHANGE);\n\t this.enable();\n\t }\n\t } else if (this.enabled) {\n\t this.disable();\n\t this.listenTo(this.core, _events2.default.CORE_OPTIONS_CHANGE, this.configure);\n\t }\n\t };\n\t\n\t Favicon.prototype.bindEvents = function bindEvents() {\n\t this.listenTo(this.core, _events2.default.CORE_OPTIONS_CHANGE, this.configure);\n\t this.listenTo(this.core.mediaControl, _events2.default.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged);\n\t if (this.core.mediaControl.container) {\n\t this.containerChanged();\n\t }\n\t };\n\t\n\t Favicon.prototype.containerChanged = function containerChanged() {\n\t this._container && this.stopListening(this._container);\n\t this._container = this.core.mediaControl.container;\n\t this.listenTo(this._container, _events2.default.CONTAINER_PLAY, this.setPlayIcon);\n\t this.listenTo(this._container, _events2.default.CONTAINER_PAUSE, this.setPauseIcon);\n\t this.listenTo(this._container, _events2.default.CONTAINER_STOP, this.resetIcon);\n\t this.listenTo(this._container, _events2.default.CONTAINER_ENDED, this.resetIcon);\n\t this.listenTo(this._container, _events2.default.CONTAINER_ERROR, this.resetIcon);\n\t this.resetIcon();\n\t };\n\t\n\t Favicon.prototype.disable = function disable() {\n\t _CorePlugin.prototype.disable.call(this);\n\t this.resetIcon();\n\t };\n\t\n\t Favicon.prototype.destroy = function destroy() {\n\t _CorePlugin.prototype.destroy.call(this);\n\t this.resetIcon();\n\t };\n\t\n\t Favicon.prototype.createIcon = function createIcon(svg) {\n\t var canvas = (0, _clapprZepto2.default)('<canvas/>');\n\t canvas[0].width = 16;\n\t canvas[0].height = 16;\n\t var ctx = canvas[0].getContext('2d');\n\t ctx.fillStyle = '#000';\n\t var d = (0, _clapprZepto2.default)(svg).find('path').attr('d');\n\t var path = new Path2D(d);\n\t ctx.fill(path);\n\t var icon = (0, _clapprZepto2.default)('<link rel=\"shortcut icon\" type=\"image/png\"/>');\n\t icon.attr('href', canvas[0].toDataURL('image/png'));\n\t return icon;\n\t };\n\t\n\t Favicon.prototype.setPlayIcon = function setPlayIcon() {\n\t if (!this.playIcon) {\n\t this.playIcon = this.createIcon(_play2.default);\n\t }\n\t this.changeIcon(this.playIcon);\n\t };\n\t\n\t Favicon.prototype.setPauseIcon = function setPauseIcon() {\n\t if (!this.pauseIcon) {\n\t this.pauseIcon = this.createIcon(_pause2.default);\n\t }\n\t this.changeIcon(this.pauseIcon);\n\t };\n\t\n\t Favicon.prototype.resetIcon = function resetIcon() {\n\t (0, _clapprZepto2.default)('link[rel=\"shortcut icon\"]').remove();\n\t (0, _clapprZepto2.default)('head').append(this.oldIcon);\n\t };\n\t\n\t Favicon.prototype.changeIcon = function changeIcon(icon) {\n\t if (icon) {\n\t (0, _clapprZepto2.default)('link[rel=\"shortcut icon\"]').remove();\n\t (0, _clapprZepto2.default)('head').append(icon);\n\t }\n\t };\n\t\n\t return Favicon;\n\t}(_core_plugin2.default);\n\t\n\texports.default = Favicon;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 62 */\n/*!**************************************!*\\\n !*** ./src/plugins/favicon/index.js ***!\n \\**************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./favicon.js */ 61);\n\n/***/ },\n/* 63 */\n/*!**********************************************************!*\\\n !*** ./src/plugins/google_analytics/google_analytics.js ***!\n \\**********************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _container_plugin = __webpack_require__(/*! base/container_plugin */ 13);\n\t\n\tvar _container_plugin2 = _interopRequireDefault(_container_plugin);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar GoogleAnalytics = function (_ContainerPlugin) {\n\t _inherits(GoogleAnalytics, _ContainerPlugin);\n\t\n\t _createClass(GoogleAnalytics, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'google_analytics';\n\t }\n\t }]);\n\t\n\t function GoogleAnalytics(container) {\n\t _classCallCheck(this, GoogleAnalytics);\n\t\n\t var _this = _possibleConstructorReturn(this, _ContainerPlugin.call(this, container));\n\t\n\t if (_this.container.options.gaAccount) {\n\t _this.account = _this.container.options.gaAccount;\n\t _this.trackerName = _this.container.options.gaTrackerName ? _this.container.options.gaTrackerName + '.' : 'Clappr.';\n\t _this.domainName = _this.container.options.gaDomainName;\n\t _this.currentHDState = undefined;\n\t _this.embedScript();\n\t }\n\t return _this;\n\t }\n\t\n\t GoogleAnalytics.prototype.embedScript = function embedScript() {\n\t var _this2 = this;\n\t\n\t if (!window._gat) {\n\t var script = document.createElement('script');\n\t script.setAttribute('type', 'text/javascript');\n\t script.setAttribute('async', 'async');\n\t script.setAttribute('src', '//www.google-analytics.com/ga.js');\n\t script.onload = function () {\n\t return _this2.addEventListeners();\n\t };\n\t document.body.appendChild(script);\n\t } else {\n\t this.addEventListeners();\n\t }\n\t };\n\t\n\t GoogleAnalytics.prototype.addEventListeners = function addEventListeners() {\n\t var _this3 = this;\n\t\n\t if (this.container) {\n\t this.listenTo(this.container, _events2.default.CONTAINER_READY, this.onReady);\n\t this.listenTo(this.container, _events2.default.CONTAINER_PLAY, this.onPlay);\n\t this.listenTo(this.container, _events2.default.CONTAINER_STOP, this.onStop);\n\t this.listenTo(this.container, _events2.default.CONTAINER_PAUSE, this.onPause);\n\t this.listenTo(this.container, _events2.default.CONTAINER_ENDED, this.onEnded);\n\t this.listenTo(this.container, _events2.default.CONTAINER_STATE_BUFFERING, this.onBuffering);\n\t this.listenTo(this.container, _events2.default.CONTAINER_STATE_BUFFERFULL, this.onBufferFull);\n\t this.listenTo(this.container, _events2.default.CONTAINER_ERROR, this.onError);\n\t this.listenTo(this.container, _events2.default.CONTAINER_PLAYBACKSTATE, this.onPlaybackChanged);\n\t this.listenTo(this.container, _events2.default.CONTAINER_VOLUME, function (event) {\n\t return _this3.onVolumeChanged(event);\n\t });\n\t this.listenTo(this.container, _events2.default.CONTAINER_SEEK, function (event) {\n\t return _this3.onSeek(event);\n\t });\n\t this.listenTo(this.container, _events2.default.CONTAINER_FULL_SCREEN, this.onFullscreen);\n\t this.listenTo(this.container, _events2.default.CONTAINER_HIGHDEFINITIONUPDATE, this.onHD);\n\t this.listenTo(this.container, _events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, this.onDVR);\n\t }\n\t _gaq.push([this.trackerName + '_setAccount', this.account]);\n\t if (this.domainName) _gaq.push([this.trackerName + '_setDomainName', this.domainName]);\n\t };\n\t\n\t GoogleAnalytics.prototype.onReady = function onReady() {\n\t this.push(['Video', 'Playback', this.container.playback.name]);\n\t };\n\t\n\t GoogleAnalytics.prototype.onPlay = function onPlay() {\n\t this.push(['Video', 'Play', this.container.playback.src]);\n\t };\n\t\n\t GoogleAnalytics.prototype.onStop = function onStop() {\n\t this.push(['Video', 'Stop', this.container.playback.src]);\n\t };\n\t\n\t GoogleAnalytics.prototype.onEnded = function onEnded() {\n\t this.push(['Video', 'Ended', this.container.playback.src]);\n\t };\n\t\n\t GoogleAnalytics.prototype.onBuffering = function onBuffering() {\n\t this.push(['Video', 'Buffering', this.container.playback.src]);\n\t };\n\t\n\t GoogleAnalytics.prototype.onBufferFull = function onBufferFull() {\n\t this.push(['Video', 'Bufferfull', this.container.playback.src]);\n\t };\n\t\n\t GoogleAnalytics.prototype.onError = function onError() {\n\t this.push(['Video', 'Error', this.container.playback.src]);\n\t };\n\t\n\t GoogleAnalytics.prototype.onHD = function onHD(isHD) {\n\t var status = isHD ? 'ON' : 'OFF';\n\t if (status !== this.currentHDState) {\n\t this.currentHDState = status;\n\t this.push(['Video', 'HD - ' + status, this.container.playback.src]);\n\t }\n\t };\n\t\n\t GoogleAnalytics.prototype.onPlaybackChanged = function onPlaybackChanged(playbackState) {\n\t if (playbackState.type !== null) {\n\t this.push(['Video', 'Playback Type - ' + playbackState.type, this.container.playback.src]);\n\t }\n\t };\n\t\n\t GoogleAnalytics.prototype.onDVR = function onDVR(dvrInUse) {\n\t var status = dvrInUse ? 'ON' : 'OFF';\n\t this.push(['Interaction', 'DVR - ' + status, this.container.playback.src]);\n\t };\n\t\n\t GoogleAnalytics.prototype.onPause = function onPause() {\n\t this.push(['Video', 'Pause', this.container.playback.src]);\n\t };\n\t\n\t GoogleAnalytics.prototype.onSeek = function onSeek() {\n\t this.push(['Video', 'Seek', this.container.playback.src]);\n\t };\n\t\n\t GoogleAnalytics.prototype.onVolumeChanged = function onVolumeChanged() {\n\t this.push(['Interaction', 'Volume', this.container.playback.src]);\n\t };\n\t\n\t GoogleAnalytics.prototype.onFullscreen = function onFullscreen() {\n\t this.push(['Interaction', 'Fullscreen', this.container.playback.src]);\n\t };\n\t\n\t GoogleAnalytics.prototype.push = function push(array) {\n\t var res = [this.trackerName + '_trackEvent'].concat(array);\n\t _gaq.push(res);\n\t };\n\t\n\t return GoogleAnalytics;\n\t}(_container_plugin2.default);\n\t\n\texports.default = GoogleAnalytics;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 64 */\n/*!***********************************************!*\\\n !*** ./src/plugins/google_analytics/index.js ***!\n \\***********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./google_analytics */ 63);\n\n/***/ },\n/* 65 */\n/*!********************************!*\\\n !*** ./src/plugins/log/log.js ***!\n \\********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _vendor = __webpack_require__(/*! vendor */ 20);\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar BOLD = 'font-weight: bold; font-size: 13px;';\n\tvar INFO = 'color: #006600;' + BOLD;\n\tvar DEBUG = 'color: #0000ff;' + BOLD;\n\tvar WARN = 'color: #ff8000;' + BOLD;\n\tvar ERROR = 'color: #ff0000;' + BOLD;\n\t\n\tvar LEVEL_DEBUG = 0;\n\tvar LEVEL_INFO = 1;\n\tvar LEVEL_WARN = 2;\n\tvar LEVEL_ERROR = 3;\n\tvar LEVEL_DISABLED = LEVEL_ERROR;\n\t\n\tvar COLORS = [DEBUG, INFO, WARN, ERROR, ERROR];\n\tvar DESCRIPTIONS = ['debug', 'info', 'warn', 'error', 'disabled'];\n\t\n\tvar Log = function () {\n\t function Log() {\n\t var _this = this;\n\t\n\t var level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : LEVEL_INFO;\n\t var offLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : LEVEL_DISABLED;\n\t\n\t _classCallCheck(this, Log);\n\t\n\t this.kibo = new _vendor.Kibo();\n\t this.kibo.down(['ctrl shift d'], function () {\n\t return _this.onOff();\n\t });\n\t this.BLACKLIST = ['timeupdate', 'playback:timeupdate', 'playback:progress', 'container:hover', 'container:timeupdate', 'container:progress'];\n\t this.level = level;\n\t this.offLevel = offLevel;\n\t }\n\t\n\t Log.prototype.debug = function debug(klass) {\n\t this.log(klass, LEVEL_DEBUG, Array.prototype.slice.call(arguments, 1));\n\t };\n\t\n\t Log.prototype.info = function info(klass) {\n\t this.log(klass, LEVEL_INFO, Array.prototype.slice.call(arguments, 1));\n\t };\n\t\n\t Log.prototype.warn = function warn(klass) {\n\t this.log(klass, LEVEL_WARN, Array.prototype.slice.call(arguments, 1));\n\t };\n\t\n\t Log.prototype.error = function error(klass) {\n\t this.log(klass, LEVEL_ERROR, Array.prototype.slice.call(arguments, 1));\n\t };\n\t\n\t Log.prototype.onOff = function onOff() {\n\t if (this.level === this.offLevel) {\n\t this.level = this.previousLevel;\n\t } else {\n\t this.previousLevel = this.level;\n\t this.level = this.offLevel;\n\t }\n\t // handle instances where console.log is unavailable\n\t if (window.console && window.console.log) {\n\t window.console.log('%c[Clappr.Log] set log level to ' + DESCRIPTIONS[this.level], WARN);\n\t }\n\t };\n\t\n\t Log.prototype.level = function level(newLevel) {\n\t this.level = newLevel;\n\t };\n\t\n\t Log.prototype.log = function log(klass, level, message) {\n\t if (this.BLACKLIST.indexOf(message[0]) >= 0) return;\n\t if (level < this.level) return;\n\t\n\t if (!message) {\n\t message = klass;\n\t klass = null;\n\t }\n\t var color = COLORS[level];\n\t var klassDescription = '';\n\t if (klass) {\n\t klassDescription = '[' + klass + ']';\n\t }\n\t if (window.console && window.console.log) {\n\t window.console.log.apply(console, ['%c[' + DESCRIPTIONS[level] + ']' + klassDescription, color].concat(message));\n\t }\n\t };\n\t\n\t return Log;\n\t}();\n\t\n\texports.default = Log;\n\t\n\t\n\tLog.LEVEL_DEBUG = LEVEL_DEBUG;\n\tLog.LEVEL_INFO = LEVEL_INFO;\n\tLog.LEVEL_WARN = LEVEL_WARN;\n\tLog.LEVEL_ERROR = LEVEL_ERROR;\n\t\n\tLog.getInstance = function () {\n\t if (this._instance === undefined) {\n\t this._instance = new this();\n\t this._instance.previousLevel = this._instance.level;\n\t this._instance.level = this._instance.offLevel;\n\t }\n\t return this._instance;\n\t};\n\t\n\tLog.setLevel = function (level) {\n\t this.getInstance().level = level;\n\t};\n\t\n\tLog.debug = function () {\n\t this.getInstance().debug.apply(this.getInstance(), arguments);\n\t};\n\tLog.info = function () {\n\t this.getInstance().info.apply(this.getInstance(), arguments);\n\t};\n\tLog.warn = function () {\n\t this.getInstance().warn.apply(this.getInstance(), arguments);\n\t};\n\tLog.error = function () {\n\t this.getInstance().error.apply(this.getInstance(), arguments);\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 66 */\n/*!**************************************!*\\\n !*** ./src/plugins/poster/poster.js ***!\n \\**************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _ui_container_plugin = __webpack_require__(/*! base/ui_container_plugin */ 14);\n\t\n\tvar _ui_container_plugin2 = _interopRequireDefault(_ui_container_plugin);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _poster = __webpack_require__(/*! ./public/poster.scss */ 86);\n\t\n\tvar _poster2 = _interopRequireDefault(_poster);\n\t\n\tvar _poster3 = __webpack_require__(/*! ./public/poster.html */ 95);\n\t\n\tvar _poster4 = _interopRequireDefault(_poster3);\n\t\n\tvar _play = __webpack_require__(/*! icons/01-play.svg */ 22);\n\t\n\tvar _play2 = _interopRequireDefault(_play);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } //Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar PosterPlugin = function (_UIContainerPlugin) {\n\t _inherits(PosterPlugin, _UIContainerPlugin);\n\t\n\t _createClass(PosterPlugin, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'poster';\n\t }\n\t }, {\n\t key: 'template',\n\t get: function get() {\n\t return (0, _template2.default)(_poster4.default);\n\t }\n\t }, {\n\t key: 'shouldRender',\n\t get: function get() {\n\t var showForNoOp = !!(this.options.poster && this.options.poster.showForNoOp);\n\t return this.container.playback.name !== 'html_img' && (this.container.playback.getPlaybackType() !== _playback2.default.NO_OP || showForNoOp);\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t return {\n\t 'class': 'player-poster',\n\t 'data-poster': ''\n\t };\n\t }\n\t }, {\n\t key: 'events',\n\t get: function get() {\n\t return {\n\t 'click': 'clicked'\n\t };\n\t }\n\t }, {\n\t key: 'showOnVideoEnd',\n\t get: function get() {\n\t return !this.options.poster || this.options.poster.showOnVideoEnd || this.options.poster.showOnVideoEnd === undefined;\n\t }\n\t }]);\n\t\n\t function PosterPlugin(container) {\n\t _classCallCheck(this, PosterPlugin);\n\t\n\t var _this = _possibleConstructorReturn(this, _UIContainerPlugin.call(this, container));\n\t\n\t _this.hasStartedPlaying = false;\n\t _this.playRequested = false;\n\t _this.render();\n\t process.nextTick(function () {\n\t return _this.update();\n\t });\n\t return _this;\n\t }\n\t\n\t PosterPlugin.prototype.bindEvents = function bindEvents() {\n\t this.listenTo(this.container, _events2.default.CONTAINER_STOP, this.onStop);\n\t this.listenTo(this.container, _events2.default.CONTAINER_PLAY, this.onPlay);\n\t this.listenTo(this.container, _events2.default.CONTAINER_STATE_BUFFERING, this.update);\n\t this.listenTo(this.container, _events2.default.CONTAINER_STATE_BUFFERFULL, this.update);\n\t this.listenTo(this.container, _events2.default.CONTAINER_OPTIONS_CHANGE, this.render);\n\t this.showOnVideoEnd && this.listenTo(this.container, _events2.default.CONTAINER_ENDED, this.onStop);\n\t };\n\t\n\t PosterPlugin.prototype.stopListening = function stopListening() {\n\t _UIContainerPlugin.prototype.stopListening.call(this);\n\t };\n\t\n\t PosterPlugin.prototype.onPlay = function onPlay() {\n\t this.hasStartedPlaying = true;\n\t this.update();\n\t };\n\t\n\t PosterPlugin.prototype.onStop = function onStop() {\n\t this.hasStartedPlaying = false;\n\t this.playRequested = false;\n\t this.update();\n\t };\n\t\n\t PosterPlugin.prototype.showPlayButton = function showPlayButton(show) {\n\t if (show && (!this.options.chromeless || this.options.allowUserInteraction)) {\n\t this.$playButton.show();\n\t this.$el.addClass('clickable');\n\t } else {\n\t this.$playButton.hide();\n\t this.$el.removeClass('clickable');\n\t }\n\t };\n\t\n\t PosterPlugin.prototype.clicked = function clicked() {\n\t if (!this.options.chromeless || this.options.allowUserInteraction) {\n\t this.playRequested = true;\n\t this.update();\n\t this.container.play();\n\t }\n\t return false;\n\t };\n\t\n\t PosterPlugin.prototype.shouldHideOnPlay = function shouldHideOnPlay() {\n\t // Audio broadcasts should keep the poster up; video should hide poster while playing.\n\t return !this.container.playback.isAudioOnly;\n\t };\n\t\n\t PosterPlugin.prototype.update = function update() {\n\t if (!this.shouldRender) {\n\t return;\n\t }\n\t var showPlayButton = !this.playRequested && !this.hasStartedPlaying && !this.container.buffering;\n\t this.showPlayButton(showPlayButton);\n\t if (!this.hasStartedPlaying) {\n\t this.container.disableMediaControl();\n\t this.$el.show();\n\t } else {\n\t this.container.enableMediaControl();\n\t if (this.shouldHideOnPlay()) {\n\t this.$el.hide();\n\t }\n\t }\n\t };\n\t\n\t PosterPlugin.prototype.render = function render() {\n\t if (!this.shouldRender) {\n\t return;\n\t }\n\t var style = _styler2.default.getStyleFor(_poster2.default, { baseUrl: this.options.baseUrl });\n\t this.$el.html(this.template());\n\t this.$el.append(style);\n\t if (this.options.poster) {\n\t var posterUrl = this.options.poster.url || this.options.poster;\n\t this.$el.css({ 'background-image': 'url(' + posterUrl + ')' });\n\t }\n\t this.container.$el.append(this.el);\n\t this.$playWrapper = this.$el.find('.play-wrapper');\n\t this.$playWrapper.append(_play2.default);\n\t this.$playButton = this.$playWrapper.find('svg');\n\t this.$playButton.addClass('poster-icon');\n\t this.$playButton.attr('data-poster', '');\n\t\n\t var buttonsColor = this.options.mediacontrol && this.options.mediacontrol.buttons;\n\t if (buttonsColor) {\n\t this.$el.find('svg path').css('fill', buttonsColor);\n\t }\n\t\n\t if (this.options.mediacontrol && this.options.mediacontrol.buttons) {\n\t buttonsColor = this.options.mediacontrol.buttons;\n\t this.$playButton.css('color', buttonsColor);\n\t }\n\t this.update();\n\t return this;\n\t };\n\t\n\t return PosterPlugin;\n\t}(_ui_container_plugin2.default);\n\t\n\texports.default = PosterPlugin;\n\tmodule.exports = exports['default'];\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./~/process/browser.js */ 21)))\n\n/***/ },\n/* 67 */\n/*!****************************************!*\\\n !*** ./src/plugins/seek_time/index.js ***!\n \\****************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./seek_time */ 68);\n\n/***/ },\n/* 68 */\n/*!********************************************!*\\\n !*** ./src/plugins/seek_time/seek_time.js ***!\n \\********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _ui_core_plugin = __webpack_require__(/*! base/ui_core_plugin */ 17);\n\t\n\tvar _ui_core_plugin2 = _interopRequireDefault(_ui_core_plugin);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _seek_time = __webpack_require__(/*! ./public/seek_time.scss */ 87);\n\t\n\tvar _seek_time2 = _interopRequireDefault(_seek_time);\n\t\n\tvar _seek_time3 = __webpack_require__(/*! ./public/seek_time.html */ 96);\n\t\n\tvar _seek_time4 = _interopRequireDefault(_seek_time3);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar SeekTime = function (_UICorePlugin) {\n\t _inherits(SeekTime, _UICorePlugin);\n\t\n\t _createClass(SeekTime, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'seek_time';\n\t }\n\t }, {\n\t key: 'template',\n\t get: function get() {\n\t return (0, _template2.default)(_seek_time4.default);\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t return {\n\t 'class': 'seek-time',\n\t 'data-seek-time': ''\n\t };\n\t }\n\t }, {\n\t key: 'mediaControl',\n\t get: function get() {\n\t return this.core.mediaControl;\n\t }\n\t }, {\n\t key: 'mediaControlContainer',\n\t get: function get() {\n\t return this.mediaControl.container;\n\t }\n\t }, {\n\t key: 'isLiveStreamWithDvr',\n\t get: function get() {\n\t return this.mediaControlContainer && this.mediaControlContainer.getPlaybackType() === _playback2.default.LIVE && this.mediaControlContainer.isDvrEnabled();\n\t }\n\t }, {\n\t key: 'durationShown',\n\t get: function get() {\n\t return this.isLiveStreamWithDvr && !this.useActualLiveTime;\n\t }\n\t }, {\n\t key: 'useActualLiveTime',\n\t get: function get() {\n\t return this.actualLiveTime && this.isLiveStreamWithDvr;\n\t }\n\t }]);\n\t\n\t function SeekTime(core) {\n\t _classCallCheck(this, SeekTime);\n\t\n\t var _this = _possibleConstructorReturn(this, _UICorePlugin.call(this, core));\n\t\n\t _this.hoveringOverSeekBar = false;\n\t _this.hoverPosition = null;\n\t _this.duration = null;\n\t _this.actualLiveTime = !!_this.mediaControl.options.actualLiveTime;\n\t if (_this.actualLiveTime) {\n\t if (_this.mediaControl.options.actualLiveServerTime) {\n\t _this.actualLiveServerTimeDiff = new Date().getTime() - new Date(_this.mediaControl.options.actualLiveServerTime).getTime();\n\t } else {\n\t _this.actualLiveServerTimeDiff = 0;\n\t }\n\t }\n\t return _this;\n\t }\n\t\n\t SeekTime.prototype.bindEvents = function bindEvents() {\n\t this.listenTo(this.mediaControl, _events2.default.MEDIACONTROL_RENDERED, this.render);\n\t this.listenTo(this.mediaControl, _events2.default.MEDIACONTROL_MOUSEMOVE_SEEKBAR, this.showTime);\n\t this.listenTo(this.mediaControl, _events2.default.MEDIACONTROL_MOUSELEAVE_SEEKBAR, this.hideTime);\n\t this.listenTo(this.mediaControl, _events2.default.MEDIACONTROL_CONTAINERCHANGED, this.onContainerChanged);\n\t if (this.mediaControlContainer) {\n\t this.listenTo(this.mediaControlContainer, _events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, this.update);\n\t this.listenTo(this.mediaControlContainer, _events2.default.CONTAINER_TIMEUPDATE, this.updateDuration);\n\t }\n\t };\n\t\n\t SeekTime.prototype.onContainerChanged = function onContainerChanged() {\n\t this.stopListening();\n\t this.bindEvents();\n\t };\n\t\n\t SeekTime.prototype.updateDuration = function updateDuration(timeProgress) {\n\t this.duration = timeProgress.total;\n\t this.update();\n\t };\n\t\n\t SeekTime.prototype.showTime = function showTime(event) {\n\t this.hoveringOverSeekBar = true;\n\t this.calculateHoverPosition(event);\n\t this.update();\n\t };\n\t\n\t SeekTime.prototype.hideTime = function hideTime() {\n\t this.hoveringOverSeekBar = false;\n\t this.update();\n\t };\n\t\n\t SeekTime.prototype.calculateHoverPosition = function calculateHoverPosition(event) {\n\t var offset = event.pageX - this.mediaControl.$seekBarContainer.offset().left;\n\t // proportion into the seek bar that the mouse is hovered over 0-1\n\t this.hoverPosition = Math.min(1, Math.max(offset / this.mediaControl.$seekBarContainer.width(), 0));\n\t };\n\t\n\t SeekTime.prototype.getSeekTime = function getSeekTime() {\n\t var seekTime = void 0,\n\t secondsSinceMidnight = void 0;\n\t if (this.useActualLiveTime) {\n\t var d = new Date(new Date().getTime() - this.actualLiveServerTimeDiff),\n\t e = new Date(d);\n\t secondsSinceMidnight = (e - d.setHours(0, 0, 0, 0)) / 1000;\n\t seekTime = secondsSinceMidnight - this.duration + this.hoverPosition * this.duration;\n\t if (seekTime < 0) {\n\t seekTime += 86400;\n\t }\n\t } else {\n\t seekTime = this.hoverPosition * this.duration;\n\t }\n\t return { seekTime: seekTime, secondsSinceMidnight: secondsSinceMidnight };\n\t };\n\t\n\t SeekTime.prototype.update = function update() {\n\t if (!this.rendered) {\n\t // update() is always called after a render\n\t return;\n\t }\n\t if (!this.shouldBeVisible()) {\n\t this.$el.hide();\n\t this.$el.css('left', '-100%');\n\t } else {\n\t var seekTime = this.getSeekTime();\n\t var currentSeekTime = (0, _utils.formatTime)(seekTime.seekTime, this.useActualLiveTime);\n\t // only update dom if necessary, ie time actually changed\n\t if (currentSeekTime !== this.displayedSeekTime) {\n\t this.$seekTimeEl.text(currentSeekTime);\n\t this.displayedSeekTime = currentSeekTime;\n\t }\n\t\n\t if (this.durationShown) {\n\t this.$durationEl.show();\n\t var currentDuration = (0, _utils.formatTime)(this.actualLiveTime ? seekTime.secondsSinceMidnight : this.duration, this.actualLiveTime);\n\t if (currentDuration !== this.displayedDuration) {\n\t this.$durationEl.text(currentDuration);\n\t this.displayedDuration = currentDuration;\n\t }\n\t } else {\n\t this.$durationEl.hide();\n\t }\n\t\n\t // the element must be unhidden before its width is requested, otherwise it's width will be reported as 0\n\t this.$el.show();\n\t var containerWidth = this.mediaControl.$seekBarContainer.width();\n\t var elWidth = this.$el.width();\n\t var elLeftPos = this.hoverPosition * containerWidth;\n\t elLeftPos -= elWidth / 2;\n\t elLeftPos = Math.max(0, Math.min(elLeftPos, containerWidth - elWidth));\n\t this.$el.css('left', elLeftPos);\n\t }\n\t };\n\t\n\t SeekTime.prototype.shouldBeVisible = function shouldBeVisible() {\n\t return this.mediaControlContainer && this.mediaControlContainer.settings.seekEnabled && this.hoveringOverSeekBar && this.hoverPosition !== null && this.duration !== null;\n\t };\n\t\n\t SeekTime.prototype.render = function render() {\n\t this.rendered = true;\n\t this.displayedDuration = null;\n\t this.displayedSeekTime = null;\n\t var style = _styler2.default.getStyleFor(_seek_time2.default);\n\t this.$el.html(this.template());\n\t this.$el.append(style);\n\t this.$el.hide();\n\t this.mediaControl.$el.append(this.el);\n\t this.$seekTimeEl = this.$el.find('[data-seek-time]');\n\t this.$durationEl = this.$el.find('[data-duration]');\n\t this.$durationEl.hide();\n\t this.update();\n\t };\n\t\n\t return SeekTime;\n\t}(_ui_core_plugin2.default);\n\t\n\texports.default = SeekTime;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 69 */\n/*!********************************!*\\\n !*** ./src/plugins/sources.js ***!\n \\********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _core_plugin = __webpack_require__(/*! base/core_plugin */ 12);\n\t\n\tvar _core_plugin2 = _interopRequireDefault(_core_plugin);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar SourcesPlugin = function (_CorePlugin) {\n\t _inherits(SourcesPlugin, _CorePlugin);\n\t\n\t function SourcesPlugin() {\n\t _classCallCheck(this, SourcesPlugin);\n\t\n\t return _possibleConstructorReturn(this, _CorePlugin.apply(this, arguments));\n\t }\n\t\n\t SourcesPlugin.prototype.bindEvents = function bindEvents() {\n\t this.listenTo(this.core, _events2.default.CORE_CONTAINERS_CREATED, this.onContainersCreated);\n\t };\n\t\n\t SourcesPlugin.prototype.onContainersCreated = function onContainersCreated() {\n\t var firstValidSource = this.core.containers.filter(function (container) {\n\t return container.playback.name !== 'no_op';\n\t })[0] || this.core.containers[0];\n\t if (firstValidSource) {\n\t this.core.containers.forEach(function (container) {\n\t if (container !== firstValidSource) {\n\t container.destroy();\n\t }\n\t });\n\t }\n\t };\n\t\n\t _createClass(SourcesPlugin, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'sources';\n\t }\n\t }]);\n\t\n\t return SourcesPlugin;\n\t}(_core_plugin2.default);\n\t\n\texports.default = SourcesPlugin;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 70 */\n/*!***************************************************!*\\\n !*** ./src/plugins/spinner_three_bounce/index.js ***!\n \\***************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./spinner_three_bounce */ 71);\n\n/***/ },\n/* 71 */\n/*!******************************************************************!*\\\n !*** ./src/plugins/spinner_three_bounce/spinner_three_bounce.js ***!\n \\******************************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _ui_container_plugin = __webpack_require__(/*! base/ui_container_plugin */ 14);\n\t\n\tvar _ui_container_plugin2 = _interopRequireDefault(_ui_container_plugin);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _spinner = __webpack_require__(/*! ./public/spinner.html */ 97);\n\t\n\tvar _spinner2 = _interopRequireDefault(_spinner);\n\t\n\tvar _spinner3 = __webpack_require__(/*! ./public/spinner.scss */ 88);\n\t\n\tvar _spinner4 = _interopRequireDefault(_spinner3);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar SpinnerThreeBouncePlugin = function (_UIContainerPlugin) {\n\t _inherits(SpinnerThreeBouncePlugin, _UIContainerPlugin);\n\t\n\t _createClass(SpinnerThreeBouncePlugin, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'spinner';\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t return {\n\t 'data-spinner': '',\n\t 'class': 'spinner-three-bounce'\n\t };\n\t }\n\t }]);\n\t\n\t function SpinnerThreeBouncePlugin(container) {\n\t _classCallCheck(this, SpinnerThreeBouncePlugin);\n\t\n\t var _this = _possibleConstructorReturn(this, _UIContainerPlugin.call(this, container));\n\t\n\t _this.template = (0, _template2.default)(_spinner2.default);\n\t _this.showTimeout = null;\n\t _this.listenTo(_this.container, _events2.default.CONTAINER_STATE_BUFFERING, _this.onBuffering);\n\t _this.listenTo(_this.container, _events2.default.CONTAINER_STATE_BUFFERFULL, _this.onBufferFull);\n\t _this.listenTo(_this.container, _events2.default.CONTAINER_STOP, _this.onStop);\n\t _this.listenTo(_this.container, _events2.default.CONTAINER_ENDED, _this.onStop);\n\t _this.listenTo(_this.container, _events2.default.CONTAINER_ERROR, _this.onStop);\n\t _this.render();\n\t return _this;\n\t }\n\t\n\t SpinnerThreeBouncePlugin.prototype.onBuffering = function onBuffering() {\n\t this.show();\n\t };\n\t\n\t SpinnerThreeBouncePlugin.prototype.onBufferFull = function onBufferFull() {\n\t this.hide();\n\t };\n\t\n\t SpinnerThreeBouncePlugin.prototype.onStop = function onStop() {\n\t this.hide();\n\t };\n\t\n\t SpinnerThreeBouncePlugin.prototype.show = function show() {\n\t var _this2 = this;\n\t\n\t if (this.showTimeout === null) {\n\t this.showTimeout = setTimeout(function () {\n\t return _this2.$el.show();\n\t }, 300);\n\t }\n\t };\n\t\n\t SpinnerThreeBouncePlugin.prototype.hide = function hide() {\n\t if (this.showTimeout !== null) {\n\t clearTimeout(this.showTimeout);\n\t this.showTimeout = null;\n\t }\n\t this.$el.hide();\n\t };\n\t\n\t SpinnerThreeBouncePlugin.prototype.render = function render() {\n\t this.$el.html(this.template());\n\t var style = _styler2.default.getStyleFor(_spinner4.default);\n\t this.container.$el.append(style);\n\t this.container.$el.append(this.$el);\n\t this.$el.hide();\n\t if (this.container.buffering) {\n\t this.onBuffering();\n\t }\n\t return this;\n\t };\n\t\n\t return SpinnerThreeBouncePlugin;\n\t}(_ui_container_plugin2.default);\n\t\n\texports.default = SpinnerThreeBouncePlugin;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 72 */\n/*!************************************!*\\\n !*** ./src/plugins/stats/index.js ***!\n \\************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./stats */ 73);\n\n/***/ },\n/* 73 */\n/*!************************************!*\\\n !*** ./src/plugins/stats/stats.js ***!\n \\************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _container_plugin = __webpack_require__(/*! base/container_plugin */ 13);\n\t\n\tvar _container_plugin2 = _interopRequireDefault(_container_plugin);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar StatsPlugin = function (_ContainerPlugin) {\n\t _inherits(StatsPlugin, _ContainerPlugin);\n\t\n\t _createClass(StatsPlugin, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'stats';\n\t }\n\t }]);\n\t\n\t function StatsPlugin(container) {\n\t _classCallCheck(this, StatsPlugin);\n\t\n\t var _this = _possibleConstructorReturn(this, _ContainerPlugin.call(this, container));\n\t\n\t _this.setInitialAttrs();\n\t _this.reportInterval = _this.options.reportInterval || 5000;\n\t _this.state = 'IDLE';\n\t return _this;\n\t }\n\t\n\t StatsPlugin.prototype.bindEvents = function bindEvents() {\n\t this.listenTo(this.container.playback, _events2.default.PLAYBACK_PLAY, this.onPlay);\n\t this.listenTo(this.container, _events2.default.CONTAINER_STOP, this.onStop);\n\t this.listenTo(this.container, _events2.default.CONTAINER_ENDED, this.onStop);\n\t this.listenTo(this.container, _events2.default.CONTAINER_DESTROYED, this.onStop);\n\t this.listenTo(this.container, _events2.default.CONTAINER_STATE_BUFFERING, this.onBuffering);\n\t this.listenTo(this.container, _events2.default.CONTAINER_STATE_BUFFERFULL, this.onBufferFull);\n\t this.listenTo(this.container, _events2.default.CONTAINER_STATS_ADD, this.onStatsAdd);\n\t this.listenTo(this.container, _events2.default.CONTAINER_BITRATE, this.onStatsAdd);\n\t this.listenTo(this.container.playback, _events2.default.PLAYBACK_STATS_ADD, this.onStatsAdd);\n\t };\n\t\n\t StatsPlugin.prototype.setInitialAttrs = function setInitialAttrs() {\n\t this.firstPlay = true;\n\t this.startupTime = 0;\n\t this.rebufferingTime = 0;\n\t this.watchingTime = 0;\n\t this.rebuffers = 0;\n\t this.externalMetrics = {};\n\t };\n\t\n\t StatsPlugin.prototype.onPlay = function onPlay() {\n\t this.state = 'PLAYING';\n\t this.watchingTimeInit = Date.now();\n\t if (!this.intervalId) {\n\t this.intervalId = setInterval(this.report.bind(this), this.reportInterval);\n\t }\n\t };\n\t\n\t StatsPlugin.prototype.onStop = function onStop() {\n\t clearInterval(this.intervalId);\n\t this.report();\n\t this.intervalId = undefined;\n\t this.state = 'STOPPED';\n\t };\n\t\n\t StatsPlugin.prototype.onBuffering = function onBuffering() {\n\t if (this.firstPlay) {\n\t this.startupTimeInit = Date.now();\n\t } else {\n\t this.rebufferingTimeInit = Date.now();\n\t }\n\t this.state = 'BUFFERING';\n\t this.rebuffers++;\n\t };\n\t\n\t StatsPlugin.prototype.onBufferFull = function onBufferFull() {\n\t if (this.firstPlay && this.startupTimeInit) {\n\t this.firstPlay = false;\n\t this.startupTime = Date.now() - this.startupTimeInit;\n\t this.watchingTimeInit = Date.now();\n\t } else if (this.rebufferingTimeInit) {\n\t this.rebufferingTime += this.getRebufferingTime();\n\t }\n\t this.rebufferingTimeInit = undefined;\n\t this.state = 'PLAYING';\n\t };\n\t\n\t StatsPlugin.prototype.getRebufferingTime = function getRebufferingTime() {\n\t return Date.now() - this.rebufferingTimeInit;\n\t };\n\t\n\t StatsPlugin.prototype.getWatchingTime = function getWatchingTime() {\n\t var totalTime = Date.now() - this.watchingTimeInit;\n\t return totalTime - this.rebufferingTime;\n\t };\n\t\n\t StatsPlugin.prototype.isRebuffering = function isRebuffering() {\n\t return !!this.rebufferingTimeInit;\n\t };\n\t\n\t StatsPlugin.prototype.onStatsAdd = function onStatsAdd(metric) {\n\t _clapprZepto2.default.extend(this.externalMetrics, metric);\n\t };\n\t\n\t StatsPlugin.prototype.getStats = function getStats() {\n\t var metrics = {\n\t startupTime: this.startupTime,\n\t rebuffers: this.rebuffers,\n\t rebufferingTime: this.isRebuffering() ? this.rebufferingTime + this.getRebufferingTime() : this.rebufferingTime,\n\t watchingTime: this.isRebuffering() ? this.getWatchingTime() - this.getRebufferingTime() : this.getWatchingTime()\n\t };\n\t _clapprZepto2.default.extend(metrics, this.externalMetrics);\n\t return metrics;\n\t };\n\t\n\t StatsPlugin.prototype.report = function report() {\n\t this.container.statsReport(this.getStats());\n\t };\n\t\n\t return StatsPlugin;\n\t}(_container_plugin2.default);\n\t\n\texports.default = StatsPlugin;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 74 */\n/*!********************************!*\\\n !*** ./src/plugins/strings.js ***!\n \\********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _core_plugin = __webpack_require__(/*! base/core_plugin */ 12);\n\t\n\tvar _core_plugin2 = _interopRequireDefault(_core_plugin);\n\t\n\tvar _lodash = __webpack_require__(/*! lodash.merge */ 35);\n\t\n\tvar _lodash2 = _interopRequireDefault(_lodash);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\t/**\n\t * The internationalization (i18n) plugin\n\t * @class Strings\n\t * @constructor\n\t * @extends CorePlugin\n\t * @module plugins\n\t */\n\tvar Strings = function (_CorePlugin) {\n\t _inherits(Strings, _CorePlugin);\n\t\n\t _createClass(Strings, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'strings';\n\t }\n\t }]);\n\t\n\t function Strings(core) {\n\t _classCallCheck(this, Strings);\n\t\n\t var _this = _possibleConstructorReturn(this, _CorePlugin.call(this, core));\n\t\n\t _this._initializeMessages();\n\t return _this;\n\t }\n\t /**\n\t * Gets a translated string for the given key.\n\t * @method t\n\t * @param {String} key the key to all messages\n\t * @return {String} translated label\n\t */\n\t\n\t\n\t Strings.prototype.t = function t(key) {\n\t var lang = this._language();\n\t var i18n = lang && this._messages[lang] || this._messages['en'];\n\t return i18n[key] || key;\n\t };\n\t\n\t Strings.prototype._language = function _language() {\n\t return this.core.options.language || (0, _utils.getBrowserLanguage)();\n\t };\n\t\n\t Strings.prototype._initializeMessages = function _initializeMessages() {\n\t this._messages = (0, _lodash2.default)({\n\t 'en': {\n\t 'live': 'live',\n\t 'back_to_live': 'back to live',\n\t 'playback_not_supported': 'Your browser does not support the playback of this video. Please try using a different browser.'\n\t },\n\t 'pt': {\n\t 'live': 'ao vivo',\n\t 'back_to_live': 'voltar para o ao vivo',\n\t 'playback_not_supported': 'Seu navegador não supporta a reprodução deste video. Por favor, tente usar um navegador diferente.'\n\t },\n\t 'es': {\n\t 'live': 'vivo',\n\t 'back_to_live': 'volver en vivo',\n\t 'playback_not_supported': 'Su navegador no soporta la reproducción de un video. Por favor, trate de usar un navegador diferente.'\n\t },\n\t 'ru': {\n\t 'live': 'прямой эфир',\n\t 'back_to_live': 'к прямому эфиру',\n\t 'playback_not_supported': 'Ваш браузер не поддерживает воспроизведение этого видео. Пожалуйста, попробуйте другой браузер.'\n\t }\n\t }, this.core.options.strings || {});\n\t\n\t this._messages['pt-BR'] = this._messages['pt'];\n\t this._messages['en-US'] = this._messages['en'];\n\t this._messages['es-419'] = this._messages['es'];\n\t };\n\t\n\t return Strings;\n\t}(_core_plugin2.default);\n\t\n\texports.default = Strings;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 75 */\n/*!****************************************!*\\\n !*** ./src/plugins/watermark/index.js ***!\n \\****************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(/*! ./watermark */ 76);\n\n/***/ },\n/* 76 */\n/*!********************************************!*\\\n !*** ./src/plugins/watermark/watermark.js ***!\n \\********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _ui_container_plugin = __webpack_require__(/*! base/ui_container_plugin */ 14);\n\t\n\tvar _ui_container_plugin2 = _interopRequireDefault(_ui_container_plugin);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _watermark = __webpack_require__(/*! ./public/watermark.scss */ 89);\n\t\n\tvar _watermark2 = _interopRequireDefault(_watermark);\n\t\n\tvar _watermark3 = __webpack_require__(/*! ./public/watermark.html */ 98);\n\t\n\tvar _watermark4 = _interopRequireDefault(_watermark3);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar WaterMarkPlugin = function (_UIContainerPlugin) {\n\t _inherits(WaterMarkPlugin, _UIContainerPlugin);\n\t\n\t _createClass(WaterMarkPlugin, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'watermark';\n\t }\n\t }, {\n\t key: 'template',\n\t get: function get() {\n\t return (0, _template2.default)(_watermark4.default);\n\t }\n\t }]);\n\t\n\t function WaterMarkPlugin(container) {\n\t _classCallCheck(this, WaterMarkPlugin);\n\t\n\t var _this = _possibleConstructorReturn(this, _UIContainerPlugin.call(this, container));\n\t\n\t _this.configure();\n\t return _this;\n\t }\n\t\n\t WaterMarkPlugin.prototype.bindEvents = function bindEvents() {\n\t this.listenTo(this.container, _events2.default.CONTAINER_PLAY, this.onPlay);\n\t this.listenTo(this.container, _events2.default.CONTAINER_STOP, this.onStop);\n\t this.listenTo(this.container, _events2.default.CONTAINER_OPTIONS_CHANGE, this.configure);\n\t };\n\t\n\t WaterMarkPlugin.prototype.configure = function configure() {\n\t this.position = this.options.position || 'bottom-right';\n\t if (this.options.watermark) {\n\t this.imageUrl = this.options.watermark;\n\t this.imageLink = this.options.watermarkLink;\n\t this.render();\n\t } else {\n\t this.$el.remove();\n\t }\n\t };\n\t\n\t WaterMarkPlugin.prototype.onPlay = function onPlay() {\n\t if (!this.hidden) this.$el.show();\n\t };\n\t\n\t WaterMarkPlugin.prototype.onStop = function onStop() {\n\t this.$el.hide();\n\t };\n\t\n\t WaterMarkPlugin.prototype.render = function render() {\n\t this.$el.hide();\n\t var templateOptions = { position: this.position, imageUrl: this.imageUrl, imageLink: this.imageLink };\n\t this.$el.html(this.template(templateOptions));\n\t var style = _styler2.default.getStyleFor(_watermark2.default);\n\t this.container.$el.append(style);\n\t this.container.$el.append(this.$el);\n\t return this;\n\t };\n\t\n\t return WaterMarkPlugin;\n\t}(_ui_container_plugin2.default);\n\t\n\texports.default = WaterMarkPlugin;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 77 */\n/*!****************************!*\\\n !*** ./src/vendor/kibo.js ***!\n \\****************************/\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t/* eslint-disable */\n\t// Kibo is released under the MIT License. Copyright (c) 2013 marquete.\n\t// see https://github.com/marquete/kibo\n\t\n\tvar Kibo = function Kibo(element) {\n\t this.element = element || window.document;\n\t this.initialize();\n\t};\n\t\n\tKibo.KEY_NAMES_BY_CODE = {\n\t 8: 'backspace', 9: 'tab', 13: 'enter',\n\t 16: 'shift', 17: 'ctrl', 18: 'alt',\n\t 20: 'caps_lock',\n\t 27: 'esc',\n\t 32: 'space',\n\t 37: 'left', 38: 'up', 39: 'right', 40: 'down',\n\t 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', 54: '6', 55: '7', 56: '8', 57: '9',\n\t 65: 'a', 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h', 73: 'i', 74: 'j',\n\t 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't',\n\t 85: 'u', 86: 'v', 87: 'w', 88: 'x', 89: 'y', 90: 'z', 112: 'f1', 113: 'f2', 114: 'f3',\n\t 115: 'f4', 116: 'f5', 117: 'f6', 118: 'f7', 119: 'f8', 120: 'f9', 121: 'f10', 122: 'f11', 123: 'f12'\n\t};\n\t\n\tKibo.KEY_CODES_BY_NAME = {};\n\t(function () {\n\t for (var key in Kibo.KEY_NAMES_BY_CODE) {\n\t if (Object.prototype.hasOwnProperty.call(Kibo.KEY_NAMES_BY_CODE, key)) {\n\t Kibo.KEY_CODES_BY_NAME[Kibo.KEY_NAMES_BY_CODE[key]] = +key;\n\t }\n\t }\n\t})();\n\t\n\tKibo.MODIFIERS = ['shift', 'ctrl', 'alt'];\n\t\n\tKibo.registerEvent = function () {\n\t if (document.addEventListener) {\n\t return function (element, eventName, func) {\n\t element.addEventListener(eventName, func, false);\n\t };\n\t } else if (document.attachEvent) {\n\t return function (element, eventName, func) {\n\t element.attachEvent('on' + eventName, func);\n\t };\n\t }\n\t}();\n\t\n\tKibo.unregisterEvent = function () {\n\t if (document.removeEventListener) {\n\t return function (element, eventName, func) {\n\t element.removeEventListener(eventName, func, false);\n\t };\n\t } else if (document.detachEvent) {\n\t return function (element, eventName, func) {\n\t element.detachEvent('on' + eventName, func);\n\t };\n\t }\n\t}();\n\t\n\tKibo.stringContains = function (string, substring) {\n\t return string.indexOf(substring) !== -1;\n\t};\n\t\n\tKibo.neatString = function (string) {\n\t return string.replace(/^\\s+|\\s+$/g, '').replace(/\\s+/g, ' ');\n\t};\n\t\n\tKibo.capitalize = function (string) {\n\t return string.toLowerCase().replace(/^./, function (match) {\n\t return match.toUpperCase();\n\t });\n\t};\n\t\n\tKibo.isString = function (what) {\n\t return Kibo.stringContains(Object.prototype.toString.call(what), 'String');\n\t};\n\t\n\tKibo.arrayIncludes = function () {\n\t if (Array.prototype.indexOf) {\n\t return function (haystack, needle) {\n\t return haystack.indexOf(needle) !== -1;\n\t };\n\t } else {\n\t return function (haystack, needle) {\n\t for (var i = 0; i < haystack.length; i++) {\n\t if (haystack[i] === needle) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t };\n\t }\n\t}();\n\t\n\tKibo.extractModifiers = function (keyCombination) {\n\t var modifiers, i;\n\t modifiers = [];\n\t for (i = 0; i < Kibo.MODIFIERS.length; i++) {\n\t if (Kibo.stringContains(keyCombination, Kibo.MODIFIERS[i])) {\n\t modifiers.push(Kibo.MODIFIERS[i]);\n\t }\n\t }\n\t return modifiers;\n\t};\n\t\n\tKibo.extractKey = function (keyCombination) {\n\t var keys, i;\n\t keys = Kibo.neatString(keyCombination).split(' ');\n\t for (i = 0; i < keys.length; i++) {\n\t if (!Kibo.arrayIncludes(Kibo.MODIFIERS, keys[i])) {\n\t return keys[i];\n\t }\n\t }\n\t};\n\t\n\tKibo.modifiersAndKey = function (keyCombination) {\n\t var result, key;\n\t\n\t if (Kibo.stringContains(keyCombination, 'any')) {\n\t return Kibo.neatString(keyCombination).split(' ').slice(0, 2).join(' ');\n\t }\n\t\n\t result = Kibo.extractModifiers(keyCombination);\n\t\n\t key = Kibo.extractKey(keyCombination);\n\t if (key && !Kibo.arrayIncludes(Kibo.MODIFIERS, key)) {\n\t result.push(key);\n\t }\n\t\n\t return result.join(' ');\n\t};\n\t\n\tKibo.keyName = function (keyCode) {\n\t return Kibo.KEY_NAMES_BY_CODE[keyCode + ''];\n\t};\n\t\n\tKibo.keyCode = function (keyName) {\n\t return +Kibo.KEY_CODES_BY_NAME[keyName];\n\t};\n\t\n\tKibo.prototype.initialize = function () {\n\t var i,\n\t that = this;\n\t\n\t this.lastKeyCode = -1;\n\t this.lastModifiers = {};\n\t for (i = 0; i < Kibo.MODIFIERS.length; i++) {\n\t this.lastModifiers[Kibo.MODIFIERS[i]] = false;\n\t }\n\t\n\t this.keysDown = { any: [] };\n\t this.keysUp = { any: [] };\n\t this.downHandler = this.handler('down');\n\t this.upHandler = this.handler('up');\n\t\n\t Kibo.registerEvent(this.element, 'keydown', this.downHandler);\n\t Kibo.registerEvent(this.element, 'keyup', this.upHandler);\n\t Kibo.registerEvent(window, 'unload', function unloader() {\n\t Kibo.unregisterEvent(that.element, 'keydown', that.downHandler);\n\t Kibo.unregisterEvent(that.element, 'keyup', that.upHandler);\n\t Kibo.unregisterEvent(window, 'unload', unloader);\n\t });\n\t};\n\t\n\tKibo.prototype.handler = function (upOrDown) {\n\t var that = this;\n\t return function (e) {\n\t var i, registeredKeys, lastModifiersAndKey;\n\t\n\t e = e || window.event;\n\t\n\t that.lastKeyCode = e.keyCode;\n\t for (i = 0; i < Kibo.MODIFIERS.length; i++) {\n\t that.lastModifiers[Kibo.MODIFIERS[i]] = e[Kibo.MODIFIERS[i] + 'Key'];\n\t }\n\t if (Kibo.arrayIncludes(Kibo.MODIFIERS, Kibo.keyName(that.lastKeyCode))) {\n\t that.lastModifiers[Kibo.keyName(that.lastKeyCode)] = true;\n\t }\n\t\n\t registeredKeys = that['keys' + Kibo.capitalize(upOrDown)];\n\t\n\t for (i = 0; i < registeredKeys.any.length; i++) {\n\t if (registeredKeys.any[i](e) === false && e.preventDefault) {\n\t e.preventDefault();\n\t }\n\t }\n\t\n\t lastModifiersAndKey = that.lastModifiersAndKey();\n\t if (registeredKeys[lastModifiersAndKey]) {\n\t for (i = 0; i < registeredKeys[lastModifiersAndKey].length; i++) {\n\t if (registeredKeys[lastModifiersAndKey][i](e) === false && e.preventDefault) {\n\t e.preventDefault();\n\t }\n\t }\n\t }\n\t };\n\t};\n\t\n\tKibo.prototype.registerKeys = function (upOrDown, newKeys, func) {\n\t var i,\n\t keys,\n\t registeredKeys = this['keys' + Kibo.capitalize(upOrDown)];\n\t\n\t if (Kibo.isString(newKeys)) {\n\t newKeys = [newKeys];\n\t }\n\t\n\t for (i = 0; i < newKeys.length; i++) {\n\t keys = newKeys[i];\n\t keys = Kibo.modifiersAndKey(keys + '');\n\t\n\t if (registeredKeys[keys]) {\n\t registeredKeys[keys].push(func);\n\t } else {\n\t registeredKeys[keys] = [func];\n\t }\n\t }\n\t\n\t return this;\n\t};\n\t\n\t// jshint maxdepth:5\n\tKibo.prototype.unregisterKeys = function (upOrDown, newKeys, func) {\n\t var i,\n\t j,\n\t keys,\n\t registeredKeys = this['keys' + Kibo.capitalize(upOrDown)];\n\t\n\t if (Kibo.isString(newKeys)) {\n\t newKeys = [newKeys];\n\t }\n\t\n\t for (i = 0; i < newKeys.length; i++) {\n\t keys = newKeys[i];\n\t keys = Kibo.modifiersAndKey(keys + '');\n\t\n\t if (func === null) {\n\t delete registeredKeys[keys];\n\t } else {\n\t if (registeredKeys[keys]) {\n\t for (j = 0; j < registeredKeys[keys].length; j++) {\n\t if (String(registeredKeys[keys][j]) === String(func)) {\n\t registeredKeys[keys].splice(j, 1);\n\t break;\n\t }\n\t }\n\t }\n\t }\n\t }\n\t\n\t return this;\n\t};\n\t\n\tKibo.prototype.off = function (keys) {\n\t return this.unregisterKeys('down', keys, null);\n\t};\n\t\n\tKibo.prototype.delegate = function (upOrDown, keys, func) {\n\t return func !== null || func !== undefined ? this.registerKeys(upOrDown, keys, func) : this.unregisterKeys(upOrDown, keys, func);\n\t};\n\t\n\tKibo.prototype.down = function (keys, func) {\n\t return this.delegate('down', keys, func);\n\t};\n\t\n\tKibo.prototype.up = function (keys, func) {\n\t return this.delegate('up', keys, func);\n\t};\n\t\n\tKibo.prototype.lastKey = function (modifier) {\n\t if (!modifier) {\n\t return Kibo.keyName(this.lastKeyCode);\n\t }\n\t\n\t return this.lastModifiers[modifier];\n\t};\n\t\n\tKibo.prototype.lastModifiersAndKey = function () {\n\t var result, i;\n\t\n\t result = [];\n\t for (i = 0; i < Kibo.MODIFIERS.length; i++) {\n\t if (this.lastKey(Kibo.MODIFIERS[i])) {\n\t result.push(Kibo.MODIFIERS[i]);\n\t }\n\t }\n\t\n\t if (!Kibo.arrayIncludes(result, this.lastKey())) {\n\t result.push(this.lastKey());\n\t }\n\t\n\t return result.join(' ');\n\t};\n\t\n\texports.default = Kibo;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 78 */\n/*!****************************************************!*\\\n !*** ./src/components/container/public/style.scss ***!\n \\****************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../../../~/css-loader/lib/css-base.js */ 7)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \".container[data-container]{position:absolute;background-color:#000;height:100%;width:100%}.container[data-container] .chromeless{cursor:default}[data-player]:not(.nocursor) .container[data-container]:not(.chromeless).pointer-enabled{cursor:pointer}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 79 */\n/*!***********************************************!*\\\n !*** ./src/components/core/public/style.scss ***!\n \\***********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../../../~/css-loader/lib/css-base.js */ 7)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \"@font-face{font-family:Roboto;font-style:normal;font-weight:400;src:local(\\\"Roboto\\\"),local(\\\"Roboto-Regular\\\"),url(\" + __webpack_require__(/*! ./Roboto.ttf */ 110) + \") format(\\\"truetype\\\")}[data-player]{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-transform:translateZ(0);transform:translateZ(0);position:relative;margin:0;padding:0;border:0;font-style:normal;font-weight:400;text-align:center;overflow:hidden;font-size:100%;font-family:Roboto,Open Sans,Arial,sans-serif;text-shadow:0 0 0;box-sizing:border-box}[data-player] a,[data-player] abbr,[data-player] acronym,[data-player] address,[data-player] applet,[data-player] article,[data-player] aside,[data-player] audio,[data-player] b,[data-player] big,[data-player] blockquote,[data-player] canvas,[data-player] caption,[data-player] center,[data-player] cite,[data-player] code,[data-player] dd,[data-player] del,[data-player] details,[data-player] dfn,[data-player] div,[data-player] dl,[data-player] dt,[data-player] em,[data-player] embed,[data-player] fieldset,[data-player] figcaption,[data-player] figure,[data-player] footer,[data-player] form,[data-player] h1,[data-player] h2,[data-player] h3,[data-player] h4,[data-player] h5,[data-player] h6,[data-player] header,[data-player] hgroup,[data-player] i,[data-player] iframe,[data-player] img,[data-player] ins,[data-player] kbd,[data-player] label,[data-player] legend,[data-player] li,[data-player] mark,[data-player] menu,[data-player] nav,[data-player] object,[data-player] ol,[data-player] output,[data-player] p,[data-player] pre,[data-player] q,[data-player] ruby,[data-player] s,[data-player] samp,[data-player] section,[data-player] small,[data-player] span,[data-player] strike,[data-player] strong,[data-player] sub,[data-player] summary,[data-player] sup,[data-player] table,[data-player] tbody,[data-player] td,[data-player] tfoot,[data-player] th,[data-player] thead,[data-player] time,[data-player] tr,[data-player] tt,[data-player] u,[data-player] ul,[data-player] var,[data-player] video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}[data-player] table{border-collapse:collapse;border-spacing:0}[data-player] caption,[data-player] td,[data-player] th{text-align:left;font-weight:400;vertical-align:middle}[data-player] blockquote,[data-player] q{quotes:none}[data-player] blockquote:after,[data-player] blockquote:before,[data-player] q:after,[data-player] q:before{content:\\\"\\\";content:none}[data-player] a img{border:none}[data-player]:focus{outline:0}[data-player] *{max-width:none;box-sizing:inherit;float:none}[data-player] div{display:block}[data-player].fullscreen{width:100%!important;height:100%!important;top:0;left:0}[data-player].nocursor{cursor:none}.clappr-style{display:none!important}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 80 */\n/*!****************************************************************!*\\\n !*** ./src/components/media_control/public/media-control.scss ***!\n \\****************************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../../../~/css-loader/lib/css-base.js */ 7)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \".media-control-notransition{-webkit-transition:none!important;transition:none!important}.media-control[data-media-control]{position:absolute;width:100%;height:100%;z-index:9999;pointer-events:none}.media-control[data-media-control].dragging{pointer-events:auto;cursor:-webkit-grabbing!important;cursor:grabbing!important;cursor:url(\" + __webpack_require__(/*! ./closed-hand.cur */ 37) + \"),move}.media-control[data-media-control].dragging *{cursor:-webkit-grabbing!important;cursor:grabbing!important;cursor:url(\" + __webpack_require__(/*! ./closed-hand.cur */ 37) + \"),move}.media-control[data-media-control] .media-control-background[data-background]{position:absolute;height:40%;width:100%;bottom:0;background:-webkit-linear-gradient(transparent,rgba(0,0,0,.9));background:linear-gradient(transparent,rgba(0,0,0,.9));-webkit-transition:opacity .6s ease-out;transition:opacity .6s ease-out}.media-control[data-media-control] .media-control-icon{line-height:0;letter-spacing:0;speak:none;color:#fff;opacity:.5;vertical-align:middle;text-align:left;-webkit-transition:all .1s ease;transition:all .1s ease}.media-control[data-media-control] .media-control-icon:hover{color:#fff;opacity:.75;text-shadow:hsla(0,0%,100%,.8) 0 0 5px}.media-control[data-media-control].media-control-hide .media-control-background[data-background]{opacity:0}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls]{bottom:-50px}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls]{position:absolute;bottom:7px;width:100%;height:32px;font-size:0;vertical-align:middle;pointer-events:auto;-webkit-transition:bottom .4s ease-out;transition:bottom .4s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control]{position:absolute;top:0;left:4px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control]{height:100%;text-align:center;line-height:32px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control]{position:absolute;top:0;right:4px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button{background-color:transparent;border:0;margin:0 6px;padding:0;cursor:pointer;display:inline-block;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg{width:100%;height:22px}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg path{fill:#fff}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus{outline:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop]{float:left;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen]{float:right;background-color:transparent;border:0;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator]{cursor:default;float:right;background-color:transparent;border:0;height:100%;display:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled{opacity:1;display:block}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled:hover{opacity:1;text-shadow:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop]{float:left}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration],.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{display:inline-block;font-size:10px;color:#fff;cursor:default;line-height:32px;position:relative}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{margin:0 6px 0 7px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]{color:hsla(0,0%,100%,.5);margin-right:6px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before{content:\\\"|\\\";margin-right:7px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]{position:absolute;top:-20px;left:0;display:inline-block;vertical-align:middle;width:100%;height:25px;cursor:pointer}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar]{width:100%;height:1px;position:relative;top:12px;background-color:#666}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#c2c2c2;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#005aff;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:0;position:absolute;top:-3px;width:5px;height:7px;background-color:hsla(0,0%,100%,.5);-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]:hover .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled{cursor:default}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled:hover .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);top:2px;left:0;width:20px;height:20px;opacity:1;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar]{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:10px;box-shadow:0 0 0 6px hsla(0,0%,100%,.2);background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume]{float:right;display:inline-block;height:32px;cursor:pointer;margin:0 6px;box-sizing:border-box}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume]{float:left;bottom:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]{background-color:transparent;border:0;box-sizing:content-box;width:32px;height:32px;opacity:.5}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:hover{opacity:.75}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg{height:24px;position:relative;top:3px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg path{fill:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted svg{margin-left:2px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume]{float:left;position:relative;overflow:hidden;top:6px;width:42px;height:18px;padding:3px 0;-webkit-transition:width .2s ease-out;transition:width .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume]{height:1px;position:relative;top:7px;margin:0 3px;background-color:#666}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#c2c2c2;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-2[data-volume]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#005aff;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-hover[data-volume]{opacity:0;position:absolute;top:-3px;width:5px;height:7px;background-color:hsla(0,0%,100%,.5);-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume]{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);top:0;left:0;width:20px;height:20px;opacity:1;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume]{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:10px;box-shadow:0 0 0 6px hsla(0,0%,100%,.2);background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]{float:left;width:4px;padding-left:2px;height:12px;opacity:.5;box-shadow:inset 2px 0 0 #fff;-webkit-transition:-webkit-transform .2s ease-out;transition:transform .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume].fill{box-shadow:inset 2px 0 0 #fff;opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:nth-of-type(1){padding-left:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:hover{-webkit-transform:scaleY(1.5);transform:scaleY(1.5)}.media-control[data-media-control].w320 .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide{width:0;height:12px;top:9px;padding:0}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 81 */\n/*!*************************************************************!*\\\n !*** ./src/playbacks/base_flash_playback/public/flash.scss ***!\n \\*************************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../../../~/css-loader/lib/css-base.js */ 7)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \".clappr-flash-playback[data-flash-playback]{display:block;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 82 */\n/*!*****************************************************!*\\\n !*** ./src/playbacks/html5_video/public/style.scss ***!\n \\*****************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../../../~/css-loader/lib/css-base.js */ 7)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \"[data-html5-video]{position:absolute;height:100%;width:100%;display:block}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 83 */\n/*!**************************************************!*\\\n !*** ./src/playbacks/html_img/public/style.scss ***!\n \\**************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../../../~/css-loader/lib/css-base.js */ 7)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \"[data-html-img]{max-width:100%;max-height:100%}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 84 */\n/*!***********************************************!*\\\n !*** ./src/playbacks/no_op/public/style.scss ***!\n \\***********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../../../~/css-loader/lib/css-base.js */ 7)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \"[data-no-op]{position:absolute;height:100%;width:100%;text-align:center}[data-no-op] p[data-no-op-msg]{position:absolute;text-align:center;font-size:25px;left:0;right:0;color:#fff;padding:10px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);max-height:100%;overflow:auto}[data-no-op] canvas[data-no-op-canvas]{background-color:#777;height:100%;width:100%}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 85 */\n/*!***********************************************************!*\\\n !*** ./src/plugins/dvr_controls/public/dvr_controls.scss ***!\n \\***********************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../../../~/css-loader/lib/css-base.js */ 7)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \".dvr-controls[data-dvr-controls]{display:inline-block;float:left;color:#fff;line-height:32px;font-size:10px;font-weight:700;margin-left:6px}.dvr-controls[data-dvr-controls] .live-info{cursor:default;font-family:Roboto,Open Sans,Arial,sans-serif;text-transform:uppercase}.dvr-controls[data-dvr-controls] .live-info:before{content:\\\"\\\";display:inline-block;position:relative;width:7px;height:7px;border-radius:3.5px;margin-right:3.5px;background-color:#ff0101}.dvr-controls[data-dvr-controls] .live-info.disabled{opacity:.3}.dvr-controls[data-dvr-controls] .live-info.disabled:before{background-color:#fff}.dvr-controls[data-dvr-controls] .live-button{cursor:pointer;outline:none;display:none;border:0;color:#fff;background-color:transparent;height:32px;padding:0;opacity:.7;font-family:Roboto,Open Sans,Arial,sans-serif;text-transform:uppercase;-webkit-transition:all .1s ease;transition:all .1s ease}.dvr-controls[data-dvr-controls] .live-button:before{content:\\\"\\\";display:inline-block;position:relative;width:7px;height:7px;border-radius:3.5px;margin-right:3.5px;background-color:#fff}.dvr-controls[data-dvr-controls] .live-button:hover{opacity:1;text-shadow:hsla(0,0%,100%,.75) 0 0 5px}.dvr .dvr-controls[data-dvr-controls] .live-info{display:none}.dvr .dvr-controls[data-dvr-controls] .live-button{display:block}.dvr.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{background-color:#005aff}.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{background-color:#ff0101}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 86 */\n/*!***********************************************!*\\\n !*** ./src/plugins/poster/public/poster.scss ***!\n \\***********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../../../~/css-loader/lib/css-base.js */ 7)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \".player-poster[data-poster]{display:-webkit-box;display:-moz-box;display:box;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;box-pack:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-ms-flex-pack:center;-webkit-box-align:center;box-align:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-ms-flex-align:center;position:absolute;height:100%;width:100%;z-index:998;top:0;left:0;background-color:#000;background-size:cover;background-repeat:no-repeat;background-position:50% 50%}.player-poster[data-poster].clickable{cursor:pointer}.player-poster[data-poster]:hover .play-wrapper[data-poster]{opacity:1}.player-poster[data-poster] .play-wrapper[data-poster]{width:100%;height:25%;margin:0 auto;opacity:.75;-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.player-poster[data-poster] .play-wrapper[data-poster] svg{height:100%}.player-poster[data-poster] .play-wrapper[data-poster] svg path{fill:#fff}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 87 */\n/*!*****************************************************!*\\\n !*** ./src/plugins/seek_time/public/seek_time.scss ***!\n \\*****************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../../../~/css-loader/lib/css-base.js */ 7)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \".seek-time[data-seek-time]{position:absolute;white-space:nowrap;height:20px;line-height:20px;font-size:0;left:-100%;bottom:55px;background-color:rgba(2,2,2,.5);z-index:9999;-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.seek-time[data-seek-time].hidden[data-seek-time]{opacity:0}.seek-time[data-seek-time] [data-seek-time]{display:inline-block;color:#fff;font-size:10px;padding-left:7px;padding-right:7px;vertical-align:top}.seek-time[data-seek-time] [data-duration]{display:inline-block;color:hsla(0,0%,100%,.5);font-size:10px;padding-right:7px;vertical-align:top}.seek-time[data-seek-time] [data-duration]:before{content:\\\"|\\\";margin-right:7px}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 88 */\n/*!**************************************************************!*\\\n !*** ./src/plugins/spinner_three_bounce/public/spinner.scss ***!\n \\**************************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../../../~/css-loader/lib/css-base.js */ 7)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \".spinner-three-bounce[data-spinner]{position:absolute;margin:0 auto;width:70px;text-align:center;z-index:999;left:0;right:0;margin-left:auto;margin-right:auto;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.spinner-three-bounce[data-spinner]>div{width:18px;height:18px;background-color:#fff;border-radius:100%;display:inline-block;-webkit-animation:bouncedelay 1.4s infinite ease-in-out;animation:bouncedelay 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner-three-bounce[data-spinner] [data-bounce1]{-webkit-animation-delay:-.32s;animation-delay:-.32s}.spinner-three-bounce[data-spinner] [data-bounce2]{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 89 */\n/*!*****************************************************!*\\\n !*** ./src/plugins/watermark/public/watermark.scss ***!\n \\*****************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\texports = module.exports = __webpack_require__(/*! ./../../../../~/css-loader/lib/css-base.js */ 7)();\n\t// imports\n\t\n\t\n\t// module\n\texports.push([module.id, \"[data-watermark]{position:absolute;min-width:70px;max-width:200px;width:12%;text-align:center;z-index:10}[data-watermark] a{outline:none;cursor:pointer}[data-watermark] img{max-width:100%}[data-watermark-bottom-left]{bottom:10px;left:10px}[data-watermark-bottom-right]{bottom:10px;right:42px}[data-watermark-top-left]{top:10px;left:10px}[data-watermark-top-right]{top:10px;right:37px}\", \"\"]);\n\t\n\t// exports\n\n\n/***/ },\n/* 90 */\n/*!******************************!*\\\n !*** ./~/hls.js/dist/hls.js ***!\n \\******************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar require;var require;(function(f){if(true){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.Hls = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\tfunction EventEmitter() {\n\t this._events = this._events || {};\n\t this._maxListeners = this._maxListeners || undefined;\n\t}\n\tmodule.exports = EventEmitter;\n\t\n\t// Backwards-compat with node 0.10.x\n\tEventEmitter.EventEmitter = EventEmitter;\n\t\n\tEventEmitter.prototype._events = undefined;\n\tEventEmitter.prototype._maxListeners = undefined;\n\t\n\t// By default EventEmitters will print a warning if more than 10 listeners are\n\t// added to it. This is a useful default which helps finding memory leaks.\n\tEventEmitter.defaultMaxListeners = 10;\n\t\n\t// Obviously not all Emitters should be limited to 10. This function allows\n\t// that to be increased. Set to zero for unlimited.\n\tEventEmitter.prototype.setMaxListeners = function(n) {\n\t if (!isNumber(n) || n < 0 || isNaN(n))\n\t throw TypeError('n must be a positive number');\n\t this._maxListeners = n;\n\t return this;\n\t};\n\t\n\tEventEmitter.prototype.emit = function(type) {\n\t var er, handler, len, args, i, listeners;\n\t\n\t if (!this._events)\n\t this._events = {};\n\t\n\t // If there is no 'error' event listener then throw.\n\t if (type === 'error') {\n\t if (!this._events.error ||\n\t (isObject(this._events.error) && !this._events.error.length)) {\n\t er = arguments[1];\n\t if (er instanceof Error) {\n\t throw er; // Unhandled 'error' event\n\t }\n\t throw TypeError('Uncaught, unspecified \"error\" event.');\n\t }\n\t }\n\t\n\t handler = this._events[type];\n\t\n\t if (isUndefined(handler))\n\t return false;\n\t\n\t if (isFunction(handler)) {\n\t switch (arguments.length) {\n\t // fast cases\n\t case 1:\n\t handler.call(this);\n\t break;\n\t case 2:\n\t handler.call(this, arguments[1]);\n\t break;\n\t case 3:\n\t handler.call(this, arguments[1], arguments[2]);\n\t break;\n\t // slower\n\t default:\n\t args = Array.prototype.slice.call(arguments, 1);\n\t handler.apply(this, args);\n\t }\n\t } else if (isObject(handler)) {\n\t args = Array.prototype.slice.call(arguments, 1);\n\t listeners = handler.slice();\n\t len = listeners.length;\n\t for (i = 0; i < len; i++)\n\t listeners[i].apply(this, args);\n\t }\n\t\n\t return true;\n\t};\n\t\n\tEventEmitter.prototype.addListener = function(type, listener) {\n\t var m;\n\t\n\t if (!isFunction(listener))\n\t throw TypeError('listener must be a function');\n\t\n\t if (!this._events)\n\t this._events = {};\n\t\n\t // To avoid recursion in the case that type === \"newListener\"! Before\n\t // adding it to the listeners, first emit \"newListener\".\n\t if (this._events.newListener)\n\t this.emit('newListener', type,\n\t isFunction(listener.listener) ?\n\t listener.listener : listener);\n\t\n\t if (!this._events[type])\n\t // Optimize the case of one listener. Don't need the extra array object.\n\t this._events[type] = listener;\n\t else if (isObject(this._events[type]))\n\t // If we've already got an array, just append.\n\t this._events[type].push(listener);\n\t else\n\t // Adding the second element, need to change to array.\n\t this._events[type] = [this._events[type], listener];\n\t\n\t // Check for listener leak\n\t if (isObject(this._events[type]) && !this._events[type].warned) {\n\t if (!isUndefined(this._maxListeners)) {\n\t m = this._maxListeners;\n\t } else {\n\t m = EventEmitter.defaultMaxListeners;\n\t }\n\t\n\t if (m && m > 0 && this._events[type].length > m) {\n\t this._events[type].warned = true;\n\t console.error('(node) warning: possible EventEmitter memory ' +\n\t 'leak detected. %d listeners added. ' +\n\t 'Use emitter.setMaxListeners() to increase limit.',\n\t this._events[type].length);\n\t if (typeof console.trace === 'function') {\n\t // not supported in IE 10\n\t console.trace();\n\t }\n\t }\n\t }\n\t\n\t return this;\n\t};\n\t\n\tEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\t\n\tEventEmitter.prototype.once = function(type, listener) {\n\t if (!isFunction(listener))\n\t throw TypeError('listener must be a function');\n\t\n\t var fired = false;\n\t\n\t function g() {\n\t this.removeListener(type, g);\n\t\n\t if (!fired) {\n\t fired = true;\n\t listener.apply(this, arguments);\n\t }\n\t }\n\t\n\t g.listener = listener;\n\t this.on(type, g);\n\t\n\t return this;\n\t};\n\t\n\t// emits a 'removeListener' event iff the listener was removed\n\tEventEmitter.prototype.removeListener = function(type, listener) {\n\t var list, position, length, i;\n\t\n\t if (!isFunction(listener))\n\t throw TypeError('listener must be a function');\n\t\n\t if (!this._events || !this._events[type])\n\t return this;\n\t\n\t list = this._events[type];\n\t length = list.length;\n\t position = -1;\n\t\n\t if (list === listener ||\n\t (isFunction(list.listener) && list.listener === listener)) {\n\t delete this._events[type];\n\t if (this._events.removeListener)\n\t this.emit('removeListener', type, listener);\n\t\n\t } else if (isObject(list)) {\n\t for (i = length; i-- > 0;) {\n\t if (list[i] === listener ||\n\t (list[i].listener && list[i].listener === listener)) {\n\t position = i;\n\t break;\n\t }\n\t }\n\t\n\t if (position < 0)\n\t return this;\n\t\n\t if (list.length === 1) {\n\t list.length = 0;\n\t delete this._events[type];\n\t } else {\n\t list.splice(position, 1);\n\t }\n\t\n\t if (this._events.removeListener)\n\t this.emit('removeListener', type, listener);\n\t }\n\t\n\t return this;\n\t};\n\t\n\tEventEmitter.prototype.removeAllListeners = function(type) {\n\t var key, listeners;\n\t\n\t if (!this._events)\n\t return this;\n\t\n\t // not listening for removeListener, no need to emit\n\t if (!this._events.removeListener) {\n\t if (arguments.length === 0)\n\t this._events = {};\n\t else if (this._events[type])\n\t delete this._events[type];\n\t return this;\n\t }\n\t\n\t // emit removeListener for all listeners on all events\n\t if (arguments.length === 0) {\n\t for (key in this._events) {\n\t if (key === 'removeListener') continue;\n\t this.removeAllListeners(key);\n\t }\n\t this.removeAllListeners('removeListener');\n\t this._events = {};\n\t return this;\n\t }\n\t\n\t listeners = this._events[type];\n\t\n\t if (isFunction(listeners)) {\n\t this.removeListener(type, listeners);\n\t } else if (listeners) {\n\t // LIFO order\n\t while (listeners.length)\n\t this.removeListener(type, listeners[listeners.length - 1]);\n\t }\n\t delete this._events[type];\n\t\n\t return this;\n\t};\n\t\n\tEventEmitter.prototype.listeners = function(type) {\n\t var ret;\n\t if (!this._events || !this._events[type])\n\t ret = [];\n\t else if (isFunction(this._events[type]))\n\t ret = [this._events[type]];\n\t else\n\t ret = this._events[type].slice();\n\t return ret;\n\t};\n\t\n\tEventEmitter.prototype.listenerCount = function(type) {\n\t if (this._events) {\n\t var evlistener = this._events[type];\n\t\n\t if (isFunction(evlistener))\n\t return 1;\n\t else if (evlistener)\n\t return evlistener.length;\n\t }\n\t return 0;\n\t};\n\t\n\tEventEmitter.listenerCount = function(emitter, type) {\n\t return emitter.listenerCount(type);\n\t};\n\t\n\tfunction isFunction(arg) {\n\t return typeof arg === 'function';\n\t}\n\t\n\tfunction isNumber(arg) {\n\t return typeof arg === 'number';\n\t}\n\t\n\tfunction isObject(arg) {\n\t return typeof arg === 'object' && arg !== null;\n\t}\n\t\n\tfunction isUndefined(arg) {\n\t return arg === void 0;\n\t}\n\t\n\t},{}],2:[function(_dereq_,module,exports){\n\tvar bundleFn = arguments[3];\n\tvar sources = arguments[4];\n\tvar cache = arguments[5];\n\t\n\tvar stringify = JSON.stringify;\n\t\n\tmodule.exports = function (fn, options) {\n\t var wkey;\n\t var cacheKeys = Object.keys(cache);\n\t\n\t for (var i = 0, l = cacheKeys.length; i < l; i++) {\n\t var key = cacheKeys[i];\n\t var exp = cache[key].exports;\n\t // Using babel as a transpiler to use esmodule, the export will always\n\t // be an object with the default export as a property of it. To ensure\n\t // the existing api and babel esmodule exports are both supported we\n\t // check for both\n\t if (exp === fn || exp && exp.default === fn) {\n\t wkey = key;\n\t break;\n\t }\n\t }\n\t\n\t if (!wkey) {\n\t wkey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);\n\t var wcache = {};\n\t for (var i = 0, l = cacheKeys.length; i < l; i++) {\n\t var key = cacheKeys[i];\n\t wcache[key] = key;\n\t }\n\t sources[wkey] = [\n\t Function(['require','module','exports'], '(' + fn + ')(self)'),\n\t wcache\n\t ];\n\t }\n\t var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);\n\t\n\t var scache = {}; scache[wkey] = wkey;\n\t sources[skey] = [\n\t Function(['require'], (\n\t // try to call default if defined to also support babel esmodule\n\t // exports\n\t 'var f = require(' + stringify(wkey) + ');' +\n\t '(f.default ? f.default : f)(self);'\n\t )),\n\t scache\n\t ];\n\t\n\t var workerSources = {};\n\t resolveSources(skey);\n\t\n\t function resolveSources(key) {\n\t workerSources[key] = true;\n\t\n\t for (var depPath in sources[key][1]) {\n\t var depKey = sources[key][1][depPath];\n\t if (!workerSources[depKey]) {\n\t resolveSources(depKey);\n\t }\n\t }\n\t }\n\t\n\t var src = '(' + bundleFn + ')({'\n\t + Object.keys(workerSources).map(function (key) {\n\t return stringify(key) + ':['\n\t + sources[key][0]\n\t + ',' + stringify(sources[key][1]) + ']'\n\t ;\n\t }).join(',')\n\t + '},{},[' + stringify(skey) + '])'\n\t ;\n\t\n\t var URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\n\t\n\t var blob = new Blob([src], { type: 'text/javascript' });\n\t if (options && options.bare) { return blob; }\n\t var workerUrl = URL.createObjectURL(blob);\n\t var worker = new Worker(workerUrl);\n\t worker.objectURL = workerUrl;\n\t return worker;\n\t};\n\t\n\t},{}],3:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _eventHandler = _dereq_(25);\n\t\n\tvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\t\n\tvar _bufferHelper = _dereq_(28);\n\t\n\tvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tvar _ewmaBandwidthEstimator = _dereq_(8);\n\t\n\tvar _ewmaBandwidthEstimator2 = _interopRequireDefault(_ewmaBandwidthEstimator);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * simple ABR Controller\n\t * - compute next level based on last fragment bw heuristics\n\t * - implement an abandon rules triggered if we have less than 2 frag buffered and if computed bw shows that we risk buffer stalling\n\t */\n\t\n\tvar AbrController = function (_EventHandler) {\n\t _inherits(AbrController, _EventHandler);\n\t\n\t function AbrController(hls) {\n\t _classCallCheck(this, AbrController);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(AbrController).call(this, hls, _events2.default.FRAG_LOADING, _events2.default.FRAG_LOADED, _events2.default.FRAG_BUFFERED, _events2.default.ERROR));\n\t\n\t _this.lastLoadedFragLevel = 0;\n\t _this._autoLevelCapping = -1;\n\t _this._nextAutoLevel = -1;\n\t _this.hls = hls;\n\t _this.onCheck = _this.abandonRulesCheck.bind(_this);\n\t return _this;\n\t }\n\t\n\t _createClass(AbrController, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t this.clearTimer();\n\t _eventHandler2.default.prototype.destroy.call(this);\n\t }\n\t }, {\n\t key: 'onFragLoading',\n\t value: function onFragLoading(data) {\n\t var frag = data.frag;\n\t if (frag.type === 'main') {\n\t if (!this.timer) {\n\t this.timer = setInterval(this.onCheck, 100);\n\t }\n\t // lazy init of bw Estimator, rationale is that we use different params for Live/VoD\n\t // so we need to wait for stream manifest / playlist type to instantiate it.\n\t if (!this.bwEstimator) {\n\t var hls = this.hls,\n\t level = data.frag.level,\n\t isLive = hls.levels[level].details.live,\n\t config = hls.config,\n\t ewmaFast = void 0,\n\t ewmaSlow = void 0;\n\t\n\t if (isLive) {\n\t ewmaFast = config.abrEwmaFastLive;\n\t ewmaSlow = config.abrEwmaSlowLive;\n\t } else {\n\t ewmaFast = config.abrEwmaFastVoD;\n\t ewmaSlow = config.abrEwmaSlowVoD;\n\t }\n\t this.bwEstimator = new _ewmaBandwidthEstimator2.default(hls, ewmaSlow, ewmaFast, config.abrEwmaDefaultEstimate);\n\t }\n\t this.fragCurrent = frag;\n\t }\n\t }\n\t }, {\n\t key: 'abandonRulesCheck',\n\t value: function abandonRulesCheck() {\n\t /*\n\t monitor fragment retrieval time...\n\t we compute expected time of arrival of the complete fragment.\n\t we compare it to expected time of buffer starvation\n\t */\n\t var hls = this.hls,\n\t v = hls.media,\n\t frag = this.fragCurrent,\n\t loader = frag.loader;\n\t\n\t // if loader has been destroyed or loading has been aborted, stop timer and return\n\t if (!loader || loader.stats && loader.stats.aborted) {\n\t _logger.logger.warn('frag loader destroy or aborted, disarm abandonRules');\n\t this.clearTimer();\n\t return;\n\t }\n\t var stats = loader.stats;\n\t /* only monitor frag retrieval time if\n\t (video not paused OR first fragment being loaded(ready state === HAVE_NOTHING = 0)) AND autoswitching enabled AND not lowest level (=> means that we have several levels) */\n\t if (v && (!v.paused && v.playbackRate !== 0 || !v.readyState) && frag.autoLevel && frag.level) {\n\t var requestDelay = performance.now() - stats.trequest,\n\t playbackRate = Math.abs(v.playbackRate);\n\t // monitor fragment load progress after half of expected fragment duration,to stabilize bitrate\n\t if (requestDelay > 500 * frag.duration / playbackRate) {\n\t var levels = hls.levels,\n\t loadRate = Math.max(1, stats.bw ? stats.bw / 8 : stats.loaded * 1000 / requestDelay),\n\t // byte/s; at least 1 byte/s to avoid division by zero\n\t // compute expected fragment length using frag duration and level bitrate. also ensure that expected len is gte than already loaded size\n\t expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levels[frag.level].bitrate / 8)),\n\t pos = v.currentTime,\n\t fragLoadedDelay = (expectedLen - stats.loaded) / loadRate,\n\t bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, hls.config.maxBufferHole).end - pos) / playbackRate;\n\t // consider emergency switch down only if we have less than 2 frag buffered AND\n\t // time to finish loading current fragment is bigger than buffer starvation delay\n\t // ie if we risk buffer starvation if bw does not increase quickly\n\t if (bufferStarvationDelay < 2 * frag.duration / playbackRate && fragLoadedDelay > bufferStarvationDelay) {\n\t var fragLevelNextLoadedDelay = void 0,\n\t nextLoadLevel = void 0;\n\t // lets iterate through lower level and try to find the biggest one that could avoid rebuffering\n\t // we start from current level - 1 and we step down , until we find a matching level\n\t for (nextLoadLevel = frag.level - 1; nextLoadLevel >= 0; nextLoadLevel--) {\n\t // compute time to load next fragment at lower level\n\t // 0.8 : consider only 80% of current bw to be conservative\n\t // 8 = bits per byte (bps/Bps)\n\t fragLevelNextLoadedDelay = frag.duration * levels[nextLoadLevel].bitrate / (8 * 0.8 * loadRate);\n\t if (fragLevelNextLoadedDelay < bufferStarvationDelay) {\n\t // we found a lower level that be rebuffering free with current estimated bw !\n\t break;\n\t }\n\t }\n\t // only emergency switch down if it takes less time to load new fragment at lowest level instead\n\t // of finishing loading current one ...\n\t if (fragLevelNextLoadedDelay < fragLoadedDelay) {\n\t // ensure nextLoadLevel is not negative\n\t nextLoadLevel = Math.max(0, nextLoadLevel);\n\t _logger.logger.warn('loading too slow, abort fragment loading and switch to level ' + nextLoadLevel + ':fragLoadedDelay[' + nextLoadLevel + ']<fragLoadedDelay[' + (frag.level - 1) + '];bufferStarvationDelay:' + fragLevelNextLoadedDelay.toFixed(1) + '<' + fragLoadedDelay.toFixed(1) + ':' + bufferStarvationDelay.toFixed(1));\n\t // force next load level in auto mode\n\t hls.nextLoadLevel = nextLoadLevel;\n\t // update bw estimate for this fragment before cancelling load (this will help reducing the bw)\n\t this.bwEstimator.sample(requestDelay, stats.loaded);\n\t //abort fragment loading\n\t loader.abort();\n\t // stop abandon rules timer\n\t this.clearTimer();\n\t hls.trigger(_events2.default.FRAG_LOAD_EMERGENCY_ABORTED, { frag: frag, stats: stats });\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'onFragLoaded',\n\t value: function onFragLoaded(data) {\n\t var frag = data.frag;\n\t if (frag.type === 'main') {\n\t // stop monitoring bw once frag loaded\n\t this.clearTimer();\n\t // store level id after successful fragment load\n\t this.lastLoadedFragLevel = frag.level;\n\t // reset forced auto level value so that next level will be selected\n\t this._nextAutoLevel = -1;\n\t // if fragment has been loaded to perform a bitrate test,\n\t if (data.frag.bitrateTest) {\n\t var stats = data.stats;\n\t stats.tparsed = stats.tbuffered = stats.tload;\n\t this.onFragBuffered(data);\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'onFragBuffered',\n\t value: function onFragBuffered(data) {\n\t var stats = data.stats,\n\t frag = data.frag;\n\t // only update stats on first frag buffering\n\t // if same frag is loaded multiple times, it might be in browser cache, and loaded quickly\n\t // and leading to wrong bw estimation\n\t // on bitrate test, also only update stats once (if tload = tbuffered == on FRAG_LOADED)\n\t if (stats.aborted !== true && frag.loadCounter === 1 && frag.type === 'main' && (!frag.bitrateTest || stats.tload === stats.tbuffered)) {\n\t var fragLoadingProcessingMs = stats.tbuffered - stats.trequest;\n\t _logger.logger.log('latency/loading/parsing/append/kbps:' + Math.round(stats.tfirst - stats.trequest) + '/' + Math.round(stats.tload - stats.tfirst) + '/' + Math.round(stats.tparsed - stats.tload) + '/' + Math.round(stats.tbuffered - stats.tparsed) + '/' + Math.round(8 * stats.loaded / (stats.tbuffered - stats.trequest)));\n\t this.bwEstimator.sample(fragLoadingProcessingMs, stats.loaded);\n\t // if fragment has been loaded to perform a bitrate test, (hls.startLevel = -1), store bitrate test delay duration\n\t if (frag.bitrateTest) {\n\t this.bitrateTestDelay = fragLoadingProcessingMs / 1000;\n\t } else {\n\t this.bitrateTestDelay = 0;\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'onError',\n\t value: function onError(data) {\n\t // stop timer in case of frag loading error\n\t switch (data.details) {\n\t case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n\t case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n\t this.clearTimer();\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t }, {\n\t key: 'clearTimer',\n\t value: function clearTimer() {\n\t if (this.timer) {\n\t clearInterval(this.timer);\n\t this.timer = null;\n\t }\n\t }\n\t\n\t /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n\t\n\t }, {\n\t key: 'findBestLevel',\n\t value: function findBestLevel(currentLevel, currentFragDuration, currentBw, minAutoLevel, maxAutoLevel, maxFetchDuration, bwFactor, bwUpFactor, levels) {\n\t for (var i = maxAutoLevel; i >= minAutoLevel; i--) {\n\t var levelInfo = levels[i],\n\t levelDetails = levelInfo.details,\n\t avgDuration = levelDetails ? levelDetails.totalduration / levelDetails.fragments.length : currentFragDuration,\n\t adjustedbw = void 0;\n\t // follow algorithm captured from stagefright :\n\t // https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp\n\t // Pick the highest bandwidth stream below or equal to estimated bandwidth.\n\t // consider only 80% of the available bandwidth, but if we are switching up,\n\t // be even more conservative (70%) to avoid overestimating and immediately\n\t // switching back.\n\t if (i <= currentLevel) {\n\t adjustedbw = bwFactor * currentBw;\n\t } else {\n\t adjustedbw = bwUpFactor * currentBw;\n\t }\n\t var bitrate = levels[i].bitrate,\n\t fetchDuration = bitrate * avgDuration / adjustedbw;\n\t\n\t _logger.logger.trace('level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: ' + i + '/' + Math.round(adjustedbw) + '/' + bitrate + '/' + avgDuration + '/' + maxFetchDuration + '/' + fetchDuration);\n\t // if adjusted bw is greater than level bitrate AND\n\t if (adjustedbw > bitrate && (\n\t // fragment fetchDuration unknown or fragment fetchDuration less than max allowed fetch duration, then this level matches\n\t !fetchDuration || fetchDuration < maxFetchDuration)) {\n\t // as we are looping from highest to lowest, this will return the best achievable quality level\n\t\n\t return i;\n\t }\n\t }\n\t // not enough time budget even with quality level 0 ... rebuffering might happen\n\t return -1;\n\t }\n\t }, {\n\t key: 'autoLevelCapping',\n\t get: function get() {\n\t return this._autoLevelCapping;\n\t }\n\t\n\t /** set the capping/max level value that could be used by automatic level selection algorithm **/\n\t ,\n\t set: function set(newLevel) {\n\t this._autoLevelCapping = newLevel;\n\t }\n\t }, {\n\t key: 'nextAutoLevel',\n\t get: function get() {\n\t var nextAutoLevel = this._nextAutoLevel,\n\t bwEstimator = this.bwEstimator,\n\t hls = this.hls,\n\t levels = hls.levels,\n\t minAutoBitrate = hls.config.minAutoBitrate;\n\t // in case next auto level has been forced, and bw not available or not reliable\n\t if (nextAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {\n\t // cap next auto level by max auto level\n\t return Math.min(nextAutoLevel, this.maxAutoLevel);\n\t }\n\t // compute next level using ABR logic\n\t var nextABRAutoLevel = this.nextABRAutoLevel;\n\t if (nextAutoLevel !== -1) {\n\t // nextAutoLevel is defined, use it to cap ABR computed quality level\n\t nextABRAutoLevel = Math.min(nextAutoLevel, nextABRAutoLevel);\n\t }\n\t if (minAutoBitrate !== undefined) {\n\t while (levels[nextABRAutoLevel].bitrate < minAutoBitrate) {\n\t nextABRAutoLevel++;\n\t }\n\t }\n\t return nextABRAutoLevel;\n\t },\n\t set: function set(nextLevel) {\n\t this._nextAutoLevel = nextLevel;\n\t }\n\t }, {\n\t key: 'minAutoLevel',\n\t get: function get() {\n\t var hls = this.hls,\n\t levels = hls.levels,\n\t minAutoBitrate = hls.config.minAutoBitrate;\n\t for (var i = 0; i < levels.length; i++) {\n\t if (levels[i].bitrate > minAutoBitrate) {\n\t return i;\n\t }\n\t }\n\t return 0;\n\t }\n\t }, {\n\t key: 'maxAutoLevel',\n\t get: function get() {\n\t var levels = this.hls.levels,\n\t autoLevelCapping = this._autoLevelCapping,\n\t maxAutoLevel;\n\t if (autoLevelCapping === -1 && levels && levels.length) {\n\t maxAutoLevel = levels.length - 1;\n\t } else {\n\t maxAutoLevel = autoLevelCapping;\n\t }\n\t return maxAutoLevel;\n\t }\n\t }, {\n\t key: 'nextABRAutoLevel',\n\t get: function get() {\n\t var hls = this.hls,\n\t maxAutoLevel = this.maxAutoLevel,\n\t levels = hls.levels,\n\t config = hls.config,\n\t minAutoLevel = this.minAutoLevel;\n\t var v = hls.media,\n\t currentLevel = this.lastLoadedFragLevel,\n\t currentFragDuration = this.fragCurrent ? this.fragCurrent.duration : 0,\n\t pos = v ? v.currentTime : 0,\n\t\n\t // playbackRate is the absolute value of the playback rate; if v.playbackRate is 0, we use 1 to load as\n\t // if we're playing back at the normal rate.\n\t playbackRate = v && v.playbackRate !== 0 ? Math.abs(v.playbackRate) : 1.0,\n\t avgbw = this.bwEstimator ? this.bwEstimator.getEstimate() : config.abrEwmaDefaultEstimate,\n\t\n\t // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.\n\t bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, config.maxBufferHole).end - pos) / playbackRate;\n\t\n\t // First, look to see if we can find a level matching with our avg bandwidth AND that could also guarantee no rebuffering at all\n\t var bestLevel = this.findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay, config.abrBandWidthFactor, config.abrBandWidthUpFactor, levels);\n\t if (bestLevel >= 0) {\n\t return bestLevel;\n\t } else {\n\t _logger.logger.trace('rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering');\n\t // not possible to get rid of rebuffering ... let's try to find level that will guarantee less than maxStarvationDelay of rebuffering\n\t // if no matching level found, logic will return 0\n\t var maxStarvationDelay = config.maxStarvationDelay,\n\t bwFactor = config.abrBandWidthFactor,\n\t bwUpFactor = config.abrBandWidthUpFactor;\n\t if (bufferStarvationDelay === 0) {\n\t // in case buffer is empty, let's check if previous fragment was loaded to perform a bitrate test\n\t var bitrateTestDelay = this.bitrateTestDelay;\n\t if (bitrateTestDelay) {\n\t // if it is the case, then we need to adjust our max starvation delay using maxLoadingDelay config value\n\t // max video loading delay used in automatic start level selection :\n\t // in that mode ABR controller will ensure that video loading time (ie the time to fetch the first fragment at lowest quality level +\n\t // the time to fetch the fragment at the appropriate quality level is less than ```maxLoadingDelay``` )\n\t maxStarvationDelay = config.maxLoadingDelay - bitrateTestDelay;\n\t _logger.logger.trace('bitrate test took ' + Math.round(1000 * bitrateTestDelay) + 'ms, set first fragment max fetchDuration to ' + Math.round(1000 * maxStarvationDelay) + ' ms');\n\t // don't use conservative factor on bitrate test\n\t bwFactor = bwUpFactor = 1;\n\t }\n\t }\n\t bestLevel = this.findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay + maxStarvationDelay, bwFactor, bwUpFactor, levels);\n\t return Math.max(bestLevel, 0);\n\t }\n\t }\n\t }]);\n\t\n\t return AbrController;\n\t}(_eventHandler2.default);\n\t\n\texports.default = AbrController;\n\t\n\t},{\"24\":24,\"25\":25,\"26\":26,\"28\":28,\"43\":43,\"8\":8}],4:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _binarySearch = _dereq_(39);\n\t\n\tvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\t\n\tvar _bufferHelper = _dereq_(28);\n\t\n\tvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\t\n\tvar _demuxer = _dereq_(20);\n\t\n\tvar _demuxer2 = _interopRequireDefault(_demuxer);\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _eventHandler = _dereq_(25);\n\t\n\tvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\t\n\tvar _levelHelper = _dereq_(29);\n\t\n\tvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\t\n\tvar _timeRanges = _dereq_(45);\n\t\n\tvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * Audio Stream Controller\n\t */\n\t\n\tvar State = {\n\t STOPPED: 'STOPPED',\n\t STARTING: 'STARTING',\n\t IDLE: 'IDLE',\n\t PAUSED: 'PAUSED',\n\t KEY_LOADING: 'KEY_LOADING',\n\t FRAG_LOADING: 'FRAG_LOADING',\n\t FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n\t WAITING_TRACK: 'WAITING_TRACK',\n\t PARSING: 'PARSING',\n\t PARSED: 'PARSED',\n\t ENDED: 'ENDED',\n\t ERROR: 'ERROR'\n\t};\n\t\n\tvar AudioStreamController = function (_EventHandler) {\n\t _inherits(AudioStreamController, _EventHandler);\n\t\n\t function AudioStreamController(hls) {\n\t _classCallCheck(this, AudioStreamController);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(AudioStreamController).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.AUDIO_TRACKS_UPDATED, _events2.default.AUDIO_TRACK_SWITCH, _events2.default.AUDIO_TRACK_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED));\n\t\n\t _this.config = hls.config;\n\t _this.audioCodecSwap = false;\n\t _this.ticks = 0;\n\t _this.ontick = _this.tick.bind(_this);\n\t return _this;\n\t }\n\t\n\t _createClass(AudioStreamController, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t this.stopLoad();\n\t if (this.timer) {\n\t clearInterval(this.timer);\n\t this.timer = null;\n\t }\n\t _eventHandler2.default.prototype.destroy.call(this);\n\t this.state = State.STOPPED;\n\t }\n\t }, {\n\t key: 'startLoad',\n\t value: function startLoad(startPosition) {\n\t if (this.tracks) {\n\t var media = this.media,\n\t lastCurrentTime = this.lastCurrentTime;\n\t this.stopLoad();\n\t if (!this.timer) {\n\t this.timer = setInterval(this.ontick, 100);\n\t }\n\t this.fragLoadError = 0;\n\t if (media && lastCurrentTime) {\n\t _logger.logger.log('configure startPosition @' + lastCurrentTime);\n\t this.state = State.IDLE;\n\t } else {\n\t this.lastCurrentTime = this.startPosition ? this.startPosition : startPosition;\n\t this.state = State.STARTING;\n\t }\n\t this.nextLoadPosition = this.startPosition = this.lastCurrentTime;\n\t this.tick();\n\t } else {\n\t this.startPosition = startPosition;\n\t this.state = State.STOPPED;\n\t }\n\t }\n\t }, {\n\t key: 'stopLoad',\n\t value: function stopLoad() {\n\t var frag = this.fragCurrent;\n\t if (frag) {\n\t if (frag.loader) {\n\t frag.loader.abort();\n\t }\n\t this.fragCurrent = null;\n\t }\n\t this.fragPrevious = null;\n\t if (this.demuxer) {\n\t this.demuxer.destroy();\n\t this.demuxer = null;\n\t }\n\t this.state = State.STOPPED;\n\t }\n\t }, {\n\t key: 'tick',\n\t value: function tick() {\n\t this.ticks++;\n\t if (this.ticks === 1) {\n\t this.doTick();\n\t if (this.ticks > 1) {\n\t setTimeout(this.tick, 1);\n\t }\n\t this.ticks = 0;\n\t }\n\t }\n\t }, {\n\t key: 'doTick',\n\t value: function doTick() {\n\t var pos,\n\t track,\n\t trackDetails,\n\t hls = this.hls,\n\t config = hls.config;\n\t //logger.log('audioStream:' + this.state);\n\t switch (this.state) {\n\t case State.ERROR:\n\t //don't do anything in error state to avoid breaking further ...\n\t case State.PAUSED:\n\t //don't do anything in paused state either ...\n\t break;\n\t case State.STARTING:\n\t this.state = State.WAITING_TRACK;\n\t this.loadedmetadata = false;\n\t break;\n\t case State.IDLE:\n\t // if video not attached AND\n\t // start fragment already requested OR start frag prefetch disable\n\t // exit loop\n\t // => if media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n\t if (!this.media && (this.startFragRequested || !config.startFragPrefetch)) {\n\t break;\n\t }\n\t // determine next candidate fragment to be loaded, based on current position and\n\t // end of buffer position\n\t // if we have not yet loaded any fragment, start loading from start position\n\t if (this.loadedmetadata) {\n\t pos = this.media.currentTime;\n\t } else {\n\t pos = this.nextLoadPosition;\n\t }\n\t var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n\t var bufferInfo = _bufferHelper2.default.bufferInfo(media, pos, config.maxBufferHole),\n\t bufferLen = bufferInfo.len,\n\t bufferEnd = bufferInfo.end,\n\t fragPrevious = this.fragPrevious,\n\t maxBufLen = config.maxMaxBufferLength;\n\t\n\t // if buffer length is less than maxBufLen try to load a new fragment\n\t if (bufferLen < maxBufLen && this.trackId < this.tracks.length) {\n\t trackDetails = this.tracks[this.trackId].details;\n\t // if track info not retrieved yet, switch state and wait for track retrieval\n\t if (typeof trackDetails === 'undefined') {\n\t this.state = State.WAITING_TRACK;\n\t break;\n\t }\n\t\n\t // we just got done loading the final fragment, check if we need to finalize media stream\n\t if (!trackDetails.live && fragPrevious && fragPrevious.sn === trackDetails.endSN) {\n\t // if we are not seeking or if we are seeking but everything (almost) til the end is buffered, let's signal eos\n\t // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference when switching\n\t // between different renditions. using half frag duration should help cope with these cases.\n\t if (!this.media.seeking || this.media.duration - bufferEnd < fragPrevious.duration / 2) {\n\t // Finalize the media stream\n\t this.hls.trigger(_events2.default.BUFFER_EOS, { type: 'audio' });\n\t this.state = State.ENDED;\n\t break;\n\t }\n\t }\n\t\n\t // find fragment index, contiguous with end of buffer position\n\t var fragments = trackDetails.fragments,\n\t fragLen = fragments.length,\n\t start = fragments[0].start,\n\t end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,\n\t frag = void 0;\n\t\n\t // if bufferEnd before start of playlist, load first fragment\n\t if (bufferEnd < start) {\n\t frag = fragments[0];\n\t } else {\n\t (function () {\n\t var foundFrag = void 0;\n\t var maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n\t if (bufferEnd < end) {\n\t if (bufferEnd > end - maxFragLookUpTolerance) {\n\t maxFragLookUpTolerance = 0;\n\t }\n\t foundFrag = _binarySearch2.default.search(fragments, function (candidate) {\n\t // offset should be within fragment boundary - config.maxFragLookUpTolerance\n\t // this is to cope with situations like\n\t // bufferEnd = 9.991\n\t // frag[Ø] : [0,10]\n\t // frag[1] : [10,20]\n\t // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n\t // frag start frag start+duration\n\t // |-----------------------------|\n\t // <---> <--->\n\t // ...--------><-----------------------------><---------....\n\t // previous frag matching fragment next frag\n\t // return -1 return 0 return 1\n\t //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n\t if (candidate.start + candidate.duration - maxFragLookUpTolerance <= bufferEnd) {\n\t return 1;\n\t } else if (candidate.start - maxFragLookUpTolerance > bufferEnd) {\n\t return -1;\n\t }\n\t return 0;\n\t });\n\t } else {\n\t // reach end of playlist\n\t foundFrag = fragments[fragLen - 1];\n\t }\n\t if (foundFrag) {\n\t frag = foundFrag;\n\t start = foundFrag.start;\n\t //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n\t if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {\n\t if (frag.sn < trackDetails.endSN) {\n\t frag = fragments[frag.sn + 1 - trackDetails.startSN];\n\t _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n\t } else {\n\t frag = null;\n\t }\n\t }\n\t }\n\t })();\n\t }\n\t if (frag) {\n\t //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n\t if (frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n\t _logger.logger.log('Loading key for ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + this.trackId);\n\t this.state = State.KEY_LOADING;\n\t hls.trigger(_events2.default.KEY_LOADING, { frag: frag });\n\t } else {\n\t _logger.logger.log('Loading ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + this.trackId + ', currentTime:' + pos + ',bufferEnd:' + bufferEnd.toFixed(3));\n\t // ensure that we are not reloading the same fragments in loop ...\n\t if (this.fragLoadIdx !== undefined) {\n\t this.fragLoadIdx++;\n\t } else {\n\t this.fragLoadIdx = 0;\n\t }\n\t if (frag.loadCounter) {\n\t frag.loadCounter++;\n\t var maxThreshold = config.fragLoadingLoopThreshold;\n\t // if this frag has already been loaded 3 times, and if it has been reloaded recently\n\t if (frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold) {\n\t hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });\n\t return;\n\t }\n\t } else {\n\t frag.loadCounter = 1;\n\t }\n\t frag.loadIdx = this.fragLoadIdx;\n\t this.fragCurrent = frag;\n\t this.startFragRequested = true;\n\t hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n\t this.state = State.FRAG_LOADING;\n\t }\n\t }\n\t }\n\t break;\n\t case State.WAITING_TRACK:\n\t track = this.tracks[this.trackId];\n\t // check if playlist is already loaded\n\t if (track && track.details) {\n\t this.state = State.IDLE;\n\t }\n\t break;\n\t case State.FRAG_LOADING_WAITING_RETRY:\n\t var now = performance.now();\n\t var retryDate = this.retryDate;\n\t media = this.media;\n\t var isSeeking = media && media.seeking;\n\t // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n\t if (!retryDate || now >= retryDate || isSeeking) {\n\t _logger.logger.log('audioStreamController: retryDate reached, switch back to IDLE state');\n\t this.state = State.IDLE;\n\t }\n\t break;\n\t case State.STOPPED:\n\t case State.FRAG_LOADING:\n\t case State.PARSING:\n\t case State.PARSED:\n\t case State.ENDED:\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t }, {\n\t key: 'onMediaAttached',\n\t value: function onMediaAttached(data) {\n\t var media = this.media = this.mediaBuffer = data.media;\n\t this.onvseeking = this.onMediaSeeking.bind(this);\n\t this.onvended = this.onMediaEnded.bind(this);\n\t media.addEventListener('seeking', this.onvseeking);\n\t media.addEventListener('ended', this.onvended);\n\t var config = this.config;\n\t if (this.tracks && config.autoStartLoad) {\n\t this.startLoad(config.startPosition);\n\t }\n\t }\n\t }, {\n\t key: 'onMediaDetaching',\n\t value: function onMediaDetaching() {\n\t var media = this.media;\n\t if (media && media.ended) {\n\t _logger.logger.log('MSE detaching and video ended, reset startPosition');\n\t this.startPosition = this.lastCurrentTime = 0;\n\t }\n\t\n\t // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery\n\t var tracks = this.tracks;\n\t if (tracks) {\n\t // reset fragment load counter\n\t tracks.forEach(function (track) {\n\t if (track.details) {\n\t track.details.fragments.forEach(function (fragment) {\n\t fragment.loadCounter = undefined;\n\t });\n\t }\n\t });\n\t }\n\t // remove video listeners\n\t if (media) {\n\t media.removeEventListener('seeking', this.onvseeking);\n\t media.removeEventListener('ended', this.onvended);\n\t this.onvseeking = this.onvseeked = this.onvended = null;\n\t }\n\t this.media = null;\n\t this.loadedmetadata = false;\n\t this.stopLoad();\n\t }\n\t }, {\n\t key: 'onMediaSeeking',\n\t value: function onMediaSeeking() {\n\t if (this.state === State.ENDED) {\n\t // switch to IDLE state to check for potential new fragment\n\t this.state = State.IDLE;\n\t }\n\t if (this.media) {\n\t this.lastCurrentTime = this.media.currentTime;\n\t }\n\t // avoid reporting fragment loop loading error in case user is seeking several times on same position\n\t if (this.fragLoadIdx !== undefined) {\n\t this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n\t }\n\t // tick to speed up processing\n\t this.tick();\n\t }\n\t }, {\n\t key: 'onMediaEnded',\n\t value: function onMediaEnded() {\n\t // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n\t this.startPosition = this.lastCurrentTime = 0;\n\t }\n\t }, {\n\t key: 'onAudioTracksUpdated',\n\t value: function onAudioTracksUpdated(data) {\n\t _logger.logger.log('audio tracks updated');\n\t this.tracks = data.audioTracks;\n\t }\n\t }, {\n\t key: 'onAudioTrackSwitch',\n\t value: function onAudioTrackSwitch(data) {\n\t // if any URL found on new audio track, it is an alternate audio track\n\t var altAudio = !!data.url;\n\t this.trackId = data.id;\n\t this.state = State.IDLE;\n\t\n\t this.fragCurrent = null;\n\t this.state = State.PAUSED;\n\t // destroy useless demuxer when switching audio to main\n\t if (!altAudio) {\n\t if (this.demuxer) {\n\t this.demuxer.destroy();\n\t this.demuxer = null;\n\t }\n\t } else {\n\t // switching to audio track, start timer if not already started\n\t if (!this.timer) {\n\t this.timer = setInterval(this.ontick, 100);\n\t }\n\t }\n\t // flush audio source buffer\n\t this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n\t this.tick();\n\t }\n\t }, {\n\t key: 'onAudioTrackLoaded',\n\t value: function onAudioTrackLoaded(data) {\n\t var details = data.details,\n\t trackId = data.id,\n\t track = this.tracks[trackId],\n\t duration = details.totalduration;\n\t\n\t _logger.logger.log('track ' + trackId + ' loaded [' + details.startSN + ',' + details.endSN + '],duration:' + duration);\n\t details.PTSKnown = false;\n\t track.details = details;\n\t\n\t // compute start position\n\t if (!this.startFragRequested) {\n\t // compute start position if set to -1. use it straight away if value is defined\n\t if (this.startPosition === -1) {\n\t // first, check if start time offset has been set in playlist, if yes, use this value\n\t var startTimeOffset = details.startTimeOffset;\n\t if (!isNaN(startTimeOffset)) {\n\t _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);\n\t this.startPosition = startTimeOffset;\n\t } else {\n\t this.startPosition = 0;\n\t }\n\t }\n\t this.nextLoadPosition = this.startPosition;\n\t }\n\t // only switch batck to IDLE state if we were waiting for track to start downloading a new fragment\n\t if (this.state === State.WAITING_TRACK) {\n\t this.state = State.IDLE;\n\t }\n\t //trigger handler right now\n\t this.tick();\n\t }\n\t }, {\n\t key: 'onKeyLoaded',\n\t value: function onKeyLoaded() {\n\t if (this.state === State.KEY_LOADING) {\n\t this.state = State.IDLE;\n\t this.tick();\n\t }\n\t }\n\t }, {\n\t key: 'onFragLoaded',\n\t value: function onFragLoaded(data) {\n\t var fragCurrent = this.fragCurrent;\n\t if (this.state === State.FRAG_LOADING && fragCurrent && data.frag.type === 'audio' && data.frag.level === fragCurrent.level && data.frag.sn === fragCurrent.sn) {\n\t this.state = State.PARSING;\n\t // transmux the MPEG-TS data to ISO-BMFF segments\n\t this.stats = data.stats;\n\t var track = this.tracks[this.trackId],\n\t details = track.details,\n\t duration = details.totalduration,\n\t start = fragCurrent.start,\n\t trackId = fragCurrent.level,\n\t sn = fragCurrent.sn,\n\t audioCodec = this.config.defaultAudioCodec || track.audioCodec;\n\t this.pendingAppending = 0;\n\t if (!this.demuxer) {\n\t this.demuxer = new _demuxer2.default(this.hls, 'audio');\n\t }\n\t _logger.logger.log('Demuxing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);\n\t // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)\n\t var accurateTimeOffset = details.PTSKnown || !details.live;\n\t this.demuxer.push(data.payload, audioCodec, null, start, fragCurrent.cc, trackId, sn, duration, fragCurrent.decryptdata, accurateTimeOffset);\n\t }\n\t this.fragLoadError = 0;\n\t }\n\t }, {\n\t key: 'onFragParsingInitSegment',\n\t value: function onFragParsingInitSegment(data) {\n\t var fragCurrent = this.fragCurrent;\n\t if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n\t var tracks = data.tracks,\n\t track = void 0;\n\t\n\t // include levelCodec in audio and video tracks\n\t track = tracks.audio;\n\t if (track) {\n\t track.levelCodec = 'mp4a.40.2';\n\t track.id = data.id;\n\t this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);\n\t _logger.logger.log('audio track:audio,container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');\n\t var initSegment = track.initSegment;\n\t if (initSegment) {\n\t this.pendingAppending++;\n\t this.hls.trigger(_events2.default.BUFFER_APPENDING, { type: 'audio', data: initSegment, parent: 'audio', content: 'initSegment' });\n\t }\n\t //trigger handler right now\n\t this.tick();\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'onFragParsingData',\n\t value: function onFragParsingData(data) {\n\t var _this2 = this;\n\t\n\t var fragCurrent = this.fragCurrent;\n\t if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n\t var track = this.tracks[this.trackId],\n\t frag = this.fragCurrent;\n\t\n\t _logger.logger.log('parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb);\n\t _levelHelper2.default.updateFragPTSDTS(track.details, frag.sn, data.startPTS, data.endPTS);\n\t\n\t [data.data1, data.data2].forEach(function (buffer) {\n\t if (buffer) {\n\t _this2.pendingAppending++;\n\t _this2.hls.trigger(_events2.default.BUFFER_APPENDING, { type: data.type, data: buffer, parent: 'audio', content: 'data' });\n\t }\n\t });\n\t this.nextLoadPosition = data.endPTS;\n\t //trigger handler right now\n\t this.tick();\n\t }\n\t }\n\t }, {\n\t key: 'onFragParsed',\n\t value: function onFragParsed(data) {\n\t var fragCurrent = this.fragCurrent;\n\t if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n\t this.stats.tparsed = performance.now();\n\t this.state = State.PARSED;\n\t this._checkAppendedParsed();\n\t }\n\t }\n\t }, {\n\t key: 'onBufferCreated',\n\t value: function onBufferCreated(data) {\n\t var audioTrack = data.tracks.audio;\n\t if (audioTrack) {\n\t this.mediaBuffer = audioTrack.buffer;\n\t this.loadedmetadata = true;\n\t }\n\t }\n\t }, {\n\t key: 'onBufferAppended',\n\t value: function onBufferAppended(data) {\n\t if (data.parent === 'audio') {\n\t switch (this.state) {\n\t case State.PARSING:\n\t case State.PARSED:\n\t this.pendingAppending--;\n\t this._checkAppendedParsed();\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t }\n\t }, {\n\t key: '_checkAppendedParsed',\n\t value: function _checkAppendedParsed() {\n\t //trigger handler right now\n\t if (this.state === State.PARSED && this.pendingAppending === 0) {\n\t var frag = this.fragCurrent,\n\t stats = this.stats;\n\t if (frag) {\n\t this.fragPrevious = frag;\n\t stats.tbuffered = performance.now();\n\t this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'audio' });\n\t var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n\t _logger.logger.log('audio buffered : ' + _timeRanges2.default.toString(media.buffered));\n\t this.state = State.IDLE;\n\t }\n\t this.tick();\n\t }\n\t }\n\t }, {\n\t key: 'onError',\n\t value: function onError(data) {\n\t var frag = data.frag;\n\t // don't handle frag error not related to audio fragment\n\t if (frag && frag.type !== 'audio') {\n\t return;\n\t }\n\t switch (data.details) {\n\t case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n\t case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n\t if (!data.fatal) {\n\t var loadError = this.fragLoadError;\n\t if (loadError) {\n\t loadError++;\n\t } else {\n\t loadError = 1;\n\t }\n\t var config = this.config;\n\t if (loadError <= config.fragLoadingMaxRetry) {\n\t this.fragLoadError = loadError;\n\t // reset load counter to avoid frag loop loading error\n\t frag.loadCounter = 0;\n\t // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n\t var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n\t _logger.logger.warn('audioStreamController: frag loading failed, retry in ' + delay + ' ms');\n\t this.retryDate = performance.now() + delay;\n\t // retry loading state\n\t this.state = State.FRAG_LOADING_WAITING_RETRY;\n\t } else {\n\t _logger.logger.error('audioStreamController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n\t // redispatch same error but with fatal set to true\n\t data.fatal = true;\n\t this.hls.trigger(_events2.default.ERROR, data);\n\t this.state = State.ERROR;\n\t }\n\t }\n\t break;\n\t case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n\t case _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:\n\t case _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:\n\t case _errors.ErrorDetails.KEY_LOAD_ERROR:\n\t case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n\t // when in ERROR state, don't switch back to IDLE state in case a non-fatal error is received\n\t if (this.state !== State.ERROR) {\n\t // if fatal error, stop processing, otherwise move to IDLE to retry loading\n\t this.state = data.fatal ? State.ERROR : State.IDLE;\n\t _logger.logger.warn('audioStreamController: ' + data.details + ' while loading frag,switch to ' + this.state + ' state ...');\n\t }\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t }, {\n\t key: 'onBufferFlushed',\n\t value: function onBufferFlushed() {\n\t // increase fragment load Index to avoid frag loop loading error after buffer flush\n\t this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n\t // move to IDLE once flush complete. this should trigger new fragment loading\n\t this.state = State.IDLE;\n\t // reset reference to frag\n\t this.fragPrevious = null;\n\t this.tick();\n\t }\n\t }]);\n\t\n\t return AudioStreamController;\n\t}(_eventHandler2.default);\n\t\n\texports.default = AudioStreamController;\n\t\n\t},{\"20\":20,\"24\":24,\"25\":25,\"26\":26,\"28\":28,\"29\":29,\"39\":39,\"43\":43,\"45\":45}],5:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _eventHandler = _dereq_(25);\n\t\n\tvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * audio track controller\n\t */\n\t\n\tvar AudioTrackController = function (_EventHandler) {\n\t _inherits(AudioTrackController, _EventHandler);\n\t\n\t function AudioTrackController(hls) {\n\t _classCallCheck(this, AudioTrackController);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(AudioTrackController).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_LOADED, _events2.default.AUDIO_TRACK_LOADED));\n\t }\n\t\n\t _createClass(AudioTrackController, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t _eventHandler2.default.prototype.destroy.call(this);\n\t }\n\t }, {\n\t key: 'onManifestLoading',\n\t value: function onManifestLoading() {\n\t // reset audio tracks on manifest loading\n\t this.tracks = [];\n\t this.trackId = -1;\n\t }\n\t }, {\n\t key: 'onManifestLoaded',\n\t value: function onManifestLoaded(data) {\n\t var _this2 = this;\n\t\n\t var tracks = data.audioTracks || [];\n\t var defaultFound = false;\n\t this.tracks = tracks;\n\t this.hls.trigger(_events2.default.AUDIO_TRACKS_UPDATED, { audioTracks: tracks });\n\t // loop through available audio tracks and autoselect default if needed\n\t var id = 0;\n\t tracks.forEach(function (track) {\n\t if (track.default) {\n\t _this2.audioTrack = id;\n\t defaultFound = true;\n\t return;\n\t }\n\t id++;\n\t });\n\t if (defaultFound === false && tracks.length) {\n\t _logger.logger.log('no default audio track defined, use first audio track as default');\n\t this.audioTrack = 0;\n\t }\n\t }\n\t }, {\n\t key: 'onAudioTrackLoaded',\n\t value: function onAudioTrackLoaded(data) {\n\t if (data.id < this.tracks.length) {\n\t _logger.logger.log('audioTrack ' + data.id + ' loaded');\n\t this.tracks[data.id].details = data.details;\n\t // check if current playlist is a live playlist\n\t if (data.details.live && !this.timer) {\n\t // if live playlist we will have to reload it periodically\n\t // set reload period to playlist target duration\n\t this.timer = setInterval(this.ontick, 1000 * data.details.targetduration);\n\t }\n\t if (!data.details.live && this.timer) {\n\t // playlist is not live and timer is armed : stopping it\n\t clearInterval(this.timer);\n\t this.timer = null;\n\t }\n\t }\n\t }\n\t\n\t /** get alternate audio tracks list from playlist **/\n\t\n\t }, {\n\t key: 'setAudioTrackInternal',\n\t value: function setAudioTrackInternal(newId) {\n\t // check if level idx is valid\n\t if (newId >= 0 && newId < this.tracks.length) {\n\t // stopping live reloading timer if any\n\t if (this.timer) {\n\t clearInterval(this.timer);\n\t this.timer = null;\n\t }\n\t this.trackId = newId;\n\t _logger.logger.log('switching to audioTrack ' + newId);\n\t var audioTrack = this.tracks[newId],\n\t type = audioTrack.type,\n\t url = audioTrack.url;\n\t this.hls.trigger(_events2.default.AUDIO_TRACK_SWITCH, { id: newId, type: type, url: url });\n\t // check if we need to load playlist for this audio Track\n\t var details = audioTrack.details;\n\t if (url && (details === undefined || details.live === true)) {\n\t // track not retrieved yet, or live playlist we need to (re)load it\n\t _logger.logger.log('(re)loading playlist for audioTrack ' + newId);\n\t this.hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'audioTracks',\n\t get: function get() {\n\t return this.tracks;\n\t }\n\t\n\t /** get index of the selected audio track (index in audio track lists) **/\n\t\n\t }, {\n\t key: 'audioTrack',\n\t get: function get() {\n\t return this.trackId;\n\t }\n\t\n\t /** select an audio track, based on its index in audio track lists**/\n\t ,\n\t set: function set(audioTrackId) {\n\t if (this.trackId !== audioTrackId || this.tracks[audioTrackId].details === undefined) {\n\t this.setAudioTrackInternal(audioTrackId);\n\t }\n\t }\n\t }]);\n\t\n\t return AudioTrackController;\n\t}(_eventHandler2.default);\n\t\n\texports.default = AudioTrackController;\n\t\n\t},{\"25\":25,\"26\":26,\"43\":43}],6:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _eventHandler = _dereq_(25);\n\t\n\tvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * Buffer Controller\n\t */\n\t\n\tvar BufferController = function (_EventHandler) {\n\t _inherits(BufferController, _EventHandler);\n\t\n\t function BufferController(hls) {\n\t _classCallCheck(this, BufferController);\n\t\n\t // the value that we have set mediasource.duration to\n\t // (the actual duration may be tweaked slighly by the browser)\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(BufferController).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_PARSED, _events2.default.BUFFER_RESET, _events2.default.BUFFER_APPENDING, _events2.default.BUFFER_CODECS, _events2.default.BUFFER_EOS, _events2.default.BUFFER_FLUSHING, _events2.default.LEVEL_UPDATED));\n\t\n\t _this._msDuration = null;\n\t // the value that we want to set mediaSource.duration to\n\t _this._levelDuration = null;\n\t\n\t // Source Buffer listeners\n\t _this.onsbue = _this.onSBUpdateEnd.bind(_this);\n\t _this.onsbe = _this.onSBUpdateError.bind(_this);\n\t _this.pendingTracks = {};\n\t return _this;\n\t }\n\t\n\t _createClass(BufferController, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t _eventHandler2.default.prototype.destroy.call(this);\n\t }\n\t }, {\n\t key: 'onManifestParsed',\n\t value: function onManifestParsed(data) {\n\t var audioExpected = data.audio,\n\t videoExpected = data.video,\n\t sourceBufferNb = 0;\n\t // in case of alt audio 2 BUFFER_CODECS events will be triggered, one per stream controller\n\t // sourcebuffers will be created all at once when the expected nb of tracks will be reached\n\t // in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller\n\t // it will contain the expected nb of source buffers, no need to compute it\n\t if (data.altAudio && (audioExpected || videoExpected)) {\n\t sourceBufferNb = (audioExpected ? 1 : 0) + (videoExpected ? 1 : 0);\n\t _logger.logger.log(sourceBufferNb + ' sourceBuffer(s) expected');\n\t }\n\t this.sourceBufferNb = sourceBufferNb;\n\t }\n\t }, {\n\t key: 'onMediaAttaching',\n\t value: function onMediaAttaching(data) {\n\t var media = this.media = data.media;\n\t if (media) {\n\t // setup the media source\n\t var ms = this.mediaSource = new MediaSource();\n\t //Media Source listeners\n\t this.onmso = this.onMediaSourceOpen.bind(this);\n\t this.onmse = this.onMediaSourceEnded.bind(this);\n\t this.onmsc = this.onMediaSourceClose.bind(this);\n\t ms.addEventListener('sourceopen', this.onmso);\n\t ms.addEventListener('sourceended', this.onmse);\n\t ms.addEventListener('sourceclose', this.onmsc);\n\t // link video and media Source\n\t media.src = URL.createObjectURL(ms);\n\t }\n\t }\n\t }, {\n\t key: 'onMediaDetaching',\n\t value: function onMediaDetaching() {\n\t _logger.logger.log('media source detaching');\n\t var ms = this.mediaSource;\n\t if (ms) {\n\t if (ms.readyState === 'open') {\n\t try {\n\t // endOfStream could trigger exception if any sourcebuffer is in updating state\n\t // we don't really care about checking sourcebuffer state here,\n\t // as we are anyway detaching the MediaSource\n\t // let's just avoid this exception to propagate\n\t ms.endOfStream();\n\t } catch (err) {\n\t _logger.logger.warn('onMediaDetaching:' + err.message + ' while calling endOfStream');\n\t }\n\t }\n\t ms.removeEventListener('sourceopen', this.onmso);\n\t ms.removeEventListener('sourceended', this.onmse);\n\t ms.removeEventListener('sourceclose', this.onmsc);\n\t\n\t // Detach properly the MediaSource from the HTMLMediaElement as\n\t // suggested in https://github.com/w3c/media-source/issues/53.\n\t if (this.media) {\n\t this.media.removeAttribute('src');\n\t this.media.load();\n\t }\n\t\n\t this.mediaSource = null;\n\t this.media = null;\n\t this.pendingTracks = {};\n\t this.sourceBuffer = {};\n\t this.flushRange = [];\n\t this.segments = [];\n\t this.appended = 0;\n\t }\n\t this.onmso = this.onmse = this.onmsc = null;\n\t this.hls.trigger(_events2.default.MEDIA_DETACHED);\n\t }\n\t }, {\n\t key: 'onMediaSourceOpen',\n\t value: function onMediaSourceOpen() {\n\t _logger.logger.log('media source opened');\n\t this.hls.trigger(_events2.default.MEDIA_ATTACHED, { media: this.media });\n\t var mediaSource = this.mediaSource;\n\t if (mediaSource) {\n\t // once received, don't listen anymore to sourceopen event\n\t mediaSource.removeEventListener('sourceopen', this.onmso);\n\t }\n\t this.checkPendingTracks();\n\t }\n\t }, {\n\t key: 'checkPendingTracks',\n\t value: function checkPendingTracks() {\n\t // if any buffer codecs pending, check if we have enough to create sourceBuffers\n\t var pendingTracks = this.pendingTracks,\n\t pendingTracksNb = Object.keys(pendingTracks).length;\n\t // if any pending tracks and (if nb of pending tracks gt or equal than expected nb or if unknown expected nb)\n\t if (pendingTracksNb && (this.sourceBufferNb <= pendingTracksNb || this.sourceBufferNb === 0)) {\n\t // ok, let's create them now !\n\t this.createSourceBuffers(pendingTracks);\n\t this.pendingTracks = {};\n\t // append any pending segments now !\n\t this.doAppending();\n\t }\n\t }\n\t }, {\n\t key: 'onMediaSourceClose',\n\t value: function onMediaSourceClose() {\n\t _logger.logger.log('media source closed');\n\t }\n\t }, {\n\t key: 'onMediaSourceEnded',\n\t value: function onMediaSourceEnded() {\n\t _logger.logger.log('media source ended');\n\t }\n\t }, {\n\t key: 'onSBUpdateEnd',\n\t value: function onSBUpdateEnd() {\n\t\n\t if (this._needsFlush) {\n\t this.doFlush();\n\t }\n\t\n\t if (this._needsEos) {\n\t this.checkEos();\n\t }\n\t this.appending = false;\n\t this.hls.trigger(_events2.default.BUFFER_APPENDED, { parent: this.parent });\n\t\n\t // don't append in flushing mode\n\t if (!this._needsFlush) {\n\t this.doAppending();\n\t }\n\t\n\t this.updateMediaElementDuration();\n\t }\n\t }, {\n\t key: 'onSBUpdateError',\n\t value: function onSBUpdateError(event) {\n\t _logger.logger.error('sourceBuffer error:' + event);\n\t // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n\t // this error might not always be fatal (it is fatal if decode error is set, in that case\n\t // it will be followed by a mediaElement error ...)\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false });\n\t // we don't need to do more than that, as accordin to the spec, updateend will be fired just after\n\t }\n\t }, {\n\t key: 'onBufferReset',\n\t value: function onBufferReset() {\n\t var sourceBuffer = this.sourceBuffer;\n\t for (var type in sourceBuffer) {\n\t var sb = sourceBuffer[type];\n\t try {\n\t this.mediaSource.removeSourceBuffer(sb);\n\t sb.removeEventListener('updateend', this.onsbue);\n\t sb.removeEventListener('error', this.onsbe);\n\t } catch (err) {}\n\t }\n\t this.sourceBuffer = {};\n\t this.flushRange = [];\n\t this.segments = [];\n\t this.appended = 0;\n\t }\n\t }, {\n\t key: 'onBufferCodecs',\n\t value: function onBufferCodecs(tracks) {\n\t // if source buffer(s) not created yet, appended buffer tracks in this.pendingTracks\n\t // if sourcebuffers already created, do nothing ...\n\t if (Object.keys(this.sourceBuffer).length === 0) {\n\t for (var trackName in tracks) {\n\t this.pendingTracks[trackName] = tracks[trackName];\n\t }\n\t var mediaSource = this.mediaSource;\n\t if (mediaSource && mediaSource.readyState === 'open') {\n\t // try to create sourcebuffers if mediasource opened\n\t this.checkPendingTracks();\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'createSourceBuffers',\n\t value: function createSourceBuffers(tracks) {\n\t var sourceBuffer = this.sourceBuffer,\n\t mediaSource = this.mediaSource;\n\t\n\t for (var trackName in tracks) {\n\t if (!sourceBuffer[trackName]) {\n\t var track = tracks[trackName];\n\t // use levelCodec as first priority\n\t var codec = track.levelCodec || track.codec;\n\t var mimeType = track.container + ';codecs=' + codec;\n\t _logger.logger.log('creating sourceBuffer(' + mimeType + ')');\n\t try {\n\t var sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);\n\t sb.addEventListener('updateend', this.onsbue);\n\t sb.addEventListener('error', this.onsbe);\n\t track.buffer = sb;\n\t } catch (err) {\n\t _logger.logger.error('error while trying to add sourceBuffer:' + err.message);\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_ADD_CODEC_ERROR, fatal: false, err: err, mimeType: mimeType });\n\t }\n\t }\n\t }\n\t this.hls.trigger(_events2.default.BUFFER_CREATED, { tracks: tracks });\n\t }\n\t }, {\n\t key: 'onBufferAppending',\n\t value: function onBufferAppending(data) {\n\t if (!this._needsFlush) {\n\t if (!this.segments) {\n\t this.segments = [data];\n\t } else {\n\t this.segments.push(data);\n\t }\n\t this.doAppending();\n\t }\n\t }\n\t }, {\n\t key: 'onBufferAppendFail',\n\t value: function onBufferAppendFail(data) {\n\t _logger.logger.error('sourceBuffer error:' + data.event);\n\t // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n\t // this error might not always be fatal (it is fatal if decode error is set, in that case\n\t // it will be followed by a mediaElement error ...)\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false, frag: this.fragCurrent });\n\t }\n\t\n\t // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()\n\t\n\t }, {\n\t key: 'onBufferEos',\n\t value: function onBufferEos(data) {\n\t var sb = this.sourceBuffer;\n\t var dataType = data.type;\n\t for (var type in sb) {\n\t if (!dataType || type === dataType) {\n\t if (!sb[type].ended) {\n\t sb[type].ended = true;\n\t _logger.logger.log(type + ' sourceBuffer now EOS');\n\t }\n\t }\n\t }\n\t this.checkEos();\n\t }\n\t\n\t // if all source buffers are marked as ended, signal endOfStream() to MediaSource.\n\t\n\t }, {\n\t key: 'checkEos',\n\t value: function checkEos() {\n\t var sb = this.sourceBuffer,\n\t mediaSource = this.mediaSource;\n\t if (!mediaSource || mediaSource.readyState !== 'open') {\n\t this._needsEos = false;\n\t return;\n\t }\n\t for (var type in sb) {\n\t if (!sb[type].ended) {\n\t return;\n\t }\n\t if (sb[type].updating) {\n\t this._needsEos = true;\n\t return;\n\t }\n\t }\n\t _logger.logger.log('all media data available, signal endOfStream() to MediaSource and stop loading fragment');\n\t //Notify the media element that it now has all of the media data\n\t mediaSource.endOfStream();\n\t this._needsEos = false;\n\t }\n\t }, {\n\t key: 'onBufferFlushing',\n\t value: function onBufferFlushing(data) {\n\t this.flushRange.push({ start: data.startOffset, end: data.endOffset, type: data.type });\n\t // attempt flush immediatly\n\t this.flushBufferCounter = 0;\n\t this.doFlush();\n\t }\n\t }, {\n\t key: 'onLevelUpdated',\n\t value: function onLevelUpdated(event) {\n\t var details = event.details;\n\t if (details.fragments.length === 0) {\n\t return;\n\t }\n\t this._levelDuration = details.totalduration + details.fragments[0].start;\n\t this.updateMediaElementDuration();\n\t }\n\t\n\t // https://github.com/dailymotion/hls.js/issues/355\n\t\n\t }, {\n\t key: 'updateMediaElementDuration',\n\t value: function updateMediaElementDuration() {\n\t if (this._levelDuration === null) {\n\t return;\n\t }\n\t var media = this.media,\n\t mediaSource = this.mediaSource,\n\t sourceBuffer = this.sourceBuffer;\n\t if (!media || !mediaSource || !sourceBuffer || media.readyState === 0 || mediaSource.readyState !== 'open') {\n\t return;\n\t }\n\t for (var type in sourceBuffer) {\n\t if (sourceBuffer[type].updating) {\n\t // can't set duration whilst a buffer is updating\n\t return;\n\t }\n\t }\n\t if (this._msDuration === null) {\n\t // initialise to the value that the media source is reporting\n\t this._msDuration = mediaSource.duration;\n\t }\n\t // this._levelDuration was the last value we set.\n\t // not using mediaSource.duration as the browser may tweak this value\n\t // only update mediasource duration if its value increase, this is to avoid\n\t // flushing already buffered portion when switching between quality level, as they\n\t if (this._levelDuration > this._msDuration) {\n\t _logger.logger.log('Updating mediasource duration to ' + this._levelDuration);\n\t mediaSource.duration = this._levelDuration;\n\t this._msDuration = this._levelDuration;\n\t }\n\t }\n\t }, {\n\t key: 'doFlush',\n\t value: function doFlush() {\n\t // loop through all buffer ranges to flush\n\t while (this.flushRange.length) {\n\t var range = this.flushRange[0];\n\t // flushBuffer will abort any buffer append in progress and flush Audio/Video Buffer\n\t if (this.flushBuffer(range.start, range.end, range.type)) {\n\t // range flushed, remove from flush array\n\t this.flushRange.shift();\n\t this.flushBufferCounter = 0;\n\t } else {\n\t this._needsFlush = true;\n\t // avoid looping, wait for SB update end to retrigger a flush\n\t return;\n\t }\n\t }\n\t if (this.flushRange.length === 0) {\n\t // everything flushed\n\t this._needsFlush = false;\n\t\n\t // let's recompute this.appended, which is used to avoid flush looping\n\t var appended = 0;\n\t var sourceBuffer = this.sourceBuffer;\n\t for (var type in sourceBuffer) {\n\t appended += sourceBuffer[type].buffered.length;\n\t }\n\t this.appended = appended;\n\t this.hls.trigger(_events2.default.BUFFER_FLUSHED);\n\t }\n\t }\n\t }, {\n\t key: 'doAppending',\n\t value: function doAppending() {\n\t var hls = this.hls,\n\t sourceBuffer = this.sourceBuffer,\n\t segments = this.segments;\n\t if (Object.keys(sourceBuffer).length) {\n\t if (this.media.error) {\n\t this.segments = [];\n\t _logger.logger.error('trying to append although a media error occured, flush segment and abort');\n\t return;\n\t }\n\t if (this.appending) {\n\t //logger.log(`sb appending in progress`);\n\t return;\n\t }\n\t if (segments && segments.length) {\n\t var segment = segments.shift();\n\t try {\n\t var type = segment.type;\n\t if (sourceBuffer[type]) {\n\t // reset sourceBuffer ended flag before appending segment\n\t sourceBuffer[type].ended = false;\n\t //logger.log(`appending ${segment.content} ${segment.type} SB, size:${segment.data.length}, ${segment.parent}`);\n\t this.parent = segment.parent;\n\t sourceBuffer[type].appendBuffer(segment.data);\n\t this.appendError = 0;\n\t this.appended++;\n\t this.appending = true;\n\t } else {\n\t // in case we don't have any source buffer matching with this segment type,\n\t // it means that Mediasource fails to create sourcebuffer\n\t // discard this segment, and trigger update end\n\t this.onSBUpdateEnd();\n\t }\n\t } catch (err) {\n\t // in case any error occured while appending, put back segment in segments table\n\t _logger.logger.error('error while trying to append buffer:' + err.message);\n\t segments.unshift(segment);\n\t var event = { type: _errors.ErrorTypes.MEDIA_ERROR };\n\t if (err.code !== 22) {\n\t if (this.appendError) {\n\t this.appendError++;\n\t } else {\n\t this.appendError = 1;\n\t }\n\t event.details = _errors.ErrorDetails.BUFFER_APPEND_ERROR;\n\t event.frag = this.fragCurrent;\n\t /* with UHD content, we could get loop of quota exceeded error until\n\t browser is able to evict some data from sourcebuffer. retrying help recovering this\n\t */\n\t if (this.appendError > hls.config.appendErrorMaxRetry) {\n\t _logger.logger.log('fail ' + hls.config.appendErrorMaxRetry + ' times to append segment in sourceBuffer');\n\t segments = [];\n\t event.fatal = true;\n\t hls.trigger(_events2.default.ERROR, event);\n\t return;\n\t } else {\n\t event.fatal = false;\n\t hls.trigger(_events2.default.ERROR, event);\n\t }\n\t } else {\n\t // QuotaExceededError: http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror\n\t // let's stop appending any segments, and report BUFFER_FULL_ERROR error\n\t this.segments = [];\n\t event.details = _errors.ErrorDetails.BUFFER_FULL_ERROR;\n\t hls.trigger(_events2.default.ERROR, event);\n\t return;\n\t }\n\t }\n\t }\n\t }\n\t }\n\t\n\t /*\n\t flush specified buffered range,\n\t return true once range has been flushed.\n\t as sourceBuffer.remove() is asynchronous, flushBuffer will be retriggered on sourceBuffer update end\n\t */\n\t\n\t }, {\n\t key: 'flushBuffer',\n\t value: function flushBuffer(startOffset, endOffset, typeIn) {\n\t var sb,\n\t i,\n\t bufStart,\n\t bufEnd,\n\t flushStart,\n\t flushEnd,\n\t sourceBuffer = this.sourceBuffer;\n\t if (Object.keys(sourceBuffer).length) {\n\t _logger.logger.log('flushBuffer,pos/start/end: ' + this.media.currentTime + '/' + startOffset + '/' + endOffset);\n\t // safeguard to avoid infinite looping : don't try to flush more than the nb of appended segments\n\t if (this.flushBufferCounter < this.appended) {\n\t for (var type in sourceBuffer) {\n\t // check if sourcebuffer type is defined (typeIn): if yes, let's only flush this one\n\t // if no, let's flush all sourcebuffers\n\t if (typeIn && type !== typeIn) {\n\t continue;\n\t }\n\t sb = sourceBuffer[type];\n\t // we are going to flush buffer, mark source buffer as 'not ended'\n\t sb.ended = false;\n\t if (!sb.updating) {\n\t for (i = 0; i < sb.buffered.length; i++) {\n\t bufStart = sb.buffered.start(i);\n\t bufEnd = sb.buffered.end(i);\n\t // workaround firefox not able to properly flush multiple buffered range.\n\t if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1 && endOffset === Number.POSITIVE_INFINITY) {\n\t flushStart = startOffset;\n\t flushEnd = endOffset;\n\t } else {\n\t flushStart = Math.max(bufStart, startOffset);\n\t flushEnd = Math.min(bufEnd, endOffset);\n\t }\n\t /* sometimes sourcebuffer.remove() does not flush\n\t the exact expected time range.\n\t to avoid rounding issues/infinite loop,\n\t only flush buffer range of length greater than 500ms.\n\t */\n\t if (Math.min(flushEnd, bufEnd) - flushStart > 0.5) {\n\t this.flushBufferCounter++;\n\t _logger.logger.log('flush ' + type + ' [' + flushStart + ',' + flushEnd + '], of [' + bufStart + ',' + bufEnd + '], pos:' + this.media.currentTime);\n\t sb.remove(flushStart, flushEnd);\n\t return false;\n\t }\n\t }\n\t } else {\n\t //logger.log('abort ' + type + ' append in progress');\n\t // this will abort any appending in progress\n\t //sb.abort();\n\t _logger.logger.warn('cannot flush, sb updating in progress');\n\t return false;\n\t }\n\t }\n\t } else {\n\t _logger.logger.warn('abort flushing too many retries');\n\t }\n\t _logger.logger.log('buffer flushed');\n\t }\n\t // everything flushed !\n\t return true;\n\t }\n\t }]);\n\t\n\t return BufferController;\n\t}(_eventHandler2.default);\n\t\n\texports.default = BufferController;\n\t\n\t},{\"24\":24,\"25\":25,\"26\":26,\"43\":43}],7:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _eventHandler = _dereq_(25);\n\t\n\tvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * cap stream level to media size dimension controller\n\t */\n\t\n\tvar CapLevelController = function (_EventHandler) {\n\t _inherits(CapLevelController, _EventHandler);\n\t\n\t function CapLevelController(hls) {\n\t _classCallCheck(this, CapLevelController);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(CapLevelController).call(this, hls, _events2.default.FPS_DROP_LEVEL_CAPPING, _events2.default.MEDIA_ATTACHING, _events2.default.MANIFEST_PARSED));\n\t }\n\t\n\t _createClass(CapLevelController, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t if (this.hls.config.capLevelToPlayerSize) {\n\t this.media = this.restrictedLevels = null;\n\t this.autoLevelCapping = Number.POSITIVE_INFINITY;\n\t if (this.timer) {\n\t this.timer = clearInterval(this.timer);\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'onFpsDropLevelCapping',\n\t value: function onFpsDropLevelCapping(data) {\n\t if (!this.restrictedLevels) {\n\t this.restrictedLevels = [];\n\t }\n\t if (!this.isLevelRestricted(data.droppedLevel)) {\n\t this.restrictedLevels.push(data.droppedLevel);\n\t }\n\t }\n\t }, {\n\t key: 'onMediaAttaching',\n\t value: function onMediaAttaching(data) {\n\t this.media = data.media instanceof HTMLVideoElement ? data.media : null;\n\t }\n\t }, {\n\t key: 'onManifestParsed',\n\t value: function onManifestParsed(data) {\n\t if (this.hls.config.capLevelToPlayerSize) {\n\t this.autoLevelCapping = Number.POSITIVE_INFINITY;\n\t this.levels = data.levels;\n\t this.hls.firstLevel = this.getMaxLevel(data.firstLevel);\n\t clearInterval(this.timer);\n\t this.timer = setInterval(this.detectPlayerSize.bind(this), 1000);\n\t this.detectPlayerSize();\n\t }\n\t }\n\t }, {\n\t key: 'detectPlayerSize',\n\t value: function detectPlayerSize() {\n\t if (this.media) {\n\t var levelsLength = this.levels ? this.levels.length : 0;\n\t if (levelsLength) {\n\t this.hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);\n\t if (this.hls.autoLevelCapping > this.autoLevelCapping) {\n\t // if auto level capping has a higher value for the previous one, flush the buffer using nextLevelSwitch\n\t // usually happen when the user go to the fullscreen mode.\n\t this.hls.streamController.nextLevelSwitch();\n\t }\n\t this.autoLevelCapping = this.hls.autoLevelCapping;\n\t }\n\t }\n\t }\n\t\n\t /*\n\t * returns level should be the one with the dimensions equal or greater than the media (player) dimensions (so the video will be downscaled)\n\t */\n\t\n\t }, {\n\t key: 'getMaxLevel',\n\t value: function getMaxLevel(capLevelIndex) {\n\t var result = 0,\n\t i = void 0,\n\t level = void 0,\n\t mWidth = this.mediaWidth,\n\t mHeight = this.mediaHeight,\n\t lWidth = 0,\n\t lHeight = 0;\n\t\n\t for (i = 0; i <= capLevelIndex; i++) {\n\t level = this.levels[i];\n\t if (this.isLevelRestricted(i)) {\n\t break;\n\t }\n\t result = i;\n\t lWidth = level.width;\n\t lHeight = level.height;\n\t if (mWidth <= lWidth || mHeight <= lHeight) {\n\t break;\n\t }\n\t }\n\t return result;\n\t }\n\t }, {\n\t key: 'isLevelRestricted',\n\t value: function isLevelRestricted(level) {\n\t return this.restrictedLevels && this.restrictedLevels.indexOf(level) !== -1 ? true : false;\n\t }\n\t }, {\n\t key: 'contentScaleFactor',\n\t get: function get() {\n\t var pixelRatio = 1;\n\t try {\n\t pixelRatio = window.devicePixelRatio;\n\t } catch (e) {}\n\t return pixelRatio;\n\t }\n\t }, {\n\t key: 'mediaWidth',\n\t get: function get() {\n\t var width = void 0;\n\t if (this.media) {\n\t width = this.media.width || this.media.clientWidth || this.media.offsetWidth;\n\t width *= this.contentScaleFactor;\n\t }\n\t return width;\n\t }\n\t }, {\n\t key: 'mediaHeight',\n\t get: function get() {\n\t var height = void 0;\n\t if (this.media) {\n\t height = this.media.height || this.media.clientHeight || this.media.offsetHeight;\n\t height *= this.contentScaleFactor;\n\t }\n\t return height;\n\t }\n\t }]);\n\t\n\t return CapLevelController;\n\t}(_eventHandler2.default);\n\t\n\texports.default = CapLevelController;\n\t\n\t},{\"25\":25,\"26\":26}],8:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * EWMA Bandwidth Estimator\n\t * - heavily inspired from shaka-player\n\t * Tracks bandwidth samples and estimates available bandwidth.\n\t * Based on the minimum of two exponentially-weighted moving averages with\n\t * different half-lives.\n\t */\n\t\n\tvar _ewma = _dereq_(42);\n\t\n\tvar _ewma2 = _interopRequireDefault(_ewma);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar EwmaBandWidthEstimator = function () {\n\t function EwmaBandWidthEstimator(hls, slow, fast, defaultEstimate) {\n\t _classCallCheck(this, EwmaBandWidthEstimator);\n\t\n\t this.hls = hls;\n\t this.defaultEstimate_ = defaultEstimate;\n\t this.minWeight_ = 0.001;\n\t this.minDelayMs_ = 50;\n\t this.slow_ = new _ewma2.default(slow);\n\t this.fast_ = new _ewma2.default(fast);\n\t }\n\t\n\t _createClass(EwmaBandWidthEstimator, [{\n\t key: 'sample',\n\t value: function sample(durationMs, numBytes) {\n\t durationMs = Math.max(durationMs, this.minDelayMs_);\n\t var bandwidth = 8000 * numBytes / durationMs,\n\t\n\t //console.log('instant bw:'+ Math.round(bandwidth));\n\t // we weight sample using loading duration....\n\t weight = durationMs / 1000;\n\t this.fast_.sample(weight, bandwidth);\n\t this.slow_.sample(weight, bandwidth);\n\t }\n\t }, {\n\t key: 'canEstimate',\n\t value: function canEstimate() {\n\t var fast = this.fast_;\n\t return fast && fast.getTotalWeight() >= this.minWeight_;\n\t }\n\t }, {\n\t key: 'getEstimate',\n\t value: function getEstimate() {\n\t if (this.canEstimate()) {\n\t //console.log('slow estimate:'+ Math.round(this.slow_.getEstimate()));\n\t //console.log('fast estimate:'+ Math.round(this.fast_.getEstimate()));\n\t // Take the minimum of these two estimates. This should have the effect of\n\t // adapting down quickly, but up more slowly.\n\t return Math.min(this.fast_.getEstimate(), this.slow_.getEstimate());\n\t } else {\n\t return this.defaultEstimate_;\n\t }\n\t }\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {}\n\t }]);\n\t\n\t return EwmaBandWidthEstimator;\n\t}();\n\t\n\texports.default = EwmaBandWidthEstimator;\n\t\n\t},{\"42\":42}],9:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _eventHandler = _dereq_(25);\n\t\n\tvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * FPS Controller\n\t */\n\t\n\tvar FPSController = function (_EventHandler) {\n\t _inherits(FPSController, _EventHandler);\n\t\n\t function FPSController(hls) {\n\t _classCallCheck(this, FPSController);\n\t\n\t return _possibleConstructorReturn(this, Object.getPrototypeOf(FPSController).call(this, hls, _events2.default.MEDIA_ATTACHING));\n\t }\n\t\n\t _createClass(FPSController, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t if (this.timer) {\n\t clearInterval(this.timer);\n\t }\n\t this.isVideoPlaybackQualityAvailable = false;\n\t }\n\t }, {\n\t key: 'onMediaAttaching',\n\t value: function onMediaAttaching(data) {\n\t if (this.hls.config.capLevelOnFPSDrop) {\n\t this.video = data.media instanceof HTMLVideoElement ? data.media : null;\n\t if (typeof this.video.getVideoPlaybackQuality === 'function') {\n\t this.isVideoPlaybackQualityAvailable = true;\n\t }\n\t clearInterval(this.timer);\n\t this.timer = setInterval(this.checkFPSInterval.bind(this), this.hls.config.fpsDroppedMonitoringPeriod);\n\t }\n\t }\n\t }, {\n\t key: 'checkFPS',\n\t value: function checkFPS(video, decodedFrames, droppedFrames) {\n\t var currentTime = performance.now();\n\t if (decodedFrames) {\n\t if (this.lastTime) {\n\t var currentPeriod = currentTime - this.lastTime,\n\t currentDropped = droppedFrames - this.lastDroppedFrames,\n\t currentDecoded = decodedFrames - this.lastDecodedFrames,\n\t droppedFPS = 1000 * currentDropped / currentPeriod;\n\t this.hls.trigger(_events2.default.FPS_DROP, { currentDropped: currentDropped, currentDecoded: currentDecoded, totalDroppedFrames: droppedFrames });\n\t if (droppedFPS > 0) {\n\t //logger.log('checkFPS : droppedFPS/decodedFPS:' + droppedFPS/(1000 * currentDecoded / currentPeriod));\n\t if (currentDropped > this.hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n\t var currentLevel = this.hls.currentLevel;\n\t _logger.logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n\t if (currentLevel > 0 && (this.hls.autoLevelCapping === -1 || this.hls.autoLevelCapping >= currentLevel)) {\n\t currentLevel = currentLevel - 1;\n\t this.hls.trigger(_events2.default.FPS_DROP_LEVEL_CAPPING, { level: currentLevel, droppedLevel: this.hls.currentLevel });\n\t this.hls.autoLevelCapping = currentLevel;\n\t this.hls.streamController.nextLevelSwitch();\n\t }\n\t }\n\t }\n\t }\n\t this.lastTime = currentTime;\n\t this.lastDroppedFrames = droppedFrames;\n\t this.lastDecodedFrames = decodedFrames;\n\t }\n\t }\n\t }, {\n\t key: 'checkFPSInterval',\n\t value: function checkFPSInterval() {\n\t if (this.video) {\n\t if (this.isVideoPlaybackQualityAvailable) {\n\t var videoPlaybackQuality = this.video.getVideoPlaybackQuality();\n\t this.checkFPS(this.video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n\t } else {\n\t this.checkFPS(this.video, this.video.webkitDecodedFrameCount, this.video.webkitDroppedFrameCount);\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return FPSController;\n\t}(_eventHandler2.default);\n\t\n\texports.default = FPSController;\n\t\n\t},{\"25\":25,\"26\":26,\"43\":43}],10:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _eventHandler = _dereq_(25);\n\t\n\tvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tvar _bufferHelper = _dereq_(28);\n\t\n\tvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * Level Controller\n\t */\n\t\n\tvar LevelController = function (_EventHandler) {\n\t _inherits(LevelController, _EventHandler);\n\t\n\t function LevelController(hls) {\n\t _classCallCheck(this, LevelController);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(LevelController).call(this, hls, _events2.default.MANIFEST_LOADED, _events2.default.LEVEL_LOADED, _events2.default.ERROR));\n\t\n\t _this.ontick = _this.tick.bind(_this);\n\t _this._manualLevel = _this._autoLevelCapping = -1;\n\t return _this;\n\t }\n\t\n\t _createClass(LevelController, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t if (this.timer) {\n\t clearTimeout(this.timer);\n\t this.timer = null;\n\t }\n\t this._manualLevel = -1;\n\t }\n\t }, {\n\t key: 'startLoad',\n\t value: function startLoad() {\n\t this.canload = true;\n\t // speed up live playlist refresh if timer exists\n\t if (this.timer) {\n\t this.tick();\n\t }\n\t }\n\t }, {\n\t key: 'stopLoad',\n\t value: function stopLoad() {\n\t this.canload = false;\n\t }\n\t }, {\n\t key: 'onManifestLoaded',\n\t value: function onManifestLoaded(data) {\n\t var levels0 = [],\n\t levels = [],\n\t bitrateStart,\n\t i,\n\t bitrateSet = {},\n\t videoCodecFound = false,\n\t audioCodecFound = false,\n\t hls = this.hls;\n\t\n\t // regroup redundant level together\n\t data.levels.forEach(function (level) {\n\t if (level.videoCodec) {\n\t videoCodecFound = true;\n\t }\n\t if (level.audioCodec || level.attrs && level.attrs.AUDIO) {\n\t audioCodecFound = true;\n\t }\n\t var redundantLevelId = bitrateSet[level.bitrate];\n\t if (redundantLevelId === undefined) {\n\t bitrateSet[level.bitrate] = levels0.length;\n\t level.url = [level.url];\n\t level.urlId = 0;\n\t levels0.push(level);\n\t } else {\n\t levels0[redundantLevelId].url.push(level.url);\n\t }\n\t });\n\t\n\t // remove audio-only level if we also have levels with audio+video codecs signalled\n\t if (videoCodecFound && audioCodecFound) {\n\t levels0.forEach(function (level) {\n\t if (level.videoCodec) {\n\t levels.push(level);\n\t }\n\t });\n\t } else {\n\t levels = levels0;\n\t }\n\t\n\t // only keep level with supported audio/video codecs\n\t levels = levels.filter(function (level) {\n\t var checkSupportedAudio = function checkSupportedAudio(codec) {\n\t return MediaSource.isTypeSupported('audio/mp4;codecs=' + codec);\n\t };\n\t var checkSupportedVideo = function checkSupportedVideo(codec) {\n\t return MediaSource.isTypeSupported('video/mp4;codecs=' + codec);\n\t };\n\t var audioCodec = level.audioCodec,\n\t videoCodec = level.videoCodec;\n\t\n\t return (!audioCodec || checkSupportedAudio(audioCodec)) && (!videoCodec || checkSupportedVideo(videoCodec));\n\t });\n\t\n\t if (levels.length) {\n\t // start bitrate is the first bitrate of the manifest\n\t bitrateStart = levels[0].bitrate;\n\t // sort level on bitrate\n\t levels.sort(function (a, b) {\n\t return a.bitrate - b.bitrate;\n\t });\n\t this._levels = levels;\n\t // find index of first level in sorted levels\n\t for (i = 0; i < levels.length; i++) {\n\t if (levels[i].bitrate === bitrateStart) {\n\t this._firstLevel = i;\n\t _logger.logger.log('manifest loaded,' + levels.length + ' level(s) found, first bitrate:' + bitrateStart);\n\t break;\n\t }\n\t }\n\t hls.trigger(_events2.default.MANIFEST_PARSED, { levels: this._levels, firstLevel: this._firstLevel, stats: data.stats, audio: audioCodecFound, video: videoCodecFound, altAudio: data.audioTracks.length > 0 });\n\t } else {\n\t hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR, fatal: true, url: hls.url, reason: 'no level with compatible codecs found in manifest' });\n\t }\n\t return;\n\t }\n\t }, {\n\t key: 'setLevelInternal',\n\t value: function setLevelInternal(newLevel) {\n\t var levels = this._levels;\n\t // check if level idx is valid\n\t if (newLevel >= 0 && newLevel < levels.length) {\n\t // stopping live reloading timer if any\n\t if (this.timer) {\n\t clearTimeout(this.timer);\n\t this.timer = null;\n\t }\n\t if (this._level !== newLevel) {\n\t _logger.logger.log('switching to level ' + newLevel);\n\t this._level = newLevel;\n\t }\n\t this.hls.trigger(_events2.default.LEVEL_SWITCH, { level: newLevel });\n\t var level = levels[newLevel],\n\t levelDetails = level.details;\n\t // check if we need to load playlist for this level\n\t if (!levelDetails || levelDetails.live === true) {\n\t // level not retrieved yet, or live playlist we need to (re)load it\n\t var urlId = level.urlId;\n\t this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: newLevel, id: urlId });\n\t }\n\t } else {\n\t // invalid level id given, trigger error\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx' });\n\t }\n\t }\n\t }, {\n\t key: 'onError',\n\t value: function onError(data) {\n\t if (data.fatal) {\n\t return;\n\t }\n\t\n\t var details = data.details,\n\t hls = this.hls,\n\t levelId = void 0,\n\t level = void 0,\n\t levelError = false;\n\t // try to recover not fatal errors\n\t switch (details) {\n\t case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n\t case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n\t case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n\t case _errors.ErrorDetails.KEY_LOAD_ERROR:\n\t case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n\t levelId = data.frag.level;\n\t break;\n\t case _errors.ErrorDetails.LEVEL_LOAD_ERROR:\n\t case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n\t levelId = data.context.level;\n\t levelError = true;\n\t break;\n\t default:\n\t break;\n\t }\n\t /* try to switch to a redundant stream if any available.\n\t * if no redundant stream available, emergency switch down (if in auto mode and current level not 0)\n\t * otherwise, we cannot recover this network error ...\n\t */\n\t if (levelId !== undefined) {\n\t level = this._levels[levelId];\n\t if (level.urlId < level.url.length - 1) {\n\t level.urlId++;\n\t level.details = undefined;\n\t _logger.logger.warn('level controller,' + details + ' for level ' + levelId + ': switching to redundant stream id ' + level.urlId);\n\t } else {\n\t // we could try to recover if in auto mode and current level not lowest level (0)\n\t var recoverable = this._manualLevel === -1 && levelId;\n\t if (recoverable) {\n\t _logger.logger.warn('level controller,' + details + ': emergency switch-down for next fragment');\n\t hls.abrController.nextAutoLevel = 0;\n\t } else if (level && level.details && level.details.live) {\n\t _logger.logger.warn('level controller,' + details + ' on live stream, discard');\n\t if (levelError) {\n\t // reset this._level so that another call to set level() will retrigger a frag load\n\t this._level = undefined;\n\t }\n\t // other errors are handled by stream controller\n\t } else if (details === _errors.ErrorDetails.LEVEL_LOAD_ERROR || details === _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT) {\n\t var _hls = this.hls,\n\t media = _hls.media,\n\t\n\t // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n\t mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);\n\t if (mediaBuffered) {\n\t var retryDelay = _hls.config.levelLoadingRetryDelay;\n\t _logger.logger.warn('level controller,' + details + ', but media buffered, retry in ' + retryDelay + 'ms');\n\t this.timer = setTimeout(this.ontick, retryDelay);\n\t } else {\n\t _logger.logger.error('cannot recover ' + details + ' error');\n\t this._level = undefined;\n\t // stopping live reloading timer if any\n\t if (this.timer) {\n\t clearTimeout(this.timer);\n\t this.timer = null;\n\t }\n\t // redispatch same error but with fatal set to true\n\t data.fatal = true;\n\t _hls.trigger(_events2.default.ERROR, data);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'onLevelLoaded',\n\t value: function onLevelLoaded(data) {\n\t // only process level loaded events matching with expected level\n\t if (data.level === this._level) {\n\t var newDetails = data.details;\n\t // if current playlist is a live playlist, arm a timer to reload it\n\t if (newDetails.live) {\n\t var reloadInterval = 1000 * (newDetails.averagetargetduration ? newDetails.averagetargetduration : newDetails.targetduration),\n\t curLevel = this._levels[data.level],\n\t curDetails = curLevel.details;\n\t if (curDetails && newDetails.endSN === curDetails.endSN) {\n\t // follow HLS Spec, If the client reloads a Playlist file and finds that it has not\n\t // changed then it MUST wait for a period of one-half the target\n\t // duration before retrying.\n\t reloadInterval /= 2;\n\t _logger.logger.log('same live playlist, reload twice faster');\n\t }\n\t // decrement reloadInterval with level loading delay\n\t reloadInterval -= performance.now() - data.stats.trequest;\n\t // in any case, don't reload more than every second\n\t reloadInterval = Math.max(1000, Math.round(reloadInterval));\n\t _logger.logger.log('live playlist, reload in ' + reloadInterval + ' ms');\n\t this.timer = setTimeout(this.ontick, reloadInterval);\n\t } else {\n\t this.timer = null;\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'tick',\n\t value: function tick() {\n\t var levelId = this._level;\n\t if (levelId !== undefined && this.canload) {\n\t var level = this._levels[levelId],\n\t urlId = level.urlId;\n\t this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: levelId, id: urlId });\n\t }\n\t }\n\t }, {\n\t key: 'levels',\n\t get: function get() {\n\t return this._levels;\n\t }\n\t }, {\n\t key: 'level',\n\t get: function get() {\n\t return this._level;\n\t },\n\t set: function set(newLevel) {\n\t var levels = this._levels;\n\t if (levels && levels.length > newLevel) {\n\t if (this._level !== newLevel || levels[newLevel].details === undefined) {\n\t this.setLevelInternal(newLevel);\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'manualLevel',\n\t get: function get() {\n\t return this._manualLevel;\n\t },\n\t set: function set(newLevel) {\n\t this._manualLevel = newLevel;\n\t if (this._startLevel === undefined) {\n\t this._startLevel = newLevel;\n\t }\n\t if (newLevel !== -1) {\n\t this.level = newLevel;\n\t }\n\t }\n\t }, {\n\t key: 'firstLevel',\n\t get: function get() {\n\t return this._firstLevel;\n\t },\n\t set: function set(newLevel) {\n\t this._firstLevel = newLevel;\n\t }\n\t }, {\n\t key: 'startLevel',\n\t get: function get() {\n\t // hls.startLevel takes precedence over config.startLevel\n\t // if none of these values are defined, fallback on this._firstLevel (first quality level appearing in variant manifest)\n\t if (this._startLevel === undefined) {\n\t var configStartLevel = this.hls.config.startLevel;\n\t if (configStartLevel !== undefined) {\n\t return configStartLevel;\n\t } else {\n\t return this._firstLevel;\n\t }\n\t } else {\n\t return this._startLevel;\n\t }\n\t },\n\t set: function set(newLevel) {\n\t this._startLevel = newLevel;\n\t }\n\t }, {\n\t key: 'nextLoadLevel',\n\t get: function get() {\n\t if (this._manualLevel !== -1) {\n\t return this._manualLevel;\n\t } else {\n\t return this.hls.abrController.nextAutoLevel;\n\t }\n\t },\n\t set: function set(nextLevel) {\n\t this.level = nextLevel;\n\t if (this._manualLevel === -1) {\n\t this.hls.abrController.nextAutoLevel = nextLevel;\n\t }\n\t }\n\t }]);\n\t\n\t return LevelController;\n\t}(_eventHandler2.default);\n\t\n\texports.default = LevelController;\n\t\n\t},{\"24\":24,\"25\":25,\"26\":26,\"28\":28,\"43\":43}],11:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _binarySearch = _dereq_(39);\n\t\n\tvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\t\n\tvar _bufferHelper = _dereq_(28);\n\t\n\tvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\t\n\tvar _demuxer = _dereq_(20);\n\t\n\tvar _demuxer2 = _interopRequireDefault(_demuxer);\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _eventHandler = _dereq_(25);\n\t\n\tvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\t\n\tvar _levelHelper = _dereq_(29);\n\t\n\tvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\t\n\tvar _timeRanges = _dereq_(45);\n\t\n\tvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * Stream Controller\n\t */\n\t\n\tvar State = {\n\t STOPPED: 'STOPPED',\n\t IDLE: 'IDLE',\n\t PAUSED: 'PAUSED',\n\t KEY_LOADING: 'KEY_LOADING',\n\t FRAG_LOADING: 'FRAG_LOADING',\n\t FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n\t WAITING_LEVEL: 'WAITING_LEVEL',\n\t PARSING: 'PARSING',\n\t PARSED: 'PARSED',\n\t ENDED: 'ENDED',\n\t ERROR: 'ERROR'\n\t};\n\t\n\tvar StreamController = function (_EventHandler) {\n\t _inherits(StreamController, _EventHandler);\n\t\n\t function StreamController(hls) {\n\t _classCallCheck(this, StreamController);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(StreamController).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_PARSED, _events2.default.LEVEL_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_LOAD_EMERGENCY_ABORTED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.AUDIO_TRACK_SWITCH, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED));\n\t\n\t _this.config = hls.config;\n\t _this.audioCodecSwap = false;\n\t _this.ticks = 0;\n\t _this.ontick = _this.tick.bind(_this);\n\t return _this;\n\t }\n\t\n\t _createClass(StreamController, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t this.stopLoad();\n\t if (this.timer) {\n\t clearInterval(this.timer);\n\t this.timer = null;\n\t }\n\t _eventHandler2.default.prototype.destroy.call(this);\n\t this.state = State.STOPPED;\n\t }\n\t }, {\n\t key: 'startLoad',\n\t value: function startLoad(startPosition) {\n\t if (this.levels) {\n\t var media = this.media,\n\t lastCurrentTime = this.lastCurrentTime,\n\t hls = this.hls;\n\t this.stopLoad();\n\t if (!this.timer) {\n\t this.timer = setInterval(this.ontick, 100);\n\t }\n\t this.level = -1;\n\t this.fragLoadError = 0;\n\t if (media && lastCurrentTime > 0) {\n\t _logger.logger.log('configure startPosition @' + lastCurrentTime.toFixed(3));\n\t if (!this.lastPaused) {\n\t _logger.logger.log('resuming video');\n\t media.play();\n\t }\n\t } else {\n\t this.lastCurrentTime = this.startPosition ? this.startPosition : startPosition;\n\t }\n\t if (!this.startFragRequested) {\n\t // determine load level\n\t var startLevel = hls.startLevel;\n\t if (startLevel === -1) {\n\t // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level\n\t startLevel = 0;\n\t this.bitrateTest = true;\n\t }\n\t // set new level to playlist loader : this will trigger start level load\n\t // hls.nextLoadLevel remains until it is set to a new value or until a new frag is successfully loaded\n\t this.level = hls.nextLoadLevel = startLevel;\n\t this.loadedmetadata = false;\n\t }\n\t this.state = State.IDLE;\n\t this.nextLoadPosition = this.startPosition = this.lastCurrentTime;\n\t this.tick();\n\t } else {\n\t _logger.logger.warn('cannot start loading as manifest not parsed yet');\n\t this.state = State.STOPPED;\n\t }\n\t }\n\t }, {\n\t key: 'stopLoad',\n\t value: function stopLoad() {\n\t var frag = this.fragCurrent;\n\t if (frag) {\n\t if (frag.loader) {\n\t frag.loader.abort();\n\t }\n\t this.fragCurrent = null;\n\t }\n\t this.fragPrevious = null;\n\t if (this.demuxer) {\n\t this.demuxer.destroy();\n\t this.demuxer = null;\n\t }\n\t this.state = State.STOPPED;\n\t }\n\t }, {\n\t key: 'tick',\n\t value: function tick() {\n\t this.ticks++;\n\t if (this.ticks === 1) {\n\t this.doTick();\n\t if (this.ticks > 1) {\n\t setTimeout(this.tick, 1);\n\t }\n\t this.ticks = 0;\n\t }\n\t }\n\t }, {\n\t key: 'doTick',\n\t value: function doTick() {\n\t switch (this.state) {\n\t case State.ERROR:\n\t //don't do anything in error state to avoid breaking further ...\n\t case State.PAUSED:\n\t //don't do anything in paused state either ...\n\t break;\n\t case State.IDLE:\n\t // when this returns false there was an error and we shall return immediatly\n\t // from current tick\n\t if (!this._doTickIdle()) {\n\t return;\n\t }\n\t break;\n\t case State.WAITING_LEVEL:\n\t var level = this.levels[this.level];\n\t // check if playlist is already loaded\n\t if (level && level.details) {\n\t this.state = State.IDLE;\n\t }\n\t break;\n\t case State.FRAG_LOADING_WAITING_RETRY:\n\t var now = performance.now();\n\t var retryDate = this.retryDate;\n\t // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n\t if (!retryDate || now >= retryDate || this.media && this.media.seeking) {\n\t _logger.logger.log('mediaController: retryDate reached, switch back to IDLE state');\n\t this.state = State.IDLE;\n\t }\n\t break;\n\t case State.ERROR:\n\t case State.PAUSED:\n\t case State.STOPPED:\n\t case State.FRAG_LOADING:\n\t case State.PARSING:\n\t case State.PARSED:\n\t case State.ENDED:\n\t break;\n\t default:\n\t break;\n\t }\n\t // check buffer\n\t this._checkBuffer();\n\t // check/update current fragment\n\t this._checkFragmentChanged();\n\t }\n\t\n\t // Ironically the \"idle\" state is the on we do the most logic in it seems ....\n\t // NOTE: Maybe we could rather schedule a check for buffer length after half of the currently\n\t // played segment, or on pause/play/seek instead of naively checking every 100ms?\n\t\n\t }, {\n\t key: '_doTickIdle',\n\t value: function _doTickIdle() {\n\t var hls = this.hls,\n\t config = hls.config,\n\t media = this.media;\n\t\n\t // if video not attached AND\n\t // start fragment already requested OR start frag prefetch disable\n\t // exit loop\n\t // => if media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n\t if (!media && (this.startFragRequested || !config.startFragPrefetch)) {\n\t return true;\n\t }\n\t\n\t // if we have not yet loaded any fragment, start loading from start position\n\t var pos = void 0;\n\t if (this.loadedmetadata) {\n\t pos = media.currentTime;\n\t } else {\n\t pos = this.nextLoadPosition;\n\t }\n\t // determine next load level\n\t var level = hls.nextLoadLevel;\n\t\n\t // compute max Buffer Length that we could get from this load level, based on level bitrate. don't buffer more than 60 MB and more than 30s\n\t var maxBufLen = void 0;\n\t if (this.levels[level].hasOwnProperty('bitrate')) {\n\t maxBufLen = Math.max(8 * config.maxBufferSize / this.levels[level].bitrate, config.maxBufferLength);\n\t } else {\n\t maxBufLen = config.maxBufferLength;\n\t }\n\t maxBufLen = Math.min(maxBufLen, config.maxMaxBufferLength);\n\t\n\t // determine next candidate fragment to be loaded, based on current position and end of buffer position\n\t // ensure up to `config.maxMaxBufferLength` of buffer upfront\n\t\n\t var bufferInfo = _bufferHelper2.default.bufferInfo(this.mediaBuffer ? this.mediaBuffer : media, pos, config.maxBufferHole),\n\t bufferLen = bufferInfo.len;\n\t // Stay idle if we are still with buffer margins\n\t if (bufferLen >= maxBufLen) {\n\t return true;\n\t }\n\t\n\t // if buffer length is less than maxBufLen try to load a new fragment ...\n\t _logger.logger.trace('buffer length of ' + bufferLen.toFixed(3) + ' is below max of ' + maxBufLen.toFixed(3) + '. checking for more payload ...');\n\t\n\t // set next load level : this will trigger a playlist load if needed\n\t hls.nextLoadLevel = level;\n\t this.level = level;\n\t\n\t var levelDetails = this.levels[level].details;\n\t // if level info not retrieved yet, switch state and wait for level retrieval\n\t // if live playlist, ensure that new playlist has been refreshed to avoid loading/try to load\n\t // a useless and outdated fragment (that might even introduce load error if it is already out of the live playlist)\n\t if (typeof levelDetails === 'undefined' || levelDetails.live && this.levelLastLoaded !== level) {\n\t this.state = State.WAITING_LEVEL;\n\t return true;\n\t }\n\t\n\t // we just got done loading the final fragment, check if we need to finalize media stream\n\t var fragPrevious = this.fragPrevious;\n\t if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN) {\n\t // if (we are not seeking AND current position is buffered) OR (if we are seeking but everything (almost) til the end is buffered), let's signal eos\n\t // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference when switching\n\t // between different renditions. using half frag duration should help cope with these cases.\n\t if (!media.seeking && bufferInfo.len || media.duration - bufferInfo.end <= fragPrevious.duration / 2) {\n\t // Finalize the media stream\n\t var data = {};\n\t if (this.altAudio) {\n\t data.type = 'video';\n\t }\n\t this.hls.trigger(_events2.default.BUFFER_EOS, data);\n\t this.state = State.ENDED;\n\t return true;\n\t }\n\t }\n\t\n\t // if we have the levelDetails for the selected variant, lets continue enrichen our stream (load keys/fragments or trigger EOS, etc..)\n\t return this._fetchPayloadOrEos({ pos: pos, bufferInfo: bufferInfo, levelDetails: levelDetails });\n\t }\n\t }, {\n\t key: '_fetchPayloadOrEos',\n\t value: function _fetchPayloadOrEos(_ref) {\n\t var pos = _ref.pos;\n\t var bufferInfo = _ref.bufferInfo;\n\t var levelDetails = _ref.levelDetails;\n\t\n\t var fragPrevious = this.fragPrevious,\n\t level = this.level,\n\t fragments = levelDetails.fragments,\n\t fragLen = fragments.length;\n\t\n\t // empty playlist\n\t if (fragLen === 0) {\n\t return false;\n\t }\n\t\n\t // find fragment index, contiguous with end of buffer position\n\t var start = fragments[0].start,\n\t end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,\n\t bufferEnd = bufferInfo.end,\n\t frag = void 0;\n\t\n\t // in case of live playlist we need to ensure that requested position is not located before playlist start\n\t if (levelDetails.live) {\n\t frag = this._ensureFragmentAtLivePoint({ levelDetails: levelDetails, bufferEnd: bufferEnd, start: start, end: end, fragPrevious: fragPrevious, fragments: fragments, fragLen: fragLen });\n\t // if it explicitely returns null don't load any fragment and exit function now\n\t if (frag === null) {\n\t return false;\n\t }\n\t } else {\n\t // VoD playlist: if bufferEnd before start of playlist, load first fragment\n\t if (bufferEnd < start) {\n\t frag = fragments[0];\n\t }\n\t }\n\t if (!frag) {\n\t frag = this._findFragment({ start: start, fragPrevious: fragPrevious, fragLen: fragLen, fragments: fragments, bufferEnd: bufferEnd, end: end, levelDetails: levelDetails });\n\t }\n\t if (frag) {\n\t return this._loadFragmentOrKey({ frag: frag, level: level, levelDetails: levelDetails, pos: pos, bufferEnd: bufferEnd });\n\t }\n\t return true;\n\t }\n\t }, {\n\t key: '_ensureFragmentAtLivePoint',\n\t value: function _ensureFragmentAtLivePoint(_ref2) {\n\t var levelDetails = _ref2.levelDetails;\n\t var bufferEnd = _ref2.bufferEnd;\n\t var start = _ref2.start;\n\t var end = _ref2.end;\n\t var fragPrevious = _ref2.fragPrevious;\n\t var fragments = _ref2.fragments;\n\t var fragLen = _ref2.fragLen;\n\t\n\t var config = this.hls.config,\n\t media = this.media;\n\t\n\t var frag = void 0;\n\t\n\t // check if requested position is within seekable boundaries :\n\t //logger.log(`start/pos/bufEnd/seeking:${start.toFixed(3)}/${pos.toFixed(3)}/${bufferEnd.toFixed(3)}/${this.media.seeking}`);\n\t var maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount * levelDetails.targetduration;\n\t\n\t if (bufferEnd < Math.max(start, end - maxLatency)) {\n\t var liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);\n\t _logger.logger.log('buffer end: ' + bufferEnd.toFixed(3) + ' is located too far from the end of live sliding playlist, reset currentTime to : ' + liveSyncPosition.toFixed(3));\n\t bufferEnd = liveSyncPosition;\n\t if (media && media.readyState && media.duration > liveSyncPosition) {\n\t media.currentTime = liveSyncPosition;\n\t }\n\t }\n\t\n\t // if end of buffer greater than live edge, don't load any fragment\n\t // this could happen if live playlist intermittently slides in the past.\n\t // level 1 loaded [182580161,182580167]\n\t // level 1 loaded [182580162,182580169]\n\t // Loading 182580168 of [182580162 ,182580169],level 1 ..\n\t // Loading 182580169 of [182580162 ,182580169],level 1 ..\n\t // level 1 loaded [182580162,182580168] <============= here we should have bufferEnd > end. in that case break to avoid reloading 182580168\n\t // level 1 loaded [182580164,182580171]\n\t //\n\t // don't return null in case media not loaded yet (readystate === 0)\n\t if (levelDetails.PTSKnown && bufferEnd > end && media && media.readyState) {\n\t return null;\n\t }\n\t\n\t if (this.startFragRequested && !levelDetails.PTSKnown) {\n\t /* we are switching level on live playlist, but we don't have any PTS info for that quality level ...\n\t try to load frag matching with next SN.\n\t even if SN are not synchronized between playlists, loading this frag will help us\n\t compute playlist sliding and find the right one after in case it was not the right consecutive one */\n\t if (fragPrevious) {\n\t var targetSN = fragPrevious.sn + 1;\n\t if (targetSN >= levelDetails.startSN && targetSN <= levelDetails.endSN) {\n\t frag = fragments[targetSN - levelDetails.startSN];\n\t _logger.logger.log('live playlist, switching playlist, load frag with next SN: ' + frag.sn);\n\t }\n\t }\n\t if (!frag) {\n\t /* we have no idea about which fragment should be loaded.\n\t so let's load mid fragment. it will help computing playlist sliding and find the right one\n\t */\n\t frag = fragments[Math.min(fragLen - 1, Math.round(fragLen / 2))];\n\t _logger.logger.log('live playlist, switching playlist, unknown, load middle frag : ' + frag.sn);\n\t }\n\t }\n\t return frag;\n\t }\n\t }, {\n\t key: '_findFragment',\n\t value: function _findFragment(_ref3) {\n\t var start = _ref3.start;\n\t var fragPrevious = _ref3.fragPrevious;\n\t var fragLen = _ref3.fragLen;\n\t var fragments = _ref3.fragments;\n\t var bufferEnd = _ref3.bufferEnd;\n\t var end = _ref3.end;\n\t var levelDetails = _ref3.levelDetails;\n\t\n\t var config = this.hls.config;\n\t\n\t var frag = void 0,\n\t foundFrag = void 0,\n\t maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n\t\n\t if (bufferEnd < end) {\n\t if (bufferEnd > end - maxFragLookUpTolerance) {\n\t maxFragLookUpTolerance = 0;\n\t }\n\t foundFrag = _binarySearch2.default.search(fragments, function (candidate) {\n\t // offset should be within fragment boundary - config.maxFragLookUpTolerance\n\t // this is to cope with situations like\n\t // bufferEnd = 9.991\n\t // frag[Ø] : [0,10]\n\t // frag[1] : [10,20]\n\t // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n\t // frag start frag start+duration\n\t // |-----------------------------|\n\t // <---> <--->\n\t // ...--------><-----------------------------><---------....\n\t // previous frag matching fragment next frag\n\t // return -1 return 0 return 1\n\t //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n\t if (candidate.start + candidate.duration - maxFragLookUpTolerance <= bufferEnd) {\n\t return 1;\n\t } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n\t else if (candidate.start - maxFragLookUpTolerance > bufferEnd && candidate.start) {\n\t return -1;\n\t }\n\t return 0;\n\t });\n\t } else {\n\t // reach end of playlist\n\t foundFrag = fragments[fragLen - 1];\n\t }\n\t if (foundFrag) {\n\t frag = foundFrag;\n\t start = foundFrag.start;\n\t //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n\t if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {\n\t if (frag.sn < levelDetails.endSN) {\n\t var deltaPTS = fragPrevious.deltaPTS,\n\t curSNIdx = frag.sn - levelDetails.startSN;\n\t // if there is a significant delta between audio and video, larger than max allowed hole,\n\t // and if previous remuxed fragment did not start with a keyframe. (fragPrevious.dropped)\n\t // let's try to load previous fragment again to get last keyframe\n\t // then we will reload again current fragment (that way we should be able to fill the buffer hole ...)\n\t if (deltaPTS && deltaPTS > config.maxBufferHole && fragPrevious.dropped && curSNIdx) {\n\t frag = fragments[curSNIdx - 1];\n\t _logger.logger.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');\n\t // decrement previous frag load counter to avoid frag loop loading error when next fragment will get reloaded\n\t fragPrevious.loadCounter--;\n\t } else {\n\t frag = fragments[curSNIdx + 1];\n\t _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n\t }\n\t } else {\n\t frag = null;\n\t }\n\t }\n\t }\n\t return frag;\n\t }\n\t }, {\n\t key: '_loadFragmentOrKey',\n\t value: function _loadFragmentOrKey(_ref4) {\n\t var frag = _ref4.frag;\n\t var level = _ref4.level;\n\t var levelDetails = _ref4.levelDetails;\n\t var pos = _ref4.pos;\n\t var bufferEnd = _ref4.bufferEnd;\n\t\n\t var hls = this.hls,\n\t config = hls.config;\n\t\n\t //logger.log('loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n\t if (frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n\t _logger.logger.log('Loading key for ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level);\n\t this.state = State.KEY_LOADING;\n\t hls.trigger(_events2.default.KEY_LOADING, { frag: frag });\n\t } else {\n\t _logger.logger.log('Loading ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level + ', currentTime:' + pos.toFixed(3) + ',bufferEnd:' + bufferEnd.toFixed(3));\n\t // ensure that we are not reloading the same fragments in loop ...\n\t if (this.fragLoadIdx !== undefined) {\n\t this.fragLoadIdx++;\n\t } else {\n\t this.fragLoadIdx = 0;\n\t }\n\t if (frag.loadCounter) {\n\t frag.loadCounter++;\n\t var maxThreshold = config.fragLoadingLoopThreshold;\n\t // if this frag has already been loaded 3 times, and if it has been reloaded recently\n\t if (frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold) {\n\t hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });\n\t return false;\n\t }\n\t } else {\n\t frag.loadCounter = 1;\n\t }\n\t frag.loadIdx = this.fragLoadIdx;\n\t this.fragCurrent = frag;\n\t this.startFragRequested = true;\n\t frag.autoLevel = hls.autoLevelEnabled;\n\t frag.bitrateTest = this.bitrateTest;\n\t hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n\t this.state = State.FRAG_LOADING;\n\t return true;\n\t }\n\t }\n\t }, {\n\t key: 'getBufferRange',\n\t value: function getBufferRange(position) {\n\t var i,\n\t range,\n\t bufferRange = this.bufferRange;\n\t if (bufferRange) {\n\t for (i = bufferRange.length - 1; i >= 0; i--) {\n\t range = bufferRange[i];\n\t if (position >= range.start && position <= range.end) {\n\t return range;\n\t }\n\t }\n\t }\n\t return null;\n\t }\n\t }, {\n\t key: 'followingBufferRange',\n\t value: function followingBufferRange(range) {\n\t if (range) {\n\t // try to get range of next fragment (500ms after this range)\n\t return this.getBufferRange(range.end + 0.5);\n\t }\n\t return null;\n\t }\n\t }, {\n\t key: '_checkFragmentChanged',\n\t value: function _checkFragmentChanged() {\n\t var rangeCurrent,\n\t currentTime,\n\t video = this.media;\n\t if (video && video.readyState && video.seeking === false) {\n\t currentTime = video.currentTime;\n\t /* if video element is in seeked state, currentTime can only increase.\n\t (assuming that playback rate is positive ...)\n\t As sometimes currentTime jumps back to zero after a\n\t media decode error, check this, to avoid seeking back to\n\t wrong position after a media decode error\n\t */\n\t if (currentTime > video.playbackRate * this.lastCurrentTime) {\n\t this.lastCurrentTime = currentTime;\n\t }\n\t if (_bufferHelper2.default.isBuffered(video, currentTime)) {\n\t rangeCurrent = this.getBufferRange(currentTime);\n\t } else if (_bufferHelper2.default.isBuffered(video, currentTime + 0.1)) {\n\t /* ensure that FRAG_CHANGED event is triggered at startup,\n\t when first video frame is displayed and playback is paused.\n\t add a tolerance of 100ms, in case current position is not buffered,\n\t check if current pos+100ms is buffered and use that buffer range\n\t for FRAG_CHANGED event reporting */\n\t rangeCurrent = this.getBufferRange(currentTime + 0.1);\n\t }\n\t if (rangeCurrent) {\n\t var fragPlaying = rangeCurrent.frag;\n\t if (fragPlaying !== this.fragPlaying) {\n\t this.fragPlaying = fragPlaying;\n\t this.hls.trigger(_events2.default.FRAG_CHANGED, { frag: fragPlaying });\n\t }\n\t }\n\t }\n\t }\n\t\n\t /*\n\t on immediate level switch :\n\t - pause playback if playing\n\t - cancel any pending load request\n\t - and trigger a buffer flush\n\t */\n\t\n\t }, {\n\t key: 'immediateLevelSwitch',\n\t value: function immediateLevelSwitch() {\n\t _logger.logger.log('immediateLevelSwitch');\n\t if (!this.immediateSwitch) {\n\t this.immediateSwitch = true;\n\t var media = this.media,\n\t previouslyPaused = void 0;\n\t if (media) {\n\t previouslyPaused = media.paused;\n\t media.pause();\n\t } else {\n\t // don't restart playback after instant level switch in case media not attached\n\t previouslyPaused = true;\n\t }\n\t this.previouslyPaused = previouslyPaused;\n\t }\n\t var fragCurrent = this.fragCurrent;\n\t if (fragCurrent && fragCurrent.loader) {\n\t fragCurrent.loader.abort();\n\t }\n\t this.fragCurrent = null;\n\t this.state = State.PAUSED;\n\t // flush everything\n\t this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY });\n\t }\n\t\n\t /*\n\t on immediate level switch end, after new fragment has been buffered :\n\t - nudge video decoder by slightly adjusting video currentTime (if currentTime buffered)\n\t - resume the playback if needed\n\t */\n\t\n\t }, {\n\t key: 'immediateLevelSwitchEnd',\n\t value: function immediateLevelSwitchEnd() {\n\t var media = this.media;\n\t if (media && media.buffered.length) {\n\t this.immediateSwitch = false;\n\t if (_bufferHelper2.default.isBuffered(media, media.currentTime)) {\n\t // only nudge if currentTime is buffered\n\t media.currentTime -= 0.0001;\n\t }\n\t if (!this.previouslyPaused) {\n\t media.play();\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'nextLevelSwitch',\n\t value: function nextLevelSwitch() {\n\t /* try to switch ASAP without breaking video playback :\n\t in order to ensure smooth but quick level switching,\n\t we need to find the next flushable buffer range\n\t we should take into account new segment fetch time\n\t */\n\t var media = this.media;\n\t // ensure that media is defined and that metadata are available (to retrieve currentTime)\n\t if (media && media.readyState) {\n\t var fetchdelay = void 0,\n\t currentRange = void 0,\n\t nextRange = void 0;\n\t // increase fragment load Index to avoid frag loop loading error after buffer flush\n\t this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n\t currentRange = this.getBufferRange(media.currentTime);\n\t if (currentRange && currentRange.start > 1) {\n\t // flush buffer preceding current fragment (flush until current fragment start offset)\n\t // minus 1s to avoid video freezing, that could happen if we flush keyframe of current video ...\n\t this.state = State.PAUSED;\n\t this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: currentRange.start - 1 });\n\t }\n\t if (!media.paused) {\n\t // add a safety delay of 1s\n\t var nextLevelId = this.hls.nextLoadLevel,\n\t nextLevel = this.levels[nextLevelId],\n\t fragLastKbps = this.fragLastKbps;\n\t if (fragLastKbps && this.fragCurrent) {\n\t fetchdelay = this.fragCurrent.duration * nextLevel.bitrate / (1000 * fragLastKbps) + 1;\n\t } else {\n\t fetchdelay = 0;\n\t }\n\t } else {\n\t fetchdelay = 0;\n\t }\n\t //logger.log('fetchdelay:'+fetchdelay);\n\t // find buffer range that will be reached once new fragment will be fetched\n\t nextRange = this.getBufferRange(media.currentTime + fetchdelay);\n\t if (nextRange) {\n\t // we can flush buffer range following this one without stalling playback\n\t nextRange = this.followingBufferRange(nextRange);\n\t if (nextRange) {\n\t // if we are here, we can also cancel any loading/demuxing in progress, as they are useless\n\t var fragCurrent = this.fragCurrent;\n\t if (fragCurrent && fragCurrent.loader) {\n\t fragCurrent.loader.abort();\n\t }\n\t this.fragCurrent = null;\n\t // flush position is the start position of this new buffer\n\t this.state = State.PAUSED;\n\t this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: nextRange.start, endOffset: Number.POSITIVE_INFINITY });\n\t }\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'onMediaAttached',\n\t value: function onMediaAttached(data) {\n\t var media = this.media = this.mediaBuffer = data.media;\n\t this.onvseeking = this.onMediaSeeking.bind(this);\n\t this.onvseeked = this.onMediaSeeked.bind(this);\n\t this.onvended = this.onMediaEnded.bind(this);\n\t media.addEventListener('seeking', this.onvseeking);\n\t media.addEventListener('seeked', this.onvseeked);\n\t media.addEventListener('ended', this.onvended);\n\t var config = this.config;\n\t if (this.levels && config.autoStartLoad) {\n\t this.hls.startLoad(config.startPosition);\n\t }\n\t }\n\t }, {\n\t key: 'onMediaDetaching',\n\t value: function onMediaDetaching() {\n\t var media = this.media;\n\t if (media && media.ended) {\n\t _logger.logger.log('MSE detaching and video ended, reset startPosition');\n\t this.startPosition = this.lastCurrentTime = 0;\n\t }\n\t\n\t // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery\n\t var levels = this.levels;\n\t if (levels) {\n\t // reset fragment load counter\n\t levels.forEach(function (level) {\n\t if (level.details) {\n\t level.details.fragments.forEach(function (fragment) {\n\t fragment.loadCounter = undefined;\n\t });\n\t }\n\t });\n\t }\n\t // remove video listeners\n\t if (media) {\n\t media.removeEventListener('seeking', this.onvseeking);\n\t media.removeEventListener('seeked', this.onvseeked);\n\t media.removeEventListener('ended', this.onvended);\n\t this.onvseeking = this.onvseeked = this.onvended = null;\n\t }\n\t this.media = null;\n\t this.loadedmetadata = false;\n\t this.stopLoad();\n\t }\n\t }, {\n\t key: 'onMediaSeeking',\n\t value: function onMediaSeeking() {\n\t var media = this.media,\n\t currentTime = media ? media.currentTime : undefined,\n\t config = this.config;\n\t _logger.logger.log('media seeking to ' + currentTime.toFixed(3));\n\t if (this.state === State.FRAG_LOADING) {\n\t var bufferInfo = _bufferHelper2.default.bufferInfo(media, currentTime, this.config.maxBufferHole),\n\t fragCurrent = this.fragCurrent;\n\t // check if we are seeking to a unbuffered area AND if frag loading is in progress\n\t if (bufferInfo.len === 0 && fragCurrent) {\n\t var tolerance = config.maxFragLookUpTolerance,\n\t fragStartOffset = fragCurrent.start - tolerance,\n\t fragEndOffset = fragCurrent.start + fragCurrent.duration + tolerance;\n\t // check if we seek position will be out of currently loaded frag range : if out cancel frag load, if in, don't do anything\n\t if (currentTime < fragStartOffset || currentTime > fragEndOffset) {\n\t if (fragCurrent.loader) {\n\t _logger.logger.log('seeking outside of buffer while fragment load in progress, cancel fragment load');\n\t fragCurrent.loader.abort();\n\t }\n\t this.fragCurrent = null;\n\t this.fragPrevious = null;\n\t // switch to IDLE state to load new fragment\n\t this.state = State.IDLE;\n\t } else {\n\t _logger.logger.log('seeking outside of buffer but within currently loaded fragment range');\n\t }\n\t }\n\t } else if (this.state === State.ENDED) {\n\t // switch to IDLE state to check for potential new fragment\n\t this.state = State.IDLE;\n\t }\n\t if (media) {\n\t this.lastCurrentTime = currentTime;\n\t }\n\t // avoid reporting fragment loop loading error in case user is seeking several times on same position\n\t if (this.state !== State.FRAG_LOADING && this.fragLoadIdx !== undefined) {\n\t this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n\t }\n\t // tick to speed up processing\n\t this.tick();\n\t }\n\t }, {\n\t key: 'onMediaSeeked',\n\t value: function onMediaSeeked() {\n\t _logger.logger.log('media seeked to ' + this.media.currentTime.toFixed(3));\n\t // tick to speed up FRAGMENT_PLAYING triggering\n\t this.tick();\n\t }\n\t }, {\n\t key: 'onMediaEnded',\n\t value: function onMediaEnded() {\n\t _logger.logger.log('media ended');\n\t // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n\t this.startPosition = this.lastCurrentTime = 0;\n\t }\n\t }, {\n\t key: 'onManifestLoading',\n\t value: function onManifestLoading() {\n\t // reset buffer on manifest loading\n\t _logger.logger.log('trigger BUFFER_RESET');\n\t this.hls.trigger(_events2.default.BUFFER_RESET);\n\t this.bufferRange = [];\n\t this.stalled = false;\n\t this.startPosition = this.lastCurrentTime = 0;\n\t }\n\t }, {\n\t key: 'onManifestParsed',\n\t value: function onManifestParsed(data) {\n\t var aac = false,\n\t heaac = false,\n\t codec;\n\t data.levels.forEach(function (level) {\n\t // detect if we have different kind of audio codecs used amongst playlists\n\t codec = level.audioCodec;\n\t if (codec) {\n\t if (codec.indexOf('mp4a.40.2') !== -1) {\n\t aac = true;\n\t }\n\t if (codec.indexOf('mp4a.40.5') !== -1) {\n\t heaac = true;\n\t }\n\t }\n\t });\n\t this.audioCodecSwitch = aac && heaac;\n\t if (this.audioCodecSwitch) {\n\t _logger.logger.log('both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC');\n\t }\n\t this.levels = data.levels;\n\t this.startLevelLoaded = false;\n\t this.startFragRequested = false;\n\t var config = this.config;\n\t if (config.autoStartLoad) {\n\t this.hls.startLoad(config.startPosition);\n\t }\n\t }\n\t }, {\n\t key: 'onLevelLoaded',\n\t value: function onLevelLoaded(data) {\n\t var newDetails = data.details,\n\t newLevelId = data.level,\n\t curLevel = this.levels[newLevelId],\n\t duration = newDetails.totalduration,\n\t sliding = 0;\n\t\n\t _logger.logger.log('level ' + newLevelId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);\n\t this.levelLastLoaded = newLevelId;\n\t\n\t if (newDetails.live) {\n\t var curDetails = curLevel.details;\n\t if (curDetails && newDetails.fragments.length > 0) {\n\t // we already have details for that level, merge them\n\t _levelHelper2.default.mergeDetails(curDetails, newDetails);\n\t sliding = newDetails.fragments[0].start;\n\t this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n\t if (newDetails.PTSKnown) {\n\t _logger.logger.log('live playlist sliding:' + sliding.toFixed(3));\n\t } else {\n\t _logger.logger.log('live playlist - outdated PTS, unknown sliding');\n\t }\n\t } else {\n\t newDetails.PTSKnown = false;\n\t _logger.logger.log('live playlist - first load, unknown sliding');\n\t }\n\t } else {\n\t newDetails.PTSKnown = false;\n\t }\n\t // override level info\n\t curLevel.details = newDetails;\n\t this.hls.trigger(_events2.default.LEVEL_UPDATED, { details: newDetails, level: newLevelId });\n\t\n\t if (this.startFragRequested === false) {\n\t // compute start position if set to -1. use it straight away if value is defined\n\t if (this.startPosition === -1 || this.lastCurrentTime === -1) {\n\t // first, check if start time offset has been set in playlist, if yes, use this value\n\t var startTimeOffset = newDetails.startTimeOffset;\n\t if (!isNaN(startTimeOffset)) {\n\t if (startTimeOffset < 0) {\n\t _logger.logger.log('negative start time offset ' + startTimeOffset + ', count from end of last fragment');\n\t startTimeOffset = sliding + duration + startTimeOffset;\n\t }\n\t _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);\n\t this.startPosition = startTimeOffset;\n\t } else {\n\t // if live playlist, set start position to be fragment N-this.config.liveSyncDurationCount (usually 3)\n\t if (newDetails.live) {\n\t this.startPosition = this.computeLivePosition(sliding, newDetails);\n\t _logger.logger.log('configure startPosition to ' + this.startPosition);\n\t } else {\n\t this.startPosition = 0;\n\t }\n\t }\n\t }\n\t this.nextLoadPosition = this.startPosition;\n\t }\n\t // only switch batck to IDLE state if we were waiting for level to start downloading a new fragment\n\t if (this.state === State.WAITING_LEVEL) {\n\t this.state = State.IDLE;\n\t }\n\t //trigger handler right now\n\t this.tick();\n\t }\n\t }, {\n\t key: 'onKeyLoaded',\n\t value: function onKeyLoaded() {\n\t if (this.state === State.KEY_LOADING) {\n\t this.state = State.IDLE;\n\t this.tick();\n\t }\n\t }\n\t }, {\n\t key: 'onFragLoaded',\n\t value: function onFragLoaded(data) {\n\t var fragCurrent = this.fragCurrent,\n\t fragLoaded = data.frag;\n\t if (this.state === State.FRAG_LOADING && fragCurrent && fragLoaded.type === 'main' && fragLoaded.level === fragCurrent.level && fragLoaded.sn === fragCurrent.sn) {\n\t var stats = data.stats,\n\t currentLevel = this.levels[fragCurrent.level],\n\t details = currentLevel.details;\n\t _logger.logger.log('Loaded ' + fragCurrent.sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + fragCurrent.level);\n\t // reset frag bitrate test in any case after frag loaded event\n\t this.bitrateTest = false;\n\t // if this frag was loaded to perform a bitrate test AND if hls.nextLoadLevel is greater than 0\n\t // then this means that we should be able to load a fragment at a higher quality level\n\t if (fragLoaded.bitrateTest === true && this.hls.nextLoadLevel) {\n\t // switch back to IDLE state ... we just loaded a fragment to determine adequate start bitrate and initialize autoswitch algo\n\t this.state = State.IDLE;\n\t this.startFragRequested = false;\n\t stats.tparsed = stats.tbuffered = performance.now();\n\t this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'main' });\n\t this.tick();\n\t } else {\n\t this.state = State.PARSING;\n\t // transmux the MPEG-TS data to ISO-BMFF segments\n\t this.stats = stats;\n\t var duration = details.totalduration,\n\t start = !isNaN(fragCurrent.startDTS) ? fragCurrent.startDTS : fragCurrent.start,\n\t level = fragCurrent.level,\n\t sn = fragCurrent.sn,\n\t audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;\n\t if (this.audioCodecSwap) {\n\t _logger.logger.log('swapping playlist audio codec');\n\t if (audioCodec === undefined) {\n\t audioCodec = this.lastAudioCodec;\n\t }\n\t if (audioCodec) {\n\t if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n\t audioCodec = 'mp4a.40.2';\n\t } else {\n\t audioCodec = 'mp4a.40.5';\n\t }\n\t }\n\t }\n\t this.pendingAppending = 0;\n\t _logger.logger.log('Parsing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + level + ', cc ' + fragCurrent.cc);\n\t var demuxer = this.demuxer;\n\t if (!demuxer) {\n\t demuxer = this.demuxer = new _demuxer2.default(this.hls, 'main');\n\t }\n\t // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)\n\t var accurateTimeOffset = details.PTSKnown || !details.live;\n\t demuxer.push(data.payload, audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, sn, duration, fragCurrent.decryptdata, accurateTimeOffset);\n\t }\n\t }\n\t this.fragLoadError = 0;\n\t }\n\t }, {\n\t key: 'onFragParsingInitSegment',\n\t value: function onFragParsingInitSegment(data) {\n\t var fragCurrent = this.fragCurrent;\n\t if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n\t var tracks = data.tracks,\n\t trackName,\n\t track;\n\t\n\t // if audio track is expected to come from audio stream controller, discard any coming from main\n\t if (tracks.audio && this.altAudio) {\n\t delete tracks.audio;\n\t }\n\t // include levelCodec in audio and video tracks\n\t track = tracks.audio;\n\t if (track) {\n\t var audioCodec = this.levels[this.level].audioCodec,\n\t ua = navigator.userAgent.toLowerCase();\n\t if (audioCodec && this.audioCodecSwap) {\n\t _logger.logger.log('swapping playlist audio codec');\n\t if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n\t audioCodec = 'mp4a.40.2';\n\t } else {\n\t audioCodec = 'mp4a.40.5';\n\t }\n\t }\n\t // in case AAC and HE-AAC audio codecs are signalled in manifest\n\t // force HE-AAC , as it seems that most browsers prefers that way,\n\t // except for mono streams OR on FF\n\t // these conditions might need to be reviewed ...\n\t if (this.audioCodecSwitch) {\n\t // don't force HE-AAC if mono stream\n\t if (track.metadata.channelCount !== 1 &&\n\t // don't force HE-AAC if firefox\n\t ua.indexOf('firefox') === -1) {\n\t audioCodec = 'mp4a.40.5';\n\t }\n\t }\n\t // HE-AAC is broken on Android, always signal audio codec as AAC even if variant manifest states otherwise\n\t if (ua.indexOf('android') !== -1) {\n\t audioCodec = 'mp4a.40.2';\n\t _logger.logger.log('Android: force audio codec to' + audioCodec);\n\t }\n\t track.levelCodec = audioCodec;\n\t track.id = data.id;\n\t }\n\t track = tracks.video;\n\t if (track) {\n\t track.levelCodec = this.levels[this.level].videoCodec;\n\t track.id = data.id;\n\t }\n\t\n\t // if remuxer specify that a unique track needs to generated,\n\t // let's merge all tracks together\n\t if (data.unique) {\n\t var mergedTrack = {\n\t codec: '',\n\t levelCodec: ''\n\t };\n\t for (trackName in data.tracks) {\n\t track = tracks[trackName];\n\t mergedTrack.container = track.container;\n\t if (mergedTrack.codec) {\n\t mergedTrack.codec += ',';\n\t mergedTrack.levelCodec += ',';\n\t }\n\t if (track.codec) {\n\t mergedTrack.codec += track.codec;\n\t }\n\t if (track.levelCodec) {\n\t mergedTrack.levelCodec += track.levelCodec;\n\t }\n\t }\n\t tracks = { audiovideo: mergedTrack };\n\t }\n\t this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);\n\t // loop through tracks that are going to be provided to bufferController\n\t for (trackName in tracks) {\n\t track = tracks[trackName];\n\t _logger.logger.log('main track:' + trackName + ',container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');\n\t var initSegment = track.initSegment;\n\t if (initSegment) {\n\t this.pendingAppending++;\n\t this.hls.trigger(_events2.default.BUFFER_APPENDING, { type: trackName, data: initSegment, parent: 'main', content: 'initSegment' });\n\t }\n\t }\n\t //trigger handler right now\n\t this.tick();\n\t }\n\t }\n\t }, {\n\t key: 'onFragParsingData',\n\t value: function onFragParsingData(data) {\n\t var _this2 = this;\n\t\n\t var fragCurrent = this.fragCurrent;\n\t if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && !(data.type === 'audio' && this.altAudio) && // filter out main audio if audio track is loaded through audio stream controller\n\t this.state === State.PARSING) {\n\t var level = this.levels[this.level],\n\t frag = this.fragCurrent;\n\t\n\t _logger.logger.log('Parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb + ',dropped:' + (data.dropped || 0));\n\t\n\t var drift = _levelHelper2.default.updateFragPTSDTS(level.details, frag.sn, data.startPTS, data.endPTS, data.startDTS, data.endDTS),\n\t hls = this.hls;\n\t hls.trigger(_events2.default.LEVEL_PTS_UPDATED, { details: level.details, level: this.level, drift: drift });\n\t\n\t // has remuxer dropped video frames located before first keyframe ?\n\t if (data.type === 'video') {\n\t frag.dropped = data.dropped;\n\t }\n\t\n\t [data.data1, data.data2].forEach(function (buffer) {\n\t if (buffer) {\n\t _this2.pendingAppending++;\n\t hls.trigger(_events2.default.BUFFER_APPENDING, { type: data.type, data: buffer, parent: 'main', content: 'data' });\n\t }\n\t });\n\t\n\t this.nextLoadPosition = data.endPTS;\n\t this.bufferRange.push({ type: data.type, start: data.startPTS, end: data.endPTS, frag: frag });\n\t\n\t //trigger handler right now\n\t this.tick();\n\t }\n\t }\n\t }, {\n\t key: 'onFragParsed',\n\t value: function onFragParsed(data) {\n\t var fragCurrent = this.fragCurrent;\n\t if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n\t this.stats.tparsed = performance.now();\n\t this.state = State.PARSED;\n\t this._checkAppendedParsed();\n\t }\n\t }\n\t }, {\n\t key: 'onAudioTrackSwitch',\n\t value: function onAudioTrackSwitch(data) {\n\t // if any URL found on new audio track, it is an alternate audio track\n\t var altAudio = !!data.url;\n\t // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n\t if (!altAudio) {\n\t if (this.mediaBuffer !== this.media) {\n\t _logger.logger.log('switching on main audio, use media.buffered to schedule main fragment loading');\n\t this.mediaBuffer = this.media;\n\t var fragCurrent = this.fragCurrent;\n\t // we need to refill audio buffer from main: cancel any frag loading to speed up audio switch\n\t if (fragCurrent.loader) {\n\t _logger.logger.log('switching to main audio track, cancel main fragment load');\n\t fragCurrent.loader.abort();\n\t }\n\t this.fragCurrent = null;\n\t this.fragPrevious = null;\n\t // destroy demuxer to force init segment generation (following audio switch)\n\t if (this.demuxer) {\n\t this.demuxer.destroy();\n\t this.demuxer = null;\n\t }\n\t // switch to IDLE state to load new fragment\n\t this.state = State.IDLE;\n\t }\n\t } else {\n\t // if we switch on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n\t if (this.videoBuffer && this.mediaBuffer !== this.videoBuffer) {\n\t _logger.logger.log('switching on alternate audio, use video.buffered to schedule main fragment loading');\n\t this.mediaBuffer = this.videoBuffer;\n\t }\n\t }\n\t this.altAudio = altAudio;\n\t }\n\t }, {\n\t key: 'onBufferCreated',\n\t value: function onBufferCreated(data) {\n\t var tracks = data.tracks,\n\t mediaTrack = void 0,\n\t name = void 0,\n\t alternate = false;\n\t for (var type in tracks) {\n\t var track = tracks[type];\n\t if (track.id === 'main') {\n\t name = type;\n\t mediaTrack = track;\n\t // keep video source buffer reference\n\t if (type === 'video') {\n\t this.videoBuffer = tracks[type].buffer;\n\t }\n\t } else {\n\t alternate = true;\n\t }\n\t }\n\t if (alternate && mediaTrack) {\n\t _logger.logger.log('alternate track found, use ' + name + '.buffered to schedule main fragment loading');\n\t this.mediaBuffer = mediaTrack.buffer;\n\t } else {\n\t this.mediaBuffer = this.media;\n\t }\n\t }\n\t }, {\n\t key: 'onBufferAppended',\n\t value: function onBufferAppended(data) {\n\t if (data.parent === 'main') {\n\t switch (this.state) {\n\t case State.PARSING:\n\t case State.PARSED:\n\t this.pendingAppending--;\n\t this._checkAppendedParsed();\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t }\n\t }, {\n\t key: '_checkAppendedParsed',\n\t value: function _checkAppendedParsed() {\n\t //trigger handler right now\n\t if (this.state === State.PARSED && this.pendingAppending === 0) {\n\t var frag = this.fragCurrent,\n\t stats = this.stats;\n\t if (frag) {\n\t this.fragPrevious = frag;\n\t stats.tbuffered = performance.now();\n\t // we should get rid of this.fragLastKbps\n\t this.fragLastKbps = Math.round(8 * stats.total / (stats.tbuffered - stats.tfirst));\n\t this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'main' });\n\t var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n\t _logger.logger.log('main buffered : ' + _timeRanges2.default.toString(media.buffered));\n\t this.state = State.IDLE;\n\t }\n\t this.tick();\n\t }\n\t }\n\t }, {\n\t key: 'onError',\n\t value: function onError(data) {\n\t var frag = data.frag || this.fragCurrent;\n\t // don't handle frag error not related to main fragment\n\t if (frag && frag.type !== 'main') {\n\t return;\n\t }\n\t var media = this.media,\n\t\n\t // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n\t mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);\n\t switch (data.details) {\n\t case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n\t case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n\t if (!data.fatal) {\n\t var loadError = this.fragLoadError;\n\t if (loadError) {\n\t loadError++;\n\t } else {\n\t loadError = 1;\n\t }\n\t var config = this.config;\n\t // keep retrying / don't raise fatal network error if current position is buffered\n\t if (loadError <= config.fragLoadingMaxRetry || mediaBuffered) {\n\t this.fragLoadError = loadError;\n\t // reset load counter to avoid frag loop loading error\n\t frag.loadCounter = 0;\n\t // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n\t var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n\t _logger.logger.warn('mediaController: frag loading failed, retry in ' + delay + ' ms');\n\t this.retryDate = performance.now() + delay;\n\t // retry loading state\n\t this.state = State.FRAG_LOADING_WAITING_RETRY;\n\t } else {\n\t _logger.logger.error('mediaController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n\t // redispatch same error but with fatal set to true\n\t data.fatal = true;\n\t this.hls.trigger(_events2.default.ERROR, data);\n\t this.state = State.ERROR;\n\t }\n\t }\n\t break;\n\t case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n\t if (!data.fatal) {\n\t // if buffer is not empty\n\t if (mediaBuffered) {\n\t // try to reduce max buffer length : rationale is that we could get\n\t // frag loop loading error because of buffer eviction\n\t this._reduceMaxBufferLength(frag.duration);\n\t this.state = State.IDLE;\n\t } else {\n\t // buffer empty. report as fatal if in manual mode or if lowest level.\n\t // level controller takes care of emergency switch down logic\n\t if (!frag.autoLevel || frag.level === 0) {\n\t // redispatch same error but with fatal set to true\n\t data.fatal = true;\n\t this.hls.trigger(_events2.default.ERROR, data);\n\t this.state = State.ERROR;\n\t }\n\t }\n\t }\n\t break;\n\t case _errors.ErrorDetails.LEVEL_LOAD_ERROR:\n\t case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n\t case _errors.ErrorDetails.KEY_LOAD_ERROR:\n\t case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n\t // when in ERROR state, don't switch back to IDLE state in case a non-fatal error is received\n\t if (this.state !== State.ERROR) {\n\t // if fatal error, stop processing, otherwise move to IDLE to retry loading\n\t this.state = data.fatal ? State.ERROR : State.IDLE;\n\t _logger.logger.warn('mediaController: ' + data.details + ' while loading frag,switch to ' + this.state + ' state ...');\n\t }\n\t break;\n\t case _errors.ErrorDetails.BUFFER_FULL_ERROR:\n\t // if in appending state\n\t if (this.state === State.PARSING || this.state === State.PARSED) {\n\t // reduce max buf len if current position is buffered\n\t if (mediaBuffered) {\n\t this._reduceMaxBufferLength(frag.duration);\n\t this.state = State.IDLE;\n\t } else {\n\t // current position is not buffered, but browser is still complaining about buffer full error\n\t // this happens on IE/Edge, refer to https://github.com/dailymotion/hls.js/pull/708\n\t // in that case flush the whole buffer to recover\n\t _logger.logger.warn('buffer full error also media.currentTime is not buffered, flush everything');\n\t this.fragCurrent = null;\n\t this.state = State.PAUSED;\n\t // flush everything\n\t this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY });\n\t }\n\t }\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t }, {\n\t key: '_reduceMaxBufferLength',\n\t value: function _reduceMaxBufferLength(minLength) {\n\t var config = this.config;\n\t if (config.maxMaxBufferLength >= minLength) {\n\t // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...\n\t config.maxMaxBufferLength /= 2;\n\t _logger.logger.warn('reduce max buffer length to ' + config.maxMaxBufferLength + 's and switch to IDLE state');\n\t // increase fragment load Index to avoid frag loop loading error after buffer flush\n\t this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n\t }\n\t }\n\t }, {\n\t key: '_checkBuffer',\n\t value: function _checkBuffer() {\n\t var media = this.media;\n\t // if ready state different from HAVE_NOTHING (numeric value 0), we are allowed to seek\n\t if (media && media.readyState) {\n\t var currentTime = media.currentTime,\n\t buffered = media.buffered;\n\t // adjust currentTime to start position on loaded metadata\n\t if (!this.loadedmetadata && buffered.length) {\n\t this.loadedmetadata = true;\n\t // only adjust currentTime if different from startPosition or if startPosition not buffered\n\t // at that stage, there should be only one buffered range, as we reach that code after first fragment has been buffered\n\t var startPosition = this.startPosition,\n\t startPositionBuffered = _bufferHelper2.default.isBuffered(media, startPosition);\n\t // if currentTime not matching with expected startPosition or startPosition not buffered\n\t if (currentTime !== startPosition || !startPositionBuffered) {\n\t _logger.logger.log('target start position:' + startPosition);\n\t // if startPosition not buffered, let's seek to buffered.start(0)\n\t if (!startPositionBuffered) {\n\t startPosition = buffered.start(0);\n\t _logger.logger.log('target start position not buffered, seek to buffered.start(0) ' + startPosition);\n\t }\n\t _logger.logger.log('adjust currentTime from ' + currentTime + ' to ' + startPosition);\n\t media.currentTime = startPosition;\n\t }\n\t } else if (this.immediateSwitch) {\n\t this.immediateLevelSwitchEnd();\n\t } else {\n\t var bufferInfo = _bufferHelper2.default.bufferInfo(media, currentTime, 0),\n\t expectedPlaying = !(media.paused || // not playing when media is paused\n\t media.ended || // not playing when media is ended\n\t media.buffered.length === 0),\n\t // not playing if nothing buffered\n\t jumpThreshold = 0.5,\n\t // tolerance needed as some browsers stalls playback before reaching buffered range end\n\t playheadMoving = currentTime > media.playbackRate * this.lastCurrentTime,\n\t config = this.config;\n\t\n\t if (this.stalled && playheadMoving) {\n\t this.stalled = false;\n\t _logger.logger.log('playback not stuck anymore @' + currentTime);\n\t }\n\t // check buffer upfront\n\t // if less than jumpThreshold second is buffered, let's check in more details\n\t if (expectedPlaying && bufferInfo.len <= jumpThreshold) {\n\t if (playheadMoving) {\n\t // playhead moving\n\t jumpThreshold = 0;\n\t this.seekHoleNudgeDuration = 0;\n\t } else {\n\t // playhead not moving AND media expected to play\n\t if (!this.stalled) {\n\t this.seekHoleNudgeDuration = 0;\n\t _logger.logger.log('playback seems stuck @' + currentTime);\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false });\n\t this.stalled = true;\n\t } else {\n\t this.seekHoleNudgeDuration += config.seekHoleNudgeDuration;\n\t }\n\t }\n\t // if we are below threshold, try to jump to start of next buffer range if close\n\t if (bufferInfo.len <= jumpThreshold) {\n\t // no buffer available @ currentTime, check if next buffer is close (within a config.maxSeekHole second range)\n\t var nextBufferStart = bufferInfo.nextStart,\n\t delta = nextBufferStart - currentTime;\n\t if (nextBufferStart && delta < config.maxSeekHole && delta > 0) {\n\t // next buffer is close ! adjust currentTime to nextBufferStart\n\t // this will ensure effective video decoding\n\t _logger.logger.log('adjust currentTime from ' + media.currentTime + ' to next buffered @ ' + nextBufferStart + ' + nudge ' + this.seekHoleNudgeDuration);\n\t var hole = nextBufferStart + this.seekHoleNudgeDuration - media.currentTime;\n\t media.currentTime = nextBufferStart + this.seekHoleNudgeDuration;\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole: hole });\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'onFragLoadEmergencyAborted',\n\t value: function onFragLoadEmergencyAborted() {\n\t this.state = State.IDLE;\n\t // if loadedmetadata is not set, it means that we are emergency switch down on first frag\n\t // in that case, reset startFragRequested flag\n\t if (!this.loadedmetadata) {\n\t this.startFragRequested = false;\n\t }\n\t this.tick();\n\t }\n\t }, {\n\t key: 'onBufferFlushed',\n\t value: function onBufferFlushed() {\n\t /* after successful buffer flushing, rebuild buffer Range array\n\t loop through existing buffer range and check if\n\t corresponding range is still buffered. only push to new array already buffered range\n\t use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)\n\t */\n\t var media = this.mediaBuffer ? this.mediaBuffer : this.media,\n\t bufferRange = this.bufferRange,\n\t newRange = [],\n\t range = void 0,\n\t i = void 0;\n\t for (i = 0; i < bufferRange.length; i++) {\n\t range = bufferRange[i];\n\t if (_bufferHelper2.default.isBuffered(media, (range.start + range.end) / 2)) {\n\t newRange.push(range);\n\t }\n\t }\n\t this.bufferRange = newRange;\n\t\n\t // increase fragment load Index to avoid frag loop loading error after buffer flush\n\t this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n\t // move to IDLE once flush complete. this should trigger new fragment loading\n\t this.state = State.IDLE;\n\t // reset reference to frag\n\t this.fragPrevious = null;\n\t }\n\t }, {\n\t key: 'swapAudioCodec',\n\t value: function swapAudioCodec() {\n\t this.audioCodecSwap = !this.audioCodecSwap;\n\t }\n\t }, {\n\t key: 'computeLivePosition',\n\t value: function computeLivePosition(sliding, levelDetails) {\n\t var targetLatency = this.config.liveSyncDuration !== undefined ? this.config.liveSyncDuration : this.config.liveSyncDurationCount * levelDetails.targetduration;\n\t return sliding + Math.max(0, levelDetails.totalduration - targetLatency);\n\t }\n\t }, {\n\t key: 'state',\n\t set: function set(nextState) {\n\t if (this.state !== nextState) {\n\t var previousState = this.state;\n\t this._state = nextState;\n\t _logger.logger.log('engine state transition from ' + previousState + ' to ' + nextState);\n\t this.hls.trigger(_events2.default.STREAM_STATE_TRANSITION, { previousState: previousState, nextState: nextState });\n\t }\n\t },\n\t get: function get() {\n\t return this._state;\n\t }\n\t }, {\n\t key: 'currentLevel',\n\t get: function get() {\n\t var media = this.media;\n\t if (media) {\n\t var range = this.getBufferRange(media.currentTime);\n\t if (range) {\n\t return range.frag.level;\n\t }\n\t }\n\t return -1;\n\t }\n\t }, {\n\t key: 'nextBufferRange',\n\t get: function get() {\n\t var media = this.media;\n\t if (media) {\n\t // first get end range of current fragment\n\t return this.followingBufferRange(this.getBufferRange(media.currentTime));\n\t } else {\n\t return null;\n\t }\n\t }\n\t }, {\n\t key: 'nextLevel',\n\t get: function get() {\n\t var range = this.nextBufferRange;\n\t if (range) {\n\t return range.frag.level;\n\t } else {\n\t return -1;\n\t }\n\t }\n\t }, {\n\t key: 'liveSyncPosition',\n\t get: function get() {\n\t return this._liveSyncPosition;\n\t },\n\t set: function set(value) {\n\t this._liveSyncPosition = value;\n\t }\n\t }]);\n\t\n\t return StreamController;\n\t}(_eventHandler2.default);\n\t\n\texports.default = StreamController;\n\t\n\t},{\"20\":20,\"24\":24,\"25\":25,\"26\":26,\"28\":28,\"29\":29,\"39\":39,\"43\":43,\"45\":45}],12:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _eventHandler = _dereq_(25);\n\t\n\tvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\t\n\tvar _cea608Parser = _dereq_(40);\n\t\n\tvar _cea608Parser2 = _interopRequireDefault(_cea608Parser);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * Timeline Controller\n\t */\n\t\n\tvar TimelineController = function (_EventHandler) {\n\t _inherits(TimelineController, _EventHandler);\n\t\n\t function TimelineController(hls) {\n\t _classCallCheck(this, TimelineController);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(TimelineController).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.FRAG_PARSING_USERDATA, _events2.default.MANIFEST_LOADING, _events2.default.FRAG_LOADED, _events2.default.LEVEL_SWITCH));\n\t\n\t _this.hls = hls;\n\t _this.config = hls.config;\n\t _this.enabled = true;\n\t _this.Cues = hls.config.cueHandler;\n\t\n\t if (_this.config.enableCEA708Captions) {\n\t var self = _this;\n\t\n\t var channel1 = {\n\t 'newCue': function newCue(startTime, endTime, screen) {\n\t if (!self.textTrack1) {\n\t //Enable reuse of existing text track.\n\t var existingTrack1 = self.getExistingTrack('1');\n\t if (!existingTrack1) {\n\t self.textTrack1 = self.createTextTrack('captions', 'English', 'en');\n\t self.textTrack1.textTrack1 = true;\n\t } else {\n\t self.textTrack1 = existingTrack1;\n\t self.clearCurrentCues(self.textTrack1);\n\t\n\t var e = new window.Event('addtrack');\n\t e.track = self.textTrack1;\n\t self.media.dispatchEvent(e);\n\t }\n\t }\n\t\n\t self.Cues.newCue(self.textTrack1, startTime, endTime, screen);\n\t }\n\t };\n\t\n\t var channel2 = {\n\t 'newCue': function newCue(startTime, endTime, screen) {\n\t if (!self.textTrack2) {\n\t //Enable reuse of existing text track.\n\t var existingTrack2 = self.getExistingTrack('2');\n\t if (!existingTrack2) {\n\t self.textTrack2 = self.createTextTrack('captions', 'Spanish', 'es');\n\t self.textTrack2.textTrack2 = true;\n\t } else {\n\t self.textTrack2 = existingTrack2;\n\t self.clearCurrentCues(self.textTrack2);\n\t\n\t var e = new window.Event('addtrack');\n\t e.track = self.textTrack2;\n\t self.media.dispatchEvent(e);\n\t }\n\t }\n\t\n\t self.Cues.newCue(self.textTrack2, startTime, endTime, screen);\n\t }\n\t };\n\t\n\t _this.cea608Parser = new _cea608Parser2.default(0, channel1, channel2);\n\t }\n\t return _this;\n\t }\n\t\n\t _createClass(TimelineController, [{\n\t key: 'clearCurrentCues',\n\t value: function clearCurrentCues(track) {\n\t if (track && track.cues) {\n\t while (track.cues.length > 0) {\n\t track.removeCue(track.cues[0]);\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'getExistingTrack',\n\t value: function getExistingTrack(channelNumber) {\n\t var media = this.media;\n\t if (media) {\n\t for (var i = 0; i < media.textTracks.length; i++) {\n\t var textTrack = media.textTracks[i];\n\t var propName = 'textTrack' + channelNumber;\n\t if (textTrack[propName] === true) {\n\t return textTrack;\n\t }\n\t }\n\t }\n\t return null;\n\t }\n\t }, {\n\t key: 'createTextTrack',\n\t value: function createTextTrack(kind, label, lang) {\n\t if (this.media) {\n\t return this.media.addTextTrack(kind, label, lang);\n\t }\n\t }\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t _eventHandler2.default.prototype.destroy.call(this);\n\t }\n\t }, {\n\t key: 'onMediaAttaching',\n\t value: function onMediaAttaching(data) {\n\t this.media = data.media;\n\t }\n\t }, {\n\t key: 'onMediaDetaching',\n\t value: function onMediaDetaching() {}\n\t }, {\n\t key: 'onManifestLoading',\n\t value: function onManifestLoading() {\n\t this.lastPts = Number.NEGATIVE_INFINITY;\n\t }\n\t }, {\n\t key: 'onLevelSwitch',\n\t value: function onLevelSwitch() {\n\t if (this.hls.currentLevel.closedCaptions === 'NONE') {\n\t this.enabled = false;\n\t } else {\n\t this.enabled = true;\n\t }\n\t }\n\t }, {\n\t key: 'onFragLoaded',\n\t value: function onFragLoaded(data) {\n\t if (data.frag.type === 'main') {\n\t var pts = data.frag.start; //Number.POSITIVE_INFINITY;\n\t // if this is a frag for a previously loaded timerange, remove all captions\n\t // TODO: consider just removing captions for the timerange\n\t if (pts <= this.lastPts) {\n\t this.clearCurrentCues(this.textTrack1);\n\t this.clearCurrentCues(this.textTrack2);\n\t }\n\t this.lastPts = pts;\n\t }\n\t }\n\t }, {\n\t key: 'onFragParsingUserdata',\n\t value: function onFragParsingUserdata(data) {\n\t // push all of the CEA-708 messages into the interpreter\n\t // immediately. It will create the proper timestamps based on our PTS value\n\t if (this.enabled) {\n\t for (var i = 0; i < data.samples.length; i++) {\n\t var ccdatas = this.extractCea608Data(data.samples[i].bytes);\n\t this.cea608Parser.addData(data.samples[i].pts, ccdatas);\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'extractCea608Data',\n\t value: function extractCea608Data(byteArray) {\n\t var count = byteArray[0] & 31;\n\t var position = 2;\n\t var tmpByte, ccbyte1, ccbyte2, ccValid, ccType;\n\t var actualCCBytes = [];\n\t\n\t for (var j = 0; j < count; j++) {\n\t tmpByte = byteArray[position++];\n\t ccbyte1 = 0x7F & byteArray[position++];\n\t ccbyte2 = 0x7F & byteArray[position++];\n\t ccValid = (4 & tmpByte) === 0 ? false : true;\n\t ccType = 3 & tmpByte;\n\t\n\t if (ccbyte1 === 0 && ccbyte2 === 0) {\n\t continue;\n\t }\n\t\n\t if (ccValid) {\n\t if (ccType === 0) // || ccType === 1\n\t {\n\t actualCCBytes.push(ccbyte1);\n\t actualCCBytes.push(ccbyte2);\n\t }\n\t }\n\t }\n\t return actualCCBytes;\n\t }\n\t }]);\n\t\n\t return TimelineController;\n\t}(_eventHandler2.default);\n\t\n\texports.default = TimelineController;\n\t\n\t},{\"25\":25,\"26\":26,\"40\":40}],13:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t *\n\t * This file contains an adaptation of the AES decryption algorithm\n\t * from the Standford Javascript Cryptography Library. That work is\n\t * covered by the following copyright and permissions notice:\n\t *\n\t * Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.\n\t * All rights reserved.\n\t *\n\t * Redistribution and use in source and binary forms, with or without\n\t * modification, are permitted provided that the following conditions are\n\t * met:\n\t *\n\t * 1. Redistributions of source code must retain the above copyright\n\t * notice, this list of conditions and the following disclaimer.\n\t *\n\t * 2. Redistributions in binary form must reproduce the above\n\t * copyright notice, this list of conditions and the following\n\t * disclaimer in the documentation and/or other materials provided\n\t * with the distribution.\n\t *\n\t * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR\n\t * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n\t * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n\t * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR CONTRIBUTORS BE\n\t * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n\t * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n\t * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n\t * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n\t * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n\t * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n\t * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t *\n\t * The views and conclusions contained in the software and documentation\n\t * are those of the authors and should not be interpreted as representing\n\t * official policies, either expressed or implied, of the authors.\n\t */\n\t\n\tvar AES = function () {\n\t\n\t /**\n\t * Schedule out an AES key for both encryption and decryption. This\n\t * is a low-level class. Use a cipher mode to do bulk encryption.\n\t *\n\t * @constructor\n\t * @param key {Array} The key as an array of 4, 6 or 8 words.\n\t */\n\t\n\t function AES(key) {\n\t _classCallCheck(this, AES);\n\t\n\t /**\n\t * The expanded S-box and inverse S-box tables. These will be computed\n\t * on the client so that we don't have to send them down the wire.\n\t *\n\t * There are two tables, _tables[0] is for encryption and\n\t * _tables[1] is for decryption.\n\t *\n\t * The first 4 sub-tables are the expanded S-box with MixColumns. The\n\t * last (_tables[01][4]) is the S-box itself.\n\t *\n\t * @private\n\t */\n\t this._tables = [[[], [], [], [], []], [[], [], [], [], []]];\n\t\n\t this._precompute();\n\t\n\t var i,\n\t j,\n\t tmp,\n\t encKey,\n\t decKey,\n\t sbox = this._tables[0][4],\n\t decTable = this._tables[1],\n\t keyLen = key.length,\n\t rcon = 1;\n\t\n\t if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n\t throw new Error('Invalid aes key size=' + keyLen);\n\t }\n\t\n\t encKey = key.slice(0);\n\t decKey = [];\n\t this._key = [encKey, decKey];\n\t\n\t // schedule encryption keys\n\t for (i = keyLen; i < 4 * keyLen + 28; i++) {\n\t tmp = encKey[i - 1];\n\t\n\t // apply sbox\n\t if (i % keyLen === 0 || keyLen === 8 && i % keyLen === 4) {\n\t tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];\n\t\n\t // shift rows and add rcon\n\t if (i % keyLen === 0) {\n\t tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n\t rcon = rcon << 1 ^ (rcon >> 7) * 283;\n\t }\n\t }\n\t\n\t encKey[i] = encKey[i - keyLen] ^ tmp;\n\t }\n\t\n\t // schedule decryption keys\n\t for (j = 0; i; j++, i--) {\n\t tmp = encKey[j & 3 ? i : i - 4];\n\t if (i <= 4 || j < 4) {\n\t decKey[j] = tmp;\n\t } else {\n\t decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Expand the S-box tables.\n\t *\n\t * @private\n\t */\n\t\n\t\n\t _createClass(AES, [{\n\t key: '_precompute',\n\t value: function _precompute() {\n\t var encTable = this._tables[0],\n\t decTable = this._tables[1],\n\t sbox = encTable[4],\n\t sboxInv = decTable[4],\n\t i,\n\t x,\n\t xInv,\n\t d = [],\n\t th = [],\n\t x2,\n\t x4,\n\t x8,\n\t s,\n\t tEnc,\n\t tDec;\n\t\n\t // Compute double and third tables\n\t for (i = 0; i < 256; i++) {\n\t th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n\t }\n\t\n\t for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n\t // Compute sbox\n\t s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n\t s = s >> 8 ^ s & 255 ^ 99;\n\t sbox[x] = s;\n\t sboxInv[s] = x;\n\t\n\t // Compute MixColumns\n\t x8 = d[x4 = d[x2 = d[x]]];\n\t tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n\t tEnc = d[s] * 0x101 ^ s * 0x1010100;\n\t\n\t for (i = 0; i < 4; i++) {\n\t encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n\t decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n\t }\n\t }\n\t\n\t // Compactify. Considerable speedup on Firefox.\n\t for (i = 0; i < 5; i++) {\n\t encTable[i] = encTable[i].slice(0);\n\t decTable[i] = decTable[i].slice(0);\n\t }\n\t }\n\t\n\t /**\n\t * Decrypt 16 bytes, specified as four 32-bit words.\n\t * @param encrypted0 {number} the first word to decrypt\n\t * @param encrypted1 {number} the second word to decrypt\n\t * @param encrypted2 {number} the third word to decrypt\n\t * @param encrypted3 {number} the fourth word to decrypt\n\t * @param out {Int32Array} the array to write the decrypted words\n\t * into\n\t * @param offset {number} the offset into the output array to start\n\t * writing results\n\t * @return {Array} The plaintext.\n\t */\n\t\n\t }, {\n\t key: 'decrypt',\n\t value: function decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {\n\t var key = this._key[1],\n\t\n\t // state variables a,b,c,d are loaded with pre-whitened data\n\t a = encrypted0 ^ key[0],\n\t b = encrypted3 ^ key[1],\n\t c = encrypted2 ^ key[2],\n\t d = encrypted1 ^ key[3],\n\t a2,\n\t b2,\n\t c2,\n\t nInnerRounds = key.length / 4 - 2,\n\t // key.length === 2 ?\n\t i,\n\t kIndex = 4,\n\t table = this._tables[1],\n\t\n\t\n\t // load up the tables\n\t table0 = table[0],\n\t table1 = table[1],\n\t table2 = table[2],\n\t table3 = table[3],\n\t sbox = table[4];\n\t\n\t // Inner rounds. Cribbed from OpenSSL.\n\t for (i = 0; i < nInnerRounds; i++) {\n\t a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d & 255] ^ key[kIndex];\n\t b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];\n\t c2 = table0[c >>> 24] ^ table1[d >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];\n\t d = table0[d >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];\n\t kIndex += 4;\n\t a = a2;b = b2;c = c2;\n\t }\n\t\n\t // Last round.\n\t for (i = 0; i < 4; i++) {\n\t out[(3 & -i) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d & 255] ^ key[kIndex++];\n\t a2 = a;a = b;b = c;c = d;d = a2;\n\t }\n\t }\n\t }]);\n\t\n\t return AES;\n\t}();\n\t\n\texports.default = AES;\n\t\n\t},{}],14:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t *\n\t * This file contains an adaptation of the AES decryption algorithm\n\t * from the Standford Javascript Cryptography Library. That work is\n\t * covered by the following copyright and permissions notice:\n\t *\n\t * Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.\n\t * All rights reserved.\n\t *\n\t * Redistribution and use in source and binary forms, with or without\n\t * modification, are permitted provided that the following conditions are\n\t * met:\n\t *\n\t * 1. Redistributions of source code must retain the above copyright\n\t * notice, this list of conditions and the following disclaimer.\n\t *\n\t * 2. Redistributions in binary form must reproduce the above\n\t * copyright notice, this list of conditions and the following\n\t * disclaimer in the documentation and/or other materials provided\n\t * with the distribution.\n\t *\n\t * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR\n\t * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n\t * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n\t * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR CONTRIBUTORS BE\n\t * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n\t * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n\t * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n\t * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n\t * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n\t * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n\t * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t *\n\t * The views and conclusions contained in the software and documentation\n\t * are those of the authors and should not be interpreted as representing\n\t * official policies, either expressed or implied, of the authors.\n\t */\n\t\n\tvar _aes = _dereq_(13);\n\t\n\tvar _aes2 = _interopRequireDefault(_aes);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar AES128Decrypter = function () {\n\t function AES128Decrypter(key, initVector) {\n\t _classCallCheck(this, AES128Decrypter);\n\t\n\t this.key = key;\n\t this.iv = initVector;\n\t }\n\t\n\t /**\n\t * Convert network-order (big-endian) bytes into their little-endian\n\t * representation.\n\t */\n\t\n\t\n\t _createClass(AES128Decrypter, [{\n\t key: 'ntoh',\n\t value: function ntoh(word) {\n\t return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n\t }\n\t\n\t /**\n\t * Decrypt bytes using AES-128 with CBC and PKCS#7 padding.\n\t * @param encrypted {Uint8Array} the encrypted bytes\n\t * @param key {Uint32Array} the bytes of the decryption key\n\t * @param initVector {Uint32Array} the initialization vector (IV) to\n\t * use for the first round of CBC.\n\t * @return {Uint8Array} the decrypted bytes\n\t *\n\t * @see http://en.wikipedia.org/wiki/Advanced_Encryption_Standard\n\t * @see http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29\n\t * @see https://tools.ietf.org/html/rfc2315\n\t */\n\t\n\t }, {\n\t key: 'doDecrypt',\n\t value: function doDecrypt(encrypted, key, initVector) {\n\t var\n\t // word-level access to the encrypted bytes\n\t encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2),\n\t decipher = new _aes2.default(Array.prototype.slice.call(key)),\n\t\n\t\n\t // byte and word-level access for the decrypted output\n\t decrypted = new Uint8Array(encrypted.byteLength),\n\t decrypted32 = new Int32Array(decrypted.buffer),\n\t\n\t\n\t // temporary variables for working with the IV, encrypted, and\n\t // decrypted data\n\t init0,\n\t init1,\n\t init2,\n\t init3,\n\t encrypted0,\n\t encrypted1,\n\t encrypted2,\n\t encrypted3,\n\t\n\t\n\t // iteration variable\n\t wordIx;\n\t\n\t // pull out the words of the IV to ensure we don't modify the\n\t // passed-in reference and easier access\n\t init0 = ~ ~initVector[0];\n\t init1 = ~ ~initVector[1];\n\t init2 = ~ ~initVector[2];\n\t init3 = ~ ~initVector[3];\n\t\n\t // decrypt four word sequences, applying cipher-block chaining (CBC)\n\t // to each decrypted block\n\t for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {\n\t // convert big-endian (network order) words into little-endian\n\t // (javascript order)\n\t encrypted0 = ~ ~this.ntoh(encrypted32[wordIx]);\n\t encrypted1 = ~ ~this.ntoh(encrypted32[wordIx + 1]);\n\t encrypted2 = ~ ~this.ntoh(encrypted32[wordIx + 2]);\n\t encrypted3 = ~ ~this.ntoh(encrypted32[wordIx + 3]);\n\t\n\t // decrypt the block\n\t decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx);\n\t\n\t // XOR with the IV, and restore network byte-order to obtain the\n\t // plaintext\n\t decrypted32[wordIx] = this.ntoh(decrypted32[wordIx] ^ init0);\n\t decrypted32[wordIx + 1] = this.ntoh(decrypted32[wordIx + 1] ^ init1);\n\t decrypted32[wordIx + 2] = this.ntoh(decrypted32[wordIx + 2] ^ init2);\n\t decrypted32[wordIx + 3] = this.ntoh(decrypted32[wordIx + 3] ^ init3);\n\t\n\t // setup the IV for the next round\n\t init0 = encrypted0;\n\t init1 = encrypted1;\n\t init2 = encrypted2;\n\t init3 = encrypted3;\n\t }\n\t\n\t return decrypted;\n\t }\n\t }, {\n\t key: 'localDecrypt',\n\t value: function localDecrypt(encrypted, key, initVector, decrypted) {\n\t var bytes = this.doDecrypt(encrypted, key, initVector);\n\t decrypted.set(bytes, encrypted.byteOffset);\n\t }\n\t }, {\n\t key: 'decrypt',\n\t value: function decrypt(encrypted) {\n\t var step = 4 * 8000,\n\t\n\t //encrypted32 = new Int32Array(encrypted.buffer),\n\t encrypted32 = new Int32Array(encrypted),\n\t decrypted = new Uint8Array(encrypted.byteLength),\n\t i = 0;\n\t\n\t // split up the encryption job and do the individual chunks asynchronously\n\t var key = this.key;\n\t var initVector = this.iv;\n\t this.localDecrypt(encrypted32.subarray(i, i + step), key, initVector, decrypted);\n\t\n\t for (i = step; i < encrypted32.length; i += step) {\n\t initVector = new Uint32Array([this.ntoh(encrypted32[i - 4]), this.ntoh(encrypted32[i - 3]), this.ntoh(encrypted32[i - 2]), this.ntoh(encrypted32[i - 1])]);\n\t this.localDecrypt(encrypted32.subarray(i, i + step), key, initVector, decrypted);\n\t }\n\t\n\t return decrypted;\n\t }\n\t }]);\n\t\n\t return AES128Decrypter;\n\t}();\n\t\n\texports.default = AES128Decrypter;\n\t\n\t},{\"13\":13}],15:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t * AES128 decryption.\n\t */\n\t\n\tvar _aes128Decrypter = _dereq_(14);\n\t\n\tvar _aes128Decrypter2 = _interopRequireDefault(_aes128Decrypter);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Decrypter = function () {\n\t function Decrypter(hls) {\n\t _classCallCheck(this, Decrypter);\n\t\n\t this.hls = hls;\n\t try {\n\t var browserCrypto = window ? window.crypto : crypto;\n\t this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n\t this.disableWebCrypto = !this.subtle;\n\t } catch (e) {\n\t this.disableWebCrypto = true;\n\t }\n\t }\n\t\n\t _createClass(Decrypter, [{\n\t key: 'destroy',\n\t value: function destroy() {}\n\t }, {\n\t key: 'decrypt',\n\t value: function decrypt(data, key, iv, callback) {\n\t if (this.disableWebCrypto && this.hls.config.enableSoftwareAES) {\n\t this.decryptBySoftware(data, key, iv, callback);\n\t } else {\n\t this.decryptByWebCrypto(data, key, iv, callback);\n\t }\n\t }\n\t }, {\n\t key: 'decryptByWebCrypto',\n\t value: function decryptByWebCrypto(data, key, iv, callback) {\n\t var _this = this;\n\t\n\t _logger.logger.log('decrypting by WebCrypto API');\n\t\n\t this.subtle.importKey('raw', key, { name: 'AES-CBC', length: 128 }, false, ['decrypt']).then(function (importedKey) {\n\t _this.subtle.decrypt({ name: 'AES-CBC', iv: iv.buffer }, importedKey, data).then(callback).catch(function (err) {\n\t _this.onWebCryptoError(err, data, key, iv, callback);\n\t });\n\t }).catch(function (err) {\n\t _this.onWebCryptoError(err, data, key, iv, callback);\n\t });\n\t }\n\t }, {\n\t key: 'decryptBySoftware',\n\t value: function decryptBySoftware(data, key8, iv8, callback) {\n\t _logger.logger.log('decrypting by JavaScript Implementation');\n\t\n\t var view = new DataView(key8.buffer);\n\t var key = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);\n\t\n\t view = new DataView(iv8.buffer);\n\t var iv = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);\n\t\n\t var decrypter = new _aes128Decrypter2.default(key, iv);\n\t callback(decrypter.decrypt(data).buffer);\n\t }\n\t }, {\n\t key: 'onWebCryptoError',\n\t value: function onWebCryptoError(err, data, key, iv, callback) {\n\t if (this.hls.config.enableSoftwareAES) {\n\t _logger.logger.log('disabling to use WebCrypto API');\n\t this.disableWebCrypto = true;\n\t this.decryptBySoftware(data, key, iv, callback);\n\t } else {\n\t _logger.logger.error('decrypting error : ' + err.message);\n\t this.hls.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_DECRYPT_ERROR, fatal: true, reason: err.message });\n\t }\n\t }\n\t }]);\n\t\n\t return Decrypter;\n\t}();\n\t\n\texports.default = Decrypter;\n\t\n\t},{\"14\":14,\"24\":24,\"43\":43}],16:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * AAC demuxer\n\t */\n\t\n\t\n\tvar _adts = _dereq_(17);\n\t\n\tvar _adts2 = _interopRequireDefault(_adts);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tvar _id = _dereq_(22);\n\t\n\tvar _id2 = _interopRequireDefault(_id);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar AACDemuxer = function () {\n\t function AACDemuxer(observer, id, remuxerClass, config) {\n\t _classCallCheck(this, AACDemuxer);\n\t\n\t this.observer = observer;\n\t this.id = id;\n\t this.remuxerClass = remuxerClass;\n\t this.config = config;\n\t this.remuxer = new this.remuxerClass(observer, id, config);\n\t this.insertDiscontinuity();\n\t }\n\t\n\t _createClass(AACDemuxer, [{\n\t key: 'insertDiscontinuity',\n\t value: function insertDiscontinuity() {\n\t this._aacTrack = { container: 'audio/adts', type: 'audio', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n\t }\n\t }, {\n\t key: 'push',\n\t\n\t\n\t // feed incoming data to the front of the parsing pipeline\n\t value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset) {\n\t var track,\n\t id3 = new _id2.default(data),\n\t pts = 90 * id3.timeStamp,\n\t config,\n\t frameLength,\n\t frameDuration,\n\t frameIndex,\n\t offset,\n\t headerLength,\n\t stamp,\n\t len,\n\t aacSample;\n\t\n\t var contiguous = false;\n\t if (cc !== this.lastCC) {\n\t _logger.logger.log(this.id + ' discontinuity detected');\n\t this.lastCC = cc;\n\t this.insertDiscontinuity();\n\t this.remuxer.switchLevel();\n\t this.remuxer.insertDiscontinuity();\n\t } else if (level !== this.lastLevel) {\n\t _logger.logger.log('audio track switch detected');\n\t this.lastLevel = level;\n\t this.remuxer.switchLevel();\n\t this.insertDiscontinuity();\n\t } else if (sn === this.lastSN + 1) {\n\t contiguous = true;\n\t }\n\t track = this._aacTrack;\n\t this.lastSN = sn;\n\t this.lastLevel = level;\n\t\n\t // look for ADTS header (0xFFFx)\n\t for (offset = id3.length, len = data.length; offset < len - 1; offset++) {\n\t if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n\t break;\n\t }\n\t }\n\t\n\t if (!track.audiosamplerate) {\n\t config = _adts2.default.getAudioConfig(this.observer, data, offset, audioCodec);\n\t track.config = config.config;\n\t track.audiosamplerate = config.samplerate;\n\t track.channelCount = config.channelCount;\n\t track.codec = config.codec;\n\t track.duration = duration;\n\t _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n\t }\n\t frameIndex = 0;\n\t frameDuration = 1024 * 90000 / track.audiosamplerate;\n\t while (offset + 5 < len) {\n\t // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n\t headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;\n\t // retrieve frame size\n\t frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n\t frameLength -= headerLength;\n\t //stamp = pes.pts;\n\t\n\t if (frameLength > 0 && offset + headerLength + frameLength <= len) {\n\t stamp = pts + frameIndex * frameDuration;\n\t //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n\t aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n\t track.samples.push(aacSample);\n\t track.len += frameLength;\n\t offset += frameLength + headerLength;\n\t frameIndex++;\n\t // look for ADTS header (0xFFFx)\n\t for (; offset < len - 1; offset++) {\n\t if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n\t break;\n\t }\n\t }\n\t } else {\n\t break;\n\t }\n\t }\n\t this.remuxer.remux(level, sn, this._aacTrack, { samples: [] }, { samples: [{ pts: pts, dts: pts, unit: id3.payload }] }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset);\n\t }\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {}\n\t }], [{\n\t key: 'probe',\n\t value: function probe(data) {\n\t // check if data contains ID3 timestamp and ADTS sync worc\n\t var id3 = new _id2.default(data),\n\t offset,\n\t len;\n\t if (id3.hasTimeStamp) {\n\t // look for ADTS header (0xFFFx)\n\t for (offset = id3.length, len = data.length; offset < len - 1; offset++) {\n\t if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n\t //logger.log('ADTS sync word found !');\n\t return true;\n\t }\n\t }\n\t }\n\t return false;\n\t }\n\t }]);\n\t\n\t return AACDemuxer;\n\t}();\n\t\n\texports.default = AACDemuxer;\n\t\n\t},{\"17\":17,\"22\":22,\"43\":43}],17:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * ADTS parser helper\n\t */\n\t\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar ADTS = function () {\n\t function ADTS() {\n\t _classCallCheck(this, ADTS);\n\t }\n\t\n\t _createClass(ADTS, null, [{\n\t key: 'getAudioConfig',\n\t value: function getAudioConfig(observer, data, offset, audioCodec) {\n\t var adtsObjectType,\n\t // :int\n\t adtsSampleingIndex,\n\t // :int\n\t adtsExtensionSampleingIndex,\n\t // :int\n\t adtsChanelConfig,\n\t // :int\n\t config,\n\t userAgent = navigator.userAgent.toLowerCase(),\n\t adtsSampleingRates = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n\t // byte 2\n\t adtsObjectType = ((data[offset + 2] & 0xC0) >>> 6) + 1;\n\t adtsSampleingIndex = (data[offset + 2] & 0x3C) >>> 2;\n\t if (adtsSampleingIndex > adtsSampleingRates.length - 1) {\n\t observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'invalid ADTS sampling index:' + adtsSampleingIndex });\n\t return;\n\t }\n\t adtsChanelConfig = (data[offset + 2] & 0x01) << 2;\n\t // byte 3\n\t adtsChanelConfig |= (data[offset + 3] & 0xC0) >>> 6;\n\t _logger.logger.log('manifest codec:' + audioCodec + ',ADTS data:type:' + adtsObjectType + ',sampleingIndex:' + adtsSampleingIndex + '[' + adtsSampleingRates[adtsSampleingIndex] + 'Hz],channelConfig:' + adtsChanelConfig);\n\t // firefox/Opera: freq less than 24kHz = AAC SBR (HE-AAC)\n\t if (/firefox|OPR/i.test(userAgent)) {\n\t if (adtsSampleingIndex >= 6) {\n\t adtsObjectType = 5;\n\t config = new Array(4);\n\t // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n\t // there is a factor 2 between frame sample rate and output sample rate\n\t // multiply frequency by 2 (see table below, equivalent to substract 3)\n\t adtsExtensionSampleingIndex = adtsSampleingIndex - 3;\n\t } else {\n\t adtsObjectType = 2;\n\t config = new Array(2);\n\t adtsExtensionSampleingIndex = adtsSampleingIndex;\n\t }\n\t // Android : always use AAC\n\t } else if (userAgent.indexOf('android') !== -1) {\n\t adtsObjectType = 2;\n\t config = new Array(2);\n\t adtsExtensionSampleingIndex = adtsSampleingIndex;\n\t } else {\n\t /* for other browsers (Chrome/Vivaldi ...)\n\t always force audio type to be HE-AAC SBR, as some browsers do not support audio codec switch properly (like Chrome ...)\n\t */\n\t adtsObjectType = 5;\n\t config = new Array(4);\n\t // if (manifest codec is HE-AAC or HE-AACv2) OR (manifest codec not specified AND frequency less than 24kHz)\n\t if (audioCodec && (audioCodec.indexOf('mp4a.40.29') !== -1 || audioCodec.indexOf('mp4a.40.5') !== -1) || !audioCodec && adtsSampleingIndex >= 6) {\n\t // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n\t // there is a factor 2 between frame sample rate and output sample rate\n\t // multiply frequency by 2 (see table below, equivalent to substract 3)\n\t adtsExtensionSampleingIndex = adtsSampleingIndex - 3;\n\t } else {\n\t // if (manifest codec is AAC) AND (frequency less than 24kHz AND nb channel is 1) OR (manifest codec not specified and mono audio)\n\t // Chrome fails to play back with low frequency AAC LC mono when initialized with HE-AAC. This is not a problem with stereo.\n\t if (audioCodec && audioCodec.indexOf('mp4a.40.2') !== -1 && adtsSampleingIndex >= 6 && adtsChanelConfig === 1 || !audioCodec && adtsChanelConfig === 1) {\n\t adtsObjectType = 2;\n\t config = new Array(2);\n\t }\n\t adtsExtensionSampleingIndex = adtsSampleingIndex;\n\t }\n\t }\n\t /* refer to http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio#Audio_Specific_Config\n\t ISO 14496-3 (AAC).pdf - Table 1.13 — Syntax of AudioSpecificConfig()\n\t Audio Profile / Audio Object Type\n\t 0: Null\n\t 1: AAC Main\n\t 2: AAC LC (Low Complexity)\n\t 3: AAC SSR (Scalable Sample Rate)\n\t 4: AAC LTP (Long Term Prediction)\n\t 5: SBR (Spectral Band Replication)\n\t 6: AAC Scalable\n\t sampling freq\n\t 0: 96000 Hz\n\t 1: 88200 Hz\n\t 2: 64000 Hz\n\t 3: 48000 Hz\n\t 4: 44100 Hz\n\t 5: 32000 Hz\n\t 6: 24000 Hz\n\t 7: 22050 Hz\n\t 8: 16000 Hz\n\t 9: 12000 Hz\n\t 10: 11025 Hz\n\t 11: 8000 Hz\n\t 12: 7350 Hz\n\t 13: Reserved\n\t 14: Reserved\n\t 15: frequency is written explictly\n\t Channel Configurations\n\t These are the channel configurations:\n\t 0: Defined in AOT Specifc Config\n\t 1: 1 channel: front-center\n\t 2: 2 channels: front-left, front-right\n\t */\n\t // audioObjectType = profile => profile, the MPEG-4 Audio Object Type minus 1\n\t config[0] = adtsObjectType << 3;\n\t // samplingFrequencyIndex\n\t config[0] |= (adtsSampleingIndex & 0x0E) >> 1;\n\t config[1] |= (adtsSampleingIndex & 0x01) << 7;\n\t // channelConfiguration\n\t config[1] |= adtsChanelConfig << 3;\n\t if (adtsObjectType === 5) {\n\t // adtsExtensionSampleingIndex\n\t config[1] |= (adtsExtensionSampleingIndex & 0x0E) >> 1;\n\t config[2] = (adtsExtensionSampleingIndex & 0x01) << 7;\n\t // adtsObjectType (force to 2, chrome is checking that object type is less than 5 ???\n\t // https://chromium.googlesource.com/chromium/src.git/+/master/media/formats/mp4/aac.cc\n\t config[2] |= 2 << 2;\n\t config[3] = 0;\n\t }\n\t return { config: config, samplerate: adtsSampleingRates[adtsSampleingIndex], channelCount: adtsChanelConfig, codec: 'mp4a.40.' + adtsObjectType };\n\t }\n\t }]);\n\t\n\t return ADTS;\n\t}();\n\t\n\texports.default = ADTS;\n\t\n\t},{\"24\":24,\"43\":43}],18:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* inline demuxer.\n\t * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n\t */\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tvar _aacdemuxer = _dereq_(16);\n\t\n\tvar _aacdemuxer2 = _interopRequireDefault(_aacdemuxer);\n\t\n\tvar _tsdemuxer = _dereq_(23);\n\t\n\tvar _tsdemuxer2 = _interopRequireDefault(_tsdemuxer);\n\t\n\tvar _mp4Remuxer = _dereq_(36);\n\t\n\tvar _mp4Remuxer2 = _interopRequireDefault(_mp4Remuxer);\n\t\n\tvar _passthroughRemuxer = _dereq_(37);\n\t\n\tvar _passthroughRemuxer2 = _interopRequireDefault(_passthroughRemuxer);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar DemuxerInline = function () {\n\t function DemuxerInline(hls, id, typeSupported) {\n\t var config = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3];\n\t\n\t _classCallCheck(this, DemuxerInline);\n\t\n\t this.hls = hls;\n\t this.id = id;\n\t this.config = this.hls.config || config;\n\t this.typeSupported = typeSupported;\n\t }\n\t\n\t _createClass(DemuxerInline, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t var demuxer = this.demuxer;\n\t if (demuxer) {\n\t demuxer.destroy();\n\t }\n\t }\n\t }, {\n\t key: 'push',\n\t value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset) {\n\t var demuxer = this.demuxer;\n\t if (!demuxer) {\n\t var hls = this.hls,\n\t id = this.id;\n\t // probe for content type\n\t if (_tsdemuxer2.default.probe(data)) {\n\t if (this.typeSupported.mp2t === true) {\n\t demuxer = new _tsdemuxer2.default(hls, id, _passthroughRemuxer2.default, this.config);\n\t } else {\n\t demuxer = new _tsdemuxer2.default(hls, id, _mp4Remuxer2.default, this.config);\n\t }\n\t } else if (_aacdemuxer2.default.probe(data)) {\n\t demuxer = new _aacdemuxer2.default(hls, id, _mp4Remuxer2.default, this.config);\n\t } else {\n\t hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found' });\n\t return;\n\t }\n\t this.demuxer = demuxer;\n\t }\n\t demuxer.push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset);\n\t }\n\t }]);\n\t\n\t return DemuxerInline;\n\t}();\n\t\n\texports.default = DemuxerInline;\n\t\n\t},{\"16\":16,\"23\":23,\"24\":24,\"26\":26,\"36\":36,\"37\":37}],19:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _demuxerInline = _dereq_(18);\n\t\n\tvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tvar _events3 = _dereq_(1);\n\t\n\tvar _events4 = _interopRequireDefault(_events3);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/* demuxer web worker.\n\t * - listen to worker message, and trigger DemuxerInline upon reception of Fragments.\n\t * - provides MP4 Boxes back to main thread using [transferable objects](https://developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast) in order to minimize message passing overhead.\n\t */\n\t\n\tvar DemuxerWorker = function DemuxerWorker(self) {\n\t // observer setup\n\t var observer = new _events4.default();\n\t observer.trigger = function trigger(event) {\n\t for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t data[_key - 1] = arguments[_key];\n\t }\n\t\n\t observer.emit.apply(observer, [event, event].concat(data));\n\t };\n\t\n\t observer.off = function off(event) {\n\t for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n\t data[_key2 - 1] = arguments[_key2];\n\t }\n\t\n\t observer.removeListener.apply(observer, [event].concat(data));\n\t };\n\t\n\t var forwardMessage = function forwardMessage(ev, data) {\n\t self.postMessage({ event: ev, data: data });\n\t };\n\t\n\t self.addEventListener('message', function (ev) {\n\t var data = ev.data;\n\t //console.log('demuxer cmd:' + data.cmd);\n\t switch (data.cmd) {\n\t case 'init':\n\t var config = JSON.parse(data.config);\n\t self.demuxer = new _demuxerInline2.default(observer, data.id, data.typeSupported, config);\n\t try {\n\t (0, _logger.enableLogs)(config.debug);\n\t } catch (err) {\n\t console.warn('demuxerWorker: unable to enable logs');\n\t }\n\t // signal end of worker init\n\t forwardMessage('init', null);\n\t break;\n\t case 'demux':\n\t self.demuxer.push(new Uint8Array(data.data), data.audioCodec, data.videoCodec, data.timeOffset, data.cc, data.level, data.sn, data.duration, data.accurateTimeOffset);\n\t break;\n\t default:\n\t break;\n\t }\n\t });\n\t\n\t // forward events to main thread\n\t observer.on(_events2.default.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n\t observer.on(_events2.default.FRAG_PARSED, forwardMessage);\n\t observer.on(_events2.default.ERROR, forwardMessage);\n\t observer.on(_events2.default.FRAG_PARSING_METADATA, forwardMessage);\n\t observer.on(_events2.default.FRAG_PARSING_USERDATA, forwardMessage);\n\t\n\t // special case for FRAG_PARSING_DATA: pass data1/data2 as transferable object (no copy)\n\t observer.on(_events2.default.FRAG_PARSING_DATA, function (ev, data) {\n\t var data1 = data.data1.buffer,\n\t data2 = data.data2.buffer;\n\t // remove data1 and data2 reference from data to avoid copying them ...\n\t delete data.data1;\n\t delete data.data2;\n\t self.postMessage({ event: ev, data: data, data1: data1, data2: data2 }, [data1, data2]);\n\t });\n\t};\n\t\n\texports.default = DemuxerWorker;\n\t\n\t},{\"1\":1,\"18\":18,\"26\":26,\"43\":43}],20:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _demuxerInline = _dereq_(18);\n\t\n\tvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\t\n\tvar _demuxerWorker = _dereq_(19);\n\t\n\tvar _demuxerWorker2 = _interopRequireDefault(_demuxerWorker);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tvar _decrypter = _dereq_(15);\n\t\n\tvar _decrypter2 = _interopRequireDefault(_decrypter);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Demuxer = function () {\n\t function Demuxer(hls, id) {\n\t _classCallCheck(this, Demuxer);\n\t\n\t this.hls = hls;\n\t this.id = id;\n\t var typeSupported = {\n\t mp4: MediaSource.isTypeSupported('video/mp4'),\n\t mp2t: hls.config.enableMP2TPassThrough && MediaSource.isTypeSupported('video/mp2t')\n\t };\n\t if (hls.config.enableWorker && typeof Worker !== 'undefined') {\n\t _logger.logger.log('demuxing in webworker');\n\t var w = void 0;\n\t try {\n\t var work = _dereq_(2);\n\t w = this.w = work(_demuxerWorker2.default);\n\t this.onwmsg = this.onWorkerMessage.bind(this);\n\t w.addEventListener('message', this.onwmsg);\n\t w.onerror = function (event) {\n\t hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: true, event: 'demuxerWorker', err: { message: event.message + ' (' + event.filename + ':' + event.lineno + ')' } });\n\t };\n\t w.postMessage({ cmd: 'init', typeSupported: typeSupported, id: id, config: JSON.stringify(hls.config) });\n\t } catch (err) {\n\t _logger.logger.error('error while initializing DemuxerWorker, fallback on DemuxerInline');\n\t if (w) {\n\t // revoke the Object URL that was used to create demuxer worker, so as not to leak it\n\t URL.revokeObjectURL(w.objectURL);\n\t }\n\t this.demuxer = new _demuxerInline2.default(hls, id, typeSupported);\n\t }\n\t } else {\n\t this.demuxer = new _demuxerInline2.default(hls, id, typeSupported);\n\t }\n\t this.demuxInitialized = true;\n\t }\n\t\n\t _createClass(Demuxer, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t var w = this.w;\n\t if (w) {\n\t w.removeEventListener('message', this.onwmsg);\n\t w.terminate();\n\t this.w = null;\n\t } else {\n\t var demuxer = this.demuxer;\n\t if (demuxer) {\n\t demuxer.destroy();\n\t this.demuxer = null;\n\t }\n\t }\n\t var decrypter = this.decrypter;\n\t if (decrypter) {\n\t decrypter.destroy();\n\t this.decrypter = null;\n\t }\n\t }\n\t }, {\n\t key: 'pushDecrypted',\n\t value: function pushDecrypted(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset) {\n\t var w = this.w;\n\t if (w) {\n\t // post fragment payload as transferable objects (no copy)\n\t w.postMessage({ cmd: 'demux', data: data, audioCodec: audioCodec, videoCodec: videoCodec, timeOffset: timeOffset, cc: cc, level: level, sn: sn, duration: duration, accurateTimeOffset: accurateTimeOffset }, [data]);\n\t } else {\n\t var demuxer = this.demuxer;\n\t if (demuxer) {\n\t demuxer.push(new Uint8Array(data), audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset);\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'push',\n\t value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset) {\n\t if (data.byteLength > 0 && decryptdata != null && decryptdata.key != null && decryptdata.method === 'AES-128') {\n\t if (this.decrypter == null) {\n\t this.decrypter = new _decrypter2.default(this.hls);\n\t }\n\t\n\t var localthis = this;\n\t this.decrypter.decrypt(data, decryptdata.key, decryptdata.iv, function (decryptedData) {\n\t localthis.pushDecrypted(decryptedData, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset);\n\t });\n\t } else {\n\t this.pushDecrypted(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset);\n\t }\n\t }\n\t }, {\n\t key: 'onWorkerMessage',\n\t value: function onWorkerMessage(ev) {\n\t var data = ev.data,\n\t hls = this.hls;\n\t //console.log('onWorkerMessage:' + data.event);\n\t switch (data.event) {\n\t case 'init':\n\t // revoke the Object URL that was used to create demuxer worker, so as not to leak it\n\t URL.revokeObjectURL(this.w.objectURL);\n\t break;\n\t // special case for FRAG_PARSING_DATA: data1 and data2 are transferable objects\n\t case _events2.default.FRAG_PARSING_DATA:\n\t data.data.data1 = new Uint8Array(data.data1);\n\t data.data.data2 = new Uint8Array(data.data2);\n\t /* falls through */\n\t default:\n\t hls.trigger(data.event, data.data);\n\t break;\n\t }\n\t }\n\t }]);\n\t\n\t return Demuxer;\n\t}();\n\t\n\texports.default = Demuxer;\n\t\n\t},{\"15\":15,\"18\":18,\"19\":19,\"2\":2,\"24\":24,\"26\":26,\"43\":43}],21:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.\n\t */\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar ExpGolomb = function () {\n\t function ExpGolomb(data) {\n\t _classCallCheck(this, ExpGolomb);\n\t\n\t this.data = data;\n\t // the number of bytes left to examine in this.data\n\t this.bytesAvailable = this.data.byteLength;\n\t // the current word being examined\n\t this.word = 0; // :uint\n\t // the number of bits left to examine in the current word\n\t this.bitsAvailable = 0; // :uint\n\t }\n\t\n\t // ():void\n\t\n\t\n\t _createClass(ExpGolomb, [{\n\t key: 'loadWord',\n\t value: function loadWord() {\n\t var position = this.data.byteLength - this.bytesAvailable,\n\t workingBytes = new Uint8Array(4),\n\t availableBytes = Math.min(4, this.bytesAvailable);\n\t if (availableBytes === 0) {\n\t throw new Error('no bytes available');\n\t }\n\t workingBytes.set(this.data.subarray(position, position + availableBytes));\n\t this.word = new DataView(workingBytes.buffer).getUint32(0);\n\t // track the amount of this.data that has been processed\n\t this.bitsAvailable = availableBytes * 8;\n\t this.bytesAvailable -= availableBytes;\n\t }\n\t\n\t // (count:int):void\n\t\n\t }, {\n\t key: 'skipBits',\n\t value: function skipBits(count) {\n\t var skipBytes; // :int\n\t if (this.bitsAvailable > count) {\n\t this.word <<= count;\n\t this.bitsAvailable -= count;\n\t } else {\n\t count -= this.bitsAvailable;\n\t skipBytes = count >> 3;\n\t count -= skipBytes >> 3;\n\t this.bytesAvailable -= skipBytes;\n\t this.loadWord();\n\t this.word <<= count;\n\t this.bitsAvailable -= count;\n\t }\n\t }\n\t\n\t // (size:int):uint\n\t\n\t }, {\n\t key: 'readBits',\n\t value: function readBits(size) {\n\t var bits = Math.min(this.bitsAvailable, size),\n\t // :uint\n\t valu = this.word >>> 32 - bits; // :uint\n\t if (size > 32) {\n\t _logger.logger.error('Cannot read more than 32 bits at a time');\n\t }\n\t this.bitsAvailable -= bits;\n\t if (this.bitsAvailable > 0) {\n\t this.word <<= bits;\n\t } else if (this.bytesAvailable > 0) {\n\t this.loadWord();\n\t }\n\t bits = size - bits;\n\t if (bits > 0 && this.bitsAvailable) {\n\t return valu << bits | this.readBits(bits);\n\t } else {\n\t return valu;\n\t }\n\t }\n\t\n\t // ():uint\n\t\n\t }, {\n\t key: 'skipLZ',\n\t value: function skipLZ() {\n\t var leadingZeroCount; // :uint\n\t for (leadingZeroCount = 0; leadingZeroCount < this.bitsAvailable; ++leadingZeroCount) {\n\t if (0 !== (this.word & 0x80000000 >>> leadingZeroCount)) {\n\t // the first bit of working word is 1\n\t this.word <<= leadingZeroCount;\n\t this.bitsAvailable -= leadingZeroCount;\n\t return leadingZeroCount;\n\t }\n\t }\n\t // we exhausted word and still have not found a 1\n\t this.loadWord();\n\t return leadingZeroCount + this.skipLZ();\n\t }\n\t\n\t // ():void\n\t\n\t }, {\n\t key: 'skipUEG',\n\t value: function skipUEG() {\n\t this.skipBits(1 + this.skipLZ());\n\t }\n\t\n\t // ():void\n\t\n\t }, {\n\t key: 'skipEG',\n\t value: function skipEG() {\n\t this.skipBits(1 + this.skipLZ());\n\t }\n\t\n\t // ():uint\n\t\n\t }, {\n\t key: 'readUEG',\n\t value: function readUEG() {\n\t var clz = this.skipLZ(); // :uint\n\t return this.readBits(clz + 1) - 1;\n\t }\n\t\n\t // ():int\n\t\n\t }, {\n\t key: 'readEG',\n\t value: function readEG() {\n\t var valu = this.readUEG(); // :int\n\t if (0x01 & valu) {\n\t // the number is odd if the low order bit is set\n\t return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n\t } else {\n\t return -1 * (valu >>> 1); // divide by two then make it negative\n\t }\n\t }\n\t\n\t // Some convenience functions\n\t // :Boolean\n\t\n\t }, {\n\t key: 'readBoolean',\n\t value: function readBoolean() {\n\t return 1 === this.readBits(1);\n\t }\n\t\n\t // ():int\n\t\n\t }, {\n\t key: 'readUByte',\n\t value: function readUByte() {\n\t return this.readBits(8);\n\t }\n\t\n\t // ():int\n\t\n\t }, {\n\t key: 'readUShort',\n\t value: function readUShort() {\n\t return this.readBits(16);\n\t }\n\t // ():int\n\t\n\t }, {\n\t key: 'readUInt',\n\t value: function readUInt() {\n\t return this.readBits(32);\n\t }\n\t\n\t /**\n\t * Advance the ExpGolomb decoder past a scaling list. The scaling\n\t * list is optionally transmitted as part of a sequence parameter\n\t * set and is not relevant to transmuxing.\n\t * @param count {number} the number of entries in this scaling list\n\t * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n\t */\n\t\n\t }, {\n\t key: 'skipScalingList',\n\t value: function skipScalingList(count) {\n\t var lastScale = 8,\n\t nextScale = 8,\n\t j,\n\t deltaScale;\n\t for (j = 0; j < count; j++) {\n\t if (nextScale !== 0) {\n\t deltaScale = this.readEG();\n\t nextScale = (lastScale + deltaScale + 256) % 256;\n\t }\n\t lastScale = nextScale === 0 ? lastScale : nextScale;\n\t }\n\t }\n\t\n\t /**\n\t * Read a sequence parameter set and return some interesting video\n\t * properties. A sequence parameter set is the H264 metadata that\n\t * describes the properties of upcoming video frames.\n\t * @param data {Uint8Array} the bytes of a sequence parameter set\n\t * @return {object} an object with configuration parsed from the\n\t * sequence parameter set, including the dimensions of the\n\t * associated video frames.\n\t */\n\t\n\t }, {\n\t key: 'readSPS',\n\t value: function readSPS() {\n\t var frameCropLeftOffset = 0,\n\t frameCropRightOffset = 0,\n\t frameCropTopOffset = 0,\n\t frameCropBottomOffset = 0,\n\t sarScale = 1,\n\t profileIdc,\n\t profileCompat,\n\t levelIdc,\n\t numRefFramesInPicOrderCntCycle,\n\t picWidthInMbsMinus1,\n\t picHeightInMapUnitsMinus1,\n\t frameMbsOnlyFlag,\n\t scalingListCount,\n\t i;\n\t this.readUByte();\n\t profileIdc = this.readUByte(); // profile_idc\n\t profileCompat = this.readBits(5); // constraint_set[0-4]_flag, u(5)\n\t this.skipBits(3); // reserved_zero_3bits u(3),\n\t levelIdc = this.readUByte(); //level_idc u(8)\n\t this.skipUEG(); // seq_parameter_set_id\n\t // some profiles have more optional data we don't need\n\t if (profileIdc === 100 || profileIdc === 110 || profileIdc === 122 || profileIdc === 244 || profileIdc === 44 || profileIdc === 83 || profileIdc === 86 || profileIdc === 118 || profileIdc === 128) {\n\t var chromaFormatIdc = this.readUEG();\n\t if (chromaFormatIdc === 3) {\n\t this.skipBits(1); // separate_colour_plane_flag\n\t }\n\t this.skipUEG(); // bit_depth_luma_minus8\n\t this.skipUEG(); // bit_depth_chroma_minus8\n\t this.skipBits(1); // qpprime_y_zero_transform_bypass_flag\n\t if (this.readBoolean()) {\n\t // seq_scaling_matrix_present_flag\n\t scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n\t for (i = 0; i < scalingListCount; i++) {\n\t if (this.readBoolean()) {\n\t // seq_scaling_list_present_flag[ i ]\n\t if (i < 6) {\n\t this.skipScalingList(16);\n\t } else {\n\t this.skipScalingList(64);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t this.skipUEG(); // log2_max_frame_num_minus4\n\t var picOrderCntType = this.readUEG();\n\t if (picOrderCntType === 0) {\n\t this.readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n\t } else if (picOrderCntType === 1) {\n\t this.skipBits(1); // delta_pic_order_always_zero_flag\n\t this.skipEG(); // offset_for_non_ref_pic\n\t this.skipEG(); // offset_for_top_to_bottom_field\n\t numRefFramesInPicOrderCntCycle = this.readUEG();\n\t for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n\t this.skipEG(); // offset_for_ref_frame[ i ]\n\t }\n\t }\n\t this.skipUEG(); // max_num_ref_frames\n\t this.skipBits(1); // gaps_in_frame_num_value_allowed_flag\n\t picWidthInMbsMinus1 = this.readUEG();\n\t picHeightInMapUnitsMinus1 = this.readUEG();\n\t frameMbsOnlyFlag = this.readBits(1);\n\t if (frameMbsOnlyFlag === 0) {\n\t this.skipBits(1); // mb_adaptive_frame_field_flag\n\t }\n\t this.skipBits(1); // direct_8x8_inference_flag\n\t if (this.readBoolean()) {\n\t // frame_cropping_flag\n\t frameCropLeftOffset = this.readUEG();\n\t frameCropRightOffset = this.readUEG();\n\t frameCropTopOffset = this.readUEG();\n\t frameCropBottomOffset = this.readUEG();\n\t }\n\t if (this.readBoolean()) {\n\t // vui_parameters_present_flag\n\t if (this.readBoolean()) {\n\t // aspect_ratio_info_present_flag\n\t var sarRatio = void 0;\n\t var aspectRatioIdc = this.readUByte();\n\t switch (aspectRatioIdc) {\n\t case 1:\n\t sarRatio = [1, 1];break;\n\t case 2:\n\t sarRatio = [12, 11];break;\n\t case 3:\n\t sarRatio = [10, 11];break;\n\t case 4:\n\t sarRatio = [16, 11];break;\n\t case 5:\n\t sarRatio = [40, 33];break;\n\t case 6:\n\t sarRatio = [24, 11];break;\n\t case 7:\n\t sarRatio = [20, 11];break;\n\t case 8:\n\t sarRatio = [32, 11];break;\n\t case 9:\n\t sarRatio = [80, 33];break;\n\t case 10:\n\t sarRatio = [18, 11];break;\n\t case 11:\n\t sarRatio = [15, 11];break;\n\t case 12:\n\t sarRatio = [64, 33];break;\n\t case 13:\n\t sarRatio = [160, 99];break;\n\t case 14:\n\t sarRatio = [4, 3];break;\n\t case 15:\n\t sarRatio = [3, 2];break;\n\t case 16:\n\t sarRatio = [2, 1];break;\n\t case 255:\n\t {\n\t sarRatio = [this.readUByte() << 8 | this.readUByte(), this.readUByte() << 8 | this.readUByte()];\n\t break;\n\t }\n\t }\n\t if (sarRatio) {\n\t sarScale = sarRatio[0] / sarRatio[1];\n\t }\n\t }\n\t }\n\t return {\n\t width: Math.ceil(((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2) * sarScale),\n\t height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - (frameMbsOnlyFlag ? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset)\n\t };\n\t }\n\t }, {\n\t key: 'readSliceType',\n\t value: function readSliceType() {\n\t // skip NALu type\n\t this.readUByte();\n\t // discard first_mb_in_slice\n\t this.readUEG();\n\t // return slice_type\n\t return this.readUEG();\n\t }\n\t }]);\n\t\n\t return ExpGolomb;\n\t}();\n\t\n\texports.default = ExpGolomb;\n\t\n\t},{\"43\":43}],22:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * ID3 parser\n\t */\n\t\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t//import Hex from '../utils/hex';\n\t\n\tvar ID3 = function () {\n\t function ID3(data) {\n\t _classCallCheck(this, ID3);\n\t\n\t this._hasTimeStamp = false;\n\t var offset = 0,\n\t byte1,\n\t byte2,\n\t byte3,\n\t byte4,\n\t tagSize,\n\t endPos,\n\t header,\n\t len;\n\t do {\n\t header = this.readUTF(data, offset, 3);\n\t offset += 3;\n\t // first check for ID3 header\n\t if (header === 'ID3') {\n\t // skip 24 bits\n\t offset += 3;\n\t // retrieve tag(s) length\n\t byte1 = data[offset++] & 0x7f;\n\t byte2 = data[offset++] & 0x7f;\n\t byte3 = data[offset++] & 0x7f;\n\t byte4 = data[offset++] & 0x7f;\n\t tagSize = (byte1 << 21) + (byte2 << 14) + (byte3 << 7) + byte4;\n\t endPos = offset + tagSize;\n\t //logger.log(`ID3 tag found, size/end: ${tagSize}/${endPos}`);\n\t\n\t // read ID3 tags\n\t this._parseID3Frames(data, offset, endPos);\n\t offset = endPos;\n\t } else if (header === '3DI') {\n\t // http://id3.org/id3v2.4.0-structure chapter 3.4. ID3v2 footer\n\t offset += 7;\n\t _logger.logger.log('3DI footer found, end: ' + offset);\n\t } else {\n\t offset -= 3;\n\t len = offset;\n\t if (len) {\n\t //logger.log(`ID3 len: ${len}`);\n\t if (!this.hasTimeStamp) {\n\t _logger.logger.warn('ID3 tag found, but no timestamp');\n\t }\n\t this._length = len;\n\t this._payload = data.subarray(0, len);\n\t }\n\t return;\n\t }\n\t } while (true);\n\t }\n\t\n\t _createClass(ID3, [{\n\t key: 'readUTF',\n\t value: function readUTF(data, start, len) {\n\t\n\t var result = '',\n\t offset = start,\n\t end = start + len;\n\t do {\n\t result += String.fromCharCode(data[offset++]);\n\t } while (offset < end);\n\t return result;\n\t }\n\t }, {\n\t key: '_parseID3Frames',\n\t value: function _parseID3Frames(data, offset, endPos) {\n\t var tagId, tagLen, tagStart, tagFlags, timestamp;\n\t while (offset + 8 <= endPos) {\n\t tagId = this.readUTF(data, offset, 4);\n\t offset += 4;\n\t\n\t tagLen = data[offset++] << 24 + data[offset++] << 16 + data[offset++] << 8 + data[offset++];\n\t\n\t tagFlags = data[offset++] << 8 + data[offset++];\n\t\n\t tagStart = offset;\n\t //logger.log(\"ID3 tag id:\" + tagId);\n\t switch (tagId) {\n\t case 'PRIV':\n\t //logger.log('parse frame:' + Hex.hexDump(data.subarray(offset,endPos)));\n\t // owner should be \"com.apple.streaming.transportStreamTimestamp\"\n\t if (this.readUTF(data, offset, 44) === 'com.apple.streaming.transportStreamTimestamp') {\n\t offset += 44;\n\t // smelling even better ! we found the right descriptor\n\t // skip null character (string end) + 3 first bytes\n\t offset += 4;\n\t\n\t // timestamp is 33 bit expressed as a big-endian eight-octet number, with the upper 31 bits set to zero.\n\t var pts33Bit = data[offset++] & 0x1;\n\t this._hasTimeStamp = true;\n\t\n\t timestamp = ((data[offset++] << 23) + (data[offset++] << 15) + (data[offset++] << 7) + data[offset++]) / 45;\n\t\n\t if (pts33Bit) {\n\t timestamp += 47721858.84; // 2^32 / 90\n\t }\n\t timestamp = Math.round(timestamp);\n\t _logger.logger.trace('ID3 timestamp found: ' + timestamp);\n\t this._timeStamp = timestamp;\n\t }\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'hasTimeStamp',\n\t get: function get() {\n\t return this._hasTimeStamp;\n\t }\n\t }, {\n\t key: 'timeStamp',\n\t get: function get() {\n\t return this._timeStamp;\n\t }\n\t }, {\n\t key: 'length',\n\t get: function get() {\n\t return this._length;\n\t }\n\t }, {\n\t key: 'payload',\n\t get: function get() {\n\t return this._payload;\n\t }\n\t }]);\n\t\n\t return ID3;\n\t}();\n\t\n\texports.default = ID3;\n\t\n\t},{\"43\":43}],23:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * highly optimized TS demuxer:\n\t * parse PAT, PMT\n\t * extract PES packet from audio and video PIDs\n\t * extract AVC/H264 NAL units and AAC/ADTS samples from PES packet\n\t * trigger the remuxer upon parsing completion\n\t * it also tries to workaround as best as it can audio codec switch (HE-AAC to AAC and vice versa), without having to restart the MediaSource.\n\t * it also controls the remuxing process :\n\t * upon discontinuity or level switch detection, it will also notifies the remuxer so that it can reset its state.\n\t */\n\t\n\t// import Hex from '../utils/hex';\n\t\n\t\n\tvar _adts = _dereq_(17);\n\t\n\tvar _adts2 = _interopRequireDefault(_adts);\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _expGolomb = _dereq_(21);\n\t\n\tvar _expGolomb2 = _interopRequireDefault(_expGolomb);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar TSDemuxer = function () {\n\t function TSDemuxer(observer, id, remuxerClass, config) {\n\t _classCallCheck(this, TSDemuxer);\n\t\n\t this.observer = observer;\n\t this.id = id;\n\t this.remuxerClass = remuxerClass;\n\t this.config = config;\n\t this.lastCC = 0;\n\t this.remuxer = new this.remuxerClass(observer, id, config);\n\t }\n\t\n\t _createClass(TSDemuxer, [{\n\t key: 'switchLevel',\n\t value: function switchLevel() {\n\t this.pmtParsed = false;\n\t this._pmtId = -1;\n\t this._avcTrack = { container: 'video/mp2t', type: 'video', id: -1, sequenceNumber: 0, samples: [], len: 0, dropped: 0 };\n\t this._aacTrack = { container: 'video/mp2t', type: 'audio', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n\t this._id3Track = { type: 'id3', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n\t this._txtTrack = { type: 'text', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n\t // flush any partial content\n\t this.aacOverFlow = null;\n\t this.aacLastPTS = null;\n\t this.avcSample = null;\n\t this.remuxer.switchLevel();\n\t }\n\t }, {\n\t key: 'insertDiscontinuity',\n\t value: function insertDiscontinuity() {\n\t this.switchLevel();\n\t this.remuxer.insertDiscontinuity();\n\t }\n\t\n\t // feed incoming data to the front of the parsing pipeline\n\t\n\t }, {\n\t key: 'push',\n\t value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset) {\n\t var start,\n\t len = data.length,\n\t stt,\n\t pid,\n\t atf,\n\t offset,\n\t pes,\n\t codecsOnly = this.remuxer.passthrough,\n\t unknownPIDs = false;\n\t\n\t this.audioCodec = audioCodec;\n\t this.videoCodec = videoCodec;\n\t this._duration = duration;\n\t this.contiguous = false;\n\t this.accurateTimeOffset = accurateTimeOffset;\n\t if (cc !== this.lastCC) {\n\t _logger.logger.log('discontinuity detected');\n\t this.insertDiscontinuity();\n\t this.lastCC = cc;\n\t }\n\t if (level !== this.lastLevel) {\n\t _logger.logger.log('level switch detected');\n\t this.switchLevel();\n\t this.lastLevel = level;\n\t } else if (sn === this.lastSN + 1) {\n\t this.contiguous = true;\n\t }\n\t this.lastSN = sn;\n\t\n\t var pmtParsed = this.pmtParsed,\n\t avcTrack = this._avcTrack,\n\t aacTrack = this._aacTrack,\n\t id3Track = this._id3Track,\n\t avcId = avcTrack.id,\n\t aacId = aacTrack.id,\n\t id3Id = id3Track.id,\n\t pmtId = this._pmtId,\n\t avcData = avcTrack.pesData,\n\t aacData = aacTrack.pesData,\n\t id3Data = id3Track.pesData,\n\t parsePAT = this._parsePAT,\n\t parsePMT = this._parsePMT,\n\t parsePES = this._parsePES,\n\t parseAVCPES = this._parseAVCPES.bind(this),\n\t parseAACPES = this._parseAACPES.bind(this),\n\t parseID3PES = this._parseID3PES.bind(this);\n\t\n\t // don't parse last TS packet if incomplete\n\t len -= len % 188;\n\t // loop through TS packets\n\t for (start = 0; start < len; start += 188) {\n\t if (data[start] === 0x47) {\n\t stt = !!(data[start + 1] & 0x40);\n\t // pid is a 13-bit field starting at the last bit of TS[1]\n\t pid = ((data[start + 1] & 0x1f) << 8) + data[start + 2];\n\t atf = (data[start + 3] & 0x30) >> 4;\n\t // if an adaption field is present, its length is specified by the fifth byte of the TS packet header.\n\t if (atf > 1) {\n\t offset = start + 5 + data[start + 4];\n\t // continue if there is only adaptation field\n\t if (offset === start + 188) {\n\t continue;\n\t }\n\t } else {\n\t offset = start + 4;\n\t }\n\t switch (pid) {\n\t case avcId:\n\t if (stt) {\n\t if (avcData && (pes = parsePES(avcData))) {\n\t parseAVCPES(pes, false);\n\t if (codecsOnly) {\n\t // if we have video codec info AND\n\t // if audio PID is undefined OR if we have audio codec info,\n\t // we have all codec info !\n\t if (avcTrack.codec && (aacId === -1 || aacTrack.codec)) {\n\t this.remux(level, sn, data, timeOffset);\n\t return;\n\t }\n\t }\n\t }\n\t avcData = { data: [], size: 0 };\n\t }\n\t if (avcData) {\n\t avcData.data.push(data.subarray(offset, start + 188));\n\t avcData.size += start + 188 - offset;\n\t }\n\t break;\n\t case aacId:\n\t if (stt) {\n\t if (aacData && (pes = parsePES(aacData))) {\n\t parseAACPES(pes);\n\t if (codecsOnly) {\n\t // here we now that we have audio codec info\n\t // if video PID is undefined OR if we have video codec info,\n\t // we have all codec infos !\n\t if (aacTrack.codec && (avcId === -1 || avcTrack.codec)) {\n\t this.remux(level, sn, data, timeOffset);\n\t return;\n\t }\n\t }\n\t }\n\t aacData = { data: [], size: 0 };\n\t }\n\t if (aacData) {\n\t aacData.data.push(data.subarray(offset, start + 188));\n\t aacData.size += start + 188 - offset;\n\t }\n\t break;\n\t case id3Id:\n\t if (stt) {\n\t if (id3Data && (pes = parsePES(id3Data))) {\n\t parseID3PES(pes);\n\t }\n\t id3Data = { data: [], size: 0 };\n\t }\n\t if (id3Data) {\n\t id3Data.data.push(data.subarray(offset, start + 188));\n\t id3Data.size += start + 188 - offset;\n\t }\n\t break;\n\t case 0:\n\t if (stt) {\n\t offset += data[offset] + 1;\n\t }\n\t pmtId = this._pmtId = parsePAT(data, offset);\n\t break;\n\t case pmtId:\n\t if (stt) {\n\t offset += data[offset] + 1;\n\t }\n\t var parsedPIDs = parsePMT(data, offset);\n\t avcId = avcTrack.id = parsedPIDs.avc;\n\t aacId = aacTrack.id = parsedPIDs.aac;\n\t id3Id = id3Track.id = parsedPIDs.id3;\n\t if (unknownPIDs && !pmtParsed) {\n\t _logger.logger.log('reparse from beginning');\n\t unknownPIDs = false;\n\t // we set it to -188, the += 188 in the for loop will reset start to 0\n\t start = -188;\n\t }\n\t pmtParsed = this.pmtParsed = true;\n\t break;\n\t case 17:\n\t case 0x1fff:\n\t break;\n\t default:\n\t unknownPIDs = true;\n\t break;\n\t }\n\t } else {\n\t this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'TS packet did not start with 0x47' });\n\t }\n\t }\n\t // try to parse last PES packets\n\t if (avcData && (pes = parsePES(avcData))) {\n\t parseAVCPES(pes, true);\n\t avcTrack.pesData = null;\n\t } else {\n\t // either avcData null or PES truncated, keep it for next frag parsing\n\t avcTrack.pesData = avcData;\n\t }\n\t\n\t if (aacData && (pes = parsePES(aacData))) {\n\t parseAACPES(pes);\n\t aacTrack.pesData = null;\n\t } else {\n\t if (aacData && aacData.size) {\n\t _logger.logger.log('last AAC PES packet truncated,might overlap between fragments');\n\t }\n\t // either aacData null or PES truncated, keep it for next frag parsing\n\t aacTrack.pesData = aacData;\n\t }\n\t\n\t if (id3Data && (pes = parsePES(id3Data))) {\n\t parseID3PES(pes);\n\t id3Track.pesData = null;\n\t } else {\n\t // either id3Data null or PES truncated, keep it for next frag parsing\n\t id3Track.pesData = id3Data;\n\t }\n\t this.remux(level, sn, null, timeOffset);\n\t }\n\t }, {\n\t key: 'remux',\n\t value: function remux(level, sn, data, timeOffset) {\n\t var avcTrack = this._avcTrack,\n\t samples = avcTrack.samples;\n\t\n\t // compute total/avc sample length and nb of NAL units\n\t var trackData = samples.reduce(function (prevSampleData, curSample) {\n\t var sampleData = curSample.units.units.reduce(function (prevUnitData, curUnit) {\n\t return {\n\t len: prevUnitData.len + curUnit.data.length,\n\t nbNalu: prevUnitData.nbNalu + 1\n\t };\n\t }, { len: 0, nbNalu: 0 });\n\t curSample.length = sampleData.len;\n\t return {\n\t len: prevSampleData.len + sampleData.len,\n\t nbNalu: prevSampleData.nbNalu + sampleData.nbNalu\n\t };\n\t }, { len: 0, nbNalu: 0 });\n\t avcTrack.len = trackData.len;\n\t avcTrack.nbNalu = trackData.nbNalu;\n\t this.remuxer.remux(level, sn, this._aacTrack, this._avcTrack, this._id3Track, this._txtTrack, timeOffset, this.contiguous, this.accurateTimeOffset, data);\n\t }\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t this.switchLevel();\n\t this._initPTS = this._initDTS = undefined;\n\t this._duration = 0;\n\t }\n\t }, {\n\t key: '_parsePAT',\n\t value: function _parsePAT(data, offset) {\n\t // skip the PSI header and parse the first PMT entry\n\t return (data[offset + 10] & 0x1F) << 8 | data[offset + 11];\n\t //logger.log('PMT PID:' + this._pmtId);\n\t }\n\t }, {\n\t key: '_parsePMT',\n\t value: function _parsePMT(data, offset) {\n\t var sectionLength,\n\t tableEnd,\n\t programInfoLength,\n\t pid,\n\t result = { aac: -1, avc: -1, id3: -1 };\n\t sectionLength = (data[offset + 1] & 0x0f) << 8 | data[offset + 2];\n\t tableEnd = offset + 3 + sectionLength - 4;\n\t // to determine where the table is, we have to figure out how\n\t // long the program info descriptors are\n\t programInfoLength = (data[offset + 10] & 0x0f) << 8 | data[offset + 11];\n\t // advance the offset to the first entry in the mapping table\n\t offset += 12 + programInfoLength;\n\t while (offset < tableEnd) {\n\t pid = (data[offset + 1] & 0x1F) << 8 | data[offset + 2];\n\t switch (data[offset]) {\n\t // ISO/IEC 13818-7 ADTS AAC (MPEG-2 lower bit-rate audio)\n\t case 0x0f:\n\t //logger.log('AAC PID:' + pid);\n\t if (result.aac === -1) {\n\t result.aac = pid;\n\t }\n\t break;\n\t // Packetized metadata (ID3)\n\t case 0x15:\n\t //logger.log('ID3 PID:' + pid);\n\t if (result.id3 === -1) {\n\t result.id3 = pid;\n\t }\n\t break;\n\t // ITU-T Rec. H.264 and ISO/IEC 14496-10 (lower bit-rate video)\n\t case 0x1b:\n\t //logger.log('AVC PID:' + pid);\n\t if (result.avc === -1) {\n\t result.avc = pid;\n\t }\n\t break;\n\t case 0x24:\n\t _logger.logger.warn('HEVC stream type found, not supported for now');\n\t break;\n\t default:\n\t _logger.logger.log('unkown stream type:' + data[offset]);\n\t break;\n\t }\n\t // move to the next table entry\n\t // skip past the elementary stream descriptors, if present\n\t offset += ((data[offset + 3] & 0x0F) << 8 | data[offset + 4]) + 5;\n\t }\n\t return result;\n\t }\n\t }, {\n\t key: '_parsePES',\n\t value: function _parsePES(stream) {\n\t var i = 0,\n\t frag,\n\t pesFlags,\n\t pesPrefix,\n\t pesLen,\n\t pesHdrLen,\n\t pesData,\n\t pesPts,\n\t pesDts,\n\t payloadStartOffset,\n\t data = stream.data;\n\t // safety check\n\t if (!stream || stream.size === 0) {\n\t return null;\n\t }\n\t\n\t // we might need up to 19 bytes to read PES header\n\t // if first chunk of data is less than 19 bytes, let's merge it with following ones until we get 19 bytes\n\t // usually only one merge is needed (and this is rare ...)\n\t while (data[0].length < 19 && data.length > 1) {\n\t var newData = new Uint8Array(data[0].length + data[1].length);\n\t newData.set(data[0]);\n\t newData.set(data[1], data[0].length);\n\t data[0] = newData;\n\t data.splice(1, 1);\n\t }\n\t //retrieve PTS/DTS from first fragment\n\t frag = data[0];\n\t pesPrefix = (frag[0] << 16) + (frag[1] << 8) + frag[2];\n\t if (pesPrefix === 1) {\n\t pesLen = (frag[4] << 8) + frag[5];\n\t // if PES len is not zero and not matching with total len, stop parsing. PES might be truncated\n\t // minus 6 : PES header size\n\t if (pesLen && pesLen !== stream.size - 6) {\n\t return null;\n\t }\n\t pesFlags = frag[7];\n\t if (pesFlags & 0xC0) {\n\t /* PES header described here : http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n\t as PTS / DTS is 33 bit we cannot use bitwise operator in JS,\n\t as Bitwise operators treat their operands as a sequence of 32 bits */\n\t pesPts = (frag[9] & 0x0E) * 536870912 + // 1 << 29\n\t (frag[10] & 0xFF) * 4194304 + // 1 << 22\n\t (frag[11] & 0xFE) * 16384 + // 1 << 14\n\t (frag[12] & 0xFF) * 128 + // 1 << 7\n\t (frag[13] & 0xFE) / 2;\n\t // check if greater than 2^32 -1\n\t if (pesPts > 4294967295) {\n\t // decrement 2^33\n\t pesPts -= 8589934592;\n\t }\n\t if (pesFlags & 0x40) {\n\t pesDts = (frag[14] & 0x0E) * 536870912 + // 1 << 29\n\t (frag[15] & 0xFF) * 4194304 + // 1 << 22\n\t (frag[16] & 0xFE) * 16384 + // 1 << 14\n\t (frag[17] & 0xFF) * 128 + // 1 << 7\n\t (frag[18] & 0xFE) / 2;\n\t // check if greater than 2^32 -1\n\t if (pesDts > 4294967295) {\n\t // decrement 2^33\n\t pesDts -= 8589934592;\n\t }\n\t } else {\n\t pesDts = pesPts;\n\t }\n\t }\n\t pesHdrLen = frag[8];\n\t // 9 bytes : 6 bytes for PES header + 3 bytes for PES extension\n\t payloadStartOffset = pesHdrLen + 9;\n\t\n\t stream.size -= payloadStartOffset;\n\t //reassemble PES packet\n\t pesData = new Uint8Array(stream.size);\n\t while (data.length) {\n\t frag = data.shift();\n\t var len = frag.byteLength;\n\t if (payloadStartOffset) {\n\t if (payloadStartOffset > len) {\n\t // trim full frag if PES header bigger than frag\n\t payloadStartOffset -= len;\n\t continue;\n\t } else {\n\t // trim partial frag if PES header smaller than frag\n\t frag = frag.subarray(payloadStartOffset);\n\t len -= payloadStartOffset;\n\t payloadStartOffset = 0;\n\t }\n\t }\n\t pesData.set(frag, i);\n\t i += len;\n\t }\n\t if (pesLen) {\n\t // payload size : remove PES header + PES extension\n\t pesLen -= pesHdrLen + 3;\n\t }\n\t return { data: pesData, pts: pesPts, dts: pesDts, len: pesLen };\n\t } else {\n\t return null;\n\t }\n\t }\n\t }, {\n\t key: 'pushAccesUnit',\n\t value: function pushAccesUnit(avcSample, avcTrack) {\n\t if (avcSample.units.units.length) {\n\t // only push AVC sample if starting with a keyframe is not mandatory OR\n\t // if keyframe already found in this fragment OR\n\t // keyframe found in last fragment (track.sps) AND\n\t // samples already appended (we already found a keyframe in this fragment) OR fragment is contiguous\n\t if (!this.config.forceKeyFrameOnDiscontinuity || avcSample.key === true || avcTrack.sps && (avcTrack.samples.length || this.contiguous)) {\n\t avcTrack.samples.push(avcSample);\n\t } else {\n\t // dropped samples, track it\n\t avcTrack.dropped++;\n\t }\n\t }\n\t if (avcSample.debug.length) {\n\t _logger.logger.log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug + ',' + avcSample.units.length);\n\t }\n\t }\n\t }, {\n\t key: '_parseAVCPES',\n\t value: function _parseAVCPES(pes, last) {\n\t var _this = this;\n\t\n\t //logger.log('parse new PES');\n\t var track = this._avcTrack,\n\t units = this._parseAVCNALu(pes.data),\n\t debug = false,\n\t expGolombDecoder,\n\t avcSample = this.avcSample,\n\t push,\n\t i;\n\t //free pes.data to save up some memory\n\t pes.data = null;\n\t\n\t units.forEach(function (unit) {\n\t switch (unit.type) {\n\t //NDR\n\t case 1:\n\t push = true;\n\t if (debug && avcSample) {\n\t avcSample.debug += 'NDR ';\n\t }\n\t break;\n\t //IDR\n\t case 5:\n\t push = true;\n\t // handle PES not starting with AUD\n\t if (!avcSample) {\n\t avcSample = _this.avcSample = _this._createAVCSample(true, pes.pts, pes.dts, '');\n\t }\n\t if (debug) {\n\t avcSample.debug += 'IDR ';\n\t }\n\t avcSample.key = true;\n\t break;\n\t //SEI\n\t case 6:\n\t push = true;\n\t if (debug && avcSample) {\n\t avcSample.debug += 'SEI ';\n\t }\n\t expGolombDecoder = new _expGolomb2.default(_this.discardEPB(unit.data));\n\t\n\t // skip frameType\n\t expGolombDecoder.readUByte();\n\t\n\t var payloadType = 0;\n\t var payloadSize = 0;\n\t var endOfCaptions = false;\n\t var b = 0;\n\t\n\t while (!endOfCaptions && expGolombDecoder.bytesAvailable > 1) {\n\t payloadType = 0;\n\t do {\n\t b = expGolombDecoder.readUByte();\n\t payloadType += b;\n\t } while (b === 0xFF);\n\t\n\t // Parse payload size.\n\t payloadSize = 0;\n\t do {\n\t b = expGolombDecoder.readUByte();\n\t payloadSize += b;\n\t } while (b === 0xFF);\n\t\n\t // TODO: there can be more than one payload in an SEI packet...\n\t // TODO: need to read type and size in a while loop to get them all\n\t if (payloadType === 4 && expGolombDecoder.bytesAvailable !== 0) {\n\t\n\t endOfCaptions = true;\n\t\n\t var countryCode = expGolombDecoder.readUByte();\n\t\n\t if (countryCode === 181) {\n\t var providerCode = expGolombDecoder.readUShort();\n\t\n\t if (providerCode === 49) {\n\t var userStructure = expGolombDecoder.readUInt();\n\t\n\t if (userStructure === 0x47413934) {\n\t var userDataType = expGolombDecoder.readUByte();\n\t\n\t // Raw CEA-608 bytes wrapped in CEA-708 packet\n\t if (userDataType === 3) {\n\t var firstByte = expGolombDecoder.readUByte();\n\t var secondByte = expGolombDecoder.readUByte();\n\t\n\t var totalCCs = 31 & firstByte;\n\t var byteArray = [firstByte, secondByte];\n\t\n\t for (i = 0; i < totalCCs; i++) {\n\t // 3 bytes per CC\n\t byteArray.push(expGolombDecoder.readUByte());\n\t byteArray.push(expGolombDecoder.readUByte());\n\t byteArray.push(expGolombDecoder.readUByte());\n\t }\n\t\n\t _this._insertSampleInOrder(_this._txtTrack.samples, { type: 3, pts: pes.pts, bytes: byteArray });\n\t }\n\t }\n\t }\n\t }\n\t } else if (payloadSize < expGolombDecoder.bytesAvailable) {\n\t for (i = 0; i < payloadSize; i++) {\n\t expGolombDecoder.readUByte();\n\t }\n\t }\n\t }\n\t break;\n\t //SPS\n\t case 7:\n\t push = true;\n\t if (debug && avcSample) {\n\t avcSample.debug += 'SPS ';\n\t }\n\t if (!track.sps) {\n\t expGolombDecoder = new _expGolomb2.default(unit.data);\n\t var config = expGolombDecoder.readSPS();\n\t track.width = config.width;\n\t track.height = config.height;\n\t track.sps = [unit.data];\n\t track.duration = _this._duration;\n\t var codecarray = unit.data.subarray(1, 4);\n\t var codecstring = 'avc1.';\n\t for (i = 0; i < 3; i++) {\n\t var h = codecarray[i].toString(16);\n\t if (h.length < 2) {\n\t h = '0' + h;\n\t }\n\t codecstring += h;\n\t }\n\t track.codec = codecstring;\n\t }\n\t break;\n\t //PPS\n\t case 8:\n\t push = true;\n\t if (debug && avcSample) {\n\t avcSample.debug += 'PPS ';\n\t }\n\t if (!track.pps) {\n\t track.pps = [unit.data];\n\t }\n\t break;\n\t // AUD\n\t case 9:\n\t push = false;\n\t if (avcSample) {\n\t _this.pushAccesUnit(avcSample, track);\n\t }\n\t avcSample = _this.avcSample = _this._createAVCSample(false, pes.pts, pes.dts, debug ? 'AUD ' : '');\n\t break;\n\t // Filler Data\n\t case 12:\n\t push = false;\n\t break;\n\t default:\n\t push = false;\n\t if (avcSample) {\n\t avcSample.debug += 'unknown NAL ' + unit.type + ' ';\n\t }\n\t break;\n\t }\n\t if (avcSample && push) {\n\t var _units = avcSample.units;\n\t _units.units.push(unit);\n\t }\n\t });\n\t // if last PES packet, push samples\n\t if (last && avcSample) {\n\t this.pushAccesUnit(avcSample, track);\n\t this.avcSample = null;\n\t }\n\t }\n\t }, {\n\t key: '_createAVCSample',\n\t value: function _createAVCSample(key, pts, dts, debug) {\n\t return { key: key, pts: pts, dts: dts, units: { units: [], length: 0 }, debug: debug };\n\t }\n\t }, {\n\t key: '_insertSampleInOrder',\n\t value: function _insertSampleInOrder(arr, data) {\n\t var len = arr.length;\n\t if (len > 0) {\n\t if (data.pts >= arr[len - 1].pts) {\n\t arr.push(data);\n\t } else {\n\t for (var pos = len - 1; pos >= 0; pos--) {\n\t if (data.pts < arr[pos].pts) {\n\t arr.splice(pos, 0, data);\n\t break;\n\t }\n\t }\n\t }\n\t } else {\n\t arr.push(data);\n\t }\n\t }\n\t }, {\n\t key: '_getLastNalUnit',\n\t value: function _getLastNalUnit() {\n\t var avcSample = this.avcSample,\n\t lastUnit = void 0;\n\t // try to fallback to previous sample if current one is empty\n\t if (!avcSample || avcSample.units.units.length === 0) {\n\t var track = this._avcTrack,\n\t samples = track.samples;\n\t avcSample = samples[samples.length - 1];\n\t }\n\t if (avcSample) {\n\t var units = avcSample.units.units;\n\t lastUnit = units[units.length - 1];\n\t }\n\t return lastUnit;\n\t }\n\t }, {\n\t key: '_parseAVCNALu',\n\t value: function _parseAVCNALu(array) {\n\t var i = 0,\n\t len = array.byteLength,\n\t value,\n\t overflow,\n\t track = this._avcTrack,\n\t state = track.naluState || 0,\n\t lastState = state;\n\t var units = [],\n\t unit,\n\t unitType,\n\t lastUnitStart = -1,\n\t lastUnitType;\n\t //logger.log('PES:' + Hex.hexDump(array));\n\t while (i < len) {\n\t value = array[i++];\n\t // finding 3 or 4-byte start codes (00 00 01 OR 00 00 00 01)\n\t switch (state) {\n\t case 0:\n\t if (value === 0) {\n\t state = 1;\n\t }\n\t break;\n\t case 1:\n\t if (value === 0) {\n\t state = 2;\n\t } else {\n\t state = 0;\n\t }\n\t break;\n\t case 2:\n\t case 3:\n\t if (value === 0) {\n\t state = 3;\n\t } else if (value === 1) {\n\t if (lastUnitStart >= 0) {\n\t unit = { data: array.subarray(lastUnitStart, i - state - 1), type: lastUnitType };\n\t //logger.log('pushing NALU, type/size:' + unit.type + '/' + unit.data.byteLength);\n\t units.push(unit);\n\t } else {\n\t // lastUnitStart is undefined => this is the first start code found in this PES packet\n\t // first check if start code delimiter is overlapping between 2 PES packets,\n\t // ie it started in last packet (lastState not zero)\n\t // and ended at the beginning of this PES packet (i <= 4 - lastState)\n\t var lastUnit = this._getLastNalUnit();\n\t if (lastUnit) {\n\t if (lastState && i <= 4 - lastState) {\n\t // start delimiter overlapping between PES packets\n\t // strip start delimiter bytes from the end of last NAL unit\n\t // check if lastUnit had a state different from zero\n\t if (lastUnit.state) {\n\t // strip last bytes\n\t lastUnit.data = lastUnit.data.subarray(0, lastUnit.data.byteLength - lastState);\n\t }\n\t }\n\t // If NAL units are not starting right at the beginning of the PES packet, push preceding data into previous NAL unit.\n\t overflow = i - state - 1;\n\t if (overflow > 0) {\n\t //logger.log('first NALU found with overflow:' + overflow);\n\t var tmp = new Uint8Array(lastUnit.data.byteLength + overflow);\n\t tmp.set(lastUnit.data, 0);\n\t tmp.set(array.subarray(0, overflow), lastUnit.data.byteLength);\n\t lastUnit.data = tmp;\n\t }\n\t }\n\t }\n\t // check if we can read unit type\n\t if (i < len) {\n\t unitType = array[i] & 0x1f;\n\t //logger.log('find NALU @ offset:' + i + ',type:' + unitType);\n\t lastUnitStart = i;\n\t lastUnitType = unitType;\n\t state = 0;\n\t } else {\n\t // not enough byte to read unit type. let's read it on next PES parsing\n\t state = -1;\n\t }\n\t } else {\n\t state = 0;\n\t }\n\t break;\n\t case -1:\n\t // special use case where we found 3 or 4-byte start codes exactly at the end of previous PES packet\n\t lastUnitStart = 0;\n\t // NALu type is value read from offset 0\n\t lastUnitType = value & 0x1f;\n\t state = 0;\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t if (lastUnitStart >= 0 && state >= 0) {\n\t unit = { data: array.subarray(lastUnitStart, len), type: lastUnitType, state: state };\n\t units.push(unit);\n\t //logger.log('pushing NALU, type/size/state:' + unit.type + '/' + unit.data.byteLength + '/' + state);\n\t }\n\t // no NALu found\n\t if (units.length === 0) {\n\t // append pes.data to previous NAL unit\n\t var _lastUnit = this._getLastNalUnit();\n\t if (_lastUnit) {\n\t var _tmp = new Uint8Array(_lastUnit.data.byteLength + array.byteLength);\n\t _tmp.set(_lastUnit.data, 0);\n\t _tmp.set(array, _lastUnit.data.byteLength);\n\t _lastUnit.data = _tmp;\n\t }\n\t }\n\t track.naluState = state;\n\t return units;\n\t }\n\t\n\t /**\n\t * remove Emulation Prevention bytes from a RBSP\n\t */\n\t\n\t }, {\n\t key: 'discardEPB',\n\t value: function discardEPB(data) {\n\t var length = data.byteLength,\n\t EPBPositions = [],\n\t i = 1,\n\t newLength,\n\t newData;\n\t\n\t // Find all `Emulation Prevention Bytes`\n\t while (i < length - 2) {\n\t if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n\t EPBPositions.push(i + 2);\n\t i += 2;\n\t } else {\n\t i++;\n\t }\n\t }\n\t\n\t // If no Emulation Prevention Bytes were found just return the original\n\t // array\n\t if (EPBPositions.length === 0) {\n\t return data;\n\t }\n\t\n\t // Create a new array to hold the NAL unit data\n\t newLength = length - EPBPositions.length;\n\t newData = new Uint8Array(newLength);\n\t var sourceIndex = 0;\n\t\n\t for (i = 0; i < newLength; sourceIndex++, i++) {\n\t if (sourceIndex === EPBPositions[0]) {\n\t // Skip this byte\n\t sourceIndex++;\n\t // Remove this position index\n\t EPBPositions.shift();\n\t }\n\t newData[i] = data[sourceIndex];\n\t }\n\t return newData;\n\t }\n\t }, {\n\t key: '_parseAACPES',\n\t value: function _parseAACPES(pes) {\n\t var track = this._aacTrack,\n\t data = pes.data,\n\t pts = pes.pts,\n\t startOffset = 0,\n\t aacOverFlow = this.aacOverFlow,\n\t aacLastPTS = this.aacLastPTS,\n\t config,\n\t frameLength,\n\t frameDuration,\n\t frameIndex,\n\t offset,\n\t headerLength,\n\t stamp,\n\t len,\n\t aacSample;\n\t if (aacOverFlow) {\n\t var tmp = new Uint8Array(aacOverFlow.byteLength + data.byteLength);\n\t tmp.set(aacOverFlow, 0);\n\t tmp.set(data, aacOverFlow.byteLength);\n\t //logger.log(`AAC: append overflowing ${aacOverFlow.byteLength} bytes to beginning of new PES`);\n\t data = tmp;\n\t }\n\t // look for ADTS header (0xFFFx)\n\t for (offset = startOffset, len = data.length; offset < len - 1; offset++) {\n\t if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n\t break;\n\t }\n\t }\n\t // if ADTS header does not start straight from the beginning of the PES payload, raise an error\n\t if (offset) {\n\t var reason, fatal;\n\t if (offset < len - 1) {\n\t reason = 'AAC PES did not start with ADTS header,offset:' + offset;\n\t fatal = false;\n\t } else {\n\t reason = 'no ADTS header found in AAC PES';\n\t fatal = true;\n\t }\n\t _logger.logger.warn('parsing error:' + reason);\n\t this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason });\n\t if (fatal) {\n\t return;\n\t }\n\t }\n\t if (!track.audiosamplerate) {\n\t config = _adts2.default.getAudioConfig(this.observer, data, offset, this.audioCodec);\n\t track.config = config.config;\n\t track.audiosamplerate = config.samplerate;\n\t track.channelCount = config.channelCount;\n\t track.codec = config.codec;\n\t track.duration = this._duration;\n\t _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n\t }\n\t frameIndex = 0;\n\t frameDuration = 1024 * 90000 / track.audiosamplerate;\n\t\n\t // if last AAC frame is overflowing, we should ensure timestamps are contiguous:\n\t // first sample PTS should be equal to last sample PTS + frameDuration\n\t if (aacOverFlow && aacLastPTS) {\n\t var newPTS = aacLastPTS + frameDuration;\n\t if (Math.abs(newPTS - pts) > 1) {\n\t _logger.logger.log('AAC: align PTS for overlapping frames by ' + Math.round((newPTS - pts) / 90));\n\t pts = newPTS;\n\t }\n\t }\n\t\n\t while (offset + 5 < len) {\n\t // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n\t headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;\n\t // retrieve frame size\n\t frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n\t frameLength -= headerLength;\n\t //stamp = pes.pts;\n\t\n\t if (frameLength > 0 && offset + headerLength + frameLength <= len) {\n\t stamp = pts + frameIndex * frameDuration;\n\t //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n\t aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n\t track.samples.push(aacSample);\n\t track.len += frameLength;\n\t offset += frameLength + headerLength;\n\t frameIndex++;\n\t // look for ADTS header (0xFFFx)\n\t for (; offset < len - 1; offset++) {\n\t if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n\t break;\n\t }\n\t }\n\t } else {\n\t break;\n\t }\n\t }\n\t if (offset < len) {\n\t aacOverFlow = data.subarray(offset, len);\n\t //logger.log(`AAC: overflow detected:${len-offset}`);\n\t } else {\n\t aacOverFlow = null;\n\t }\n\t this.aacOverFlow = aacOverFlow;\n\t this.aacLastPTS = stamp;\n\t }\n\t }, {\n\t key: '_parseID3PES',\n\t value: function _parseID3PES(pes) {\n\t this._id3Track.samples.push(pes);\n\t }\n\t }], [{\n\t key: 'probe',\n\t value: function probe(data) {\n\t // a TS fragment should contain at least 3 TS packets, a PAT, a PMT, and one PID, each starting with 0x47\n\t if (data.length >= 3 * 188 && data[0] === 0x47 && data[188] === 0x47 && data[2 * 188] === 0x47) {\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t }\n\t }]);\n\t\n\t return TSDemuxer;\n\t}();\n\t\n\texports.default = TSDemuxer;\n\t\n\t},{\"17\":17,\"21\":21,\"24\":24,\"26\":26,\"43\":43}],24:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar ErrorTypes = exports.ErrorTypes = {\n\t // Identifier for a network error (loading error / timeout ...)\n\t NETWORK_ERROR: 'networkError',\n\t // Identifier for a media Error (video/parsing/mediasource error)\n\t MEDIA_ERROR: 'mediaError',\n\t // Identifier for all other errors\n\t OTHER_ERROR: 'otherError'\n\t};\n\t\n\tvar ErrorDetails = exports.ErrorDetails = {\n\t // Identifier for a manifest load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n\t MANIFEST_LOAD_ERROR: 'manifestLoadError',\n\t // Identifier for a manifest load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n\t MANIFEST_LOAD_TIMEOUT: 'manifestLoadTimeOut',\n\t // Identifier for a manifest parsing error - data: { url : faulty URL, reason : error reason}\n\t MANIFEST_PARSING_ERROR: 'manifestParsingError',\n\t // Identifier for a manifest with only incompatible codecs error - data: { url : faulty URL, reason : error reason}\n\t MANIFEST_INCOMPATIBLE_CODECS_ERROR: 'manifestIncompatibleCodecsError',\n\t // Identifier for a level load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n\t LEVEL_LOAD_ERROR: 'levelLoadError',\n\t // Identifier for a level load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n\t LEVEL_LOAD_TIMEOUT: 'levelLoadTimeOut',\n\t // Identifier for a level switch error - data: { level : faulty level Id, event : error description}\n\t LEVEL_SWITCH_ERROR: 'levelSwitchError',\n\t // Identifier for an audio track load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n\t AUDIO_TRACK_LOAD_ERROR: 'audioTrackLoadError',\n\t // Identifier for an audio track load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n\t AUDIO_TRACK_LOAD_TIMEOUT: 'audioTrackLoadTimeOut',\n\t // Identifier for fragment load error - data: { frag : fragment object, response : { code: error code, text: error text }}\n\t FRAG_LOAD_ERROR: 'fragLoadError',\n\t // Identifier for fragment loop loading error - data: { frag : fragment object}\n\t FRAG_LOOP_LOADING_ERROR: 'fragLoopLoadingError',\n\t // Identifier for fragment load timeout error - data: { frag : fragment object}\n\t FRAG_LOAD_TIMEOUT: 'fragLoadTimeOut',\n\t // Identifier for a fragment decryption error event - data: parsing error description\n\t FRAG_DECRYPT_ERROR: 'fragDecryptError',\n\t // Identifier for a fragment parsing error event - data: parsing error description\n\t FRAG_PARSING_ERROR: 'fragParsingError',\n\t // Identifier for decrypt key load error - data: { frag : fragment object, response : { code: error code, text: error text }}\n\t KEY_LOAD_ERROR: 'keyLoadError',\n\t // Identifier for decrypt key load timeout error - data: { frag : fragment object}\n\t KEY_LOAD_TIMEOUT: 'keyLoadTimeOut',\n\t // Triggered when an exception occurs while adding a sourceBuffer to MediaSource - data : { err : exception , mimeType : mimeType }\n\t BUFFER_ADD_CODEC_ERROR: 'bufferAddCodecError',\n\t // Identifier for a buffer append error - data: append error description\n\t BUFFER_APPEND_ERROR: 'bufferAppendError',\n\t // Identifier for a buffer appending error event - data: appending error description\n\t BUFFER_APPENDING_ERROR: 'bufferAppendingError',\n\t // Identifier for a buffer stalled error event\n\t BUFFER_STALLED_ERROR: 'bufferStalledError',\n\t // Identifier for a buffer full event\n\t BUFFER_FULL_ERROR: 'bufferFullError',\n\t // Identifier for a buffer seek over hole event\n\t BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole',\n\t // Identifier for an internal exception happening inside hls.js while handling an event\n\t INTERNAL_EXCEPTION: 'internalException'\n\t};\n\t\n\t},{}],25:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n\t *\n\t * All objects in the event handling chain should inherit from this class\n\t *\n\t */\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar EventHandler = function () {\n\t function EventHandler(hls) {\n\t _classCallCheck(this, EventHandler);\n\t\n\t this.hls = hls;\n\t this.onEvent = this.onEvent.bind(this);\n\t\n\t for (var _len = arguments.length, events = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t events[_key - 1] = arguments[_key];\n\t }\n\t\n\t this.handledEvents = events;\n\t this.useGenericHandler = true;\n\t\n\t this.registerListeners();\n\t }\n\t\n\t _createClass(EventHandler, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t this.unregisterListeners();\n\t }\n\t }, {\n\t key: 'isEventHandler',\n\t value: function isEventHandler() {\n\t return _typeof(this.handledEvents) === 'object' && this.handledEvents.length && typeof this.onEvent === 'function';\n\t }\n\t }, {\n\t key: 'registerListeners',\n\t value: function registerListeners() {\n\t if (this.isEventHandler()) {\n\t this.handledEvents.forEach(function (event) {\n\t if (event === 'hlsEventGeneric') {\n\t throw new Error('Forbidden event name: ' + event);\n\t }\n\t this.hls.on(event, this.onEvent);\n\t }.bind(this));\n\t }\n\t }\n\t }, {\n\t key: 'unregisterListeners',\n\t value: function unregisterListeners() {\n\t if (this.isEventHandler()) {\n\t this.handledEvents.forEach(function (event) {\n\t this.hls.off(event, this.onEvent);\n\t }.bind(this));\n\t }\n\t }\n\t\n\t /**\n\t * arguments: event (string), data (any)\n\t */\n\t\n\t }, {\n\t key: 'onEvent',\n\t value: function onEvent(event, data) {\n\t this.onEventGeneric(event, data);\n\t }\n\t }, {\n\t key: 'onEventGeneric',\n\t value: function onEventGeneric(event, data) {\n\t var eventToFunction = function eventToFunction(event, data) {\n\t var funcName = 'on' + event.replace('hls', '');\n\t if (typeof this[funcName] !== 'function') {\n\t throw new Error('Event ' + event + ' has no generic handler in this ' + this.constructor.name + ' class (tried ' + funcName + ')');\n\t }\n\t return this[funcName].bind(this, data);\n\t };\n\t try {\n\t eventToFunction.call(this, event, data).call();\n\t } catch (err) {\n\t _logger.logger.error('internal error happened while processing ' + event + ':' + err.message);\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event: event, err: err });\n\t }\n\t }\n\t }]);\n\t\n\t return EventHandler;\n\t}();\n\t\n\texports.default = EventHandler;\n\t\n\t},{\"24\":24,\"26\":26,\"43\":43}],26:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tmodule.exports = {\n\t // fired before MediaSource is attaching to media element - data: { media }\n\t MEDIA_ATTACHING: 'hlsMediaAttaching',\n\t // fired when MediaSource has been succesfully attached to media element - data: { }\n\t MEDIA_ATTACHED: 'hlsMediaAttached',\n\t // fired before detaching MediaSource from media element - data: { }\n\t MEDIA_DETACHING: 'hlsMediaDetaching',\n\t // fired when MediaSource has been detached from media element - data: { }\n\t MEDIA_DETACHED: 'hlsMediaDetached',\n\t // fired when we buffer is going to be resetted\n\t BUFFER_RESET: 'hlsBufferReset',\n\t // fired when we know about the codecs that we need buffers for to push into - data: {tracks : { container, codec, levelCodec, initSegment, metadata }}\n\t BUFFER_CODECS: 'hlsBufferCodecs',\n\t // fired when sourcebuffers have been created data: { tracks : tracks}\n\t BUFFER_CREATED: 'hlsBufferCreated',\n\t // fired when we append a segment to the buffer - data: { segment: segment object }\n\t BUFFER_APPENDING: 'hlsBufferAppending',\n\t // fired when we are done with appending a media segment to the buffer data : { parent : segment parent that triggered BUFFER_APPENDING }\n\t BUFFER_APPENDED: 'hlsBufferAppended',\n\t // fired when the stream is finished and we want to notify the media buffer that there will be no more data\n\t BUFFER_EOS: 'hlsBufferEos',\n\t // fired when the media buffer should be flushed - data {startOffset, endOffset}\n\t BUFFER_FLUSHING: 'hlsBufferFlushing',\n\t // fired when the media has been flushed\n\t BUFFER_FLUSHED: 'hlsBufferFlushed',\n\t // fired to signal that a manifest loading starts - data: { url : manifestURL}\n\t MANIFEST_LOADING: 'hlsManifestLoading',\n\t // fired after manifest has been loaded - data: { levels : [available quality levels] , audioTracks : [ available audio tracks], url : manifestURL, stats : { trequest, tfirst, tload, mtime}}\n\t MANIFEST_LOADED: 'hlsManifestLoaded',\n\t // fired after manifest has been parsed - data: { levels : [available quality levels] , firstLevel : index of first quality level appearing in Manifest}\n\t MANIFEST_PARSED: 'hlsManifestParsed',\n\t // fired when a level playlist loading starts - data: { url : level URL level : id of level being loaded}\n\t LEVEL_LOADING: 'hlsLevelLoading',\n\t // fired when a level playlist loading finishes - data: { details : levelDetails object, level : id of loaded level, stats : { trequest, tfirst, tload, mtime} }\n\t LEVEL_LOADED: 'hlsLevelLoaded',\n\t // fired when a level's details have been updated based on previous details, after it has been loaded. - data: { details : levelDetails object, level : id of updated level }\n\t LEVEL_UPDATED: 'hlsLevelUpdated',\n\t // fired when a level's PTS information has been updated after parsing a fragment - data: { details : levelDetails object, level : id of updated level, drift: PTS drift observed when parsing last fragment }\n\t LEVEL_PTS_UPDATED: 'hlsLevelPtsUpdated',\n\t // fired when a level switch is requested - data: { level : id of new level }\n\t LEVEL_SWITCH: 'hlsLevelSwitch',\n\t // fired to notify that audio track lists has been updated data: { audioTracks : audioTracks}\n\t AUDIO_TRACKS_UPDATED: 'hlsAudioTracksUpdated',\n\t // fired when an audio track switch occurs - data: { id : audio track id}\n\t AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',\n\t // fired when an audio track loading starts - data: { url : audio track URL id : audio track id}\n\t AUDIO_TRACK_LOADING: 'hlsAudioTrackLoading',\n\t // fired when an audio track loading finishes - data: { details : levelDetails object, id : audio track id, stats : { trequest, tfirst, tload, mtime} }\n\t AUDIO_TRACK_LOADED: 'hlsAudioTrackLoaded',\n\t // fired when a fragment loading starts - data: { frag : fragment object}\n\t FRAG_LOADING: 'hlsFragLoading',\n\t // fired when a fragment loading is progressing - data: { frag : fragment object, { trequest, tfirst, loaded}}\n\t FRAG_LOAD_PROGRESS: 'hlsFragLoadProgress',\n\t // Identifier for fragment load aborting for emergency switch down - data: {frag : fragment object}\n\t FRAG_LOAD_EMERGENCY_ABORTED: 'hlsFragLoadEmergencyAborted',\n\t // fired when a fragment loading is completed - data: { frag : fragment object, payload : fragment payload, stats : { trequest, tfirst, tload, length}}\n\t FRAG_LOADED: 'hlsFragLoaded',\n\t // fired when Init Segment has been extracted from fragment - data: { id : demuxer id, level : levelId, sn : sequence number, moov : moov MP4 box, codecs : codecs found while parsing fragment}\n\t FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n\t // fired when parsing sei text is completed - data: { id : demuxer id, , level : levelId, sn : sequence number, samples : [ sei samples pes ] }\n\t FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',\n\t // fired when parsing id3 is completed - data: { id : demuxer id, , level : levelId, sn : sequence number, samples : [ id3 samples pes ] }\n\t FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',\n\t // fired when data have been extracted from fragment - data: { id : demuxer id, level : levelId, sn : sequence number, data1 : moof MP4 box or TS fragments, data2 : mdat MP4 box or null}\n\t FRAG_PARSING_DATA: 'hlsFragParsingData',\n\t // fired when fragment parsing is completed - data: { id : demuxer id; level : levelId, sn : sequence number, }\n\t FRAG_PARSED: 'hlsFragParsed',\n\t // fired when fragment remuxed MP4 boxes have all been appended into SourceBuffer - data: { id : demuxer id,frag : fragment object, stats : { trequest, tfirst, tload, tparsed, tbuffered, length} }\n\t FRAG_BUFFERED: 'hlsFragBuffered',\n\t // fired when fragment matching with current media position is changing - data : { id : demuxer id, frag : fragment object }\n\t FRAG_CHANGED: 'hlsFragChanged',\n\t // Identifier for a FPS drop event - data: {curentDropped, currentDecoded, totalDroppedFrames}\n\t FPS_DROP: 'hlsFpsDrop',\n\t //triggered when FPS drop triggers auto level capping - data: {level, droppedlevel}\n\t FPS_DROP_LEVEL_CAPPING: 'hlsFpsDropLevelCapping',\n\t // Identifier for an error event - data: { type : error type, details : error details, fatal : if true, hls.js cannot/will not try to recover, if false, hls.js will try to recover,other error specific data}\n\t ERROR: 'hlsError',\n\t // fired when hls.js instance starts destroying. Different from MEDIA_DETACHED as one could want to detach and reattach a media to the instance of hls.js to handle mid-rolls for example\n\t DESTROYING: 'hlsDestroying',\n\t // fired when a decrypt key loading starts - data: { frag : fragment object}\n\t KEY_LOADING: 'hlsKeyLoading',\n\t // fired when a decrypt key loading is completed - data: { frag : fragment object, payload : key payload, stats : { trequest, tfirst, tload, length}}\n\t KEY_LOADED: 'hlsKeyLoaded',\n\t // fired upon stream controller state transitions - data: {previousState, nextState}\n\t STREAM_STATE_TRANSITION: 'hlsStreamStateTransition'\n\t};\n\t\n\t},{}],27:[function(_dereq_,module,exports){\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * AAC helper\n\t */\n\t\n\tvar AAC = function () {\n\t function AAC() {\n\t _classCallCheck(this, AAC);\n\t }\n\t\n\t _createClass(AAC, null, [{\n\t key: \"getSilentFrame\",\n\t value: function getSilentFrame(channelCount) {\n\t if (channelCount === 1) {\n\t return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x23, 0x80]);\n\t } else if (channelCount === 2) {\n\t return new Uint8Array([0x21, 0x00, 0x49, 0x90, 0x02, 0x19, 0x00, 0x23, 0x80]);\n\t } else if (channelCount === 3) {\n\t return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x8e]);\n\t } else if (channelCount === 4) {\n\t return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x80, 0x2c, 0x80, 0x08, 0x02, 0x38]);\n\t } else if (channelCount === 5) {\n\t return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x38]);\n\t } else if (channelCount === 6) {\n\t return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x00, 0xb2, 0x00, 0x20, 0x08, 0xe0]);\n\t }\n\t return null;\n\t }\n\t }]);\n\t\n\t return AAC;\n\t}();\n\t\n\texports.default = AAC;\n\t\n\t},{}],28:[function(_dereq_,module,exports){\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * Buffer Helper class, providing methods dealing buffer length retrieval\n\t*/\n\t\n\tvar BufferHelper = function () {\n\t function BufferHelper() {\n\t _classCallCheck(this, BufferHelper);\n\t }\n\t\n\t _createClass(BufferHelper, null, [{\n\t key: \"isBuffered\",\n\t value: function isBuffered(media, position) {\n\t if (media) {\n\t var buffered = media.buffered;\n\t for (var i = 0; i < buffered.length; i++) {\n\t if (position >= buffered.start(i) && position <= buffered.end(i)) {\n\t return true;\n\t }\n\t }\n\t }\n\t return false;\n\t }\n\t }, {\n\t key: \"bufferInfo\",\n\t value: function bufferInfo(media, pos, maxHoleDuration) {\n\t if (media) {\n\t var vbuffered = media.buffered,\n\t buffered = [],\n\t i;\n\t for (i = 0; i < vbuffered.length; i++) {\n\t buffered.push({ start: vbuffered.start(i), end: vbuffered.end(i) });\n\t }\n\t return this.bufferedInfo(buffered, pos, maxHoleDuration);\n\t } else {\n\t return { len: 0, start: 0, end: 0, nextStart: undefined };\n\t }\n\t }\n\t }, {\n\t key: \"bufferedInfo\",\n\t value: function bufferedInfo(buffered, pos, maxHoleDuration) {\n\t var buffered2 = [],\n\t\n\t // bufferStart and bufferEnd are buffer boundaries around current video position\n\t bufferLen,\n\t bufferStart,\n\t bufferEnd,\n\t bufferStartNext,\n\t i;\n\t // sort on buffer.start/smaller end (IE does not always return sorted buffered range)\n\t buffered.sort(function (a, b) {\n\t var diff = a.start - b.start;\n\t if (diff) {\n\t return diff;\n\t } else {\n\t return b.end - a.end;\n\t }\n\t });\n\t // there might be some small holes between buffer time range\n\t // consider that holes smaller than maxHoleDuration are irrelevant and build another\n\t // buffer time range representations that discards those holes\n\t for (i = 0; i < buffered.length; i++) {\n\t var buf2len = buffered2.length;\n\t if (buf2len) {\n\t var buf2end = buffered2[buf2len - 1].end;\n\t // if small hole (value between 0 or maxHoleDuration ) or overlapping (negative)\n\t if (buffered[i].start - buf2end < maxHoleDuration) {\n\t // merge overlapping time ranges\n\t // update lastRange.end only if smaller than item.end\n\t // e.g. [ 1, 15] with [ 2,8] => [ 1,15] (no need to modify lastRange.end)\n\t // whereas [ 1, 8] with [ 2,15] => [ 1,15] ( lastRange should switch from [1,8] to [1,15])\n\t if (buffered[i].end > buf2end) {\n\t buffered2[buf2len - 1].end = buffered[i].end;\n\t }\n\t } else {\n\t // big hole\n\t buffered2.push(buffered[i]);\n\t }\n\t } else {\n\t // first value\n\t buffered2.push(buffered[i]);\n\t }\n\t }\n\t for (i = 0, bufferLen = 0, bufferStart = bufferEnd = pos; i < buffered2.length; i++) {\n\t var start = buffered2[i].start,\n\t end = buffered2[i].end;\n\t //logger.log('buf start/end:' + buffered.start(i) + '/' + buffered.end(i));\n\t if (pos + maxHoleDuration >= start && pos < end) {\n\t // play position is inside this buffer TimeRange, retrieve end of buffer position and buffer length\n\t bufferStart = start;\n\t bufferEnd = end;\n\t bufferLen = bufferEnd - pos;\n\t } else if (pos + maxHoleDuration < start) {\n\t bufferStartNext = start;\n\t break;\n\t }\n\t }\n\t return { len: bufferLen, start: bufferStart, end: bufferEnd, nextStart: bufferStartNext };\n\t }\n\t }]);\n\t\n\t return BufferHelper;\n\t}();\n\t\n\texports.default = BufferHelper;\n\t\n\t},{}],29:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * Level Helper class, providing methods dealing with playlist sliding and drift\n\t */\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar LevelHelper = function () {\n\t function LevelHelper() {\n\t _classCallCheck(this, LevelHelper);\n\t }\n\t\n\t _createClass(LevelHelper, null, [{\n\t key: 'mergeDetails',\n\t value: function mergeDetails(oldDetails, newDetails) {\n\t var start = Math.max(oldDetails.startSN, newDetails.startSN) - newDetails.startSN,\n\t end = Math.min(oldDetails.endSN, newDetails.endSN) - newDetails.startSN,\n\t delta = newDetails.startSN - oldDetails.startSN,\n\t oldfragments = oldDetails.fragments,\n\t newfragments = newDetails.fragments,\n\t ccOffset = 0,\n\t PTSFrag;\n\t\n\t // check if old/new playlists have fragments in common\n\t if (end < start) {\n\t newDetails.PTSKnown = false;\n\t return;\n\t }\n\t // loop through overlapping SN and update startPTS , cc, and duration if any found\n\t for (var i = start; i <= end; i++) {\n\t var oldFrag = oldfragments[delta + i],\n\t newFrag = newfragments[i];\n\t if (newFrag && oldFrag) {\n\t ccOffset = oldFrag.cc - newFrag.cc;\n\t if (!isNaN(oldFrag.startPTS)) {\n\t newFrag.start = newFrag.startPTS = oldFrag.startPTS;\n\t newFrag.endPTS = oldFrag.endPTS;\n\t newFrag.duration = oldFrag.duration;\n\t PTSFrag = newFrag;\n\t }\n\t }\n\t }\n\t\n\t if (ccOffset) {\n\t _logger.logger.log('discontinuity sliding from playlist, take drift into account');\n\t for (i = 0; i < newfragments.length; i++) {\n\t newfragments[i].cc += ccOffset;\n\t }\n\t }\n\t\n\t // if at least one fragment contains PTS info, recompute PTS information for all fragments\n\t if (PTSFrag) {\n\t LevelHelper.updateFragPTSDTS(newDetails, PTSFrag.sn, PTSFrag.startPTS, PTSFrag.endPTS, PTSFrag.startDTS, PTSFrag.endDTS);\n\t } else {\n\t // ensure that delta is within oldfragments range\n\t // also adjust sliding in case delta is 0 (we could have old=[50-60] and new=old=[50-61])\n\t // in that case we also need to adjust start offset of all fragments\n\t if (delta >= 0 && delta < oldfragments.length) {\n\t // adjust start by sliding offset\n\t var sliding = oldfragments[delta].start;\n\t for (i = 0; i < newfragments.length; i++) {\n\t newfragments[i].start += sliding;\n\t }\n\t }\n\t }\n\t // if we are here, it means we have fragments overlapping between\n\t // old and new level. reliable PTS info is thus relying on old level\n\t newDetails.PTSKnown = oldDetails.PTSKnown;\n\t return;\n\t }\n\t }, {\n\t key: 'updateFragPTSDTS',\n\t value: function updateFragPTSDTS(details, sn, startPTS, endPTS, startDTS, endDTS) {\n\t var fragIdx, fragments, frag, i;\n\t // exit if sn out of range\n\t if (sn < details.startSN || sn > details.endSN) {\n\t return 0;\n\t }\n\t fragIdx = sn - details.startSN;\n\t fragments = details.fragments;\n\t frag = fragments[fragIdx];\n\t if (!isNaN(frag.startPTS)) {\n\t // delta PTS between audio and video\n\t var deltaPTS = Math.abs(frag.startPTS - startPTS);\n\t if (isNaN(frag.deltaPTS)) {\n\t frag.deltaPTS = deltaPTS;\n\t } else {\n\t frag.deltaPTS = Math.max(deltaPTS, frag.deltaPTS);\n\t }\n\t startPTS = Math.min(startPTS, frag.startPTS);\n\t endPTS = Math.max(endPTS, frag.endPTS);\n\t startDTS = Math.min(startDTS, frag.startDTS);\n\t endDTS = Math.max(endDTS, frag.endDTS);\n\t }\n\t\n\t var drift = startPTS - frag.start;\n\t\n\t frag.start = frag.startPTS = startPTS;\n\t frag.endPTS = endPTS;\n\t frag.startDTS = startDTS;\n\t frag.endDTS = endDTS;\n\t frag.duration = endPTS - startPTS;\n\t // adjust fragment PTS/duration from seqnum-1 to frag 0\n\t for (i = fragIdx; i > 0; i--) {\n\t LevelHelper.updatePTS(fragments, i, i - 1);\n\t }\n\t\n\t // adjust fragment PTS/duration from seqnum to last frag\n\t for (i = fragIdx; i < fragments.length - 1; i++) {\n\t LevelHelper.updatePTS(fragments, i, i + 1);\n\t }\n\t details.PTSKnown = true;\n\t //logger.log(` frag start/end:${startPTS.toFixed(3)}/${endPTS.toFixed(3)}`);\n\t\n\t return drift;\n\t }\n\t }, {\n\t key: 'updatePTS',\n\t value: function updatePTS(fragments, fromIdx, toIdx) {\n\t var fragFrom = fragments[fromIdx],\n\t fragTo = fragments[toIdx],\n\t fragToPTS = fragTo.startPTS;\n\t // if we know startPTS[toIdx]\n\t if (!isNaN(fragToPTS)) {\n\t // update fragment duration.\n\t // it helps to fix drifts between playlist reported duration and fragment real duration\n\t if (toIdx > fromIdx) {\n\t fragFrom.duration = fragToPTS - fragFrom.start;\n\t if (fragFrom.duration < 0) {\n\t _logger.logger.warn('negative duration computed for frag ' + fragFrom.sn + ',level ' + fragFrom.level + ', there should be some duration drift between playlist and fragment!');\n\t }\n\t } else {\n\t fragTo.duration = fragFrom.start - fragToPTS;\n\t if (fragTo.duration < 0) {\n\t _logger.logger.warn('negative duration computed for frag ' + fragTo.sn + ',level ' + fragTo.level + ', there should be some duration drift between playlist and fragment!');\n\t }\n\t }\n\t } else {\n\t // we dont know startPTS[toIdx]\n\t if (toIdx > fromIdx) {\n\t fragTo.start = fragFrom.start + fragFrom.duration;\n\t } else {\n\t fragTo.start = fragFrom.start - fragTo.duration;\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return LevelHelper;\n\t}();\n\t\n\texports.default = LevelHelper;\n\t\n\t},{\"43\":43}],30:[function(_dereq_,module,exports){\n\t/**\n\t * HLS interface\n\t */\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t//import FetchLoader from './utils/fetch-loader';\n\t\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tvar _playlistLoader = _dereq_(34);\n\t\n\tvar _playlistLoader2 = _interopRequireDefault(_playlistLoader);\n\t\n\tvar _fragmentLoader = _dereq_(32);\n\t\n\tvar _fragmentLoader2 = _interopRequireDefault(_fragmentLoader);\n\t\n\tvar _abrController = _dereq_(3);\n\t\n\tvar _abrController2 = _interopRequireDefault(_abrController);\n\t\n\tvar _bufferController = _dereq_(6);\n\t\n\tvar _bufferController2 = _interopRequireDefault(_bufferController);\n\t\n\tvar _capLevelController = _dereq_(7);\n\t\n\tvar _capLevelController2 = _interopRequireDefault(_capLevelController);\n\t\n\tvar _audioStreamController = _dereq_(4);\n\t\n\tvar _audioStreamController2 = _interopRequireDefault(_audioStreamController);\n\t\n\tvar _streamController = _dereq_(11);\n\t\n\tvar _streamController2 = _interopRequireDefault(_streamController);\n\t\n\tvar _levelController = _dereq_(10);\n\t\n\tvar _levelController2 = _interopRequireDefault(_levelController);\n\t\n\tvar _timelineController = _dereq_(12);\n\t\n\tvar _timelineController2 = _interopRequireDefault(_timelineController);\n\t\n\tvar _fpsController = _dereq_(9);\n\t\n\tvar _fpsController2 = _interopRequireDefault(_fpsController);\n\t\n\tvar _audioTrackController = _dereq_(5);\n\t\n\tvar _audioTrackController2 = _interopRequireDefault(_audioTrackController);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tvar _xhrLoader = _dereq_(47);\n\t\n\tvar _xhrLoader2 = _interopRequireDefault(_xhrLoader);\n\t\n\tvar _events3 = _dereq_(1);\n\t\n\tvar _events4 = _interopRequireDefault(_events3);\n\t\n\tvar _keyLoader = _dereq_(33);\n\t\n\tvar _keyLoader2 = _interopRequireDefault(_keyLoader);\n\t\n\tvar _cues = _dereq_(41);\n\t\n\tvar _cues2 = _interopRequireDefault(_cues);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Hls = function () {\n\t _createClass(Hls, null, [{\n\t key: 'isSupported',\n\t value: function isSupported() {\n\t return window.MediaSource && typeof window.MediaSource.isTypeSupported === 'function' && window.MediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n\t }\n\t }, {\n\t key: 'version',\n\t get: function get() {\n\t // replaced with browserify-versionify transform\n\t return '0.6.7';\n\t }\n\t }, {\n\t key: 'Events',\n\t get: function get() {\n\t return _events2.default;\n\t }\n\t }, {\n\t key: 'ErrorTypes',\n\t get: function get() {\n\t return _errors.ErrorTypes;\n\t }\n\t }, {\n\t key: 'ErrorDetails',\n\t get: function get() {\n\t return _errors.ErrorDetails;\n\t }\n\t }, {\n\t key: 'DefaultConfig',\n\t get: function get() {\n\t if (!Hls.defaultConfig) {\n\t Hls.defaultConfig = {\n\t autoStartLoad: true,\n\t startPosition: -1,\n\t defaultAudioCodec: undefined,\n\t debug: false,\n\t capLevelOnFPSDrop: false,\n\t capLevelToPlayerSize: false,\n\t maxBufferLength: 30,\n\t maxBufferSize: 60 * 1000 * 1000,\n\t maxBufferHole: 0.5,\n\t maxSeekHole: 2,\n\t seekHoleNudgeDuration: 0.01,\n\t stalledInBufferedNudgeThreshold: 10,\n\t maxFragLookUpTolerance: 0.2,\n\t liveSyncDurationCount: 3,\n\t liveMaxLatencyDurationCount: Infinity,\n\t liveSyncDuration: undefined,\n\t liveMaxLatencyDuration: undefined,\n\t maxMaxBufferLength: 600,\n\t enableWorker: true,\n\t enableSoftwareAES: true,\n\t manifestLoadingTimeOut: 10000,\n\t manifestLoadingMaxRetry: 1,\n\t manifestLoadingRetryDelay: 1000,\n\t manifestLoadingMaxRetryTimeout: 64000,\n\t startLevel: undefined,\n\t levelLoadingTimeOut: 10000,\n\t levelLoadingMaxRetry: 4,\n\t levelLoadingRetryDelay: 1000,\n\t levelLoadingMaxRetryTimeout: 64000,\n\t fragLoadingTimeOut: 20000,\n\t fragLoadingMaxRetry: 6,\n\t fragLoadingRetryDelay: 1000,\n\t fragLoadingMaxRetryTimeout: 64000,\n\t fragLoadingLoopThreshold: 3,\n\t startFragPrefetch: false,\n\t fpsDroppedMonitoringPeriod: 5000,\n\t fpsDroppedMonitoringThreshold: 0.2,\n\t appendErrorMaxRetry: 3,\n\t loader: _xhrLoader2.default,\n\t //loader: FetchLoader,\n\t fLoader: undefined,\n\t pLoader: undefined,\n\t xhrSetup: undefined,\n\t fetchSetup: undefined,\n\t abrController: _abrController2.default,\n\t bufferController: _bufferController2.default,\n\t capLevelController: _capLevelController2.default,\n\t fpsController: _fpsController2.default,\n\t streamController: _streamController2.default,\n\t audioStreamController: _audioStreamController2.default,\n\t timelineController: _timelineController2.default,\n\t cueHandler: _cues2.default,\n\t enableCEA708Captions: true,\n\t enableMP2TPassThrough: false,\n\t stretchShortVideoTrack: false,\n\t forceKeyFrameOnDiscontinuity: true,\n\t abrEwmaFastLive: 5,\n\t abrEwmaSlowLive: 9,\n\t abrEwmaFastVoD: 3,\n\t abrEwmaSlowVoD: 9,\n\t abrEwmaDefaultEstimate: 5e5, // 500 kbps\n\t abrBandWidthFactor: 0.8,\n\t abrBandWidthUpFactor: 0.7,\n\t maxStarvationDelay: 4,\n\t maxLoadingDelay: 4,\n\t minAutoBitrate: 0\n\t };\n\t }\n\t return Hls.defaultConfig;\n\t },\n\t set: function set(defaultConfig) {\n\t Hls.defaultConfig = defaultConfig;\n\t }\n\t }]);\n\t\n\t function Hls() {\n\t var config = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t _classCallCheck(this, Hls);\n\t\n\t var defaultConfig = Hls.DefaultConfig;\n\t\n\t if ((config.liveSyncDurationCount || config.liveMaxLatencyDurationCount) && (config.liveSyncDuration || config.liveMaxLatencyDuration)) {\n\t throw new Error('Illegal hls.js config: don\\'t mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration');\n\t }\n\t\n\t for (var prop in defaultConfig) {\n\t if (prop in config) {\n\t continue;\n\t }\n\t config[prop] = defaultConfig[prop];\n\t }\n\t\n\t if (config.liveMaxLatencyDurationCount !== undefined && config.liveMaxLatencyDurationCount <= config.liveSyncDurationCount) {\n\t throw new Error('Illegal hls.js config: \"liveMaxLatencyDurationCount\" must be gt \"liveSyncDurationCount\"');\n\t }\n\t\n\t if (config.liveMaxLatencyDuration !== undefined && (config.liveMaxLatencyDuration <= config.liveSyncDuration || config.liveSyncDuration === undefined)) {\n\t throw new Error('Illegal hls.js config: \"liveMaxLatencyDuration\" must be gt \"liveSyncDuration\"');\n\t }\n\t\n\t (0, _logger.enableLogs)(config.debug);\n\t this.config = config;\n\t // observer setup\n\t var observer = this.observer = new _events4.default();\n\t observer.trigger = function trigger(event) {\n\t for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t data[_key - 1] = arguments[_key];\n\t }\n\t\n\t observer.emit.apply(observer, [event, event].concat(data));\n\t };\n\t\n\t observer.off = function off(event) {\n\t for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n\t data[_key2 - 1] = arguments[_key2];\n\t }\n\t\n\t observer.removeListener.apply(observer, [event].concat(data));\n\t };\n\t this.on = observer.on.bind(observer);\n\t this.off = observer.off.bind(observer);\n\t this.trigger = observer.trigger.bind(observer);\n\t this.playlistLoader = new _playlistLoader2.default(this);\n\t this.fragmentLoader = new _fragmentLoader2.default(this);\n\t this.levelController = new _levelController2.default(this);\n\t this.abrController = new config.abrController(this);\n\t this.bufferController = new config.bufferController(this);\n\t this.capLevelController = new config.capLevelController(this);\n\t this.fpsController = new config.fpsController(this);\n\t this.streamController = new config.streamController(this);\n\t this.audioStreamController = new config.audioStreamController(this);\n\t this.timelineController = new config.timelineController(this);\n\t this.audioTrackController = new _audioTrackController2.default(this);\n\t this.keyLoader = new _keyLoader2.default(this);\n\t }\n\t\n\t _createClass(Hls, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t _logger.logger.log('destroy');\n\t this.trigger(_events2.default.DESTROYING);\n\t this.detachMedia();\n\t this.playlistLoader.destroy();\n\t this.fragmentLoader.destroy();\n\t this.levelController.destroy();\n\t this.abrController.destroy();\n\t this.bufferController.destroy();\n\t this.capLevelController.destroy();\n\t this.fpsController.destroy();\n\t this.streamController.destroy();\n\t this.audioStreamController.destroy();\n\t this.timelineController.destroy();\n\t this.audioTrackController.destroy();\n\t this.keyLoader.destroy();\n\t this.url = null;\n\t this.observer.removeAllListeners();\n\t }\n\t }, {\n\t key: 'attachMedia',\n\t value: function attachMedia(media) {\n\t _logger.logger.log('attachMedia');\n\t this.media = media;\n\t this.trigger(_events2.default.MEDIA_ATTACHING, { media: media });\n\t }\n\t }, {\n\t key: 'detachMedia',\n\t value: function detachMedia() {\n\t _logger.logger.log('detachMedia');\n\t this.trigger(_events2.default.MEDIA_DETACHING);\n\t this.media = null;\n\t }\n\t }, {\n\t key: 'loadSource',\n\t value: function loadSource(url) {\n\t _logger.logger.log('loadSource:' + url);\n\t this.url = url;\n\t // when attaching to a source URL, trigger a playlist load\n\t this.trigger(_events2.default.MANIFEST_LOADING, { url: url });\n\t }\n\t }, {\n\t key: 'startLoad',\n\t value: function startLoad() {\n\t var startPosition = arguments.length <= 0 || arguments[0] === undefined ? -1 : arguments[0];\n\t\n\t _logger.logger.log('startLoad');\n\t this.levelController.startLoad();\n\t this.streamController.startLoad(startPosition);\n\t this.audioStreamController.startLoad(startPosition);\n\t }\n\t }, {\n\t key: 'stopLoad',\n\t value: function stopLoad() {\n\t _logger.logger.log('stopLoad');\n\t this.levelController.stopLoad();\n\t this.streamController.stopLoad();\n\t this.audioStreamController.stopLoad();\n\t }\n\t }, {\n\t key: 'swapAudioCodec',\n\t value: function swapAudioCodec() {\n\t _logger.logger.log('swapAudioCodec');\n\t this.streamController.swapAudioCodec();\n\t }\n\t }, {\n\t key: 'recoverMediaError',\n\t value: function recoverMediaError() {\n\t _logger.logger.log('recoverMediaError');\n\t var media = this.media;\n\t this.detachMedia();\n\t this.attachMedia(media);\n\t }\n\t\n\t /** Return all quality levels **/\n\t\n\t }, {\n\t key: 'levels',\n\t get: function get() {\n\t return this.levelController.levels;\n\t }\n\t\n\t /** Return current playback quality level **/\n\t\n\t }, {\n\t key: 'currentLevel',\n\t get: function get() {\n\t return this.streamController.currentLevel;\n\t }\n\t\n\t /* set quality level immediately (-1 for automatic level selection) */\n\t ,\n\t set: function set(newLevel) {\n\t _logger.logger.log('set currentLevel:' + newLevel);\n\t this.loadLevel = newLevel;\n\t this.streamController.immediateLevelSwitch();\n\t }\n\t\n\t /** Return next playback quality level (quality level of next fragment) **/\n\t\n\t }, {\n\t key: 'nextLevel',\n\t get: function get() {\n\t return this.streamController.nextLevel;\n\t }\n\t\n\t /* set quality level for next fragment (-1 for automatic level selection) */\n\t ,\n\t set: function set(newLevel) {\n\t _logger.logger.log('set nextLevel:' + newLevel);\n\t this.levelController.manualLevel = newLevel;\n\t this.streamController.nextLevelSwitch();\n\t }\n\t\n\t /** Return the quality level of current/last loaded fragment **/\n\t\n\t }, {\n\t key: 'loadLevel',\n\t get: function get() {\n\t return this.levelController.level;\n\t }\n\t\n\t /* set quality level for current/next loaded fragment (-1 for automatic level selection) */\n\t ,\n\t set: function set(newLevel) {\n\t _logger.logger.log('set loadLevel:' + newLevel);\n\t this.levelController.manualLevel = newLevel;\n\t }\n\t\n\t /** Return the quality level of next loaded fragment **/\n\t\n\t }, {\n\t key: 'nextLoadLevel',\n\t get: function get() {\n\t return this.levelController.nextLoadLevel;\n\t }\n\t\n\t /** set quality level of next loaded fragment **/\n\t ,\n\t set: function set(level) {\n\t this.levelController.nextLoadLevel = level;\n\t }\n\t\n\t /** Return first level (index of first level referenced in manifest)\n\t **/\n\t\n\t }, {\n\t key: 'firstLevel',\n\t get: function get() {\n\t return this.levelController.firstLevel;\n\t }\n\t\n\t /** set first level (index of first level referenced in manifest)\n\t **/\n\t ,\n\t set: function set(newLevel) {\n\t _logger.logger.log('set firstLevel:' + newLevel);\n\t this.levelController.firstLevel = newLevel;\n\t }\n\t\n\t /** Return start level (level of first fragment that will be played back)\n\t if not overrided by user, first level appearing in manifest will be used as start level\n\t if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)\n\t **/\n\t\n\t }, {\n\t key: 'startLevel',\n\t get: function get() {\n\t return this.levelController.startLevel;\n\t }\n\t\n\t /** set start level (level of first fragment that will be played back)\n\t if not overrided by user, first level appearing in manifest will be used as start level\n\t if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)\n\t **/\n\t ,\n\t set: function set(newLevel) {\n\t _logger.logger.log('set startLevel:' + newLevel);\n\t this.levelController.startLevel = newLevel;\n\t }\n\t\n\t /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n\t\n\t }, {\n\t key: 'autoLevelCapping',\n\t get: function get() {\n\t return this.abrController.autoLevelCapping;\n\t }\n\t\n\t /** set the capping/max level value that could be used by automatic level selection algorithm **/\n\t ,\n\t set: function set(newLevel) {\n\t _logger.logger.log('set autoLevelCapping:' + newLevel);\n\t this.abrController.autoLevelCapping = newLevel;\n\t }\n\t\n\t /* check if we are in automatic level selection mode */\n\t\n\t }, {\n\t key: 'autoLevelEnabled',\n\t get: function get() {\n\t return this.levelController.manualLevel === -1;\n\t }\n\t\n\t /* return manual level */\n\t\n\t }, {\n\t key: 'manualLevel',\n\t get: function get() {\n\t return this.levelController.manualLevel;\n\t }\n\t\n\t /** get alternate audio tracks list from playlist **/\n\t\n\t }, {\n\t key: 'audioTracks',\n\t get: function get() {\n\t return this.audioTrackController.audioTracks;\n\t }\n\t\n\t /** get index of the selected audio track (index in audio track lists) **/\n\t\n\t }, {\n\t key: 'audioTrack',\n\t get: function get() {\n\t return this.audioTrackController.audioTrack;\n\t }\n\t\n\t /** select an audio track, based on its index in audio track lists**/\n\t ,\n\t set: function set(audioTrackId) {\n\t this.audioTrackController.audioTrack = audioTrackId;\n\t }\n\t }, {\n\t key: 'liveSyncPosition',\n\t get: function get() {\n\t return this.streamController.liveSyncPosition;\n\t }\n\t }]);\n\t\n\t return Hls;\n\t}();\n\t\n\texports.default = Hls;\n\t\n\t},{\"1\":1,\"10\":10,\"11\":11,\"12\":12,\"24\":24,\"26\":26,\"3\":3,\"32\":32,\"33\":33,\"34\":34,\"4\":4,\"41\":41,\"43\":43,\"47\":47,\"5\":5,\"6\":6,\"7\":7,\"9\":9}],31:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\t// This is mostly for support of the es6 module export\n\t// syntax with the babel compiler, it looks like it doesnt support\n\t// function exports like we are used to in node/commonjs\n\tmodule.exports = _dereq_(30).default;\n\t\n\t},{\"30\":30}],32:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _eventHandler = _dereq_(25);\n\t\n\tvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * Fragment Loader\n\t */\n\t\n\tvar FragmentLoader = function (_EventHandler) {\n\t _inherits(FragmentLoader, _EventHandler);\n\t\n\t function FragmentLoader(hls) {\n\t _classCallCheck(this, FragmentLoader);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(FragmentLoader).call(this, hls, _events2.default.FRAG_LOADING));\n\t\n\t _this.loaders = {};\n\t return _this;\n\t }\n\t\n\t _createClass(FragmentLoader, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t var loaders = this.loaders;\n\t for (var loaderName in loaders) {\n\t var loader = loaders[loaderName];\n\t if (loader) {\n\t loader.destroy();\n\t }\n\t }\n\t this.loaders = {};\n\t _eventHandler2.default.prototype.destroy.call(this);\n\t }\n\t }, {\n\t key: 'onFragLoading',\n\t value: function onFragLoading(data) {\n\t var frag = data.frag,\n\t type = frag.type,\n\t loader = this.loaders[type],\n\t config = this.hls.config;\n\t\n\t frag.loaded = 0;\n\t if (loader) {\n\t _logger.logger.warn('abort previous fragment loader for type:' + type);\n\t loader.abort();\n\t }\n\t loader = this.loaders[type] = frag.loader = typeof config.fLoader !== 'undefined' ? new config.fLoader(config) : new config.loader(config);\n\t\n\t var loaderContext = void 0,\n\t loaderConfig = void 0,\n\t loaderCallbacks = void 0;\n\t loaderContext = { url: frag.url, frag: frag, responseType: 'arraybuffer', progressData: false };\n\t var start = frag.byteRangeStartOffset,\n\t end = frag.byteRangeEndOffset;\n\t if (!isNaN(start) && !isNaN(end)) {\n\t loaderContext.rangeStart = start;\n\t loaderContext.rangeEnd = end;\n\t }\n\t loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: 0, retryDelay: 0, maxRetryDelay: config.fragLoadingMaxRetryTimeout };\n\t loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this), onProgress: this.loadprogress.bind(this) };\n\t loader.load(loaderContext, loaderConfig, loaderCallbacks);\n\t }\n\t }, {\n\t key: 'loadsuccess',\n\t value: function loadsuccess(response, stats, context) {\n\t var payload = response.data,\n\t frag = context.frag;\n\t // detach fragment loader on load success\n\t frag.loader = undefined;\n\t this.loaders[frag.type] = undefined;\n\t this.hls.trigger(_events2.default.FRAG_LOADED, { payload: payload, frag: frag, stats: stats });\n\t }\n\t }, {\n\t key: 'loaderror',\n\t value: function loaderror(response, context) {\n\t var loader = context.loader;\n\t if (loader) {\n\t loader.abort();\n\t }\n\t this.loaders[context.type] = undefined;\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response });\n\t }\n\t }, {\n\t key: 'loadtimeout',\n\t value: function loadtimeout(stats, context) {\n\t var loader = context.loader;\n\t if (loader) {\n\t loader.abort();\n\t }\n\t this.loaders[context.type] = undefined;\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag });\n\t }\n\t\n\t // data will be used for progressive parsing\n\t\n\t }, {\n\t key: 'loadprogress',\n\t value: function loadprogress(stats, context, data) {\n\t // jshint ignore:line\n\t var frag = context.frag;\n\t frag.loaded = stats.loaded;\n\t this.hls.trigger(_events2.default.FRAG_LOAD_PROGRESS, { frag: frag, stats: stats });\n\t }\n\t }]);\n\t\n\t return FragmentLoader;\n\t}(_eventHandler2.default);\n\t\n\texports.default = FragmentLoader;\n\t\n\t},{\"24\":24,\"25\":25,\"26\":26,\"43\":43}],33:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _eventHandler = _dereq_(25);\n\t\n\tvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * Decrypt key Loader\n\t */\n\t\n\tvar KeyLoader = function (_EventHandler) {\n\t _inherits(KeyLoader, _EventHandler);\n\t\n\t function KeyLoader(hls) {\n\t _classCallCheck(this, KeyLoader);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(KeyLoader).call(this, hls, _events2.default.KEY_LOADING));\n\t\n\t _this.loaders = {};\n\t _this.decryptkey = null;\n\t _this.decrypturl = null;\n\t return _this;\n\t }\n\t\n\t _createClass(KeyLoader, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t for (var loaderName in this.loaders) {\n\t var loader = this.loaders[loaderName];\n\t if (loader) {\n\t loader.destroy();\n\t }\n\t }\n\t this.loaders = {};\n\t _eventHandler2.default.prototype.destroy.call(this);\n\t }\n\t }, {\n\t key: 'onKeyLoading',\n\t value: function onKeyLoading(data) {\n\t var frag = data.frag,\n\t type = frag.type,\n\t loader = this.loaders[type],\n\t decryptdata = frag.decryptdata,\n\t uri = decryptdata.uri;\n\t // if uri is different from previous one or if decrypt key not retrieved yet\n\t if (uri !== this.decrypturl || this.decryptkey === null) {\n\t var config = this.hls.config;\n\t\n\t if (loader) {\n\t _logger.logger.warn('abort previous fragment loader for type:' + type);\n\t loader.abort();\n\t }\n\t frag.loader = this.loaders[type] = new config.loader(config);\n\t this.decrypturl = uri;\n\t this.decryptkey = null;\n\t\n\t var loaderContext = void 0,\n\t loaderConfig = void 0,\n\t loaderCallbacks = void 0;\n\t loaderContext = { url: uri, frag: frag, responseType: 'arraybuffer' };\n\t loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: config.fragLoadingMaxRetry, retryDelay: config.fragLoadingRetryDelay, maxRetryDelay: config.fragLoadingMaxRetryTimeout };\n\t loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };\n\t frag.loader.load(loaderContext, loaderConfig, loaderCallbacks);\n\t } else if (this.decryptkey) {\n\t // we already loaded this key, return it\n\t decryptdata.key = this.decryptkey;\n\t this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });\n\t }\n\t }\n\t }, {\n\t key: 'loadsuccess',\n\t value: function loadsuccess(response, stats, context) {\n\t var frag = context.frag;\n\t this.decryptkey = frag.decryptdata.key = new Uint8Array(response.data);\n\t // detach fragment loader on load success\n\t frag.loader = undefined;\n\t this.loaders[context.type] = undefined;\n\t this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });\n\t }\n\t }, {\n\t key: 'loaderror',\n\t value: function loaderror(response, context) {\n\t var frag = context.frag,\n\t loader = frag.loader;\n\t if (loader) {\n\t loader.abort();\n\t }\n\t this.loaders[context.type] = undefined;\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_ERROR, fatal: false, frag: frag, response: response });\n\t }\n\t }, {\n\t key: 'loadtimeout',\n\t value: function loadtimeout(stats, context) {\n\t var frag = context.frag,\n\t loader = frag.loader;\n\t if (loader) {\n\t loader.abort();\n\t }\n\t this.loaders[context.type] = undefined;\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_TIMEOUT, fatal: false, frag: frag });\n\t }\n\t }]);\n\t\n\t return KeyLoader;\n\t}(_eventHandler2.default);\n\t\n\texports.default = KeyLoader;\n\t\n\t},{\"24\":24,\"25\":25,\"26\":26,\"43\":43}],34:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _eventHandler = _dereq_(25);\n\t\n\tvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\tvar _url = _dereq_(46);\n\t\n\tvar _url2 = _interopRequireDefault(_url);\n\t\n\tvar _attrList = _dereq_(38);\n\t\n\tvar _attrList2 = _interopRequireDefault(_attrList);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * Playlist Loader\n\t */\n\t\n\tvar PlaylistLoader = function (_EventHandler) {\n\t _inherits(PlaylistLoader, _EventHandler);\n\t\n\t function PlaylistLoader(hls) {\n\t _classCallCheck(this, PlaylistLoader);\n\t\n\t var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(PlaylistLoader).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.LEVEL_LOADING, _events2.default.AUDIO_TRACK_LOADING));\n\t\n\t _this.loaders = {};\n\t return _this;\n\t }\n\t\n\t _createClass(PlaylistLoader, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t for (var loaderName in this.loaders) {\n\t var loader = this.loaders[loaderName];\n\t if (loader) {\n\t loader.destroy();\n\t }\n\t }\n\t this.loaders = {};\n\t _eventHandler2.default.prototype.destroy.call(this);\n\t }\n\t }, {\n\t key: 'onManifestLoading',\n\t value: function onManifestLoading(data) {\n\t this.load(data.url, { type: 'manifest' });\n\t }\n\t }, {\n\t key: 'onLevelLoading',\n\t value: function onLevelLoading(data) {\n\t this.load(data.url, { type: 'level', level: data.level, id: data.id });\n\t }\n\t }, {\n\t key: 'onAudioTrackLoading',\n\t value: function onAudioTrackLoading(data) {\n\t this.load(data.url, { type: 'audioTrack', id: data.id });\n\t }\n\t }, {\n\t key: 'load',\n\t value: function load(url, context) {\n\t var loader = this.loaders[context.type];\n\t if (loader) {\n\t var loaderContext = loader.context;\n\t if (loaderContext && loaderContext.url === url) {\n\t _logger.logger.trace('playlist request ongoing');\n\t return;\n\t } else {\n\t _logger.logger.warn('abort previous loader for type:' + context.type);\n\t loader.abort();\n\t }\n\t }\n\t var config = this.hls.config,\n\t retry = void 0,\n\t timeout = void 0,\n\t retryDelay = void 0,\n\t maxRetryDelay = void 0;\n\t if (context.type === 'manifest') {\n\t retry = config.manifestLoadingMaxRetry;\n\t timeout = config.manifestLoadingTimeOut;\n\t retryDelay = config.manifestLoadingRetryDelay;\n\t maxRetryDelay = config.manifestLoadingMaxRetryTimeOut;\n\t } else {\n\t retry = config.levelLoadingMaxRetry;\n\t timeout = config.levelLoadingTimeOut;\n\t retryDelay = config.levelLoadingRetryDelay;\n\t maxRetryDelay = config.levelLoadingMaxRetryTimeOut;\n\t _logger.logger.log('loading playlist for level ' + context.level);\n\t }\n\t loader = this.loaders[context.type] = context.loader = typeof config.pLoader !== 'undefined' ? new config.pLoader(config) : new config.loader(config);\n\t context.url = url;\n\t context.responseType = '';\n\t\n\t var loaderConfig = void 0,\n\t loaderCallbacks = void 0;\n\t loaderConfig = { timeout: timeout, maxRetry: retry, retryDelay: retryDelay, maxRetryDelay: maxRetryDelay };\n\t loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };\n\t loader.load(context, loaderConfig, loaderCallbacks);\n\t }\n\t }, {\n\t key: 'resolve',\n\t value: function resolve(url, baseUrl) {\n\t return _url2.default.buildAbsoluteURL(baseUrl, url);\n\t }\n\t }, {\n\t key: 'parseMasterPlaylist',\n\t value: function parseMasterPlaylist(string, baseurl) {\n\t var levels = [],\n\t result = void 0;\n\t\n\t // https://regex101.com is your friend\n\t var re = /#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g;\n\t while ((result = re.exec(string)) != null) {\n\t var level = {};\n\t\n\t var attrs = level.attrs = new _attrList2.default(result[1]);\n\t level.url = this.resolve(result[2], baseurl);\n\t\n\t var resolution = attrs.decimalResolution('RESOLUTION');\n\t if (resolution) {\n\t level.width = resolution.width;\n\t level.height = resolution.height;\n\t }\n\t level.bitrate = attrs.decimalInteger('AVERAGE-BANDWIDTH') || attrs.decimalInteger('BANDWIDTH');\n\t level.name = attrs.NAME;\n\t\n\t var codecs = attrs.CODECS;\n\t if (codecs) {\n\t codecs = codecs.split(',');\n\t for (var i = 0; i < codecs.length; i++) {\n\t var codec = codecs[i];\n\t if (codec.indexOf('avc1') !== -1) {\n\t level.videoCodec = this.avc1toavcoti(codec);\n\t } else {\n\t level.audioCodec = codec;\n\t }\n\t }\n\t }\n\t\n\t levels.push(level);\n\t }\n\t return levels;\n\t }\n\t }, {\n\t key: 'parseMasterPlaylistMedia',\n\t value: function parseMasterPlaylistMedia(string, baseurl, type) {\n\t var result = void 0,\n\t medias = [];\n\t\n\t // https://regex101.com is your friend\n\t var re = /#EXT-X-MEDIA:(.*)/g;\n\t while ((result = re.exec(string)) != null) {\n\t var media = {};\n\t var attrs = new _attrList2.default(result[1]);\n\t if (attrs.TYPE === type) {\n\t media.groupId = attrs['GROUP-ID'];\n\t media.name = attrs.NAME;\n\t media.type = type;\n\t media.default = attrs.DEFAULT === 'YES';\n\t media.autoselect = attrs.AUTOSELECT === 'YES';\n\t media.forced = attrs.FORCED === 'YES';\n\t if (attrs.URI) {\n\t media.url = this.resolve(attrs.URI, baseurl);\n\t }\n\t media.lang = attrs.LANGUAGE;\n\t if (!media.name) {\n\t media.name = media.lang;\n\t }\n\t medias.push(media);\n\t }\n\t }\n\t return medias;\n\t }\n\t /**\n\t * Utility method for parseLevelPlaylist to create an initialization vector for a given segment\n\t * @returns {Uint8Array}\n\t */\n\t\n\t }, {\n\t key: 'createInitializationVector',\n\t value: function createInitializationVector(segmentNumber) {\n\t var uint8View = new Uint8Array(16);\n\t\n\t for (var i = 12; i < 16; i++) {\n\t uint8View[i] = segmentNumber >> 8 * (15 - i) & 0xff;\n\t }\n\t\n\t return uint8View;\n\t }\n\t\n\t /**\n\t * Utility method for parseLevelPlaylist to get a fragment's decryption data from the currently parsed encryption key data\n\t * @param levelkey - a playlist's encryption info\n\t * @param segmentNumber - the fragment's segment number\n\t * @returns {*} - an object to be applied as a fragment's decryptdata\n\t */\n\t\n\t }, {\n\t key: 'fragmentDecryptdataFromLevelkey',\n\t value: function fragmentDecryptdataFromLevelkey(levelkey, segmentNumber) {\n\t var decryptdata = levelkey;\n\t\n\t if (levelkey && levelkey.method && levelkey.uri && !levelkey.iv) {\n\t decryptdata = this.cloneObj(levelkey);\n\t decryptdata.iv = this.createInitializationVector(segmentNumber);\n\t }\n\t\n\t return decryptdata;\n\t }\n\t }, {\n\t key: 'avc1toavcoti',\n\t value: function avc1toavcoti(codec) {\n\t var result,\n\t avcdata = codec.split('.');\n\t if (avcdata.length > 2) {\n\t result = avcdata.shift() + '.';\n\t result += parseInt(avcdata.shift()).toString(16);\n\t result += ('000' + parseInt(avcdata.shift()).toString(16)).substr(-4);\n\t } else {\n\t result = codec;\n\t }\n\t return result;\n\t }\n\t }, {\n\t key: 'cloneObj',\n\t value: function cloneObj(obj) {\n\t return JSON.parse(JSON.stringify(obj));\n\t }\n\t }, {\n\t key: 'parseLevelPlaylist',\n\t value: function parseLevelPlaylist(string, baseurl, id, type) {\n\t var currentSN = 0,\n\t fragdecryptdata,\n\t totalduration = 0,\n\t level = { type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0 },\n\t levelkey = { method: null, key: null, iv: null, uri: null },\n\t cc = 0,\n\t programDateTime = null,\n\t frag = null,\n\t result,\n\t regexp,\n\t duration = null,\n\t title = null,\n\t byteRangeEndOffset = null,\n\t byteRangeStartOffset = null,\n\t tagList = [];\n\t\n\t regexp = /(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE):(\\d+))|(?:#EXT-X-(TARGETDURATION):(\\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT(INF):(\\d+(?:\\.\\d+)?)(?:,(.*))?)|(?:(?!#)()(\\S.+))|(?:#EXT-X-(BYTERANGE):(\\d+(?:@\\d+(?:\\.\\d+)?)?)|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(PROGRAM-DATE-TIME):(.+))|(?:#EXT-X-(VERSION):(\\d+))|(?:(#)(.*):(.*))|(?:(#)(.*)))(?:.*)\\r?\\n?/g;\n\t while ((result = regexp.exec(string)) !== null) {\n\t result.shift();\n\t result = result.filter(function (n) {\n\t return n !== undefined;\n\t });\n\t switch (result[0]) {\n\t case 'PLAYLIST-TYPE':\n\t level.type = result[1].toUpperCase();\n\t break;\n\t case 'MEDIA-SEQUENCE':\n\t currentSN = level.startSN = parseInt(result[1]);\n\t break;\n\t case 'TARGETDURATION':\n\t level.targetduration = parseFloat(result[1]);\n\t break;\n\t case 'VERSION':\n\t level.version = parseInt(result[1]);\n\t break;\n\t case 'EXTM3U':\n\t break;\n\t case 'ENDLIST':\n\t level.live = false;\n\t break;\n\t case 'DIS':\n\t cc++;\n\t tagList.push(result);\n\t break;\n\t case 'BYTERANGE':\n\t var params = result[1].split('@');\n\t if (params.length === 1) {\n\t byteRangeStartOffset = byteRangeEndOffset;\n\t } else {\n\t byteRangeStartOffset = parseInt(params[1]);\n\t }\n\t byteRangeEndOffset = parseInt(params[0]) + byteRangeStartOffset;\n\t break;\n\t case 'INF':\n\t duration = parseFloat(result[1]);\n\t title = result[2] ? result[2] : null;\n\t tagList.push(result);\n\t break;\n\t case '':\n\t // url\n\t if (!isNaN(duration)) {\n\t var sn = currentSN++;\n\t fragdecryptdata = this.fragmentDecryptdataFromLevelkey(levelkey, sn);\n\t var url = result[1] ? this.resolve(result[1], baseurl) : null;\n\t frag = { url: url,\n\t type: type,\n\t duration: duration,\n\t title: title,\n\t start: totalduration,\n\t sn: sn,\n\t level: id,\n\t cc: cc,\n\t decryptdata: fragdecryptdata,\n\t programDateTime: programDateTime,\n\t tagList: tagList };\n\t // only include byte range options if used/needed\n\t if (byteRangeStartOffset !== null) {\n\t frag.byteRangeStartOffset = byteRangeStartOffset;\n\t frag.byteRangeEndOffset = byteRangeEndOffset;\n\t }\n\t level.fragments.push(frag);\n\t totalduration += duration;\n\t duration = null;\n\t title = null;\n\t byteRangeStartOffset = null;\n\t programDateTime = null;\n\t tagList = [];\n\t }\n\t break;\n\t case 'KEY':\n\t // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4\n\t var decryptparams = result[1];\n\t var keyAttrs = new _attrList2.default(decryptparams);\n\t var decryptmethod = keyAttrs.enumeratedString('METHOD'),\n\t decrypturi = keyAttrs.URI,\n\t decryptiv = keyAttrs.hexadecimalInteger('IV');\n\t if (decryptmethod) {\n\t levelkey = { method: null, key: null, iv: null, uri: null };\n\t if (decrypturi && decryptmethod === 'AES-128') {\n\t levelkey.method = decryptmethod;\n\t // URI to get the key\n\t levelkey.uri = this.resolve(decrypturi, baseurl);\n\t levelkey.key = null;\n\t // Initialization Vector (IV)\n\t levelkey.iv = decryptiv;\n\t }\n\t }\n\t break;\n\t case 'START':\n\t var startParams = result[1];\n\t var startAttrs = new _attrList2.default(startParams);\n\t var startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');\n\t //TIME-OFFSET can be 0\n\t if (!isNaN(startTimeOffset)) {\n\t level.startTimeOffset = startTimeOffset;\n\t }\n\t break;\n\t case 'PROGRAM-DATE-TIME':\n\t programDateTime = new Date(Date.parse(result[1]));\n\t tagList.push(result);\n\t break;\n\t case '#':\n\t result.shift();\n\t tagList.push(result);\n\t break;\n\t default:\n\t _logger.logger.warn('line parsed but not handled: ' + result);\n\t break;\n\t }\n\t }\n\t //logger.log('found ' + level.fragments.length + ' fragments');\n\t if (frag && !frag.url) {\n\t level.fragments.pop();\n\t totalduration -= frag.duration;\n\t }\n\t level.totalduration = totalduration;\n\t level.averagetargetduration = totalduration / level.fragments.length;\n\t level.endSN = currentSN - 1;\n\t return level;\n\t }\n\t }, {\n\t key: 'loadsuccess',\n\t value: function loadsuccess(response, stats, context) {\n\t var string = response.data,\n\t url = response.url,\n\t type = context.type,\n\t id = context.id,\n\t level = context.level,\n\t hls = this.hls;\n\t\n\t this.loaders[type] = undefined;\n\t // responseURL not supported on some browsers (it is used to detect URL redirection)\n\t // data-uri mode also not supported (but no need to detect redirection)\n\t if (url === undefined || url.indexOf('data:') === 0) {\n\t // fallback to initial URL\n\t url = context.url;\n\t }\n\t stats.tload = performance.now();\n\t //stats.mtime = new Date(target.getResponseHeader('Last-Modified'));\n\t if (string.indexOf('#EXTM3U') === 0) {\n\t if (string.indexOf('#EXTINF:') > 0) {\n\t var isLevel = type !== 'audioTrack',\n\t levelDetails = this.parseLevelPlaylist(string, url, (isLevel ? level : id) || 0, isLevel ? 'main' : 'audio');\n\t if (type === 'manifest') {\n\t // first request, stream manifest (no master playlist), fire manifest loaded event with level details\n\t hls.trigger(_events2.default.MANIFEST_LOADED, { levels: [{ url: url, details: levelDetails }], audioTracks: [], url: url, stats: stats });\n\t }\n\t stats.tparsed = performance.now();\n\t if (isLevel) {\n\t hls.trigger(_events2.default.LEVEL_LOADED, { details: levelDetails, level: level || 0, id: id || 0, stats: stats });\n\t } else {\n\t hls.trigger(_events2.default.AUDIO_TRACK_LOADED, { details: levelDetails, id: id, stats: stats });\n\t }\n\t } else {\n\t var levels = this.parseMasterPlaylist(string, url);\n\t // multi level playlist, parse level info\n\t if (levels.length) {\n\t var audiotracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO');\n\t if (audiotracks.length) {\n\t // check if we have found an audio track embedded in main playlist (audio track without URI attribute)\n\t var embeddedAudioFound = false;\n\t audiotracks.forEach(function (audioTrack) {\n\t if (!audioTrack.url) {\n\t embeddedAudioFound = true;\n\t }\n\t });\n\t // if no embedded audio track defined, but audio codec signaled in quality level, we need to signal this main audio track\n\t // this could happen with playlists with alt audio rendition in which quality levels (main) contains both audio+video. but with mixed audio track not signaled\n\t if (embeddedAudioFound === false && levels[0].audioCodec && !levels[0].attrs.AUDIO) {\n\t _logger.logger.log('audio codec signaled in quality level, but no embedded audio track signaled, create one');\n\t audiotracks.unshift({ type: 'main', name: 'main' });\n\t }\n\t }\n\t hls.trigger(_events2.default.MANIFEST_LOADED, { levels: levels, audioTracks: audiotracks, url: url, stats: stats });\n\t } else {\n\t hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest' });\n\t }\n\t }\n\t } else {\n\t hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter' });\n\t }\n\t }\n\t }, {\n\t key: 'loaderror',\n\t value: function loaderror(response, context) {\n\t var details,\n\t fatal,\n\t loader = context.loader;\n\t switch (context.type) {\n\t case 'manifest':\n\t details = _errors.ErrorDetails.MANIFEST_LOAD_ERROR;\n\t fatal = true;\n\t break;\n\t case 'level':\n\t details = _errors.ErrorDetails.LEVEL_LOAD_ERROR;\n\t fatal = false;\n\t break;\n\t case 'audioTrack':\n\t details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR;\n\t fatal = false;\n\t break;\n\t }\n\t if (loader) {\n\t loader.abort();\n\t this.loaders[context.type] = undefined;\n\t }\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context: context });\n\t }\n\t }, {\n\t key: 'loadtimeout',\n\t value: function loadtimeout(stats, context) {\n\t var details,\n\t fatal,\n\t loader = context.loader;\n\t switch (context.type) {\n\t case 'manifest':\n\t details = _errors.ErrorDetails.MANIFEST_LOAD_TIMEOUT;\n\t fatal = true;\n\t break;\n\t case 'level':\n\t details = _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT;\n\t fatal = false;\n\t break;\n\t case 'audioTrack':\n\t details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT;\n\t fatal = false;\n\t break;\n\t }\n\t if (loader) {\n\t loader.abort();\n\t this.loaders[context.type] = undefined;\n\t }\n\t this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context: context });\n\t }\n\t }]);\n\t\n\t return PlaylistLoader;\n\t}(_eventHandler2.default);\n\t\n\texports.default = PlaylistLoader;\n\t\n\t},{\"24\":24,\"25\":25,\"26\":26,\"38\":38,\"43\":43,\"46\":46}],35:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * Generate MP4 Box\n\t*/\n\t\n\t//import Hex from '../utils/hex';\n\t\n\tvar MP4 = function () {\n\t function MP4() {\n\t _classCallCheck(this, MP4);\n\t }\n\t\n\t _createClass(MP4, null, [{\n\t key: 'init',\n\t value: function init() {\n\t MP4.types = {\n\t avc1: [], // codingname\n\t avcC: [],\n\t btrt: [],\n\t dinf: [],\n\t dref: [],\n\t esds: [],\n\t ftyp: [],\n\t hdlr: [],\n\t mdat: [],\n\t mdhd: [],\n\t mdia: [],\n\t mfhd: [],\n\t minf: [],\n\t moof: [],\n\t moov: [],\n\t mp4a: [],\n\t mvex: [],\n\t mvhd: [],\n\t sdtp: [],\n\t stbl: [],\n\t stco: [],\n\t stsc: [],\n\t stsd: [],\n\t stsz: [],\n\t stts: [],\n\t tfdt: [],\n\t tfhd: [],\n\t traf: [],\n\t trak: [],\n\t trun: [],\n\t trex: [],\n\t tkhd: [],\n\t vmhd: [],\n\t smhd: []\n\t };\n\t\n\t var i;\n\t for (i in MP4.types) {\n\t if (MP4.types.hasOwnProperty(i)) {\n\t MP4.types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n\t }\n\t }\n\t\n\t var videoHdlr = new Uint8Array([0x00, // version 0\n\t 0x00, 0x00, 0x00, // flags\n\t 0x00, 0x00, 0x00, 0x00, // pre_defined\n\t 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n\t 0x00, 0x00, 0x00, 0x00, // reserved\n\t 0x00, 0x00, 0x00, 0x00, // reserved\n\t 0x00, 0x00, 0x00, 0x00, // reserved\n\t 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n\t ]);\n\t\n\t var audioHdlr = new Uint8Array([0x00, // version 0\n\t 0x00, 0x00, 0x00, // flags\n\t 0x00, 0x00, 0x00, 0x00, // pre_defined\n\t 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n\t 0x00, 0x00, 0x00, 0x00, // reserved\n\t 0x00, 0x00, 0x00, 0x00, // reserved\n\t 0x00, 0x00, 0x00, 0x00, // reserved\n\t 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n\t ]);\n\t\n\t MP4.HDLR_TYPES = {\n\t 'video': videoHdlr,\n\t 'audio': audioHdlr\n\t };\n\t\n\t var dref = new Uint8Array([0x00, // version 0\n\t 0x00, 0x00, 0x00, // flags\n\t 0x00, 0x00, 0x00, 0x01, // entry_count\n\t 0x00, 0x00, 0x00, 0x0c, // entry_size\n\t 0x75, 0x72, 0x6c, 0x20, // 'url' type\n\t 0x00, // version 0\n\t 0x00, 0x00, 0x01 // entry_flags\n\t ]);\n\t\n\t var stco = new Uint8Array([0x00, // version\n\t 0x00, 0x00, 0x00, // flags\n\t 0x00, 0x00, 0x00, 0x00 // entry_count\n\t ]);\n\t\n\t MP4.STTS = MP4.STSC = MP4.STCO = stco;\n\t\n\t MP4.STSZ = new Uint8Array([0x00, // version\n\t 0x00, 0x00, 0x00, // flags\n\t 0x00, 0x00, 0x00, 0x00, // sample_size\n\t 0x00, 0x00, 0x00, 0x00]);\n\t // sample_count\n\t MP4.VMHD = new Uint8Array([0x00, // version\n\t 0x00, 0x00, 0x01, // flags\n\t 0x00, 0x00, // graphicsmode\n\t 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n\t ]);\n\t MP4.SMHD = new Uint8Array([0x00, // version\n\t 0x00, 0x00, 0x00, // flags\n\t 0x00, 0x00, // balance\n\t 0x00, 0x00 // reserved\n\t ]);\n\t\n\t MP4.STSD = new Uint8Array([0x00, // version 0\n\t 0x00, 0x00, 0x00, // flags\n\t 0x00, 0x00, 0x00, 0x01]); // entry_count\n\t\n\t var majorBrand = new Uint8Array([105, 115, 111, 109]); // isom\n\t var avc1Brand = new Uint8Array([97, 118, 99, 49]); // avc1\n\t var minorVersion = new Uint8Array([0, 0, 0, 1]);\n\t\n\t MP4.FTYP = MP4.box(MP4.types.ftyp, majorBrand, minorVersion, majorBrand, avc1Brand);\n\t MP4.DINF = MP4.box(MP4.types.dinf, MP4.box(MP4.types.dref, dref));\n\t }\n\t }, {\n\t key: 'box',\n\t value: function box(type) {\n\t var payload = Array.prototype.slice.call(arguments, 1),\n\t size = 8,\n\t i = payload.length,\n\t len = i,\n\t result;\n\t // calculate the total size we need to allocate\n\t while (i--) {\n\t size += payload[i].byteLength;\n\t }\n\t result = new Uint8Array(size);\n\t result[0] = size >> 24 & 0xff;\n\t result[1] = size >> 16 & 0xff;\n\t result[2] = size >> 8 & 0xff;\n\t result[3] = size & 0xff;\n\t result.set(type, 4);\n\t // copy the payload into the result\n\t for (i = 0, size = 8; i < len; i++) {\n\t // copy payload[i] array @ offset size\n\t result.set(payload[i], size);\n\t size += payload[i].byteLength;\n\t }\n\t return result;\n\t }\n\t }, {\n\t key: 'hdlr',\n\t value: function hdlr(type) {\n\t return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);\n\t }\n\t }, {\n\t key: 'mdat',\n\t value: function mdat(data) {\n\t return MP4.box(MP4.types.mdat, data);\n\t }\n\t }, {\n\t key: 'mdhd',\n\t value: function mdhd(timescale, duration) {\n\t duration *= timescale;\n\t return MP4.box(MP4.types.mdhd, new Uint8Array([0x00, // version 0\n\t 0x00, 0x00, 0x00, // flags\n\t 0x00, 0x00, 0x00, 0x02, // creation_time\n\t 0x00, 0x00, 0x00, 0x03, // modification_time\n\t timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n\t duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n\t 0x55, 0xc4, // 'und' language (undetermined)\n\t 0x00, 0x00]));\n\t }\n\t }, {\n\t key: 'mdia',\n\t value: function mdia(track) {\n\t return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale, track.duration), MP4.hdlr(track.type), MP4.minf(track));\n\t }\n\t }, {\n\t key: 'mfhd',\n\t value: function mfhd(sequenceNumber) {\n\t return MP4.box(MP4.types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags\n\t sequenceNumber >> 24, sequenceNumber >> 16 & 0xFF, sequenceNumber >> 8 & 0xFF, sequenceNumber & 0xFF]));\n\t }\n\t }, {\n\t key: 'minf',\n\t // sequence_number\n\t value: function minf(track) {\n\t if (track.type === 'audio') {\n\t return MP4.box(MP4.types.minf, MP4.box(MP4.types.smhd, MP4.SMHD), MP4.DINF, MP4.stbl(track));\n\t } else {\n\t return MP4.box(MP4.types.minf, MP4.box(MP4.types.vmhd, MP4.VMHD), MP4.DINF, MP4.stbl(track));\n\t }\n\t }\n\t }, {\n\t key: 'moof',\n\t value: function moof(sn, baseMediaDecodeTime, track) {\n\t return MP4.box(MP4.types.moof, MP4.mfhd(sn), MP4.traf(track, baseMediaDecodeTime));\n\t }\n\t /**\n\t * @param tracks... (optional) {array} the tracks associated with this movie\n\t */\n\t\n\t }, {\n\t key: 'moov',\n\t value: function moov(tracks) {\n\t var i = tracks.length,\n\t boxes = [];\n\t\n\t while (i--) {\n\t boxes[i] = MP4.trak(tracks[i]);\n\t }\n\t\n\t return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale, tracks[0].duration)].concat(boxes).concat(MP4.mvex(tracks)));\n\t }\n\t }, {\n\t key: 'mvex',\n\t value: function mvex(tracks) {\n\t var i = tracks.length,\n\t boxes = [];\n\t\n\t while (i--) {\n\t boxes[i] = MP4.trex(tracks[i]);\n\t }\n\t return MP4.box.apply(null, [MP4.types.mvex].concat(boxes));\n\t }\n\t }, {\n\t key: 'mvhd',\n\t value: function mvhd(timescale, duration) {\n\t duration *= timescale;\n\t var bytes = new Uint8Array([0x00, // version 0\n\t 0x00, 0x00, 0x00, // flags\n\t 0x00, 0x00, 0x00, 0x01, // creation_time\n\t 0x00, 0x00, 0x00, 0x02, // modification_time\n\t timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n\t duration >> 24 & 0xFF, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n\t 0x00, 0x01, 0x00, 0x00, // 1.0 rate\n\t 0x01, 0x00, // 1.0 volume\n\t 0x00, 0x00, // reserved\n\t 0x00, 0x00, 0x00, 0x00, // reserved\n\t 0x00, 0x00, 0x00, 0x00, // reserved\n\t 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n\t 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n\t 0xff, 0xff, 0xff, 0xff // next_track_ID\n\t ]);\n\t return MP4.box(MP4.types.mvhd, bytes);\n\t }\n\t }, {\n\t key: 'sdtp',\n\t value: function sdtp(track) {\n\t var samples = track.samples || [],\n\t bytes = new Uint8Array(4 + samples.length),\n\t flags,\n\t i;\n\t // leave the full box header (4 bytes) all zero\n\t // write the sample table\n\t for (i = 0; i < samples.length; i++) {\n\t flags = samples[i].flags;\n\t bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n\t }\n\t\n\t return MP4.box(MP4.types.sdtp, bytes);\n\t }\n\t }, {\n\t key: 'stbl',\n\t value: function stbl(track) {\n\t return MP4.box(MP4.types.stbl, MP4.stsd(track), MP4.box(MP4.types.stts, MP4.STTS), MP4.box(MP4.types.stsc, MP4.STSC), MP4.box(MP4.types.stsz, MP4.STSZ), MP4.box(MP4.types.stco, MP4.STCO));\n\t }\n\t }, {\n\t key: 'avc1',\n\t value: function avc1(track) {\n\t var sps = [],\n\t pps = [],\n\t i,\n\t data,\n\t len;\n\t // assemble the SPSs\n\t\n\t for (i = 0; i < track.sps.length; i++) {\n\t data = track.sps[i];\n\t len = data.byteLength;\n\t sps.push(len >>> 8 & 0xFF);\n\t sps.push(len & 0xFF);\n\t sps = sps.concat(Array.prototype.slice.call(data)); // SPS\n\t }\n\t\n\t // assemble the PPSs\n\t for (i = 0; i < track.pps.length; i++) {\n\t data = track.pps[i];\n\t len = data.byteLength;\n\t pps.push(len >>> 8 & 0xFF);\n\t pps.push(len & 0xFF);\n\t pps = pps.concat(Array.prototype.slice.call(data));\n\t }\n\t\n\t var avcc = MP4.box(MP4.types.avcC, new Uint8Array([0x01, // version\n\t sps[3], // profile\n\t sps[4], // profile compat\n\t sps[5], // level\n\t 0xfc | 3, // lengthSizeMinusOne, hard-coded to 4 bytes\n\t 0xE0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets\n\t ].concat(sps).concat([track.pps.length // numOfPictureParameterSets\n\t ]).concat(pps))),\n\t // \"PPS\"\n\t width = track.width,\n\t height = track.height;\n\t //console.log('avcc:' + Hex.hexDump(avcc));\n\t return MP4.box(MP4.types.avc1, new Uint8Array([0x00, 0x00, 0x00, // reserved\n\t 0x00, 0x00, 0x00, // reserved\n\t 0x00, 0x01, // data_reference_index\n\t 0x00, 0x00, // pre_defined\n\t 0x00, 0x00, // reserved\n\t 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n\t width >> 8 & 0xFF, width & 0xff, // width\n\t height >> 8 & 0xFF, height & 0xff, // height\n\t 0x00, 0x48, 0x00, 0x00, // horizresolution\n\t 0x00, 0x48, 0x00, 0x00, // vertresolution\n\t 0x00, 0x00, 0x00, 0x00, // reserved\n\t 0x00, 0x01, // frame_count\n\t 0x12, 0x64, 0x61, 0x69, 0x6C, //dailymotion/hls.js\n\t 0x79, 0x6D, 0x6F, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x68, 0x6C, 0x73, 0x2E, 0x6A, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname\n\t 0x00, 0x18, // depth = 24\n\t 0x11, 0x11]), // pre_defined = -1\n\t avcc, MP4.box(MP4.types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n\t 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n\t 0x00, 0x2d, 0xc6, 0xc0])) // avgBitrate\n\t );\n\t }\n\t }, {\n\t key: 'esds',\n\t value: function esds(track) {\n\t var configlen = track.config.length;\n\t return new Uint8Array([0x00, // version 0\n\t 0x00, 0x00, 0x00, // flags\n\t\n\t 0x03, // descriptor_type\n\t 0x17 + configlen, // length\n\t 0x00, 0x01, //es_id\n\t 0x00, // stream_priority\n\t\n\t 0x04, // descriptor_type\n\t 0x0f + configlen, // length\n\t 0x40, //codec : mpeg4_audio\n\t 0x15, // stream_type\n\t 0x00, 0x00, 0x00, // buffer_size\n\t 0x00, 0x00, 0x00, 0x00, // maxBitrate\n\t 0x00, 0x00, 0x00, 0x00, // avgBitrate\n\t\n\t 0x05 // descriptor_type\n\t ].concat([configlen]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor\n\t }\n\t }, {\n\t key: 'mp4a',\n\t value: function mp4a(track) {\n\t var audiosamplerate = track.audiosamplerate;\n\t return MP4.box(MP4.types.mp4a, new Uint8Array([0x00, 0x00, 0x00, // reserved\n\t 0x00, 0x00, 0x00, // reserved\n\t 0x00, 0x01, // data_reference_index\n\t 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n\t 0x00, track.channelCount, // channelcount\n\t 0x00, 0x10, // sampleSize:16bits\n\t 0x00, 0x00, 0x00, 0x00, // reserved2\n\t audiosamplerate >> 8 & 0xFF, audiosamplerate & 0xff, //\n\t 0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));\n\t }\n\t }, {\n\t key: 'stsd',\n\t value: function stsd(track) {\n\t if (track.type === 'audio') {\n\t return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp4a(track));\n\t } else {\n\t return MP4.box(MP4.types.stsd, MP4.STSD, MP4.avc1(track));\n\t }\n\t }\n\t }, {\n\t key: 'tkhd',\n\t value: function tkhd(track) {\n\t var id = track.id,\n\t duration = track.duration * track.timescale,\n\t width = track.width,\n\t height = track.height;\n\t return MP4.box(MP4.types.tkhd, new Uint8Array([0x00, // version 0\n\t 0x00, 0x00, 0x07, // flags\n\t 0x00, 0x00, 0x00, 0x00, // creation_time\n\t 0x00, 0x00, 0x00, 0x00, // modification_time\n\t id >> 24 & 0xFF, id >> 16 & 0xFF, id >> 8 & 0xFF, id & 0xFF, // track_ID\n\t 0x00, 0x00, 0x00, 0x00, // reserved\n\t duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n\t 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n\t 0x00, 0x00, // layer\n\t 0x00, 0x00, // alternate_group\n\t 0x00, 0x00, // non-audio track volume\n\t 0x00, 0x00, // reserved\n\t 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n\t width >> 8 & 0xFF, width & 0xFF, 0x00, 0x00, // width\n\t height >> 8 & 0xFF, height & 0xFF, 0x00, 0x00 // height\n\t ]));\n\t }\n\t }, {\n\t key: 'traf',\n\t value: function traf(track, baseMediaDecodeTime) {\n\t var sampleDependencyTable = MP4.sdtp(track),\n\t id = track.id;\n\t return MP4.box(MP4.types.traf, MP4.box(MP4.types.tfhd, new Uint8Array([0x00, // version 0\n\t 0x00, 0x00, 0x00, // flags\n\t id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF])), // track_ID\n\t MP4.box(MP4.types.tfdt, new Uint8Array([0x00, // version 0\n\t 0x00, 0x00, 0x00, // flags\n\t baseMediaDecodeTime >> 24, baseMediaDecodeTime >> 16 & 0XFF, baseMediaDecodeTime >> 8 & 0XFF, baseMediaDecodeTime & 0xFF])), // baseMediaDecodeTime\n\t MP4.trun(track, sampleDependencyTable.length + 16 + // tfhd\n\t 16 + // tfdt\n\t 8 + // traf header\n\t 16 + // mfhd\n\t 8 + // moof header\n\t 8), // mdat header\n\t sampleDependencyTable);\n\t }\n\t\n\t /**\n\t * Generate a track box.\n\t * @param track {object} a track definition\n\t * @return {Uint8Array} the track box\n\t */\n\t\n\t }, {\n\t key: 'trak',\n\t value: function trak(track) {\n\t track.duration = track.duration || 0xffffffff;\n\t return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));\n\t }\n\t }, {\n\t key: 'trex',\n\t value: function trex(track) {\n\t var id = track.id;\n\t return MP4.box(MP4.types.trex, new Uint8Array([0x00, // version 0\n\t 0x00, 0x00, 0x00, // flags\n\t id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF, // track_ID\n\t 0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n\t 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n\t 0x00, 0x00, 0x00, 0x00, // default_sample_size\n\t 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n\t ]));\n\t }\n\t }, {\n\t key: 'trun',\n\t value: function trun(track, offset) {\n\t var samples = track.samples || [],\n\t len = samples.length,\n\t arraylen = 12 + 16 * len,\n\t array = new Uint8Array(arraylen),\n\t i,\n\t sample,\n\t duration,\n\t size,\n\t flags,\n\t cts;\n\t offset += 8 + arraylen;\n\t array.set([0x00, // version 0\n\t 0x00, 0x0f, 0x01, // flags\n\t len >>> 24 & 0xFF, len >>> 16 & 0xFF, len >>> 8 & 0xFF, len & 0xFF, // sample_count\n\t offset >>> 24 & 0xFF, offset >>> 16 & 0xFF, offset >>> 8 & 0xFF, offset & 0xFF // data_offset\n\t ], 0);\n\t for (i = 0; i < len; i++) {\n\t sample = samples[i];\n\t duration = sample.duration;\n\t size = sample.size;\n\t flags = sample.flags;\n\t cts = sample.cts;\n\t array.set([duration >>> 24 & 0xFF, duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, // sample_duration\n\t size >>> 24 & 0xFF, size >>> 16 & 0xFF, size >>> 8 & 0xFF, size & 0xFF, // sample_size\n\t flags.isLeading << 2 | flags.dependsOn, flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.paddingValue << 1 | flags.isNonSync, flags.degradPrio & 0xF0 << 8, flags.degradPrio & 0x0F, // sample_flags\n\t cts >>> 24 & 0xFF, cts >>> 16 & 0xFF, cts >>> 8 & 0xFF, cts & 0xFF // sample_composition_time_offset\n\t ], 12 + 16 * i);\n\t }\n\t return MP4.box(MP4.types.trun, array);\n\t }\n\t }, {\n\t key: 'initSegment',\n\t value: function initSegment(tracks) {\n\t if (!MP4.types) {\n\t MP4.init();\n\t }\n\t var movie = MP4.moov(tracks),\n\t result;\n\t result = new Uint8Array(MP4.FTYP.byteLength + movie.byteLength);\n\t result.set(MP4.FTYP);\n\t result.set(movie, MP4.FTYP.byteLength);\n\t return result;\n\t }\n\t }]);\n\t\n\t return MP4;\n\t}();\n\t\n\texports.default = MP4;\n\t\n\t},{}],36:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * fMP4 remuxer\n\t */\n\t\n\tvar _aac = _dereq_(27);\n\t\n\tvar _aac2 = _interopRequireDefault(_aac);\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tvar _mp4Generator = _dereq_(35);\n\t\n\tvar _mp4Generator2 = _interopRequireDefault(_mp4Generator);\n\t\n\tvar _errors = _dereq_(24);\n\t\n\t_dereq_(44);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar MP4Remuxer = function () {\n\t function MP4Remuxer(observer, id, config) {\n\t _classCallCheck(this, MP4Remuxer);\n\t\n\t this.observer = observer;\n\t this.id = id;\n\t this.config = config;\n\t this.ISGenerated = false;\n\t this.PES2MP4SCALEFACTOR = 4;\n\t this.PES_TIMESCALE = 90000;\n\t this.MP4_TIMESCALE = this.PES_TIMESCALE / this.PES2MP4SCALEFACTOR;\n\t }\n\t\n\t _createClass(MP4Remuxer, [{\n\t key: 'destroy',\n\t value: function destroy() {}\n\t }, {\n\t key: 'insertDiscontinuity',\n\t value: function insertDiscontinuity() {\n\t this._initPTS = this._initDTS = undefined;\n\t }\n\t }, {\n\t key: 'switchLevel',\n\t value: function switchLevel() {\n\t this.ISGenerated = false;\n\t }\n\t }, {\n\t key: 'remux',\n\t value: function remux(level, sn, audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n\t this.level = level;\n\t this.sn = sn;\n\t // generate Init Segment if needed\n\t if (!this.ISGenerated) {\n\t this.generateIS(audioTrack, videoTrack, timeOffset);\n\t }\n\t\n\t if (this.ISGenerated) {\n\t // Purposefully remuxing audio before video, so that remuxVideo can use nextAacPts, which is\n\t // calculated in remuxAudio.\n\t //logger.log('nb AAC samples:' + audioTrack.samples.length);\n\t if (audioTrack.samples.length) {\n\t var audioData = this.remuxAudio(audioTrack, timeOffset, contiguous, accurateTimeOffset);\n\t //logger.log('nb AVC samples:' + videoTrack.samples.length);\n\t if (videoTrack.samples.length) {\n\t var audioTrackLength = void 0;\n\t if (audioData) {\n\t audioTrackLength = audioData.endPTS - audioData.startPTS;\n\t }\n\t this.remuxVideo(videoTrack, timeOffset, contiguous, audioTrackLength);\n\t }\n\t } else {\n\t var videoData = void 0;\n\t //logger.log('nb AVC samples:' + videoTrack.samples.length);\n\t if (videoTrack.samples.length) {\n\t videoData = this.remuxVideo(videoTrack, timeOffset, contiguous);\n\t }\n\t if (videoData && audioTrack.codec) {\n\t this.remuxEmptyAudio(audioTrack, timeOffset, contiguous, videoData);\n\t }\n\t }\n\t }\n\t //logger.log('nb ID3 samples:' + audioTrack.samples.length);\n\t if (id3Track.samples.length) {\n\t this.remuxID3(id3Track, timeOffset);\n\t }\n\t //logger.log('nb ID3 samples:' + audioTrack.samples.length);\n\t if (textTrack.samples.length) {\n\t this.remuxText(textTrack, timeOffset);\n\t }\n\t //notify end of parsing\n\t this.observer.trigger(_events2.default.FRAG_PARSED, { id: this.id, level: this.level, sn: this.sn });\n\t }\n\t }, {\n\t key: 'generateIS',\n\t value: function generateIS(audioTrack, videoTrack, timeOffset) {\n\t var observer = this.observer,\n\t audioSamples = audioTrack.samples,\n\t videoSamples = videoTrack.samples,\n\t pesTimeScale = this.PES_TIMESCALE,\n\t tracks = {},\n\t data = { id: this.id, level: this.level, sn: this.sn, tracks: tracks, unique: false },\n\t computePTSDTS = this._initPTS === undefined,\n\t initPTS,\n\t initDTS;\n\t\n\t if (computePTSDTS) {\n\t initPTS = initDTS = Infinity;\n\t }\n\t if (audioTrack.config && audioSamples.length) {\n\t audioTrack.timescale = audioTrack.audiosamplerate;\n\t // MP4 duration (track duration in seconds multiplied by timescale) is coded on 32 bits\n\t // we know that each AAC sample contains 1024 frames....\n\t // in order to avoid overflowing the 32 bit counter for large duration, we use smaller timescale (timescale/gcd)\n\t // we just need to ensure that AAC sample duration will still be an integer (will be 1024/gcd)\n\t if (audioTrack.timescale * audioTrack.duration > Math.pow(2, 32)) {\n\t (function () {\n\t var greatestCommonDivisor = function greatestCommonDivisor(a, b) {\n\t if (!b) {\n\t return a;\n\t }\n\t return greatestCommonDivisor(b, a % b);\n\t };\n\t audioTrack.timescale = audioTrack.audiosamplerate / greatestCommonDivisor(audioTrack.audiosamplerate, 1024);\n\t })();\n\t }\n\t _logger.logger.log('audio mp4 timescale :' + audioTrack.timescale);\n\t tracks.audio = {\n\t container: 'audio/mp4',\n\t codec: audioTrack.codec,\n\t initSegment: _mp4Generator2.default.initSegment([audioTrack]),\n\t metadata: {\n\t channelCount: audioTrack.channelCount\n\t }\n\t };\n\t if (computePTSDTS) {\n\t // remember first PTS of this demuxing context. for audio, PTS = DTS\n\t initPTS = initDTS = audioSamples[0].pts - pesTimeScale * timeOffset;\n\t }\n\t }\n\t\n\t if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n\t videoTrack.timescale = this.MP4_TIMESCALE;\n\t tracks.video = {\n\t container: 'video/mp4',\n\t codec: videoTrack.codec,\n\t initSegment: _mp4Generator2.default.initSegment([videoTrack]),\n\t metadata: {\n\t width: videoTrack.width,\n\t height: videoTrack.height\n\t }\n\t };\n\t if (computePTSDTS) {\n\t initPTS = Math.min(initPTS, videoSamples[0].pts - pesTimeScale * timeOffset);\n\t initDTS = Math.min(initDTS, videoSamples[0].dts - pesTimeScale * timeOffset);\n\t }\n\t }\n\t\n\t if (Object.keys(tracks).length) {\n\t observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);\n\t this.ISGenerated = true;\n\t if (computePTSDTS) {\n\t this._initPTS = initPTS;\n\t this._initDTS = initDTS;\n\t }\n\t } else {\n\t observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'no audio/video samples found' });\n\t }\n\t }\n\t }, {\n\t key: 'remuxVideo',\n\t value: function remuxVideo(track, timeOffset, contiguous, audioTrackLength) {\n\t var offset = 8,\n\t pesTimeScale = this.PES_TIMESCALE,\n\t pes2mp4ScaleFactor = this.PES2MP4SCALEFACTOR,\n\t mp4SampleDuration,\n\t mdat,\n\t moof,\n\t firstPTS,\n\t firstDTS,\n\t nextDTS,\n\t lastPTS,\n\t lastDTS,\n\t inputSamples = track.samples,\n\t outputSamples = [];\n\t\n\t // for (let i = 0; i < track.samples.length; i++) {\n\t // let avcSample = track.samples[i];\n\t // let units = avcSample.units.units;\n\t // let unitsString = '';\n\t // for (let j = 0; j < units.length ; j++) {\n\t // unitsString += units[j].type + ',';\n\t // if (units[j].data.length < 500) {\n\t // unitsString += Hex.hexDump(units[j].data);\n\t // }\n\t // }\n\t // logger.log(avcSample.pts + '/' + avcSample.dts + ',' + unitsString + avcSample.units.length);\n\t // }\n\t\n\t // handle broken streams with PTS < DTS, tolerance up 200ms (18000 in 90kHz timescale)\n\t var PTSDTSshift = inputSamples.reduce(function (prev, curr) {\n\t return Math.max(Math.min(prev, curr.pts - curr.dts), -18000);\n\t }, 0);\n\t if (PTSDTSshift < 0) {\n\t _logger.logger.warn('PTS < DTS detected in video samples, shifting DTS by ' + Math.round(PTSDTSshift / 90) + ' ms to overcome this issue');\n\t for (var i = 0; i < inputSamples.length; i++) {\n\t inputSamples[i].dts += PTSDTSshift;\n\t }\n\t }\n\t\n\t // PTS is coded on 33bits, and can loop from -2^32 to 2^32\n\t // PTSNormalize will make PTS/DTS value monotonic, we use last known DTS value as reference value\n\t var nextAvcDts = void 0;\n\t // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n\t if (contiguous) {\n\t // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n\t nextAvcDts = this.nextAvcDts;\n\t } else {\n\t // if not contiguous, let's use target timeOffset\n\t nextAvcDts = timeOffset * pesTimeScale;\n\t }\n\t\n\t // compute first DTS and last DTS, normalize them against reference value\n\t var sample = inputSamples[0];\n\t firstDTS = Math.max(this._PTSNormalize(sample.dts - this._initDTS, nextAvcDts), 0);\n\t firstPTS = Math.max(this._PTSNormalize(sample.pts - this._initDTS, nextAvcDts), 0);\n\t\n\t // check timestamp continuity accross consecutive fragments (this is to remove inter-fragment gap/hole)\n\t var delta = Math.round((firstDTS - nextAvcDts) / 90);\n\t // if fragment are contiguous, detect hole/overlapping between fragments\n\t if (contiguous) {\n\t if (delta) {\n\t if (delta > 1) {\n\t _logger.logger.log('AVC:' + delta + ' ms hole between fragments detected,filling it');\n\t } else if (delta < -1) {\n\t _logger.logger.log('AVC:' + -delta + ' ms overlapping between fragments detected');\n\t }\n\t // remove hole/gap : set DTS to next expected DTS\n\t firstDTS = nextAvcDts;\n\t inputSamples[0].dts = firstDTS + this._initDTS;\n\t // offset PTS as well, ensure that PTS is smaller or equal than new DTS\n\t firstPTS = Math.max(firstPTS - delta, nextAvcDts);\n\t inputSamples[0].pts = firstPTS + this._initDTS;\n\t _logger.logger.log('Video/PTS/DTS adjusted: ' + Math.round(firstPTS / 90) + '/' + Math.round(firstDTS / 90) + ',delta:' + delta + ' ms');\n\t }\n\t }\n\t nextDTS = firstDTS;\n\t\n\t // compute lastPTS/lastDTS\n\t sample = inputSamples[inputSamples.length - 1];\n\t lastDTS = Math.max(this._PTSNormalize(sample.dts - this._initDTS, nextAvcDts), 0);\n\t lastPTS = Math.max(this._PTSNormalize(sample.pts - this._initDTS, nextAvcDts), 0);\n\t lastPTS = Math.max(lastPTS, lastDTS);\n\t\n\t var vendor = navigator.vendor,\n\t userAgent = navigator.userAgent,\n\t isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');\n\t\n\t // on Safari let's signal the same sample duration for all samples\n\t // sample duration (as expected by trun MP4 boxes), should be the delta between sample DTS\n\t // set this constant duration as being the avg delta between consecutive DTS.\n\t if (isSafari) {\n\t mp4SampleDuration = Math.round((lastDTS - firstDTS) / (pes2mp4ScaleFactor * (inputSamples.length - 1)));\n\t }\n\t\n\t // normalize all PTS/DTS now ...\n\t for (var _i = 0; _i < inputSamples.length; _i++) {\n\t var _sample = inputSamples[_i];\n\t if (isSafari) {\n\t // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples\n\t _sample.dts = firstDTS + _i * pes2mp4ScaleFactor * mp4SampleDuration;\n\t } else {\n\t // ensure sample monotonic DTS\n\t _sample.dts = Math.max(this._PTSNormalize(_sample.dts - this._initDTS, nextAvcDts), firstDTS);\n\t // ensure dts is a multiple of scale factor to avoid rounding issues\n\t _sample.dts = Math.round(_sample.dts / pes2mp4ScaleFactor) * pes2mp4ScaleFactor;\n\t }\n\t // we normalize PTS against nextAvcDts, we also substract initDTS (some streams don't start @ PTS O)\n\t // and we ensure that computed value is greater or equal than sample DTS\n\t _sample.pts = Math.max(this._PTSNormalize(_sample.pts - this._initDTS, nextAvcDts), _sample.dts);\n\t // ensure pts is a multiple of scale factor to avoid rounding issues\n\t _sample.pts = Math.round(_sample.pts / pes2mp4ScaleFactor) * pes2mp4ScaleFactor;\n\t }\n\t\n\t /* concatenate the video data and construct the mdat in place\n\t (need 8 more bytes to fill length and mpdat type) */\n\t mdat = new Uint8Array(track.len + 4 * track.nbNalu + 8);\n\t var view = new DataView(mdat.buffer);\n\t view.setUint32(0, mdat.byteLength);\n\t mdat.set(_mp4Generator2.default.types.mdat, 4);\n\t\n\t for (var _i2 = 0; _i2 < inputSamples.length; _i2++) {\n\t var avcSample = inputSamples[_i2],\n\t mp4SampleLength = 0,\n\t compositionTimeOffset = void 0;\n\t // convert NALU bitstream to MP4 format (prepend NALU with size field)\n\t while (avcSample.units.units.length) {\n\t var unit = avcSample.units.units.shift();\n\t view.setUint32(offset, unit.data.byteLength);\n\t offset += 4;\n\t mdat.set(unit.data, offset);\n\t offset += unit.data.byteLength;\n\t mp4SampleLength += 4 + unit.data.byteLength;\n\t }\n\t\n\t if (!isSafari) {\n\t // expected sample duration is the Decoding Timestamp diff of consecutive samples\n\t if (_i2 < inputSamples.length - 1) {\n\t mp4SampleDuration = inputSamples[_i2 + 1].dts - avcSample.dts;\n\t } else {\n\t var config = this.config,\n\t lastFrameDuration = avcSample.dts - inputSamples[_i2 > 0 ? _i2 - 1 : _i2].dts;\n\t if (config.stretchShortVideoTrack) {\n\t // In some cases, a segment's audio track duration may exceed the video track duration.\n\t // Since we've already remuxed audio, and we know how long the audio track is, we look to\n\t // see if the delta to the next segment is longer than the minimum of maxBufferHole and\n\t // maxSeekHole. If so, playback would potentially get stuck, so we artificially inflate\n\t // the duration of the last frame to minimize any potential gap between segments.\n\t var maxBufferHole = config.maxBufferHole,\n\t maxSeekHole = config.maxSeekHole,\n\t gapTolerance = Math.floor(Math.min(maxBufferHole, maxSeekHole) * pesTimeScale),\n\t deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * pesTimeScale : this.nextAacPts) - avcSample.pts;\n\t if (deltaToFrameEnd > gapTolerance) {\n\t // We subtract lastFrameDuration from deltaToFrameEnd to try to prevent any video\n\t // frame overlap. maxBufferHole/maxSeekHole should be >> lastFrameDuration anyway.\n\t mp4SampleDuration = deltaToFrameEnd - lastFrameDuration;\n\t if (mp4SampleDuration < 0) {\n\t mp4SampleDuration = lastFrameDuration;\n\t }\n\t _logger.logger.log('It is approximately ' + deltaToFrameEnd / 90 + ' ms to the next segment; using duration ' + mp4SampleDuration / 90 + ' ms for the last video frame.');\n\t } else {\n\t mp4SampleDuration = lastFrameDuration;\n\t }\n\t } else {\n\t mp4SampleDuration = lastFrameDuration;\n\t }\n\t }\n\t mp4SampleDuration /= pes2mp4ScaleFactor;\n\t compositionTimeOffset = Math.round((avcSample.pts - avcSample.dts) / pes2mp4ScaleFactor);\n\t } else {\n\t compositionTimeOffset = Math.max(0, mp4SampleDuration * Math.round((avcSample.pts - avcSample.dts) / (pes2mp4ScaleFactor * mp4SampleDuration)));\n\t }\n\t\n\t //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${this._initDTS}/${ptsnorm}/${dtsnorm}/${(avcSample.pts/4294967296).toFixed(3)}');\n\t outputSamples.push({\n\t size: mp4SampleLength,\n\t // constant duration\n\t duration: mp4SampleDuration,\n\t cts: compositionTimeOffset,\n\t flags: {\n\t isLeading: 0,\n\t isDependedOn: 0,\n\t hasRedundancy: 0,\n\t degradPrio: 0,\n\t dependsOn: avcSample.key ? 2 : 1,\n\t isNonSync: avcSample.key ? 0 : 1\n\t }\n\t });\n\t }\n\t // next AVC sample DTS should be equal to last sample DTS + last sample duration (in PES timescale)\n\t this.nextAvcDts = lastDTS + mp4SampleDuration * pes2mp4ScaleFactor;\n\t var dropped = track.dropped;\n\t track.len = 0;\n\t track.nbNalu = 0;\n\t track.dropped = 0;\n\t if (outputSamples.length && navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {\n\t var flags = outputSamples[0].flags;\n\t // chrome workaround, mark first sample as being a Random Access Point to avoid sourcebuffer append issue\n\t // https://code.google.com/p/chromium/issues/detail?id=229412\n\t flags.dependsOn = 2;\n\t flags.isNonSync = 0;\n\t }\n\t track.samples = outputSamples;\n\t moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS / pes2mp4ScaleFactor, track);\n\t track.samples = [];\n\t\n\t var data = {\n\t id: this.id,\n\t level: this.level,\n\t sn: this.sn,\n\t data1: moof,\n\t data2: mdat,\n\t startPTS: firstPTS / pesTimeScale,\n\t endPTS: (lastPTS + pes2mp4ScaleFactor * mp4SampleDuration) / pesTimeScale,\n\t startDTS: firstDTS / pesTimeScale,\n\t endDTS: this.nextAvcDts / pesTimeScale,\n\t type: 'video',\n\t nb: outputSamples.length,\n\t dropped: dropped\n\t };\n\t this.observer.trigger(_events2.default.FRAG_PARSING_DATA, data);\n\t return data;\n\t }\n\t }, {\n\t key: 'remuxAudio',\n\t value: function remuxAudio(track, timeOffset, contiguous, accurateTimeOffset) {\n\t var pesTimeScale = this.PES_TIMESCALE,\n\t mp4timeScale = track.timescale,\n\t pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,\n\t expectedSampleDuration = track.timescale * 1024 / track.audiosamplerate;\n\t var view,\n\t offset = 8,\n\t aacSample,\n\t mp4Sample,\n\t unit,\n\t mdat,\n\t moof,\n\t firstPTS,\n\t firstDTS,\n\t lastDTS,\n\t pts,\n\t dts,\n\t ptsnorm,\n\t dtsnorm,\n\t samples = [],\n\t samples0 = [],\n\t fillFrame,\n\t newStamp;\n\t\n\t track.samples.sort(function (a, b) {\n\t return a.pts - b.pts;\n\t });\n\t samples0 = track.samples;\n\t\n\t // for audio samples, also consider consecutive fragments as being contiguous (even if a level switch occurs),\n\t // for sake of clarity:\n\t // consecutive fragments are frags with less than 100ms gaps between new time offset and next expected PTS\n\t // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n\t // this helps ensuring audio continuity\n\t // and this also avoids audio glitches/cut when switching quality, or reporting wrong duration on first audio frame\n\t\n\t contiguous |= samples0.length && this.nextAacPts && Math.abs(timeOffset - this.nextAacPts / pesTimeScale) < 0.1;\n\t\n\t var nextAacPts = contiguous ? this.nextAacPts : timeOffset * pesTimeScale;\n\t\n\t // If the audio track is missing samples, the frames seem to get \"left-shifted\" within the\n\t // resulting mp4 segment, causing sync issues and leaving gaps at the end of the audio segment.\n\t // In an effort to prevent this from happening, we inject frames here where there are gaps.\n\t // When possible, we inject a silent frame; when that's not possible, we duplicate the last\n\t // frame.\n\t var pesFrameDuration = expectedSampleDuration * pes2mp4ScaleFactor;\n\t var nextPtsNorm = nextAacPts;\n\t\n\t // only inject/drop audio frames in case time offset is accurate\n\t if (accurateTimeOffset) {\n\t for (var i = 0; i < samples0.length;) {\n\t // First, let's see how far off this frame is from where we expect it to be\n\t var sample = samples0[i],\n\t ptsNorm = this._PTSNormalize(sample.pts - this._initDTS, nextAacPts),\n\t delta = ptsNorm - nextPtsNorm;\n\t\n\t // If we're overlapping by more than a duration, drop this sample\n\t if (delta <= -pesFrameDuration) {\n\t _logger.logger.warn('Dropping 1 audio frame @ ' + Math.round(nextPtsNorm / 90) / 1000 + 's due to ' + Math.round(Math.abs(delta / 90)) + ' ms overlap.');\n\t samples0.splice(i, 1);\n\t track.len -= sample.unit.length;\n\t // Don't touch nextPtsNorm or i\n\t }\n\t // Otherwise, if we're more than a frame away from where we should be, insert missing frames\n\t else if (delta >= pesFrameDuration) {\n\t var missing = Math.round(delta / pesFrameDuration);\n\t _logger.logger.warn('Injecting ' + missing + ' audio frame @ ' + Math.round(nextPtsNorm / 90) / 1000 + 's due to ' + Math.round(delta / 90) + ' ms gap.');\n\t for (var j = 0; j < missing; j++) {\n\t newStamp = nextPtsNorm + this._initDTS;\n\t newStamp = Math.max(newStamp, this._initDTS);\n\t fillFrame = _aac2.default.getSilentFrame(track.channelCount);\n\t if (!fillFrame) {\n\t _logger.logger.log('Unable to get silent frame for given audio codec; duplicating last frame instead.');\n\t fillFrame = sample.unit.slice(0);\n\t }\n\t samples0.splice(i, 0, { unit: fillFrame, pts: newStamp, dts: newStamp });\n\t track.len += fillFrame.length;\n\t nextPtsNorm += pesFrameDuration;\n\t i += 1;\n\t }\n\t\n\t // Adjust sample to next expected pts\n\t sample.pts = sample.dts = nextPtsNorm + this._initDTS;\n\t nextPtsNorm += pesFrameDuration;\n\t i += 1;\n\t }\n\t // Otherwise, we're within half a frame duration, so just adjust pts\n\t else {\n\t if (Math.abs(delta) > 0.1 * pesFrameDuration) {\n\t //logger.log(`Invalid frame delta ${Math.round(ptsNorm - nextPtsNorm + pesFrameDuration)} at PTS ${Math.round(ptsNorm / 90)} (should be ${Math.round(pesFrameDuration)}).`);\n\t }\n\t nextPtsNorm += pesFrameDuration;\n\t if (i === 0) {\n\t sample.pts = sample.dts = this._initDTS + nextAacPts;\n\t } else {\n\t sample.pts = sample.dts = samples0[i - 1].pts + pesFrameDuration;\n\t }\n\t i += 1;\n\t }\n\t }\n\t }\n\t\n\t while (samples0.length) {\n\t aacSample = samples0.shift();\n\t unit = aacSample.unit;\n\t pts = aacSample.pts - this._initDTS;\n\t dts = aacSample.dts - this._initDTS;\n\t //logger.log(`Audio/PTS:${Math.round(pts/90)}`);\n\t // if not first sample\n\t if (lastDTS !== undefined) {\n\t ptsnorm = this._PTSNormalize(pts, lastDTS);\n\t dtsnorm = this._PTSNormalize(dts, lastDTS);\n\t mp4Sample.duration = Math.round((dtsnorm - lastDTS) / pes2mp4ScaleFactor);\n\t } else {\n\t ptsnorm = this._PTSNormalize(pts, nextAacPts);\n\t dtsnorm = this._PTSNormalize(dts, nextAacPts);\n\t var _delta = Math.round(1000 * (ptsnorm - nextAacPts) / pesTimeScale),\n\t numMissingFrames = 0;\n\t // if fragment are contiguous, detect hole/overlapping between fragments\n\t // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n\t if (contiguous) {\n\t // log delta\n\t if (_delta) {\n\t if (_delta > 0) {\n\t numMissingFrames = Math.round((ptsnorm - nextAacPts) / pesFrameDuration);\n\t _logger.logger.log(_delta + ' ms hole between AAC samples detected,filling it');\n\t if (numMissingFrames > 0) {\n\t fillFrame = _aac2.default.getSilentFrame(track.channelCount);\n\t if (!fillFrame) {\n\t fillFrame = unit.slice(0);\n\t }\n\t track.len += numMissingFrames * fillFrame.length;\n\t }\n\t // if we have frame overlap, overlapping for more than half a frame duraion\n\t } else if (_delta < -12) {\n\t // drop overlapping audio frames... browser will deal with it\n\t _logger.logger.log(-_delta + ' ms overlapping between AAC samples detected, drop frame');\n\t track.len -= unit.byteLength;\n\t continue;\n\t }\n\t // set PTS/DTS to expected PTS/DTS\n\t ptsnorm = dtsnorm = nextAacPts;\n\t }\n\t }\n\t // remember first PTS of our aacSamples, ensure value is positive\n\t firstPTS = Math.max(0, ptsnorm);\n\t firstDTS = Math.max(0, dtsnorm);\n\t if (track.len > 0) {\n\t /* concatenate the audio data and construct the mdat in place\n\t (need 8 more bytes to fill length and mdat type) */\n\t mdat = new Uint8Array(track.len + 8);\n\t view = new DataView(mdat.buffer);\n\t view.setUint32(0, mdat.byteLength);\n\t mdat.set(_mp4Generator2.default.types.mdat, 4);\n\t } else {\n\t // no audio samples\n\t return;\n\t }\n\t for (var _i3 = 0; _i3 < numMissingFrames; _i3++) {\n\t newStamp = ptsnorm - (numMissingFrames - _i3) * pesFrameDuration;\n\t fillFrame = _aac2.default.getSilentFrame(track.channelCount);\n\t if (!fillFrame) {\n\t _logger.logger.log('Unable to get silent frame for given audio codec; duplicating this frame instead.');\n\t fillFrame = unit.slice(0);\n\t }\n\t mdat.set(fillFrame, offset);\n\t offset += fillFrame.byteLength;\n\t mp4Sample = {\n\t size: fillFrame.byteLength,\n\t cts: 0,\n\t duration: 1024,\n\t flags: {\n\t isLeading: 0,\n\t isDependedOn: 0,\n\t hasRedundancy: 0,\n\t degradPrio: 0,\n\t dependsOn: 1\n\t }\n\t };\n\t samples.push(mp4Sample);\n\t }\n\t }\n\t mdat.set(unit, offset);\n\t offset += unit.byteLength;\n\t //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${aacSample.pts}/${aacSample.dts}/${this._initDTS}/${ptsnorm}/${dtsnorm}/${(aacSample.pts/4294967296).toFixed(3)}');\n\t mp4Sample = {\n\t size: unit.byteLength,\n\t cts: 0,\n\t duration: 0,\n\t flags: {\n\t isLeading: 0,\n\t isDependedOn: 0,\n\t hasRedundancy: 0,\n\t degradPrio: 0,\n\t dependsOn: 1\n\t }\n\t };\n\t samples.push(mp4Sample);\n\t lastDTS = dtsnorm;\n\t }\n\t var lastSampleDuration = 0;\n\t var nbSamples = samples.length;\n\t //set last sample duration as being identical to previous sample\n\t if (nbSamples >= 2) {\n\t lastSampleDuration = samples[nbSamples - 2].duration;\n\t mp4Sample.duration = lastSampleDuration;\n\t }\n\t if (nbSamples) {\n\t // next aac sample PTS should be equal to last sample PTS + duration\n\t this.nextAacPts = ptsnorm + pes2mp4ScaleFactor * lastSampleDuration;\n\t //logger.log('Audio/PTS/PTSend:' + aacSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));\n\t track.len = 0;\n\t track.samples = samples;\n\t moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS / pes2mp4ScaleFactor, track);\n\t track.samples = [];\n\t var audioData = {\n\t id: this.id,\n\t level: this.level,\n\t sn: this.sn,\n\t data1: moof,\n\t data2: mdat,\n\t startPTS: firstPTS / pesTimeScale,\n\t endPTS: this.nextAacPts / pesTimeScale,\n\t startDTS: firstDTS / pesTimeScale,\n\t endDTS: (dtsnorm + pes2mp4ScaleFactor * lastSampleDuration) / pesTimeScale,\n\t type: 'audio',\n\t nb: nbSamples\n\t };\n\t this.observer.trigger(_events2.default.FRAG_PARSING_DATA, audioData);\n\t return audioData;\n\t }\n\t return null;\n\t }\n\t }, {\n\t key: 'remuxEmptyAudio',\n\t value: function remuxEmptyAudio(track, timeOffset, contiguous, videoData) {\n\t var pesTimeScale = this.PES_TIMESCALE,\n\t mp4timeScale = track.timescale ? track.timescale : track.audiosamplerate,\n\t pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,\n\t\n\t\n\t // sync with video's timestamp\n\t startDTS = videoData.startDTS * pesTimeScale + this._initDTS,\n\t endDTS = videoData.endDTS * pesTimeScale + this._initDTS,\n\t\n\t\n\t // one sample's duration value\n\t sampleDuration = 1024,\n\t frameDuration = pes2mp4ScaleFactor * sampleDuration,\n\t\n\t\n\t // samples count of this segment's duration\n\t nbSamples = Math.ceil((endDTS - startDTS) / frameDuration),\n\t\n\t\n\t // silent frame\n\t silentFrame = _aac2.default.getSilentFrame(track.channelCount);\n\t\n\t // Can't remux if we can't generate a silent frame...\n\t if (!silentFrame) {\n\t _logger.logger.trace('Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!');\n\t return;\n\t }\n\t\n\t var samples = [];\n\t for (var i = 0; i < nbSamples; i++) {\n\t var stamp = startDTS + i * frameDuration;\n\t samples.push({ unit: silentFrame.slice(0), pts: stamp, dts: stamp });\n\t track.len += silentFrame.length;\n\t }\n\t track.samples = samples;\n\t\n\t this.remuxAudio(track, timeOffset, contiguous);\n\t }\n\t }, {\n\t key: 'remuxID3',\n\t value: function remuxID3(track, timeOffset) {\n\t var length = track.samples.length,\n\t sample;\n\t // consume samples\n\t if (length) {\n\t for (var index = 0; index < length; index++) {\n\t sample = track.samples[index];\n\t // setting id3 pts, dts to relative time\n\t // using this._initPTS and this._initDTS to calculate relative time\n\t sample.pts = (sample.pts - this._initPTS) / this.PES_TIMESCALE;\n\t sample.dts = (sample.dts - this._initDTS) / this.PES_TIMESCALE;\n\t }\n\t this.observer.trigger(_events2.default.FRAG_PARSING_METADATA, {\n\t id: this.id,\n\t level: this.level,\n\t sn: this.sn,\n\t samples: track.samples\n\t });\n\t }\n\t\n\t track.samples = [];\n\t timeOffset = timeOffset;\n\t }\n\t }, {\n\t key: 'remuxText',\n\t value: function remuxText(track, timeOffset) {\n\t track.samples.sort(function (a, b) {\n\t return a.pts - b.pts;\n\t });\n\t\n\t var length = track.samples.length,\n\t sample;\n\t // consume samples\n\t if (length) {\n\t for (var index = 0; index < length; index++) {\n\t sample = track.samples[index];\n\t // setting text pts, dts to relative time\n\t // using this._initPTS and this._initDTS to calculate relative time\n\t sample.pts = (sample.pts - this._initPTS) / this.PES_TIMESCALE;\n\t }\n\t this.observer.trigger(_events2.default.FRAG_PARSING_USERDATA, {\n\t id: this.id,\n\t level: this.level,\n\t sn: this.sn,\n\t samples: track.samples\n\t });\n\t }\n\t\n\t track.samples = [];\n\t timeOffset = timeOffset;\n\t }\n\t }, {\n\t key: '_PTSNormalize',\n\t value: function _PTSNormalize(value, reference) {\n\t var offset;\n\t if (reference === undefined) {\n\t return value;\n\t }\n\t if (reference < value) {\n\t // - 2^33\n\t offset = -8589934592;\n\t } else {\n\t // + 2^33\n\t offset = 8589934592;\n\t }\n\t /* PTS is 33bit (from 0 to 2^33 -1)\n\t if diff between value and reference is bigger than half of the amplitude (2^32) then it means that\n\t PTS looping occured. fill the gap */\n\t while (Math.abs(value - reference) > 4294967296) {\n\t value += offset;\n\t }\n\t return value;\n\t }\n\t }, {\n\t key: 'passthrough',\n\t get: function get() {\n\t return false;\n\t }\n\t }]);\n\t\n\t return MP4Remuxer;\n\t}();\n\t\n\texports.default = MP4Remuxer;\n\t\n\t},{\"24\":24,\"26\":26,\"27\":27,\"35\":35,\"43\":43,\"44\":44}],37:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * passthrough remuxer\n\t */\n\t\n\t\n\tvar _events = _dereq_(26);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar PassThroughRemuxer = function () {\n\t function PassThroughRemuxer(observer, id) {\n\t _classCallCheck(this, PassThroughRemuxer);\n\t\n\t this.observer = observer;\n\t this.id = id;\n\t this.ISGenerated = false;\n\t }\n\t\n\t _createClass(PassThroughRemuxer, [{\n\t key: 'destroy',\n\t value: function destroy() {}\n\t }, {\n\t key: 'insertDiscontinuity',\n\t value: function insertDiscontinuity() {}\n\t }, {\n\t key: 'switchLevel',\n\t value: function switchLevel() {\n\t this.ISGenerated = false;\n\t }\n\t }, {\n\t key: 'remux',\n\t value: function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, rawData) {\n\t var observer = this.observer;\n\t // generate Init Segment if needed\n\t if (!this.ISGenerated) {\n\t var tracks = {},\n\t data = { id: this.id, tracks: tracks, unique: true },\n\t track = videoTrack,\n\t codec = track.codec;\n\t\n\t if (codec) {\n\t data.tracks.video = {\n\t container: track.container,\n\t codec: codec,\n\t metadata: {\n\t width: track.width,\n\t height: track.height\n\t }\n\t };\n\t }\n\t\n\t track = audioTrack;\n\t codec = track.codec;\n\t if (codec) {\n\t data.tracks.audio = {\n\t container: track.container,\n\t codec: codec,\n\t metadata: {\n\t channelCount: track.channelCount\n\t }\n\t };\n\t }\n\t this.ISGenerated = true;\n\t observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);\n\t }\n\t observer.trigger(_events2.default.FRAG_PARSING_DATA, {\n\t id: this.id,\n\t data1: rawData,\n\t startPTS: timeOffset,\n\t startDTS: timeOffset,\n\t type: 'audiovideo',\n\t nb: 1,\n\t dropped: 0\n\t });\n\t }\n\t }, {\n\t key: 'passthrough',\n\t get: function get() {\n\t return true;\n\t }\n\t }]);\n\t\n\t return PassThroughRemuxer;\n\t}();\n\t\n\texports.default = PassThroughRemuxer;\n\t\n\t},{\"26\":26}],38:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js\n\t\n\tvar AttrList = function () {\n\t function AttrList(attrs) {\n\t _classCallCheck(this, AttrList);\n\t\n\t if (typeof attrs === 'string') {\n\t attrs = AttrList.parseAttrList(attrs);\n\t }\n\t for (var attr in attrs) {\n\t if (attrs.hasOwnProperty(attr)) {\n\t this[attr] = attrs[attr];\n\t }\n\t }\n\t }\n\t\n\t _createClass(AttrList, [{\n\t key: 'decimalInteger',\n\t value: function decimalInteger(attrName) {\n\t var intValue = parseInt(this[attrName], 10);\n\t if (intValue > Number.MAX_SAFE_INTEGER) {\n\t return Infinity;\n\t }\n\t return intValue;\n\t }\n\t }, {\n\t key: 'hexadecimalInteger',\n\t value: function hexadecimalInteger(attrName) {\n\t if (this[attrName]) {\n\t var stringValue = (this[attrName] || '0x').slice(2);\n\t stringValue = (stringValue.length & 1 ? '0' : '') + stringValue;\n\t\n\t var value = new Uint8Array(stringValue.length / 2);\n\t for (var i = 0; i < stringValue.length / 2; i++) {\n\t value[i] = parseInt(stringValue.slice(i * 2, i * 2 + 2), 16);\n\t }\n\t return value;\n\t } else {\n\t return null;\n\t }\n\t }\n\t }, {\n\t key: 'hexadecimalIntegerAsNumber',\n\t value: function hexadecimalIntegerAsNumber(attrName) {\n\t var intValue = parseInt(this[attrName], 16);\n\t if (intValue > Number.MAX_SAFE_INTEGER) {\n\t return Infinity;\n\t }\n\t return intValue;\n\t }\n\t }, {\n\t key: 'decimalFloatingPoint',\n\t value: function decimalFloatingPoint(attrName) {\n\t return parseFloat(this[attrName]);\n\t }\n\t }, {\n\t key: 'enumeratedString',\n\t value: function enumeratedString(attrName) {\n\t return this[attrName];\n\t }\n\t }, {\n\t key: 'decimalResolution',\n\t value: function decimalResolution(attrName) {\n\t var res = /^(\\d+)x(\\d+)$/.exec(this[attrName]);\n\t if (res === null) {\n\t return undefined;\n\t }\n\t return {\n\t width: parseInt(res[1], 10),\n\t height: parseInt(res[2], 10)\n\t };\n\t }\n\t }], [{\n\t key: 'parseAttrList',\n\t value: function parseAttrList(input) {\n\t var re = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g;\n\t var match,\n\t attrs = {};\n\t while ((match = re.exec(input)) !== null) {\n\t var value = match[2],\n\t quote = '\"';\n\t\n\t if (value.indexOf(quote) === 0 && value.lastIndexOf(quote) === value.length - 1) {\n\t value = value.slice(1, -1);\n\t }\n\t attrs[match[1]] = value;\n\t }\n\t return attrs;\n\t }\n\t }]);\n\t\n\t return AttrList;\n\t}();\n\t\n\texports.default = AttrList;\n\t\n\t},{}],39:[function(_dereq_,module,exports){\n\t\"use strict\";\n\t\n\tvar BinarySearch = {\n\t /**\n\t * Searches for an item in an array which matches a certain condition.\n\t * This requires the condition to only match one item in the array,\n\t * and for the array to be ordered.\n\t *\n\t * @param {Array} list The array to search.\n\t * @param {Function} comparisonFunction\n\t * Called and provided a candidate item as the first argument.\n\t * Should return:\n\t * > -1 if the item should be located at a lower index than the provided item.\n\t * > 1 if the item should be located at a higher index than the provided item.\n\t * > 0 if the item is the item you're looking for.\n\t *\n\t * @return {*} The object if it is found or null otherwise.\n\t */\n\t search: function search(list, comparisonFunction) {\n\t var minIndex = 0;\n\t var maxIndex = list.length - 1;\n\t var currentIndex = null;\n\t var currentElement = null;\n\t\n\t while (minIndex <= maxIndex) {\n\t currentIndex = (minIndex + maxIndex) / 2 | 0;\n\t currentElement = list[currentIndex];\n\t\n\t var comparisonResult = comparisonFunction(currentElement);\n\t if (comparisonResult > 0) {\n\t minIndex = currentIndex + 1;\n\t } else if (comparisonResult < 0) {\n\t maxIndex = currentIndex - 1;\n\t } else {\n\t return currentElement;\n\t }\n\t }\n\t\n\t return null;\n\t }\n\t};\n\t\n\tmodule.exports = BinarySearch;\n\t\n\t},{}],40:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t *\n\t * This code was ported from the dash.js project at:\n\t * https://github.com/Dash-Industry-Forum/dash.js/blob/development/externals/cea608-parser.js\n\t * https://github.com/Dash-Industry-Forum/dash.js/commit/8269b26a761e0853bb21d78780ed945144ecdd4d#diff-71bc295a2d6b6b7093a1d3290d53a4b2\n\t *\n\t * The original copyright appears below:\n\t *\n\t * The copyright in this software is being made available under the BSD License,\n\t * included below. This software may be subject to other third party and contributor\n\t * rights, including patent rights, and no such rights are granted under this license.\n\t *\n\t * Copyright (c) 2015-2016, DASH Industry Forum.\n\t * All rights reserved.\n\t *\n\t * Redistribution and use in source and binary forms, with or without modification,\n\t * are permitted provided that the following conditions are met:\n\t * 1. Redistributions of source code must retain the above copyright notice, this\n\t * list of conditions and the following disclaimer.\n\t * * Redistributions in binary form must reproduce the above copyright notice,\n\t * this list of conditions and the following disclaimer in the documentation and/or\n\t * other materials provided with the distribution.\n\t * 2. Neither the name of Dash Industry Forum nor the names of its\n\t * contributors may be used to endorse or promote products derived from this software\n\t * without specific prior written permission.\n\t *\n\t * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n\t * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n\t * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n\t * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n\t * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n\t * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n\t * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n\t * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n\t * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n\t * POSSIBILITY OF SUCH DAMAGE.\n\t */\n\t/**\n\t * Exceptions from regular ASCII. CodePoints are mapped to UTF-16 codes\n\t */\n\t\n\tvar specialCea608CharsCodes = {\n\t 0x2a: 0xe1, // lowercase a, acute accent\n\t 0x5c: 0xe9, // lowercase e, acute accent\n\t 0x5e: 0xed, // lowercase i, acute accent\n\t 0x5f: 0xf3, // lowercase o, acute accent\n\t 0x60: 0xfa, // lowercase u, acute accent\n\t 0x7b: 0xe7, // lowercase c with cedilla\n\t 0x7c: 0xf7, // division symbol\n\t 0x7d: 0xd1, // uppercase N tilde\n\t 0x7e: 0xf1, // lowercase n tilde\n\t 0x7f: 0x2588, // Full block\n\t // THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n\t // THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F\n\t // THIS MEANS THAT \\x50 MUST BE ADDED TO THE VALUES\n\t 0x80: 0xae, // Registered symbol (R)\n\t 0x81: 0xb0, // degree sign\n\t 0x82: 0xbd, // 1/2 symbol\n\t 0x83: 0xbf, // Inverted (open) question mark\n\t 0x84: 0x2122, // Trademark symbol (TM)\n\t 0x85: 0xa2, // Cents symbol\n\t 0x86: 0xa3, // Pounds sterling\n\t 0x87: 0x266a, // Music 8'th note\n\t 0x88: 0xe0, // lowercase a, grave accent\n\t 0x89: 0x20, // transparent space (regular)\n\t 0x8a: 0xe8, // lowercase e, grave accent\n\t 0x8b: 0xe2, // lowercase a, circumflex accent\n\t 0x8c: 0xea, // lowercase e, circumflex accent\n\t 0x8d: 0xee, // lowercase i, circumflex accent\n\t 0x8e: 0xf4, // lowercase o, circumflex accent\n\t 0x8f: 0xfb, // lowercase u, circumflex accent\n\t // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n\t // THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F\n\t 0x90: 0xc1, // capital letter A with acute\n\t 0x91: 0xc9, // capital letter E with acute\n\t 0x92: 0xd3, // capital letter O with acute\n\t 0x93: 0xda, // capital letter U with acute\n\t 0x94: 0xdc, // capital letter U with diaresis\n\t 0x95: 0xfc, // lowercase letter U with diaeresis\n\t 0x96: 0x2018, // opening single quote\n\t 0x97: 0xa1, // inverted exclamation mark\n\t 0x98: 0x2a, // asterisk\n\t 0x99: 0x2019, // closing single quote\n\t 0x9a: 0x2501, // box drawings heavy horizontal\n\t 0x9b: 0xa9, // copyright sign\n\t 0x9c: 0x2120, // Service mark\n\t 0x9d: 0x2022, // (round) bullet\n\t 0x9e: 0x201c, // Left double quotation mark\n\t 0x9f: 0x201d, // Right double quotation mark\n\t 0xa0: 0xc0, // uppercase A, grave accent\n\t 0xa1: 0xc2, // uppercase A, circumflex\n\t 0xa2: 0xc7, // uppercase C with cedilla\n\t 0xa3: 0xc8, // uppercase E, grave accent\n\t 0xa4: 0xca, // uppercase E, circumflex\n\t 0xa5: 0xcb, // capital letter E with diaresis\n\t 0xa6: 0xeb, // lowercase letter e with diaresis\n\t 0xa7: 0xce, // uppercase I, circumflex\n\t 0xa8: 0xcf, // uppercase I, with diaresis\n\t 0xa9: 0xef, // lowercase i, with diaresis\n\t 0xaa: 0xd4, // uppercase O, circumflex\n\t 0xab: 0xd9, // uppercase U, grave accent\n\t 0xac: 0xf9, // lowercase u, grave accent\n\t 0xad: 0xdb, // uppercase U, circumflex\n\t 0xae: 0xab, // left-pointing double angle quotation mark\n\t 0xaf: 0xbb, // right-pointing double angle quotation mark\n\t // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n\t // THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F\n\t 0xb0: 0xc3, // Uppercase A, tilde\n\t 0xb1: 0xe3, // Lowercase a, tilde\n\t 0xb2: 0xcd, // Uppercase I, acute accent\n\t 0xb3: 0xcc, // Uppercase I, grave accent\n\t 0xb4: 0xec, // Lowercase i, grave accent\n\t 0xb5: 0xd2, // Uppercase O, grave accent\n\t 0xb6: 0xf2, // Lowercase o, grave accent\n\t 0xb7: 0xd5, // Uppercase O, tilde\n\t 0xb8: 0xf5, // Lowercase o, tilde\n\t 0xb9: 0x7b, // Open curly brace\n\t 0xba: 0x7d, // Closing curly brace\n\t 0xbb: 0x5c, // Backslash\n\t 0xbc: 0x5e, // Caret\n\t 0xbd: 0x5f, // Underscore\n\t 0xbe: 0x7c, // Pipe (vertical line)\n\t 0xbf: 0x223c, // Tilde operator\n\t 0xc0: 0xc4, // Uppercase A, umlaut\n\t 0xc1: 0xe4, // Lowercase A, umlaut\n\t 0xc2: 0xd6, // Uppercase O, umlaut\n\t 0xc3: 0xf6, // Lowercase o, umlaut\n\t 0xc4: 0xdf, // Esszett (sharp S)\n\t 0xc5: 0xa5, // Yen symbol\n\t 0xc6: 0xa4, // Generic currency sign\n\t 0xc7: 0x2503, // Box drawings heavy vertical\n\t 0xc8: 0xc5, // Uppercase A, ring\n\t 0xc9: 0xe5, // Lowercase A, ring\n\t 0xca: 0xd8, // Uppercase O, stroke\n\t 0xcb: 0xf8, // Lowercase o, strok\n\t 0xcc: 0x250f, // Box drawings heavy down and right\n\t 0xcd: 0x2513, // Box drawings heavy down and left\n\t 0xce: 0x2517, // Box drawings heavy up and right\n\t 0xcf: 0x251b // Box drawings heavy up and left\n\t};\n\t\n\t/**\n\t * Utils\n\t */\n\tvar getCharForByte = function getCharForByte(byte) {\n\t var charCode = byte;\n\t if (specialCea608CharsCodes.hasOwnProperty(byte)) {\n\t charCode = specialCea608CharsCodes[byte];\n\t }\n\t return String.fromCharCode(charCode);\n\t};\n\t\n\tvar NR_ROWS = 15,\n\t NR_COLS = 32;\n\t// Tables to look up row from PAC data\n\tvar rowsLowCh1 = { 0x11: 1, 0x12: 3, 0x15: 5, 0x16: 7, 0x17: 9, 0x10: 11, 0x13: 12, 0x14: 14 };\n\tvar rowsHighCh1 = { 0x11: 2, 0x12: 4, 0x15: 6, 0x16: 8, 0x17: 10, 0x13: 13, 0x14: 15 };\n\tvar rowsLowCh2 = { 0x19: 1, 0x1A: 3, 0x1D: 5, 0x1E: 7, 0x1F: 9, 0x18: 11, 0x1B: 12, 0x1C: 14 };\n\tvar rowsHighCh2 = { 0x19: 2, 0x1A: 4, 0x1D: 6, 0x1E: 8, 0x1F: 10, 0x1B: 13, 0x1C: 15 };\n\t\n\tvar backgroundColors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'black', 'transparent'];\n\t\n\t/**\n\t * Simple logger class to be able to write with time-stamps and filter on level.\n\t */\n\tvar logger = {\n\t verboseFilter: { 'DATA': 3, 'DEBUG': 3, 'INFO': 2, 'WARNING': 2, 'TEXT': 1, 'ERROR': 0 },\n\t time: null,\n\t verboseLevel: 0, // Only write errors\n\t setTime: function setTime(newTime) {\n\t this.time = newTime;\n\t },\n\t log: function log(severity, msg) {\n\t var minLevel = this.verboseFilter[severity];\n\t if (this.verboseLevel >= minLevel) {\n\t console.log(this.time + ' [' + severity + '] ' + msg);\n\t }\n\t }\n\t};\n\t\n\tvar numArrayToHexArray = function numArrayToHexArray(numArray) {\n\t var hexArray = [];\n\t for (var j = 0; j < numArray.length; j++) {\n\t hexArray.push(numArray[j].toString(16));\n\t }\n\t return hexArray;\n\t};\n\t\n\tvar PenState = function () {\n\t function PenState(foreground, underline, italics, background, flash) {\n\t _classCallCheck(this, PenState);\n\t\n\t this.foreground = foreground || 'white';\n\t this.underline = underline || false;\n\t this.italics = italics || false;\n\t this.background = background || 'black';\n\t this.flash = flash || false;\n\t }\n\t\n\t _createClass(PenState, [{\n\t key: 'reset',\n\t value: function reset() {\n\t this.foreground = 'white';\n\t this.underline = false;\n\t this.italics = false;\n\t this.background = 'black';\n\t this.flash = false;\n\t }\n\t }, {\n\t key: 'setStyles',\n\t value: function setStyles(styles) {\n\t var attribs = ['foreground', 'underline', 'italics', 'background', 'flash'];\n\t for (var i = 0; i < attribs.length; i++) {\n\t var style = attribs[i];\n\t if (styles.hasOwnProperty(style)) {\n\t this[style] = styles[style];\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'isDefault',\n\t value: function isDefault() {\n\t return this.foreground === 'white' && !this.underline && !this.italics && this.background === 'black' && !this.flash;\n\t }\n\t }, {\n\t key: 'equals',\n\t value: function equals(other) {\n\t return this.foreground === other.foreground && this.underline === other.underline && this.italics === other.italics && this.background === other.background && this.flash === other.flash;\n\t }\n\t }, {\n\t key: 'copy',\n\t value: function copy(newPenState) {\n\t this.foreground = newPenState.foreground;\n\t this.underline = newPenState.underline;\n\t this.italics = newPenState.italics;\n\t this.background = newPenState.background;\n\t this.flash = newPenState.flash;\n\t }\n\t }, {\n\t key: 'toString',\n\t value: function toString() {\n\t return 'color=' + this.foreground + ', underline=' + this.underline + ', italics=' + this.italics + ', background=' + this.background + ', flash=' + this.flash;\n\t }\n\t }]);\n\t\n\t return PenState;\n\t}();\n\t\n\t/**\n\t * Unicode character with styling and background.\n\t * @constructor\n\t */\n\t\n\t\n\tvar StyledUnicodeChar = function () {\n\t function StyledUnicodeChar(uchar, foreground, underline, italics, background, flash) {\n\t _classCallCheck(this, StyledUnicodeChar);\n\t\n\t this.uchar = uchar || ' '; // unicode character\n\t this.penState = new PenState(foreground, underline, italics, background, flash);\n\t }\n\t\n\t _createClass(StyledUnicodeChar, [{\n\t key: 'reset',\n\t value: function reset() {\n\t this.uchar = ' ';\n\t this.penState.reset();\n\t }\n\t }, {\n\t key: 'setChar',\n\t value: function setChar(uchar, newPenState) {\n\t this.uchar = uchar;\n\t this.penState.copy(newPenState);\n\t }\n\t }, {\n\t key: 'setPenState',\n\t value: function setPenState(newPenState) {\n\t this.penState.copy(newPenState);\n\t }\n\t }, {\n\t key: 'equals',\n\t value: function equals(other) {\n\t return this.uchar === other.uchar && this.penState.equals(other.penState);\n\t }\n\t }, {\n\t key: 'copy',\n\t value: function copy(newChar) {\n\t this.uchar = newChar.uchar;\n\t this.penState.copy(newChar.penState);\n\t }\n\t }, {\n\t key: 'isEmpty',\n\t value: function isEmpty() {\n\t return this.uchar === ' ' && this.penState.isDefault();\n\t }\n\t }]);\n\t\n\t return StyledUnicodeChar;\n\t}();\n\t\n\t/**\n\t * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.\n\t * @constructor\n\t */\n\t\n\t\n\tvar Row = function () {\n\t function Row() {\n\t _classCallCheck(this, Row);\n\t\n\t this.chars = [];\n\t for (var i = 0; i < NR_COLS; i++) {\n\t this.chars.push(new StyledUnicodeChar());\n\t }\n\t this.pos = 0;\n\t this.currPenState = new PenState();\n\t }\n\t\n\t _createClass(Row, [{\n\t key: 'equals',\n\t value: function equals(other) {\n\t var equal = true;\n\t for (var i = 0; i < NR_COLS; i++) {\n\t if (!this.chars[i].equals(other.chars[i])) {\n\t equal = false;\n\t break;\n\t }\n\t }\n\t return equal;\n\t }\n\t }, {\n\t key: 'copy',\n\t value: function copy(other) {\n\t for (var i = 0; i < NR_COLS; i++) {\n\t this.chars[i].copy(other.chars[i]);\n\t }\n\t }\n\t }, {\n\t key: 'isEmpty',\n\t value: function isEmpty() {\n\t var empty = true;\n\t for (var i = 0; i < NR_COLS; i++) {\n\t if (!this.chars[i].isEmpty()) {\n\t empty = false;\n\t break;\n\t }\n\t }\n\t return empty;\n\t }\n\t\n\t /**\n\t * Set the cursor to a valid column.\n\t */\n\t\n\t }, {\n\t key: 'setCursor',\n\t value: function setCursor(absPos) {\n\t if (this.pos !== absPos) {\n\t this.pos = absPos;\n\t }\n\t if (this.pos < 0) {\n\t logger.log('ERROR', 'Negative cursor position ' + this.pos);\n\t this.pos = 0;\n\t } else if (this.pos > NR_COLS) {\n\t logger.log('ERROR', 'Too large cursor position ' + this.pos);\n\t this.pos = NR_COLS;\n\t }\n\t }\n\t\n\t /**\n\t * Move the cursor relative to current position.\n\t */\n\t\n\t }, {\n\t key: 'moveCursor',\n\t value: function moveCursor(relPos) {\n\t var newPos = this.pos + relPos;\n\t if (relPos > 1) {\n\t for (var i = this.pos + 1; i < newPos + 1; i++) {\n\t this.chars[i].setPenState(this.currPenState);\n\t }\n\t }\n\t this.setCursor(newPos);\n\t }\n\t\n\t /**\n\t * Backspace, move one step back and clear character.\n\t */\n\t\n\t }, {\n\t key: 'backSpace',\n\t value: function backSpace() {\n\t this.moveCursor(-1);\n\t this.chars[this.pos].setChar(' ', this.currPenState);\n\t }\n\t }, {\n\t key: 'insertChar',\n\t value: function insertChar(byte) {\n\t if (byte >= 0x90) {\n\t //Extended char\n\t this.backSpace();\n\t }\n\t var char = getCharForByte(byte);\n\t if (this.pos >= NR_COLS) {\n\t logger.log('ERROR', 'Cannot insert ' + byte.toString(16) + ' (' + char + ') at position ' + this.pos + '. Skipping it!');\n\t return;\n\t }\n\t this.chars[this.pos].setChar(char, this.currPenState);\n\t this.moveCursor(1);\n\t }\n\t }, {\n\t key: 'clearFromPos',\n\t value: function clearFromPos(startPos) {\n\t var i;\n\t for (i = startPos; i < NR_COLS; i++) {\n\t this.chars[i].reset();\n\t }\n\t }\n\t }, {\n\t key: 'clear',\n\t value: function clear() {\n\t this.clearFromPos(0);\n\t this.pos = 0;\n\t this.currPenState.reset();\n\t }\n\t }, {\n\t key: 'clearToEndOfRow',\n\t value: function clearToEndOfRow() {\n\t this.clearFromPos(this.pos);\n\t }\n\t }, {\n\t key: 'getTextString',\n\t value: function getTextString() {\n\t var chars = [];\n\t var empty = true;\n\t for (var i = 0; i < NR_COLS; i++) {\n\t var char = this.chars[i].uchar;\n\t if (char !== ' ') {\n\t empty = false;\n\t }\n\t chars.push(char);\n\t }\n\t if (empty) {\n\t return '';\n\t } else {\n\t return chars.join('');\n\t }\n\t }\n\t }, {\n\t key: 'setPenStyles',\n\t value: function setPenStyles(styles) {\n\t this.currPenState.setStyles(styles);\n\t var currChar = this.chars[this.pos];\n\t currChar.setPenState(this.currPenState);\n\t }\n\t }]);\n\t\n\t return Row;\n\t}();\n\t\n\t/**\n\t * Keep a CEA-608 screen of 32x15 styled characters\n\t * @constructor\n\t*/\n\t\n\t\n\tvar CaptionScreen = function () {\n\t function CaptionScreen() {\n\t _classCallCheck(this, CaptionScreen);\n\t\n\t this.rows = [];\n\t for (var i = 0; i < NR_ROWS; i++) {\n\t this.rows.push(new Row()); // Note that we use zero-based numbering (0-14)\n\t }\n\t this.currRow = NR_ROWS - 1;\n\t this.nrRollUpRows = null;\n\t this.reset();\n\t }\n\t\n\t _createClass(CaptionScreen, [{\n\t key: 'reset',\n\t value: function reset() {\n\t for (var i = 0; i < NR_ROWS; i++) {\n\t this.rows[i].clear();\n\t }\n\t this.currRow = NR_ROWS - 1;\n\t }\n\t }, {\n\t key: 'equals',\n\t value: function equals(other) {\n\t var equal = true;\n\t for (var i = 0; i < NR_ROWS; i++) {\n\t if (!this.rows[i].equals(other.rows[i])) {\n\t equal = false;\n\t break;\n\t }\n\t }\n\t return equal;\n\t }\n\t }, {\n\t key: 'copy',\n\t value: function copy(other) {\n\t for (var i = 0; i < NR_ROWS; i++) {\n\t this.rows[i].copy(other.rows[i]);\n\t }\n\t }\n\t }, {\n\t key: 'isEmpty',\n\t value: function isEmpty() {\n\t var empty = true;\n\t for (var i = 0; i < NR_ROWS; i++) {\n\t if (!this.rows[i].isEmpty()) {\n\t empty = false;\n\t break;\n\t }\n\t }\n\t return empty;\n\t }\n\t }, {\n\t key: 'backSpace',\n\t value: function backSpace() {\n\t var row = this.rows[this.currRow];\n\t row.backSpace();\n\t }\n\t }, {\n\t key: 'clearToEndOfRow',\n\t value: function clearToEndOfRow() {\n\t var row = this.rows[this.currRow];\n\t row.clearToEndOfRow();\n\t }\n\t\n\t /**\n\t * Insert a character (without styling) in the current row.\n\t */\n\t\n\t }, {\n\t key: 'insertChar',\n\t value: function insertChar(char) {\n\t var row = this.rows[this.currRow];\n\t row.insertChar(char);\n\t }\n\t }, {\n\t key: 'setPen',\n\t value: function setPen(styles) {\n\t var row = this.rows[this.currRow];\n\t row.setPenStyles(styles);\n\t }\n\t }, {\n\t key: 'moveCursor',\n\t value: function moveCursor(relPos) {\n\t var row = this.rows[this.currRow];\n\t row.moveCursor(relPos);\n\t }\n\t }, {\n\t key: 'setCursor',\n\t value: function setCursor(absPos) {\n\t logger.log('INFO', 'setCursor: ' + absPos);\n\t var row = this.rows[this.currRow];\n\t row.setCursor(absPos);\n\t }\n\t }, {\n\t key: 'setPAC',\n\t value: function setPAC(pacData) {\n\t logger.log('INFO', 'pacData = ' + JSON.stringify(pacData));\n\t var newRow = pacData.row - 1;\n\t if (this.nrRollUpRows && newRow < this.nrRollUpRows - 1) {\n\t newRow = this.nrRollUpRows - 1;\n\t }\n\t this.currRow = newRow;\n\t var row = this.rows[this.currRow];\n\t if (pacData.indent !== null) {\n\t var indent = pacData.indent;\n\t var prevPos = Math.max(indent - 1, 0);\n\t row.setCursor(pacData.indent);\n\t pacData.color = row.chars[prevPos].penState.foreground;\n\t }\n\t var styles = { foreground: pacData.color, underline: pacData.underline, italics: pacData.italics, background: 'black', flash: false };\n\t this.setPen(styles);\n\t }\n\t\n\t /**\n\t * Set background/extra foreground, but first do back_space, and then insert space (backwards compatibility).\n\t */\n\t\n\t }, {\n\t key: 'setBkgData',\n\t value: function setBkgData(bkgData) {\n\t\n\t logger.log('INFO', 'bkgData = ' + JSON.stringify(bkgData));\n\t this.backSpace();\n\t this.setPen(bkgData);\n\t this.insertChar(0x20); //Space\n\t }\n\t }, {\n\t key: 'setRollUpRows',\n\t value: function setRollUpRows(nrRows) {\n\t this.nrRollUpRows = nrRows;\n\t }\n\t }, {\n\t key: 'rollUp',\n\t value: function rollUp() {\n\t if (this.nrRollUpRows === null) {\n\t logger.log('DEBUG', 'roll_up but nrRollUpRows not set yet');\n\t return; //Not properly setup\n\t }\n\t logger.log('TEXT', this.getDisplayText());\n\t var topRowIndex = this.currRow + 1 - this.nrRollUpRows;\n\t var topRow = this.rows.splice(topRowIndex, 1)[0];\n\t topRow.clear();\n\t this.rows.splice(this.currRow, 0, topRow);\n\t logger.log('INFO', 'Rolling up');\n\t //logger.log('TEXT', this.get_display_text())\n\t }\n\t\n\t /**\n\t * Get all non-empty rows with as unicode text.\n\t */\n\t\n\t }, {\n\t key: 'getDisplayText',\n\t value: function getDisplayText(asOneRow) {\n\t asOneRow = asOneRow || false;\n\t var displayText = [];\n\t var text = '';\n\t var rowNr = -1;\n\t for (var i = 0; i < NR_ROWS; i++) {\n\t var rowText = this.rows[i].getTextString();\n\t if (rowText) {\n\t rowNr = i + 1;\n\t if (asOneRow) {\n\t displayText.push('Row ' + rowNr + ': \\'' + rowText + '\\'');\n\t } else {\n\t displayText.push(rowText.trim());\n\t }\n\t }\n\t }\n\t if (displayText.length > 0) {\n\t if (asOneRow) {\n\t text = '[' + displayText.join(' | ') + ']';\n\t } else {\n\t text = displayText.join('\\n');\n\t }\n\t }\n\t return text;\n\t }\n\t }, {\n\t key: 'getTextAndFormat',\n\t value: function getTextAndFormat() {\n\t return this.rows;\n\t }\n\t }]);\n\t\n\t return CaptionScreen;\n\t}();\n\t\n\t//var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];\n\t\n\tvar Cea608Channel = function () {\n\t function Cea608Channel(channelNumber, outputFilter) {\n\t _classCallCheck(this, Cea608Channel);\n\t\n\t this.chNr = channelNumber;\n\t this.outputFilter = outputFilter;\n\t this.mode = null;\n\t this.verbose = 0;\n\t this.displayedMemory = new CaptionScreen();\n\t this.nonDisplayedMemory = new CaptionScreen();\n\t this.lastOutputScreen = new CaptionScreen();\n\t this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];\n\t this.writeScreen = this.displayedMemory;\n\t this.mode = null;\n\t this.cueStartTime = null; // Keeps track of where a cue started.\n\t }\n\t\n\t _createClass(Cea608Channel, [{\n\t key: 'reset',\n\t value: function reset() {\n\t this.mode = null;\n\t this.displayedMemory.reset();\n\t this.nonDisplayedMemory.reset();\n\t this.lastOutputScreen.reset();\n\t this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];\n\t this.writeScreen = this.displayedMemory;\n\t this.mode = null;\n\t this.cueStartTime = null;\n\t this.lastCueEndTime = null;\n\t }\n\t }, {\n\t key: 'getHandler',\n\t value: function getHandler() {\n\t return this.outputFilter;\n\t }\n\t }, {\n\t key: 'setHandler',\n\t value: function setHandler(newHandler) {\n\t this.outputFilter = newHandler;\n\t }\n\t }, {\n\t key: 'setPAC',\n\t value: function setPAC(pacData) {\n\t this.writeScreen.setPAC(pacData);\n\t }\n\t }, {\n\t key: 'setBkgData',\n\t value: function setBkgData(bkgData) {\n\t this.writeScreen.setBkgData(bkgData);\n\t }\n\t }, {\n\t key: 'setMode',\n\t value: function setMode(newMode) {\n\t if (newMode === this.mode) {\n\t return;\n\t }\n\t this.mode = newMode;\n\t logger.log('INFO', 'MODE=' + newMode);\n\t if (this.mode === 'MODE_POP-ON') {\n\t this.writeScreen = this.nonDisplayedMemory;\n\t } else {\n\t this.writeScreen = this.displayedMemory;\n\t this.writeScreen.reset();\n\t }\n\t if (this.mode !== 'MODE_ROLL-UP') {\n\t this.displayedMemory.nrRollUpRows = null;\n\t this.nonDisplayedMemory.nrRollUpRows = null;\n\t }\n\t this.mode = newMode;\n\t }\n\t }, {\n\t key: 'insertChars',\n\t value: function insertChars(chars) {\n\t for (var i = 0; i < chars.length; i++) {\n\t this.writeScreen.insertChar(chars[i]);\n\t }\n\t var screen = this.writeScreen === this.displayedMemory ? 'DISP' : 'NON_DISP';\n\t logger.log('INFO', screen + ': ' + this.writeScreen.getDisplayText(true));\n\t if (this.mode === 'MODE_PAINT-ON' || this.mode === 'MODE_ROLL-UP') {\n\t logger.log('TEXT', 'DISPLAYED: ' + this.displayedMemory.getDisplayText(true));\n\t this.outputDataUpdate();\n\t }\n\t }\n\t }, {\n\t key: 'ccRCL',\n\t value: function ccRCL() {\n\t // Resume Caption Loading (switch mode to Pop On)\n\t logger.log('INFO', 'RCL - Resume Caption Loading');\n\t this.setMode('MODE_POP-ON');\n\t }\n\t }, {\n\t key: 'ccBS',\n\t value: function ccBS() {\n\t // BackSpace\n\t logger.log('INFO', 'BS - BackSpace');\n\t if (this.mode === 'MODE_TEXT') {\n\t return;\n\t }\n\t this.writeScreen.backSpace();\n\t if (this.writeScreen === this.displayedMemory) {\n\t this.outputDataUpdate();\n\t }\n\t }\n\t }, {\n\t key: 'ccAOF',\n\t value: function ccAOF() {\n\t // Reserved (formerly Alarm Off)\n\t return;\n\t }\n\t }, {\n\t key: 'ccAON',\n\t value: function ccAON() {\n\t // Reserved (formerly Alarm On)\n\t return;\n\t }\n\t }, {\n\t key: 'ccDER',\n\t value: function ccDER() {\n\t // Delete to End of Row\n\t logger.log('INFO', 'DER- Delete to End of Row');\n\t this.writeScreen.clearToEndOfRow();\n\t this.outputDataUpdate();\n\t }\n\t }, {\n\t key: 'ccRU',\n\t value: function ccRU(nrRows) {\n\t //Roll-Up Captions-2,3,or 4 Rows\n\t logger.log('INFO', 'RU(' + nrRows + ') - Roll Up');\n\t this.writeScreen = this.displayedMemory;\n\t this.setMode('MODE_ROLL-UP');\n\t this.writeScreen.setRollUpRows(nrRows);\n\t }\n\t }, {\n\t key: 'ccFON',\n\t value: function ccFON() {\n\t //Flash On\n\t logger.log('INFO', 'FON - Flash On');\n\t this.writeScreen.setPen({ flash: true });\n\t }\n\t }, {\n\t key: 'ccRDC',\n\t value: function ccRDC() {\n\t // Resume Direct Captioning (switch mode to PaintOn)\n\t logger.log('INFO', 'RDC - Resume Direct Captioning');\n\t this.setMode('MODE_PAINT-ON');\n\t }\n\t }, {\n\t key: 'ccTR',\n\t value: function ccTR() {\n\t // Text Restart in text mode (not supported, however)\n\t logger.log('INFO', 'TR');\n\t this.setMode('MODE_TEXT');\n\t }\n\t }, {\n\t key: 'ccRTD',\n\t value: function ccRTD() {\n\t // Resume Text Display in Text mode (not supported, however)\n\t logger.log('INFO', 'RTD');\n\t this.setMode('MODE_TEXT');\n\t }\n\t }, {\n\t key: 'ccEDM',\n\t value: function ccEDM() {\n\t // Erase Displayed Memory\n\t logger.log('INFO', 'EDM - Erase Displayed Memory');\n\t this.displayedMemory.reset();\n\t this.outputDataUpdate();\n\t }\n\t }, {\n\t key: 'ccCR',\n\t value: function ccCR() {\n\t // Carriage Return\n\t logger.log('CR - Carriage Return');\n\t this.writeScreen.rollUp();\n\t this.outputDataUpdate();\n\t }\n\t }, {\n\t key: 'ccENM',\n\t value: function ccENM() {\n\t //Erase Non-Displayed Memory\n\t logger.log('INFO', 'ENM - Erase Non-displayed Memory');\n\t this.nonDisplayedMemory.reset();\n\t }\n\t }, {\n\t key: 'ccEOC',\n\t value: function ccEOC() {\n\t //End of Caption (Flip Memories)\n\t logger.log('INFO', 'EOC - End Of Caption');\n\t if (this.mode === 'MODE_POP-ON') {\n\t var tmp = this.displayedMemory;\n\t this.displayedMemory = this.nonDisplayedMemory;\n\t this.nonDisplayedMemory = tmp;\n\t this.writeScreen = this.nonDisplayedMemory;\n\t logger.log('TEXT', 'DISP: ' + this.displayedMemory.getDisplayText());\n\t }\n\t this.outputDataUpdate();\n\t }\n\t }, {\n\t key: 'ccTO',\n\t value: function ccTO(nrCols) {\n\t // Tab Offset 1,2, or 3 columns\n\t logger.log('INFO', 'TO(' + nrCols + ') - Tab Offset');\n\t this.writeScreen.moveCursor(nrCols);\n\t }\n\t }, {\n\t key: 'ccMIDROW',\n\t value: function ccMIDROW(secondByte) {\n\t // Parse MIDROW command\n\t var styles = { flash: false };\n\t styles.underline = secondByte % 2 === 1;\n\t styles.italics = secondByte >= 0x2e;\n\t if (!styles.italics) {\n\t var colorIndex = Math.floor(secondByte / 2) - 0x10;\n\t var colors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta'];\n\t styles.foreground = colors[colorIndex];\n\t } else {\n\t styles.foreground = 'white';\n\t }\n\t logger.log('INFO', 'MIDROW: ' + JSON.stringify(styles));\n\t this.writeScreen.setPen(styles);\n\t }\n\t }, {\n\t key: 'outputDataUpdate',\n\t value: function outputDataUpdate() {\n\t var t = logger.time;\n\t if (t === null) {\n\t return;\n\t }\n\t if (this.outputFilter) {\n\t if (this.outputFilter.updateData) {\n\t this.outputFilter.updateData(t, this.displayedMemory);\n\t }\n\t if (this.cueStartTime === null && !this.displayedMemory.isEmpty()) {\n\t // Start of a new cue\n\t this.cueStartTime = t;\n\t } else {\n\t if (!this.displayedMemory.equals(this.lastOutputScreen)) {\n\t if (this.outputFilter.newCue) {\n\t this.outputFilter.newCue(this.cueStartTime, t, this.lastOutputScreen);\n\t }\n\t this.cueStartTime = this.displayedMemory.isEmpty() ? null : t;\n\t }\n\t }\n\t this.lastOutputScreen.copy(this.displayedMemory);\n\t }\n\t }\n\t }, {\n\t key: 'cueSplitAtTime',\n\t value: function cueSplitAtTime(t) {\n\t if (this.outputFilter) {\n\t if (!this.displayedMemory.isEmpty()) {\n\t if (this.outputFilter.newCue) {\n\t this.outputFilter.newCue(this.cueStartTime, t, this.displayedMemory);\n\t }\n\t this.cueStartTime = t;\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return Cea608Channel;\n\t}();\n\t\n\tvar Cea608Parser = function () {\n\t function Cea608Parser(field, out1, out2) {\n\t _classCallCheck(this, Cea608Parser);\n\t\n\t this.field = field || 1;\n\t this.outputs = [out1, out2];\n\t this.channels = [new Cea608Channel(1, out1), new Cea608Channel(2, out2)];\n\t this.currChNr = -1; // Will be 1 or 2\n\t this.lastCmdA = null; // First byte of last command\n\t this.lastCmdB = null; // Second byte of last command\n\t this.bufferedData = [];\n\t this.startTime = null;\n\t this.lastTime = null;\n\t this.dataCounters = { 'padding': 0, 'char': 0, 'cmd': 0, 'other': 0 };\n\t }\n\t\n\t _createClass(Cea608Parser, [{\n\t key: 'getHandler',\n\t value: function getHandler(index) {\n\t return this.channels[index].getHandler();\n\t }\n\t }, {\n\t key: 'setHandler',\n\t value: function setHandler(index, newHandler) {\n\t this.channels[index].setHandler(newHandler);\n\t }\n\t\n\t /**\n\t * Add data for time t in forms of list of bytes (unsigned ints). The bytes are treated as pairs.\n\t */\n\t\n\t }, {\n\t key: 'addData',\n\t value: function addData(t, byteList) {\n\t var cmdFound,\n\t a,\n\t b,\n\t charsFound = false;\n\t\n\t this.lastTime = t;\n\t logger.setTime(t);\n\t\n\t for (var i = 0; i < byteList.length; i += 2) {\n\t a = byteList[i] & 0x7f;\n\t b = byteList[i + 1] & 0x7f;\n\t if (a === 0 && b === 0) {\n\t this.dataCounters.padding += 2;\n\t continue;\n\t } else {\n\t logger.log('DATA', '[' + numArrayToHexArray([byteList[i], byteList[i + 1]]) + '] -> (' + numArrayToHexArray([a, b]) + ')');\n\t }\n\t cmdFound = this.parseCmd(a, b);\n\t if (!cmdFound) {\n\t cmdFound = this.parseMidrow(a, b);\n\t }\n\t if (!cmdFound) {\n\t cmdFound = this.parsePAC(a, b);\n\t }\n\t if (!cmdFound) {\n\t cmdFound = this.parseBackgroundAttributes(a, b);\n\t }\n\t if (!cmdFound) {\n\t charsFound = this.parseChars(a, b);\n\t if (charsFound) {\n\t if (this.currChNr && this.currChNr >= 0) {\n\t var channel = this.channels[this.currChNr - 1];\n\t channel.insertChars(charsFound);\n\t } else {\n\t logger.log('WARNING', 'No channel found yet. TEXT-MODE?');\n\t }\n\t }\n\t }\n\t if (cmdFound) {\n\t this.dataCounters.cmd += 2;\n\t } else if (charsFound) {\n\t this.dataCounters.char += 2;\n\t } else {\n\t this.dataCounters.other += 2;\n\t logger.log('WARNING', 'Couldn\\'t parse cleaned data ' + numArrayToHexArray([a, b]) + ' orig: ' + numArrayToHexArray([byteList[i], byteList[i + 1]]));\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Parse Command.\n\t * @returns {Boolean} Tells if a command was found\n\t */\n\t\n\t }, {\n\t key: 'parseCmd',\n\t value: function parseCmd(a, b) {\n\t var chNr = null;\n\t\n\t var cond1 = (a === 0x14 || a === 0x1C) && 0x20 <= b && b <= 0x2F;\n\t var cond2 = (a === 0x17 || a === 0x1F) && 0x21 <= b && b <= 0x23;\n\t if (!(cond1 || cond2)) {\n\t return false;\n\t }\n\t\n\t if (a === this.lastCmdA && b === this.lastCmdB) {\n\t this.lastCmdA = null;\n\t this.lastCmdB = null; // Repeated commands are dropped (once)\n\t logger.log('DEBUG', 'Repeated command (' + numArrayToHexArray([a, b]) + ') is dropped');\n\t return true;\n\t }\n\t\n\t if (a === 0x14 || a === 0x17) {\n\t chNr = 1;\n\t } else {\n\t chNr = 2; // (a === 0x1C || a=== 0x1f)\n\t }\n\t\n\t var channel = this.channels[chNr - 1];\n\t\n\t if (a === 0x14 || a === 0x1C) {\n\t if (b === 0x20) {\n\t channel.ccRCL();\n\t } else if (b === 0x21) {\n\t channel.ccBS();\n\t } else if (b === 0x22) {\n\t channel.ccAOF();\n\t } else if (b === 0x23) {\n\t channel.ccAON();\n\t } else if (b === 0x24) {\n\t channel.ccDER();\n\t } else if (b === 0x25) {\n\t channel.ccRU(2);\n\t } else if (b === 0x26) {\n\t channel.ccRU(3);\n\t } else if (b === 0x27) {\n\t channel.ccRU(4);\n\t } else if (b === 0x28) {\n\t channel.ccFON();\n\t } else if (b === 0x29) {\n\t channel.ccRDC();\n\t } else if (b === 0x2A) {\n\t channel.ccTR();\n\t } else if (b === 0x2B) {\n\t channel.ccRTD();\n\t } else if (b === 0x2C) {\n\t channel.ccEDM();\n\t } else if (b === 0x2D) {\n\t channel.ccCR();\n\t } else if (b === 0x2E) {\n\t channel.ccENM();\n\t } else if (b === 0x2F) {\n\t channel.ccEOC();\n\t }\n\t } else {\n\t //a == 0x17 || a == 0x1F\n\t channel.ccTO(b - 0x20);\n\t }\n\t this.lastCmdA = a;\n\t this.lastCmdB = b;\n\t this.currChNr = chNr;\n\t return true;\n\t }\n\t\n\t /**\n\t * Parse midrow styling command\n\t * @returns {Boolean}\n\t */\n\t\n\t }, {\n\t key: 'parseMidrow',\n\t value: function parseMidrow(a, b) {\n\t var chNr = null;\n\t\n\t if ((a === 0x11 || a === 0x19) && 0x20 <= b && b <= 0x2f) {\n\t if (a === 0x11) {\n\t chNr = 1;\n\t } else {\n\t chNr = 2;\n\t }\n\t if (chNr !== this.currChNr) {\n\t logger.log('ERROR', 'Mismatch channel in midrow parsing');\n\t return false;\n\t }\n\t var channel = this.channels[chNr - 1];\n\t channel.ccMIDROW(b);\n\t logger.log('DEBUG', 'MIDROW (' + numArrayToHexArray([a, b]) + ')');\n\t return true;\n\t }\n\t return false;\n\t }\n\t /**\n\t * Parse Preable Access Codes (Table 53).\n\t * @returns {Boolean} Tells if PAC found\n\t */\n\t\n\t }, {\n\t key: 'parsePAC',\n\t value: function parsePAC(a, b) {\n\t\n\t var chNr = null;\n\t var row = null;\n\t\n\t var case1 = (0x11 <= a && a <= 0x17 || 0x19 <= a && a <= 0x1F) && 0x40 <= b && b <= 0x7F;\n\t var case2 = (a === 0x10 || a === 0x18) && 0x40 <= b && b <= 0x5F;\n\t if (!(case1 || case2)) {\n\t return false;\n\t }\n\t\n\t if (a === this.lastCmdA && b === this.lastCmdB) {\n\t this.lastCmdA = null;\n\t this.lastCmdB = null;\n\t return true; // Repeated commands are dropped (once)\n\t }\n\t\n\t chNr = a <= 0x17 ? 1 : 2;\n\t\n\t if (0x40 <= b && b <= 0x5F) {\n\t row = chNr === 1 ? rowsLowCh1[a] : rowsLowCh2[a];\n\t } else {\n\t // 0x60 <= b <= 0x7F\n\t row = chNr === 1 ? rowsHighCh1[a] : rowsHighCh2[a];\n\t }\n\t var pacData = this.interpretPAC(row, b);\n\t var channel = this.channels[chNr - 1];\n\t channel.setPAC(pacData);\n\t this.lastCmdA = a;\n\t this.lastCmdB = b;\n\t this.currChNr = chNr;\n\t return true;\n\t }\n\t\n\t /**\n\t * Interpret the second byte of the pac, and return the information.\n\t * @returns {Object} pacData with style parameters.\n\t */\n\t\n\t }, {\n\t key: 'interpretPAC',\n\t value: function interpretPAC(row, byte) {\n\t var pacIndex = byte;\n\t var pacData = { color: null, italics: false, indent: null, underline: false, row: row };\n\t\n\t if (byte > 0x5F) {\n\t pacIndex = byte - 0x60;\n\t } else {\n\t pacIndex = byte - 0x40;\n\t }\n\t pacData.underline = (pacIndex & 1) === 1;\n\t if (pacIndex <= 0xd) {\n\t pacData.color = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'white'][Math.floor(pacIndex / 2)];\n\t } else if (pacIndex <= 0xf) {\n\t pacData.italics = true;\n\t pacData.color = 'white';\n\t } else {\n\t pacData.indent = Math.floor((pacIndex - 0x10) / 2) * 4;\n\t }\n\t return pacData; // Note that row has zero offset. The spec uses 1.\n\t }\n\t\n\t /**\n\t * Parse characters.\n\t * @returns An array with 1 to 2 codes corresponding to chars, if found. null otherwise.\n\t */\n\t\n\t }, {\n\t key: 'parseChars',\n\t value: function parseChars(a, b) {\n\t\n\t var channelNr = null,\n\t charCodes = null,\n\t charCode1 = null;\n\t\n\t if (a >= 0x19) {\n\t channelNr = 2;\n\t charCode1 = a - 8;\n\t } else {\n\t channelNr = 1;\n\t charCode1 = a;\n\t }\n\t if (0x11 <= charCode1 && charCode1 <= 0x13) {\n\t // Special character\n\t var oneCode = b;\n\t if (charCode1 === 0x11) {\n\t oneCode = b + 0x50;\n\t } else if (charCode1 === 0x12) {\n\t oneCode = b + 0x70;\n\t } else {\n\t oneCode = b + 0x90;\n\t }\n\t logger.log('INFO', 'Special char \\'' + getCharForByte(oneCode) + '\\' in channel ' + channelNr);\n\t charCodes = [oneCode];\n\t } else if (0x20 <= a && a <= 0x7f) {\n\t charCodes = b === 0 ? [a] : [a, b];\n\t }\n\t if (charCodes) {\n\t var hexCodes = numArrayToHexArray(charCodes);\n\t logger.log('DEBUG', 'Char codes = ' + hexCodes.join(','));\n\t this.lastCmdA = null;\n\t this.lastCmdB = null;\n\t }\n\t return charCodes;\n\t }\n\t\n\t /**\n\t * Parse extended background attributes as well as new foreground color black.\n\t * @returns{Boolean} Tells if background attributes are found\n\t */\n\t\n\t }, {\n\t key: 'parseBackgroundAttributes',\n\t value: function parseBackgroundAttributes(a, b) {\n\t var bkgData, index, chNr, channel;\n\t\n\t var case1 = (a === 0x10 || a === 0x18) && 0x20 <= b && b <= 0x2f;\n\t var case2 = (a === 0x17 || a === 0x1f) && 0x2d <= b && b <= 0x2f;\n\t if (!(case1 || case2)) {\n\t return false;\n\t }\n\t bkgData = {};\n\t if (a === 0x10 || a === 0x18) {\n\t index = Math.floor((b - 0x20) / 2);\n\t bkgData.background = backgroundColors[index];\n\t if (b % 2 === 1) {\n\t bkgData.background = bkgData.background + '_semi';\n\t }\n\t } else if (b === 0x2d) {\n\t bkgData.background = 'transparent';\n\t } else {\n\t bkgData.foreground = 'black';\n\t if (b === 0x2f) {\n\t bkgData.underline = true;\n\t }\n\t }\n\t chNr = a < 0x18 ? 1 : 2;\n\t channel = this.channels[chNr - 1];\n\t channel.setBkgData(bkgData);\n\t this.lastCmdA = null;\n\t this.lastCmdB = null;\n\t return true;\n\t }\n\t\n\t /**\n\t * Reset state of parser and its channels.\n\t */\n\t\n\t }, {\n\t key: 'reset',\n\t value: function reset() {\n\t for (var i = 0; i < this.channels.length; i++) {\n\t if (this.channels[i]) {\n\t this.channels[i].reset();\n\t }\n\t }\n\t this.lastCmdA = null;\n\t this.lastCmdB = null;\n\t }\n\t\n\t /**\n\t * Trigger the generation of a cue, and the start of a new one if displayScreens are not empty.\n\t */\n\t\n\t }, {\n\t key: 'cueSplitAtTime',\n\t value: function cueSplitAtTime(t) {\n\t for (var i = 0; i < this.channels.length; i++) {\n\t if (this.channels[i]) {\n\t this.channels[i].cueSplitAtTime(t);\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return Cea608Parser;\n\t}();\n\t\n\texports.default = Cea608Parser;\n\t\n\t},{}],41:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tvar Cues = {\n\t\n\t newCue: function newCue(track, startTime, endTime, captionScreen) {\n\t var row;\n\t var cue;\n\t var indenting;\n\t var indent;\n\t var text;\n\t var VTTCue = window.VTTCue || window.TextTrackCue;\n\t\n\t for (var r = 0; r < captionScreen.rows.length; r++) {\n\t row = captionScreen.rows[r];\n\t indenting = true;\n\t indent = 0;\n\t text = '';\n\t\n\t if (!row.isEmpty()) {\n\t for (var c = 0; c < row.chars.length; c++) {\n\t if (row.chars[c].uchar.match(/\\s/) && indenting) {\n\t indent++;\n\t } else {\n\t text += row.chars[c].uchar;\n\t indenting = false;\n\t }\n\t }\n\t cue = new VTTCue(startTime, endTime, text.trim());\n\t\n\t if (indent >= 16) {\n\t indent--;\n\t } else {\n\t indent++;\n\t }\n\t\n\t // VTTCue.line get's flakey when using controls, so let's now include line 13&14\n\t // also, drop line 1 since it's to close to the top\n\t if (navigator.userAgent.match(/Firefox\\//)) {\n\t cue.line = r + 1;\n\t } else {\n\t cue.line = r > 7 ? r - 2 : r + 1;\n\t }\n\t cue.align = 'left';\n\t cue.position = 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\\//) ? 50 : 0);\n\t track.addCue(cue);\n\t }\n\t }\n\t }\n\t\n\t};\n\t\n\tmodule.exports = Cues;\n\t\n\t},{}],42:[function(_dereq_,module,exports){\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * compute an Exponential Weighted moving average\n\t * - https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average\n\t * - heavily inspired from shaka-player\n\t */\n\t\n\tvar EWMA = function () {\n\t\n\t // About half of the estimated value will be from the last |halfLife| samples by weight.\n\t\n\t function EWMA(halfLife) {\n\t _classCallCheck(this, EWMA);\n\t\n\t // Larger values of alpha expire historical data more slowly.\n\t this.alpha_ = halfLife ? Math.exp(Math.log(0.5) / halfLife) : 0;\n\t this.estimate_ = 0;\n\t this.totalWeight_ = 0;\n\t }\n\t\n\t _createClass(EWMA, [{\n\t key: \"sample\",\n\t value: function sample(weight, value) {\n\t var adjAlpha = Math.pow(this.alpha_, weight);\n\t this.estimate_ = value * (1 - adjAlpha) + adjAlpha * this.estimate_;\n\t this.totalWeight_ += weight;\n\t }\n\t }, {\n\t key: \"getTotalWeight\",\n\t value: function getTotalWeight() {\n\t return this.totalWeight_;\n\t }\n\t }, {\n\t key: \"getEstimate\",\n\t value: function getEstimate() {\n\t if (this.alpha_) {\n\t var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);\n\t return this.estimate_ / zeroFactor;\n\t } else {\n\t return this.estimate_;\n\t }\n\t }\n\t }]);\n\t\n\t return EWMA;\n\t}();\n\t\n\texports.default = EWMA;\n\t\n\t},{}],43:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tfunction noop() {}\n\t\n\tvar fakeLogger = {\n\t trace: noop,\n\t debug: noop,\n\t log: noop,\n\t warn: noop,\n\t info: noop,\n\t error: noop\n\t};\n\t\n\tvar exportedLogger = fakeLogger;\n\t\n\t/*globals self: false */\n\t\n\t//let lastCallTime;\n\t// function formatMsgWithTimeInfo(type, msg) {\n\t// const now = Date.now();\n\t// const diff = lastCallTime ? '+' + (now - lastCallTime) : '0';\n\t// lastCallTime = now;\n\t// msg = (new Date(now)).toISOString() + ' | [' + type + '] > ' + msg + ' ( ' + diff + ' ms )';\n\t// return msg;\n\t// }\n\t\n\tfunction formatMsg(type, msg) {\n\t msg = '[' + type + '] > ' + msg;\n\t return msg;\n\t}\n\t\n\tfunction consolePrintFn(type) {\n\t var func = self.console[type];\n\t if (func) {\n\t return function () {\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t if (args[0]) {\n\t args[0] = formatMsg(type, args[0]);\n\t }\n\t func.apply(self.console, args);\n\t };\n\t }\n\t return noop;\n\t}\n\t\n\tfunction exportLoggerFunctions(debugConfig) {\n\t for (var _len2 = arguments.length, functions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n\t functions[_key2 - 1] = arguments[_key2];\n\t }\n\t\n\t functions.forEach(function (type) {\n\t exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);\n\t });\n\t}\n\t\n\tvar enableLogs = exports.enableLogs = function enableLogs(debugConfig) {\n\t if (debugConfig === true || (typeof debugConfig === 'undefined' ? 'undefined' : _typeof(debugConfig)) === 'object') {\n\t exportLoggerFunctions(debugConfig,\n\t // Remove out from list here to hard-disable a log-level\n\t //'trace',\n\t 'debug', 'log', 'info', 'warn', 'error');\n\t // Some browsers don't allow to use bind on console object anyway\n\t // fallback to default if needed\n\t try {\n\t exportedLogger.log();\n\t } catch (e) {\n\t exportedLogger = fakeLogger;\n\t }\n\t } else {\n\t exportedLogger = fakeLogger;\n\t }\n\t};\n\t\n\tvar logger = exports.logger = exportedLogger;\n\t\n\t},{}],44:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tif (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {\n\t ArrayBuffer.prototype.slice = function (start, end) {\n\t var that = new Uint8Array(this);\n\t if (end === undefined) {\n\t end = that.length;\n\t }\n\t var result = new ArrayBuffer(end - start);\n\t var resultArray = new Uint8Array(result);\n\t for (var i = 0; i < resultArray.length; i++) {\n\t resultArray[i] = that[i + start];\n\t }\n\t return result;\n\t };\n\t}\n\t\n\t},{}],45:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * TimeRanges to string helper\n\t */\n\t\n\tvar TimeRanges = function () {\n\t function TimeRanges() {\n\t _classCallCheck(this, TimeRanges);\n\t }\n\t\n\t _createClass(TimeRanges, null, [{\n\t key: 'toString',\n\t value: function toString(r) {\n\t var log = '',\n\t len = r.length;\n\t for (var i = 0; i < len; i++) {\n\t log += '[' + r.start(i).toFixed(3) + ',' + r.end(i).toFixed(3) + ']';\n\t }\n\t return log;\n\t }\n\t }]);\n\t\n\t return TimeRanges;\n\t}();\n\t\n\texports.default = TimeRanges;\n\t\n\t},{}],46:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tvar URLHelper = {\n\t // build an absolute URL from a relative one using the provided baseURL\n\t // if relativeURL is an absolute URL it will be returned as is.\n\t buildAbsoluteURL: function buildAbsoluteURL(baseURL, relativeURL) {\n\t // remove any remaining space and CRLF\n\t relativeURL = relativeURL.trim();\n\t if (/^[a-z]+:/i.test(relativeURL)) {\n\t // complete url, not relative\n\t return relativeURL;\n\t }\n\t\n\t var relativeURLQuery = null;\n\t var relativeURLHash = null;\n\t\n\t var relativeURLHashSplit = /^([^#]*)(.*)$/.exec(relativeURL);\n\t if (relativeURLHashSplit) {\n\t relativeURLHash = relativeURLHashSplit[2];\n\t relativeURL = relativeURLHashSplit[1];\n\t }\n\t var relativeURLQuerySplit = /^([^\\?]*)(.*)$/.exec(relativeURL);\n\t if (relativeURLQuerySplit) {\n\t relativeURLQuery = relativeURLQuerySplit[2];\n\t relativeURL = relativeURLQuerySplit[1];\n\t }\n\t\n\t var baseURLHashSplit = /^([^#]*)(.*)$/.exec(baseURL);\n\t if (baseURLHashSplit) {\n\t baseURL = baseURLHashSplit[1];\n\t }\n\t var baseURLQuerySplit = /^([^\\?]*)(.*)$/.exec(baseURL);\n\t if (baseURLQuerySplit) {\n\t baseURL = baseURLQuerySplit[1];\n\t }\n\t\n\t var baseURLDomainSplit = /^(([a-z]+:)?\\/\\/[a-z0-9\\.\\-_~]+(:[0-9]+)?)?(\\/.*)$/i.exec(baseURL);\n\t if (!baseURLDomainSplit) {\n\t throw new Error('Error trying to parse base URL.');\n\t }\n\t\n\t // e.g. 'http:', 'https:', ''\n\t var baseURLProtocol = baseURLDomainSplit[2] || '';\n\t // e.g. 'http://example.com', '//example.com', ''\n\t var baseURLProtocolDomain = baseURLDomainSplit[1] || '';\n\t // e.g. '/a/b/c/playlist.m3u8'\n\t var baseURLPath = baseURLDomainSplit[4];\n\t\n\t var builtURL = null;\n\t if (/^\\/\\//.test(relativeURL)) {\n\t // relative url starts wth '//' so copy protocol (which may be '' if baseUrl didn't provide one)\n\t builtURL = baseURLProtocol + '//' + URLHelper.buildAbsolutePath('', relativeURL.substring(2));\n\t } else if (/^\\//.test(relativeURL)) {\n\t // relative url starts with '/' so start from root of domain\n\t builtURL = baseURLProtocolDomain + '/' + URLHelper.buildAbsolutePath('', relativeURL.substring(1));\n\t } else {\n\t builtURL = URLHelper.buildAbsolutePath(baseURLProtocolDomain + baseURLPath, relativeURL);\n\t }\n\t\n\t // put the query and hash parts back\n\t if (relativeURLQuery) {\n\t builtURL += relativeURLQuery;\n\t }\n\t if (relativeURLHash) {\n\t builtURL += relativeURLHash;\n\t }\n\t return builtURL;\n\t },\n\t\n\t // build an absolute path using the provided basePath\n\t // adapted from https://developer.mozilla.org/en-US/docs/Web/API/document/cookie#Using_relative_URLs_in_the_path_parameter\n\t // this does not handle the case where relativePath is \"/\" or \"//\". These cases should be handled outside this.\n\t buildAbsolutePath: function buildAbsolutePath(basePath, relativePath) {\n\t var sRelPath = relativePath;\n\t var nUpLn,\n\t sDir = '',\n\t sPath = basePath.replace(/[^\\/]*$/, sRelPath.replace(/(\\/|^)(?:\\.?\\/+)+/g, '$1'));\n\t for (var nEnd, nStart = 0; nEnd = sPath.indexOf('/../', nStart), nEnd > -1; nStart = nEnd + nUpLn) {\n\t nUpLn = /^\\/(?:\\.\\.\\/)*/.exec(sPath.slice(nEnd))[0].length;\n\t sDir = (sDir + sPath.substring(nStart, nEnd)).replace(new RegExp('(?:\\\\\\/+[^\\\\\\/]*){0,' + (nUpLn - 1) / 3 + '}$'), '/');\n\t }\n\t return sDir + sPath.substr(nStart);\n\t }\n\t};\n\t\n\tmodule.exports = URLHelper;\n\t\n\t},{}],47:[function(_dereq_,module,exports){\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * XHR based logger\n\t */\n\t\n\tvar _logger = _dereq_(43);\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar XhrLoader = function () {\n\t function XhrLoader(config) {\n\t _classCallCheck(this, XhrLoader);\n\t\n\t if (config && config.xhrSetup) {\n\t this.xhrSetup = config.xhrSetup;\n\t }\n\t }\n\t\n\t _createClass(XhrLoader, [{\n\t key: 'destroy',\n\t value: function destroy() {\n\t this.abort();\n\t this.loader = null;\n\t }\n\t }, {\n\t key: 'abort',\n\t value: function abort() {\n\t var loader = this.loader;\n\t if (loader && loader.readyState !== 4) {\n\t this.stats.aborted = true;\n\t loader.abort();\n\t }\n\t\n\t window.clearTimeout(this.requestTimeout);\n\t this.requestTimeout = null;\n\t window.clearTimeout(this.retryTimeout);\n\t this.retryTimeout = null;\n\t }\n\t }, {\n\t key: 'load',\n\t value: function load(context, config, callbacks) {\n\t this.context = context;\n\t this.config = config;\n\t this.callbacks = callbacks;\n\t this.stats = { trequest: performance.now(), retry: 0 };\n\t this.retryDelay = config.retryDelay;\n\t this.loadInternal();\n\t }\n\t }, {\n\t key: 'loadInternal',\n\t value: function loadInternal() {\n\t var xhr,\n\t context = this.context;\n\t\n\t if (typeof XDomainRequest !== 'undefined') {\n\t xhr = this.loader = new XDomainRequest();\n\t } else {\n\t xhr = this.loader = new XMLHttpRequest();\n\t }\n\t\n\t xhr.onreadystatechange = this.readystatechange.bind(this);\n\t xhr.onprogress = this.loadprogress.bind(this);\n\t\n\t xhr.open('GET', context.url, true);\n\t\n\t if (context.rangeEnd) {\n\t xhr.setRequestHeader('Range', 'bytes=' + context.rangeStart + '-' + (context.rangeEnd - 1));\n\t }\n\t xhr.responseType = context.responseType;\n\t var stats = this.stats;\n\t stats.tfirst = 0;\n\t stats.loaded = 0;\n\t if (this.xhrSetup) {\n\t this.xhrSetup(xhr, context.url);\n\t }\n\t // setup timeout before we perform request\n\t this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), this.config.timeout);\n\t xhr.send();\n\t }\n\t }, {\n\t key: 'readystatechange',\n\t value: function readystatechange(event) {\n\t var xhr = event.currentTarget,\n\t readyState = xhr.readyState,\n\t stats = this.stats,\n\t context = this.context,\n\t config = this.config;\n\t\n\t // don't proceed if xhr has been aborted\n\t if (stats.aborted) {\n\t return;\n\t }\n\t\n\t // in any case clear the current xhrs timeout\n\t window.clearTimeout(this.requestTimeout);\n\t\n\t // HEADERS_RECEIVED\n\t if (readyState >= 2) {\n\t if (stats.tfirst === 0) {\n\t stats.tfirst = Math.max(performance.now(), stats.trequest);\n\t // reset timeout to total timeout duration minus the time it took to receive headers\n\t this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout - (stats.tfirst - stats.trequest));\n\t }\n\t if (readyState === 4) {\n\t var status = xhr.status;\n\t // http status between 200 to 299 are all successful\n\t if (status >= 200 && status < 300) {\n\t stats.tload = Math.max(stats.tfirst, performance.now());\n\t var data = void 0,\n\t len = void 0;\n\t if (context.responseType === 'arraybuffer') {\n\t data = xhr.response;\n\t len = data.byteLength;\n\t } else {\n\t data = xhr.responseText;\n\t len = data.length;\n\t }\n\t stats.loaded = stats.total = len;\n\t var response = { url: xhr.responseURL, data: data };\n\t this.callbacks.onSuccess(response, stats, context);\n\t } else {\n\t // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error\n\t if (stats.retry >= config.maxRetry || status >= 400 && status < 499) {\n\t _logger.logger.error(status + ' while loading ' + context.url);\n\t this.callbacks.onError({ code: status, text: xhr.statusText }, context);\n\t } else {\n\t // retry\n\t _logger.logger.warn(status + ' while loading ' + context.url + ', retrying in ' + this.retryDelay + '...');\n\t // aborts and resets internal state\n\t this.destroy();\n\t // schedule retry\n\t this.retryTimeout = window.setTimeout(this.loadInternal.bind(this), this.retryDelay);\n\t // set exponential backoff\n\t this.retryDelay = Math.min(2 * this.retryDelay, config.maxRetryDelay);\n\t stats.retry++;\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }, {\n\t key: 'loadtimeout',\n\t value: function loadtimeout() {\n\t _logger.logger.warn('timeout while loading ' + this.context.url);\n\t this.callbacks.onTimeout(this.stats, this.context);\n\t }\n\t }, {\n\t key: 'loadprogress',\n\t value: function loadprogress(event) {\n\t var stats = this.stats;\n\t stats.loaded = event.loaded;\n\t if (event.lengthComputable) {\n\t stats.total = event.total;\n\t }\n\t var onProgress = this.callbacks.onProgress;\n\t if (onProgress) {\n\t // last args is to provide on progress data\n\t onProgress(stats, this.context, null);\n\t }\n\t }\n\t }]);\n\t\n\t return XhrLoader;\n\t}();\n\t\n\texports.default = XhrLoader;\n\t\n\t},{\"43\":43}]},{},[31])(31)\n\t});\n\t//# sourceMappingURL=hls.js.map\n\n\n/***/ },\n/* 91 */\n/*!****************************************************************!*\\\n !*** ./src/components/media_control/public/media-control.html ***!\n \\****************************************************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<div class=\\\"media-control-background\\\" data-background></div>\\n<div class=\\\"media-control-layer\\\" data-controls>\\n <% var renderBar = function(name) { %>\\n <div class=\\\"bar-container\\\" data-<%= name %>>\\n <div class=\\\"bar-background\\\" data-<%= name %>>\\n <div class=\\\"bar-fill-1\\\" data-<%= name %>></div>\\n <div class=\\\"bar-fill-2\\\" data-<%= name %>></div>\\n <div class=\\\"bar-hover\\\" data-<%= name %>></div>\\n </div>\\n <div class=\\\"bar-scrubber\\\" data-<%= name %>>\\n <div class=\\\"bar-scrubber-icon\\\" data-<%= name %>></div>\\n </div>\\n </div>\\n <% }; %>\\n <% var renderSegmentedBar = function(name, segments) {\\n segments = segments || 10; %>\\n <div class=\\\"bar-container\\\" data-<%= name %>>\\n <% for (var i = 0; i < segments; i++) { %>\\n <div class=\\\"segmented-bar-element\\\" data-<%= name %>></div>\\n <% } %>\\n </div>\\n <% }; %>\\n <% var renderDrawer = function(name, renderContent) { %>\\n <div class=\\\"drawer-container\\\" data-<%= name %>>\\n <div class=\\\"drawer-icon-container\\\" data-<%= name %>>\\n <div class=\\\"drawer-icon media-control-icon\\\" data-<%= name %>></div>\\n <span class=\\\"drawer-text\\\" data-<%= name %>></span>\\n </div>\\n <% renderContent(name); %>\\n </div>\\n <% }; %>\\n <% var renderIndicator = function(name) { %>\\n <div class=\\\"media-control-indicator\\\" data-<%= name %>></div>\\n <% }; %>\\n <% var renderButton = function(name) { %>\\n <button type=\\\"button\\\" class=\\\"media-control-button media-control-icon\\\" data-<%= name %>></button>\\n <% }; %>\\n <% var templates = {\\n bar: renderBar,\\n segmentedBar: renderSegmentedBar,\\n };\\n var render = function(settingsList) {\\n settingsList.forEach(function(setting) {\\n if(setting === \\\"seekbar\\\") {\\n renderBar(setting);\\n } else if (setting === \\\"volume\\\") {\\n renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function(name) { return renderSegmentedBar(name); });\\n } else if (setting === \\\"duration\\\" || setting === \\\"position\\\") {\\n renderIndicator(setting);\\n } else {\\n renderButton(setting);\\n }\\n });\\n }; %>\\n <% if (settings.default && settings.default.length) { %>\\n <div class=\\\"media-control-center-panel\\\" data-media-control>\\n <% render(settings.default); %>\\n </div>\\n <% } %>\\n <% if (settings.left && settings.left.length) { %>\\n <div class=\\\"media-control-left-panel\\\" data-media-control>\\n <% render(settings.left); %>\\n </div>\\n <% } %>\\n <% if (settings.right && settings.right.length) { %>\\n <div class=\\\"media-control-right-panel\\\" data-media-control>\\n <% render(settings.right); %>\\n </div>\\n <% } %>\\n</div>\\n\";\n\n/***/ },\n/* 92 */\n/*!*************************************************************!*\\\n !*** ./src/playbacks/base_flash_playback/public/flash.html ***!\n \\*************************************************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<param name=\\\"movie\\\" value=\\\"<%= swfPath %>?inline=1\\\">\\n<param name=\\\"quality\\\" value=\\\"autohigh\\\">\\n<param name=\\\"swliveconnect\\\" value=\\\"true\\\">\\n<param name=\\\"allowScriptAccess\\\" value=\\\"always\\\">\\n<param name=\\\"bgcolor\\\" value=\\\"#000000\\\">\\n<param name=\\\"allowFullScreen\\\" value=\\\"false\\\">\\n<param name=\\\"wmode\\\" value=\\\"<%= wmode %>\\\">\\n<param name=\\\"tabindex\\\" value=\\\"1\\\">\\n<param name=\\\"FlashVars\\\" value=\\\"playbackId=<%= playbackId %>&callback=<%= callbackName %>\\\">\\n<embed\\n name=\\\"<%= cid %>\\\"\\n type=\\\"application/x-shockwave-flash\\\"\\n disabled=\\\"disabled\\\"\\n tabindex=\\\"-1\\\"\\n enablecontextmenu=\\\"false\\\"\\n allowScriptAccess=\\\"always\\\"\\n quality=\\\"autohigh\\\"\\n pluginspage=\\\"http://www.macromedia.com/go/getflashplayer\\\"\\n wmode=\\\"<%= wmode %>\\\"\\n swliveconnect=\\\"true\\\"\\n allowfullscreen=\\\"false\\\"\\n bgcolor=\\\"#000000\\\"\\n FlashVars=\\\"playbackId=<%= playbackId %>&callback=<%= callbackName %>\\\"\\n src=\\\"<%= swfPath %>\\\"\\n width=\\\"100%\\\"\\n height=\\\"100%\\\">\\n</embed>\\n\";\n\n/***/ },\n/* 93 */\n/*!***********************************************!*\\\n !*** ./src/playbacks/no_op/public/error.html ***!\n \\***********************************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<canvas data-no-op-canvas></canvas>\\n<p data-no-op-msg><%=message%><p>\\n\";\n\n/***/ },\n/* 94 */\n/*!****************************************************!*\\\n !*** ./src/plugins/dvr_controls/public/index.html ***!\n \\****************************************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<div class=\\\"live-info\\\"><%= live %></div>\\n<button type=\\\"button\\\" class=\\\"live-button\\\"><%= backToLive %></button>\\n\";\n\n/***/ },\n/* 95 */\n/*!***********************************************!*\\\n !*** ./src/plugins/poster/public/poster.html ***!\n \\***********************************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<div class=\\\"play-wrapper\\\" data-poster></div>\\n\";\n\n/***/ },\n/* 96 */\n/*!*****************************************************!*\\\n !*** ./src/plugins/seek_time/public/seek_time.html ***!\n \\*****************************************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<span data-seek-time></span>\\n<span data-duration></span>\\n\";\n\n/***/ },\n/* 97 */\n/*!**************************************************************!*\\\n !*** ./src/plugins/spinner_three_bounce/public/spinner.html ***!\n \\**************************************************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<div data-bounce1></div><div data-bounce2></div><div data-bounce3></div>\\n\";\n\n/***/ },\n/* 98 */\n/*!*****************************************************!*\\\n !*** ./src/plugins/watermark/public/watermark.html ***!\n \\*****************************************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<div data-watermark data-watermark-<%=position %>>\\n<% if(typeof imageLink !== 'undefined') { %>\\n<a target=_blank href=\\\"<%= imageLink %>\\\">\\n<% } %>\\n<img src=\\\"<%= imageUrl %>\\\">\\n<% if(typeof imageLink !== 'undefined') { %>\\n</a>\\n<% } %>\\n</div>\\n\";\n\n/***/ },\n/* 99 */\n/*!***********************************!*\\\n !*** ./~/lodash.isequal/index.js ***!\n \\***********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global, module) {/**\n\t * lodash (Custom Build) <https://lodash.com/>\n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n\t * Released under MIT license <https://lodash.com/license>\n\t * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n\t * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t */\n\t\n\t/** Used as the size to enable large array optimizations. */\n\tvar LARGE_ARRAY_SIZE = 200;\n\t\n\t/** Used to stand-in for `undefined` hash values. */\n\tvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\t\n\t/** Used to compose bitmasks for comparison styles. */\n\tvar UNORDERED_COMPARE_FLAG = 1,\n\t PARTIAL_COMPARE_FLAG = 2;\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar MAX_SAFE_INTEGER = 9007199254740991;\n\t\n\t/** `Object#toString` result references. */\n\tvar argsTag = '[object Arguments]',\n\t arrayTag = '[object Array]',\n\t boolTag = '[object Boolean]',\n\t dateTag = '[object Date]',\n\t errorTag = '[object Error]',\n\t funcTag = '[object Function]',\n\t genTag = '[object GeneratorFunction]',\n\t mapTag = '[object Map]',\n\t numberTag = '[object Number]',\n\t objectTag = '[object Object]',\n\t promiseTag = '[object Promise]',\n\t regexpTag = '[object RegExp]',\n\t setTag = '[object Set]',\n\t stringTag = '[object String]',\n\t symbolTag = '[object Symbol]',\n\t weakMapTag = '[object WeakMap]';\n\t\n\tvar arrayBufferTag = '[object ArrayBuffer]',\n\t dataViewTag = '[object DataView]',\n\t float32Tag = '[object Float32Array]',\n\t float64Tag = '[object Float64Array]',\n\t int8Tag = '[object Int8Array]',\n\t int16Tag = '[object Int16Array]',\n\t int32Tag = '[object Int32Array]',\n\t uint8Tag = '[object Uint8Array]',\n\t uint8ClampedTag = '[object Uint8ClampedArray]',\n\t uint16Tag = '[object Uint16Array]',\n\t uint32Tag = '[object Uint32Array]';\n\t\n\t/**\n\t * Used to match `RegExp`\n\t * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n\t */\n\tvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\t\n\t/** Used to detect host constructors (Safari). */\n\tvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\t\n\t/** Used to detect unsigned integer values. */\n\tvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\t\n\t/** Used to identify `toStringTag` values of typed arrays. */\n\tvar typedArrayTags = {};\n\ttypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n\ttypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n\ttypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n\ttypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n\ttypedArrayTags[uint32Tag] = true;\n\ttypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n\ttypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n\ttypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n\ttypedArrayTags[errorTag] = typedArrayTags[funcTag] =\n\ttypedArrayTags[mapTag] = typedArrayTags[numberTag] =\n\ttypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n\ttypedArrayTags[setTag] = typedArrayTags[stringTag] =\n\ttypedArrayTags[weakMapTag] = false;\n\t\n\t/** Detect free variable `global` from Node.js. */\n\tvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\t\n\t/** Detect free variable `self`. */\n\tvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\t\n\t/** Used as a reference to the global object. */\n\tvar root = freeGlobal || freeSelf || Function('return this')();\n\t\n\t/** Detect free variable `exports`. */\n\tvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\t\n\t/** Detect free variable `module`. */\n\tvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\t\n\t/** Detect the popular CommonJS extension `module.exports`. */\n\tvar moduleExports = freeModule && freeModule.exports === freeExports;\n\t\n\t/** Detect free variable `process` from Node.js. */\n\tvar freeProcess = moduleExports && freeGlobal.process;\n\t\n\t/** Used to access faster Node.js helpers. */\n\tvar nodeUtil = (function() {\n\t try {\n\t return freeProcess && freeProcess.binding('util');\n\t } catch (e) {}\n\t}());\n\t\n\t/* Node.js helper references. */\n\tvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\t\n\t/**\n\t * A specialized version of `_.some` for arrays without support for iteratee\n\t * shorthands.\n\t *\n\t * @private\n\t * @param {Array} [array] The array to iterate over.\n\t * @param {Function} predicate The function invoked per iteration.\n\t * @returns {boolean} Returns `true` if any element passes the predicate check,\n\t * else `false`.\n\t */\n\tfunction arraySome(array, predicate) {\n\t var index = -1,\n\t length = array ? array.length : 0;\n\t\n\t while (++index < length) {\n\t if (predicate(array[index], index, array)) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.times` without support for iteratee shorthands\n\t * or max array length checks.\n\t *\n\t * @private\n\t * @param {number} n The number of times to invoke `iteratee`.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @returns {Array} Returns the array of results.\n\t */\n\tfunction baseTimes(n, iteratee) {\n\t var index = -1,\n\t result = Array(n);\n\t\n\t while (++index < n) {\n\t result[index] = iteratee(index);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.unary` without support for storing metadata.\n\t *\n\t * @private\n\t * @param {Function} func The function to cap arguments for.\n\t * @returns {Function} Returns the new capped function.\n\t */\n\tfunction baseUnary(func) {\n\t return function(value) {\n\t return func(value);\n\t };\n\t}\n\t\n\t/**\n\t * Gets the value at `key` of `object`.\n\t *\n\t * @private\n\t * @param {Object} [object] The object to query.\n\t * @param {string} key The key of the property to get.\n\t * @returns {*} Returns the property value.\n\t */\n\tfunction getValue(object, key) {\n\t return object == null ? undefined : object[key];\n\t}\n\t\n\t/**\n\t * Checks if `value` is a host object in IE < 9.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n\t */\n\tfunction isHostObject(value) {\n\t // Many host objects are `Object` objects that can coerce to strings\n\t // despite having improperly defined `toString` methods.\n\t var result = false;\n\t if (value != null && typeof value.toString != 'function') {\n\t try {\n\t result = !!(value + '');\n\t } catch (e) {}\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Converts `map` to its key-value pairs.\n\t *\n\t * @private\n\t * @param {Object} map The map to convert.\n\t * @returns {Array} Returns the key-value pairs.\n\t */\n\tfunction mapToArray(map) {\n\t var index = -1,\n\t result = Array(map.size);\n\t\n\t map.forEach(function(value, key) {\n\t result[++index] = [key, value];\n\t });\n\t return result;\n\t}\n\t\n\t/**\n\t * Creates a unary function that invokes `func` with its argument transformed.\n\t *\n\t * @private\n\t * @param {Function} func The function to wrap.\n\t * @param {Function} transform The argument transform.\n\t * @returns {Function} Returns the new function.\n\t */\n\tfunction overArg(func, transform) {\n\t return function(arg) {\n\t return func(transform(arg));\n\t };\n\t}\n\t\n\t/**\n\t * Converts `set` to an array of its values.\n\t *\n\t * @private\n\t * @param {Object} set The set to convert.\n\t * @returns {Array} Returns the values.\n\t */\n\tfunction setToArray(set) {\n\t var index = -1,\n\t result = Array(set.size);\n\t\n\t set.forEach(function(value) {\n\t result[++index] = value;\n\t });\n\t return result;\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar arrayProto = Array.prototype,\n\t funcProto = Function.prototype,\n\t objectProto = Object.prototype;\n\t\n\t/** Used to detect overreaching core-js shims. */\n\tvar coreJsData = root['__core-js_shared__'];\n\t\n\t/** Used to detect methods masquerading as native. */\n\tvar maskSrcKey = (function() {\n\t var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n\t return uid ? ('Symbol(src)_1.' + uid) : '';\n\t}());\n\t\n\t/** Used to resolve the decompiled source of functions. */\n\tvar funcToString = funcProto.toString;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/**\n\t * Used to resolve the\n\t * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/** Used to detect if a method is native. */\n\tvar reIsNative = RegExp('^' +\n\t funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n\t .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n\t);\n\t\n\t/** Built-in value references. */\n\tvar Symbol = root.Symbol,\n\t Uint8Array = root.Uint8Array,\n\t propertyIsEnumerable = objectProto.propertyIsEnumerable,\n\t splice = arrayProto.splice;\n\t\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeKeys = overArg(Object.keys, Object);\n\t\n\t/* Built-in method references that are verified to be native. */\n\tvar DataView = getNative(root, 'DataView'),\n\t Map = getNative(root, 'Map'),\n\t Promise = getNative(root, 'Promise'),\n\t Set = getNative(root, 'Set'),\n\t WeakMap = getNative(root, 'WeakMap'),\n\t nativeCreate = getNative(Object, 'create');\n\t\n\t/** Used to detect maps, sets, and weakmaps. */\n\tvar dataViewCtorString = toSource(DataView),\n\t mapCtorString = toSource(Map),\n\t promiseCtorString = toSource(Promise),\n\t setCtorString = toSource(Set),\n\t weakMapCtorString = toSource(WeakMap);\n\t\n\t/** Used to convert symbols to primitives and strings. */\n\tvar symbolProto = Symbol ? Symbol.prototype : undefined,\n\t symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\t\n\t/**\n\t * Creates a hash object.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction Hash(entries) {\n\t var index = -1,\n\t length = entries ? entries.length : 0;\n\t\n\t this.clear();\n\t while (++index < length) {\n\t var entry = entries[index];\n\t this.set(entry[0], entry[1]);\n\t }\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the hash.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf Hash\n\t */\n\tfunction hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the hash.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf Hash\n\t * @param {Object} hash The hash to modify.\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction hashDelete(key) {\n\t return this.has(key) && delete this.__data__[key];\n\t}\n\t\n\t/**\n\t * Gets the hash value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf Hash\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction hashGet(key) {\n\t var data = this.__data__;\n\t if (nativeCreate) {\n\t var result = data[key];\n\t return result === HASH_UNDEFINED ? undefined : result;\n\t }\n\t return hasOwnProperty.call(data, key) ? data[key] : undefined;\n\t}\n\t\n\t/**\n\t * Checks if a hash value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf Hash\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction hashHas(key) {\n\t var data = this.__data__;\n\t return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n\t}\n\t\n\t/**\n\t * Sets the hash `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf Hash\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the hash instance.\n\t */\n\tfunction hashSet(key, value) {\n\t var data = this.__data__;\n\t data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n\t return this;\n\t}\n\t\n\t// Add methods to `Hash`.\n\tHash.prototype.clear = hashClear;\n\tHash.prototype['delete'] = hashDelete;\n\tHash.prototype.get = hashGet;\n\tHash.prototype.has = hashHas;\n\tHash.prototype.set = hashSet;\n\t\n\t/**\n\t * Creates an list cache object.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction ListCache(entries) {\n\t var index = -1,\n\t length = entries ? entries.length : 0;\n\t\n\t this.clear();\n\t while (++index < length) {\n\t var entry = entries[index];\n\t this.set(entry[0], entry[1]);\n\t }\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the list cache.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf ListCache\n\t */\n\tfunction listCacheClear() {\n\t this.__data__ = [];\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the list cache.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction listCacheDelete(key) {\n\t var data = this.__data__,\n\t index = assocIndexOf(data, key);\n\t\n\t if (index < 0) {\n\t return false;\n\t }\n\t var lastIndex = data.length - 1;\n\t if (index == lastIndex) {\n\t data.pop();\n\t } else {\n\t splice.call(data, index, 1);\n\t }\n\t return true;\n\t}\n\t\n\t/**\n\t * Gets the list cache value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction listCacheGet(key) {\n\t var data = this.__data__,\n\t index = assocIndexOf(data, key);\n\t\n\t return index < 0 ? undefined : data[index][1];\n\t}\n\t\n\t/**\n\t * Checks if a list cache value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf ListCache\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction listCacheHas(key) {\n\t return assocIndexOf(this.__data__, key) > -1;\n\t}\n\t\n\t/**\n\t * Sets the list cache `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the list cache instance.\n\t */\n\tfunction listCacheSet(key, value) {\n\t var data = this.__data__,\n\t index = assocIndexOf(data, key);\n\t\n\t if (index < 0) {\n\t data.push([key, value]);\n\t } else {\n\t data[index][1] = value;\n\t }\n\t return this;\n\t}\n\t\n\t// Add methods to `ListCache`.\n\tListCache.prototype.clear = listCacheClear;\n\tListCache.prototype['delete'] = listCacheDelete;\n\tListCache.prototype.get = listCacheGet;\n\tListCache.prototype.has = listCacheHas;\n\tListCache.prototype.set = listCacheSet;\n\t\n\t/**\n\t * Creates a map cache object to store key-value pairs.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction MapCache(entries) {\n\t var index = -1,\n\t length = entries ? entries.length : 0;\n\t\n\t this.clear();\n\t while (++index < length) {\n\t var entry = entries[index];\n\t this.set(entry[0], entry[1]);\n\t }\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the map.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf MapCache\n\t */\n\tfunction mapCacheClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': new (Map || ListCache),\n\t 'string': new Hash\n\t };\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the map.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction mapCacheDelete(key) {\n\t return getMapData(this, key)['delete'](key);\n\t}\n\t\n\t/**\n\t * Gets the map value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction mapCacheGet(key) {\n\t return getMapData(this, key).get(key);\n\t}\n\t\n\t/**\n\t * Checks if a map value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf MapCache\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction mapCacheHas(key) {\n\t return getMapData(this, key).has(key);\n\t}\n\t\n\t/**\n\t * Sets the map `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the map cache instance.\n\t */\n\tfunction mapCacheSet(key, value) {\n\t getMapData(this, key).set(key, value);\n\t return this;\n\t}\n\t\n\t// Add methods to `MapCache`.\n\tMapCache.prototype.clear = mapCacheClear;\n\tMapCache.prototype['delete'] = mapCacheDelete;\n\tMapCache.prototype.get = mapCacheGet;\n\tMapCache.prototype.has = mapCacheHas;\n\tMapCache.prototype.set = mapCacheSet;\n\t\n\t/**\n\t *\n\t * Creates an array cache object to store unique values.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [values] The values to cache.\n\t */\n\tfunction SetCache(values) {\n\t var index = -1,\n\t length = values ? values.length : 0;\n\t\n\t this.__data__ = new MapCache;\n\t while (++index < length) {\n\t this.add(values[index]);\n\t }\n\t}\n\t\n\t/**\n\t * Adds `value` to the array cache.\n\t *\n\t * @private\n\t * @name add\n\t * @memberOf SetCache\n\t * @alias push\n\t * @param {*} value The value to cache.\n\t * @returns {Object} Returns the cache instance.\n\t */\n\tfunction setCacheAdd(value) {\n\t this.__data__.set(value, HASH_UNDEFINED);\n\t return this;\n\t}\n\t\n\t/**\n\t * Checks if `value` is in the array cache.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf SetCache\n\t * @param {*} value The value to search for.\n\t * @returns {number} Returns `true` if `value` is found, else `false`.\n\t */\n\tfunction setCacheHas(value) {\n\t return this.__data__.has(value);\n\t}\n\t\n\t// Add methods to `SetCache`.\n\tSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n\tSetCache.prototype.has = setCacheHas;\n\t\n\t/**\n\t * Creates a stack cache object to store key-value pairs.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction Stack(entries) {\n\t this.__data__ = new ListCache(entries);\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the stack.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf Stack\n\t */\n\tfunction stackClear() {\n\t this.__data__ = new ListCache;\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the stack.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf Stack\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction stackDelete(key) {\n\t return this.__data__['delete'](key);\n\t}\n\t\n\t/**\n\t * Gets the stack value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf Stack\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction stackGet(key) {\n\t return this.__data__.get(key);\n\t}\n\t\n\t/**\n\t * Checks if a stack value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf Stack\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction stackHas(key) {\n\t return this.__data__.has(key);\n\t}\n\t\n\t/**\n\t * Sets the stack `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf Stack\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the stack cache instance.\n\t */\n\tfunction stackSet(key, value) {\n\t var cache = this.__data__;\n\t if (cache instanceof ListCache) {\n\t var pairs = cache.__data__;\n\t if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n\t pairs.push([key, value]);\n\t return this;\n\t }\n\t cache = this.__data__ = new MapCache(pairs);\n\t }\n\t cache.set(key, value);\n\t return this;\n\t}\n\t\n\t// Add methods to `Stack`.\n\tStack.prototype.clear = stackClear;\n\tStack.prototype['delete'] = stackDelete;\n\tStack.prototype.get = stackGet;\n\tStack.prototype.has = stackHas;\n\tStack.prototype.set = stackSet;\n\t\n\t/**\n\t * Creates an array of the enumerable property names of the array-like `value`.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @param {boolean} inherited Specify returning inherited property names.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction arrayLikeKeys(value, inherited) {\n\t // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n\t // Safari 9 makes `arguments.length` enumerable in strict mode.\n\t var result = (isArray(value) || isArguments(value))\n\t ? baseTimes(value.length, String)\n\t : [];\n\t\n\t var length = result.length,\n\t skipIndexes = !!length;\n\t\n\t for (var key in value) {\n\t if ((inherited || hasOwnProperty.call(value, key)) &&\n\t !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Gets the index at which the `key` is found in `array` of key-value pairs.\n\t *\n\t * @private\n\t * @param {Array} array The array to inspect.\n\t * @param {*} key The key to search for.\n\t * @returns {number} Returns the index of the matched value, else `-1`.\n\t */\n\tfunction assocIndexOf(array, key) {\n\t var length = array.length;\n\t while (length--) {\n\t if (eq(array[length][0], key)) {\n\t return length;\n\t }\n\t }\n\t return -1;\n\t}\n\t\n\t/**\n\t * The base implementation of `getTag`.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @returns {string} Returns the `toStringTag`.\n\t */\n\tfunction baseGetTag(value) {\n\t return objectToString.call(value);\n\t}\n\t\n\t/**\n\t * The base implementation of `_.isEqual` which supports partial comparisons\n\t * and tracks traversed objects.\n\t *\n\t * @private\n\t * @param {*} value The value to compare.\n\t * @param {*} other The other value to compare.\n\t * @param {Function} [customizer] The function to customize comparisons.\n\t * @param {boolean} [bitmask] The bitmask of comparison flags.\n\t * The bitmask may be composed of the following flags:\n\t * 1 - Unordered comparison\n\t * 2 - Partial comparison\n\t * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n\t * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n\t */\n\tfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n\t if (value === other) {\n\t return true;\n\t }\n\t if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n\t return value !== value && other !== other;\n\t }\n\t return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n\t}\n\t\n\t/**\n\t * A specialized version of `baseIsEqual` for arrays and objects which performs\n\t * deep comparisons and tracks traversed objects enabling objects with circular\n\t * references to be compared.\n\t *\n\t * @private\n\t * @param {Object} object The object to compare.\n\t * @param {Object} other The other object to compare.\n\t * @param {Function} equalFunc The function to determine equivalents of values.\n\t * @param {Function} [customizer] The function to customize comparisons.\n\t * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n\t * for more details.\n\t * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n\t * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n\t */\n\tfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n\t var objIsArr = isArray(object),\n\t othIsArr = isArray(other),\n\t objTag = arrayTag,\n\t othTag = arrayTag;\n\t\n\t if (!objIsArr) {\n\t objTag = getTag(object);\n\t objTag = objTag == argsTag ? objectTag : objTag;\n\t }\n\t if (!othIsArr) {\n\t othTag = getTag(other);\n\t othTag = othTag == argsTag ? objectTag : othTag;\n\t }\n\t var objIsObj = objTag == objectTag && !isHostObject(object),\n\t othIsObj = othTag == objectTag && !isHostObject(other),\n\t isSameTag = objTag == othTag;\n\t\n\t if (isSameTag && !objIsObj) {\n\t stack || (stack = new Stack);\n\t return (objIsArr || isTypedArray(object))\n\t ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n\t : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n\t }\n\t if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n\t var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n\t othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\t\n\t if (objIsWrapped || othIsWrapped) {\n\t var objUnwrapped = objIsWrapped ? object.value() : object,\n\t othUnwrapped = othIsWrapped ? other.value() : other;\n\t\n\t stack || (stack = new Stack);\n\t return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n\t }\n\t }\n\t if (!isSameTag) {\n\t return false;\n\t }\n\t stack || (stack = new Stack);\n\t return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n\t}\n\t\n\t/**\n\t * The base implementation of `_.isNative` without bad shim checks.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a native function,\n\t * else `false`.\n\t */\n\tfunction baseIsNative(value) {\n\t if (!isObject(value) || isMasked(value)) {\n\t return false;\n\t }\n\t var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n\t return pattern.test(toSource(value));\n\t}\n\t\n\t/**\n\t * The base implementation of `_.isTypedArray` without Node.js optimizations.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n\t */\n\tfunction baseIsTypedArray(value) {\n\t return isObjectLike(value) &&\n\t isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n\t}\n\t\n\t/**\n\t * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction baseKeys(object) {\n\t if (!isPrototype(object)) {\n\t return nativeKeys(object);\n\t }\n\t var result = [];\n\t for (var key in Object(object)) {\n\t if (hasOwnProperty.call(object, key) && key != 'constructor') {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * A specialized version of `baseIsEqualDeep` for arrays with support for\n\t * partial deep comparisons.\n\t *\n\t * @private\n\t * @param {Array} array The array to compare.\n\t * @param {Array} other The other array to compare.\n\t * @param {Function} equalFunc The function to determine equivalents of values.\n\t * @param {Function} customizer The function to customize comparisons.\n\t * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n\t * for more details.\n\t * @param {Object} stack Tracks traversed `array` and `other` objects.\n\t * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n\t */\n\tfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n\t var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n\t arrLength = array.length,\n\t othLength = other.length;\n\t\n\t if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n\t return false;\n\t }\n\t // Assume cyclic values are equal.\n\t var stacked = stack.get(array);\n\t if (stacked && stack.get(other)) {\n\t return stacked == other;\n\t }\n\t var index = -1,\n\t result = true,\n\t seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\t\n\t stack.set(array, other);\n\t stack.set(other, array);\n\t\n\t // Ignore non-index properties.\n\t while (++index < arrLength) {\n\t var arrValue = array[index],\n\t othValue = other[index];\n\t\n\t if (customizer) {\n\t var compared = isPartial\n\t ? customizer(othValue, arrValue, index, other, array, stack)\n\t : customizer(arrValue, othValue, index, array, other, stack);\n\t }\n\t if (compared !== undefined) {\n\t if (compared) {\n\t continue;\n\t }\n\t result = false;\n\t break;\n\t }\n\t // Recursively compare arrays (susceptible to call stack limits).\n\t if (seen) {\n\t if (!arraySome(other, function(othValue, othIndex) {\n\t if (!seen.has(othIndex) &&\n\t (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n\t return seen.add(othIndex);\n\t }\n\t })) {\n\t result = false;\n\t break;\n\t }\n\t } else if (!(\n\t arrValue === othValue ||\n\t equalFunc(arrValue, othValue, customizer, bitmask, stack)\n\t )) {\n\t result = false;\n\t break;\n\t }\n\t }\n\t stack['delete'](array);\n\t stack['delete'](other);\n\t return result;\n\t}\n\t\n\t/**\n\t * A specialized version of `baseIsEqualDeep` for comparing objects of\n\t * the same `toStringTag`.\n\t *\n\t * **Note:** This function only supports comparing values with tags of\n\t * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n\t *\n\t * @private\n\t * @param {Object} object The object to compare.\n\t * @param {Object} other The other object to compare.\n\t * @param {string} tag The `toStringTag` of the objects to compare.\n\t * @param {Function} equalFunc The function to determine equivalents of values.\n\t * @param {Function} customizer The function to customize comparisons.\n\t * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n\t * for more details.\n\t * @param {Object} stack Tracks traversed `object` and `other` objects.\n\t * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n\t */\n\tfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n\t switch (tag) {\n\t case dataViewTag:\n\t if ((object.byteLength != other.byteLength) ||\n\t (object.byteOffset != other.byteOffset)) {\n\t return false;\n\t }\n\t object = object.buffer;\n\t other = other.buffer;\n\t\n\t case arrayBufferTag:\n\t if ((object.byteLength != other.byteLength) ||\n\t !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n\t return false;\n\t }\n\t return true;\n\t\n\t case boolTag:\n\t case dateTag:\n\t case numberTag:\n\t // Coerce booleans to `1` or `0` and dates to milliseconds.\n\t // Invalid dates are coerced to `NaN`.\n\t return eq(+object, +other);\n\t\n\t case errorTag:\n\t return object.name == other.name && object.message == other.message;\n\t\n\t case regexpTag:\n\t case stringTag:\n\t // Coerce regexes to strings and treat strings, primitives and objects,\n\t // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n\t // for more details.\n\t return object == (other + '');\n\t\n\t case mapTag:\n\t var convert = mapToArray;\n\t\n\t case setTag:\n\t var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n\t convert || (convert = setToArray);\n\t\n\t if (object.size != other.size && !isPartial) {\n\t return false;\n\t }\n\t // Assume cyclic values are equal.\n\t var stacked = stack.get(object);\n\t if (stacked) {\n\t return stacked == other;\n\t }\n\t bitmask |= UNORDERED_COMPARE_FLAG;\n\t\n\t // Recursively compare objects (susceptible to call stack limits).\n\t stack.set(object, other);\n\t var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n\t stack['delete'](object);\n\t return result;\n\t\n\t case symbolTag:\n\t if (symbolValueOf) {\n\t return symbolValueOf.call(object) == symbolValueOf.call(other);\n\t }\n\t }\n\t return false;\n\t}\n\t\n\t/**\n\t * A specialized version of `baseIsEqualDeep` for objects with support for\n\t * partial deep comparisons.\n\t *\n\t * @private\n\t * @param {Object} object The object to compare.\n\t * @param {Object} other The other object to compare.\n\t * @param {Function} equalFunc The function to determine equivalents of values.\n\t * @param {Function} customizer The function to customize comparisons.\n\t * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n\t * for more details.\n\t * @param {Object} stack Tracks traversed `object` and `other` objects.\n\t * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n\t */\n\tfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n\t var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n\t objProps = keys(object),\n\t objLength = objProps.length,\n\t othProps = keys(other),\n\t othLength = othProps.length;\n\t\n\t if (objLength != othLength && !isPartial) {\n\t return false;\n\t }\n\t var index = objLength;\n\t while (index--) {\n\t var key = objProps[index];\n\t if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n\t return false;\n\t }\n\t }\n\t // Assume cyclic values are equal.\n\t var stacked = stack.get(object);\n\t if (stacked && stack.get(other)) {\n\t return stacked == other;\n\t }\n\t var result = true;\n\t stack.set(object, other);\n\t stack.set(other, object);\n\t\n\t var skipCtor = isPartial;\n\t while (++index < objLength) {\n\t key = objProps[index];\n\t var objValue = object[key],\n\t othValue = other[key];\n\t\n\t if (customizer) {\n\t var compared = isPartial\n\t ? customizer(othValue, objValue, key, other, object, stack)\n\t : customizer(objValue, othValue, key, object, other, stack);\n\t }\n\t // Recursively compare objects (susceptible to call stack limits).\n\t if (!(compared === undefined\n\t ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n\t : compared\n\t )) {\n\t result = false;\n\t break;\n\t }\n\t skipCtor || (skipCtor = key == 'constructor');\n\t }\n\t if (result && !skipCtor) {\n\t var objCtor = object.constructor,\n\t othCtor = other.constructor;\n\t\n\t // Non `Object` object instances with different constructors are not equal.\n\t if (objCtor != othCtor &&\n\t ('constructor' in object && 'constructor' in other) &&\n\t !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n\t typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n\t result = false;\n\t }\n\t }\n\t stack['delete'](object);\n\t stack['delete'](other);\n\t return result;\n\t}\n\t\n\t/**\n\t * Gets the data for `map`.\n\t *\n\t * @private\n\t * @param {Object} map The map to query.\n\t * @param {string} key The reference key.\n\t * @returns {*} Returns the map data.\n\t */\n\tfunction getMapData(map, key) {\n\t var data = map.__data__;\n\t return isKeyable(key)\n\t ? data[typeof key == 'string' ? 'string' : 'hash']\n\t : data.map;\n\t}\n\t\n\t/**\n\t * Gets the native function at `key` of `object`.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @param {string} key The key of the method to get.\n\t * @returns {*} Returns the function if it's native, else `undefined`.\n\t */\n\tfunction getNative(object, key) {\n\t var value = getValue(object, key);\n\t return baseIsNative(value) ? value : undefined;\n\t}\n\t\n\t/**\n\t * Gets the `toStringTag` of `value`.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @returns {string} Returns the `toStringTag`.\n\t */\n\tvar getTag = baseGetTag;\n\t\n\t// Fallback for data views, maps, sets, and weak maps in IE 11,\n\t// for data views in Edge < 14, and promises in Node.js.\n\tif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n\t (Map && getTag(new Map) != mapTag) ||\n\t (Promise && getTag(Promise.resolve()) != promiseTag) ||\n\t (Set && getTag(new Set) != setTag) ||\n\t (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n\t getTag = function(value) {\n\t var result = objectToString.call(value),\n\t Ctor = result == objectTag ? value.constructor : undefined,\n\t ctorString = Ctor ? toSource(Ctor) : undefined;\n\t\n\t if (ctorString) {\n\t switch (ctorString) {\n\t case dataViewCtorString: return dataViewTag;\n\t case mapCtorString: return mapTag;\n\t case promiseCtorString: return promiseTag;\n\t case setCtorString: return setTag;\n\t case weakMapCtorString: return weakMapTag;\n\t }\n\t }\n\t return result;\n\t };\n\t}\n\t\n\t/**\n\t * Checks if `value` is a valid array-like index.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n\t * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n\t */\n\tfunction isIndex(value, length) {\n\t length = length == null ? MAX_SAFE_INTEGER : length;\n\t return !!length &&\n\t (typeof value == 'number' || reIsUint.test(value)) &&\n\t (value > -1 && value % 1 == 0 && value < length);\n\t}\n\t\n\t/**\n\t * Checks if `value` is suitable for use as unique object key.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n\t */\n\tfunction isKeyable(value) {\n\t var type = typeof value;\n\t return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n\t ? (value !== '__proto__')\n\t : (value === null);\n\t}\n\t\n\t/**\n\t * Checks if `func` has its source masked.\n\t *\n\t * @private\n\t * @param {Function} func The function to check.\n\t * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n\t */\n\tfunction isMasked(func) {\n\t return !!maskSrcKey && (maskSrcKey in func);\n\t}\n\t\n\t/**\n\t * Checks if `value` is likely a prototype object.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n\t */\n\tfunction isPrototype(value) {\n\t var Ctor = value && value.constructor,\n\t proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\t\n\t return value === proto;\n\t}\n\t\n\t/**\n\t * Converts `func` to its source code.\n\t *\n\t * @private\n\t * @param {Function} func The function to process.\n\t * @returns {string} Returns the source code.\n\t */\n\tfunction toSource(func) {\n\t if (func != null) {\n\t try {\n\t return funcToString.call(func);\n\t } catch (e) {}\n\t try {\n\t return (func + '');\n\t } catch (e) {}\n\t }\n\t return '';\n\t}\n\t\n\t/**\n\t * Performs a\n\t * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n\t * comparison between two values to determine if they are equivalent.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to compare.\n\t * @param {*} other The other value to compare.\n\t * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n\t * @example\n\t *\n\t * var object = { 'a': 1 };\n\t * var other = { 'a': 1 };\n\t *\n\t * _.eq(object, object);\n\t * // => true\n\t *\n\t * _.eq(object, other);\n\t * // => false\n\t *\n\t * _.eq('a', 'a');\n\t * // => true\n\t *\n\t * _.eq('a', Object('a'));\n\t * // => false\n\t *\n\t * _.eq(NaN, NaN);\n\t * // => true\n\t */\n\tfunction eq(value, other) {\n\t return value === other || (value !== value && other !== other);\n\t}\n\t\n\t/**\n\t * Checks if `value` is likely an `arguments` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n\t * else `false`.\n\t * @example\n\t *\n\t * _.isArguments(function() { return arguments; }());\n\t * // => true\n\t *\n\t * _.isArguments([1, 2, 3]);\n\t * // => false\n\t */\n\tfunction isArguments(value) {\n\t // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n\t return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n\t (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as an `Array` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n\t * @example\n\t *\n\t * _.isArray([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArray(document.body.children);\n\t * // => false\n\t *\n\t * _.isArray('abc');\n\t * // => false\n\t *\n\t * _.isArray(_.noop);\n\t * // => false\n\t */\n\tvar isArray = Array.isArray;\n\t\n\t/**\n\t * Checks if `value` is array-like. A value is considered array-like if it's\n\t * not a function and has a `value.length` that's an integer greater than or\n\t * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n\t * @example\n\t *\n\t * _.isArrayLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLike(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLike('abc');\n\t * // => true\n\t *\n\t * _.isArrayLike(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLike(value) {\n\t return value != null && isLength(value.length) && !isFunction(value);\n\t}\n\t\n\t/**\n\t * This method is like `_.isArrayLike` except that it also checks if `value`\n\t * is an object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an array-like object,\n\t * else `false`.\n\t * @example\n\t *\n\t * _.isArrayLikeObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLikeObject(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLikeObject('abc');\n\t * // => false\n\t *\n\t * _.isArrayLikeObject(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLikeObject(value) {\n\t return isObjectLike(value) && isArrayLike(value);\n\t}\n\t\n\t/**\n\t * Performs a deep comparison between two values to determine if they are\n\t * equivalent.\n\t *\n\t * **Note:** This method supports comparing arrays, array buffers, booleans,\n\t * date objects, error objects, maps, numbers, `Object` objects, regexes,\n\t * sets, strings, symbols, and typed arrays. `Object` objects are compared\n\t * by their own, not inherited, enumerable properties. Functions and DOM\n\t * nodes are **not** supported.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to compare.\n\t * @param {*} other The other value to compare.\n\t * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n\t * @example\n\t *\n\t * var object = { 'a': 1 };\n\t * var other = { 'a': 1 };\n\t *\n\t * _.isEqual(object, other);\n\t * // => true\n\t *\n\t * object === other;\n\t * // => false\n\t */\n\tfunction isEqual(value, other) {\n\t return baseIsEqual(value, other);\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 8-9 which returns 'object' for typed array and other constructors.\n\t var tag = isObject(value) ? objectToString.call(value) : '';\n\t return tag == funcTag || tag == genTag;\n\t}\n\t\n\t/**\n\t * Checks if `value` is a valid array-like length.\n\t *\n\t * **Note:** This method is loosely based on\n\t * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n\t * @example\n\t *\n\t * _.isLength(3);\n\t * // => true\n\t *\n\t * _.isLength(Number.MIN_VALUE);\n\t * // => false\n\t *\n\t * _.isLength(Infinity);\n\t * // => false\n\t *\n\t * _.isLength('3');\n\t * // => false\n\t */\n\tfunction isLength(value) {\n\t return typeof value == 'number' &&\n\t value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n\t}\n\t\n\t/**\n\t * Checks if `value` is the\n\t * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n\t * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\t/**\n\t * Checks if `value` is object-like. A value is object-like if it's not `null`\n\t * and has a `typeof` result of \"object\".\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n\t * @example\n\t *\n\t * _.isObjectLike({});\n\t * // => true\n\t *\n\t * _.isObjectLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObjectLike(_.noop);\n\t * // => false\n\t *\n\t * _.isObjectLike(null);\n\t * // => false\n\t */\n\tfunction isObjectLike(value) {\n\t return !!value && typeof value == 'object';\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a typed array.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 3.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n\t * @example\n\t *\n\t * _.isTypedArray(new Uint8Array);\n\t * // => true\n\t *\n\t * _.isTypedArray([]);\n\t * // => false\n\t */\n\tvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\t\n\t/**\n\t * Creates an array of the own enumerable property names of `object`.\n\t *\n\t * **Note:** Non-object values are coerced to objects. See the\n\t * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n\t * for more details.\n\t *\n\t * @static\n\t * @since 0.1.0\n\t * @memberOf _\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.a = 1;\n\t * this.b = 2;\n\t * }\n\t *\n\t * Foo.prototype.c = 3;\n\t *\n\t * _.keys(new Foo);\n\t * // => ['a', 'b'] (iteration order is not guaranteed)\n\t *\n\t * _.keys('hi');\n\t * // => ['0', '1']\n\t */\n\tfunction keys(object) {\n\t return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n\t}\n\t\n\tmodule.exports = isEqual;\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(/*! ./../webpack/buildin/module.js */ 23)(module)))\n\n/***/ },\n/* 100 */\n/*!*****************************************!*\\\n !*** ./~/lodash.isplainobject/index.js ***!\n \\*****************************************/\n/***/ function(module, exports) {\n\n\t/**\n\t * lodash (Custom Build) <https://lodash.com/>\n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n\t * Released under MIT license <https://lodash.com/license>\n\t * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n\t * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t */\n\t\n\t/** `Object#toString` result references. */\n\tvar objectTag = '[object Object]';\n\t\n\t/**\n\t * Checks if `value` is a host object in IE < 9.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n\t */\n\tfunction isHostObject(value) {\n\t // Many host objects are `Object` objects that can coerce to strings\n\t // despite having improperly defined `toString` methods.\n\t var result = false;\n\t if (value != null && typeof value.toString != 'function') {\n\t try {\n\t result = !!(value + '');\n\t } catch (e) {}\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Creates a unary function that invokes `func` with its argument transformed.\n\t *\n\t * @private\n\t * @param {Function} func The function to wrap.\n\t * @param {Function} transform The argument transform.\n\t * @returns {Function} Returns the new function.\n\t */\n\tfunction overArg(func, transform) {\n\t return function(arg) {\n\t return func(transform(arg));\n\t };\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar funcProto = Function.prototype,\n\t objectProto = Object.prototype;\n\t\n\t/** Used to resolve the decompiled source of functions. */\n\tvar funcToString = funcProto.toString;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/** Used to infer the `Object` constructor. */\n\tvar objectCtorString = funcToString.call(Object);\n\t\n\t/**\n\t * Used to resolve the\n\t * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/** Built-in value references. */\n\tvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\t\n\t/**\n\t * Checks if `value` is object-like. A value is object-like if it's not `null`\n\t * and has a `typeof` result of \"object\".\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n\t * @example\n\t *\n\t * _.isObjectLike({});\n\t * // => true\n\t *\n\t * _.isObjectLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObjectLike(_.noop);\n\t * // => false\n\t *\n\t * _.isObjectLike(null);\n\t * // => false\n\t */\n\tfunction isObjectLike(value) {\n\t return !!value && typeof value == 'object';\n\t}\n\t\n\t/**\n\t * Checks if `value` is a plain object, that is, an object created by the\n\t * `Object` constructor or one with a `[[Prototype]]` of `null`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.8.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.a = 1;\n\t * }\n\t *\n\t * _.isPlainObject(new Foo);\n\t * // => false\n\t *\n\t * _.isPlainObject([1, 2, 3]);\n\t * // => false\n\t *\n\t * _.isPlainObject({ 'x': 0, 'y': 0 });\n\t * // => true\n\t *\n\t * _.isPlainObject(Object.create(null));\n\t * // => true\n\t */\n\tfunction isPlainObject(value) {\n\t if (!isObjectLike(value) ||\n\t objectToString.call(value) != objectTag || isHostObject(value)) {\n\t return false;\n\t }\n\t var proto = getPrototype(value);\n\t if (proto === null) {\n\t return true;\n\t }\n\t var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n\t return (typeof Ctor == 'function' &&\n\t Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);\n\t}\n\t\n\tmodule.exports = isPlainObject;\n\n\n/***/ },\n/* 101 */\n/*!********************************!*\\\n !*** ./~/lodash.once/index.js ***!\n \\********************************/\n/***/ function(module, exports) {\n\n\t/**\n\t * lodash (Custom Build) <https://lodash.com/>\n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n\t * Released under MIT license <https://lodash.com/license>\n\t * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n\t * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t */\n\t\n\t/** Used as the `TypeError` message for \"Functions\" methods. */\n\tvar FUNC_ERROR_TEXT = 'Expected a function';\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar INFINITY = 1 / 0,\n\t MAX_INTEGER = 1.7976931348623157e+308,\n\t NAN = 0 / 0;\n\t\n\t/** `Object#toString` result references. */\n\tvar symbolTag = '[object Symbol]';\n\t\n\t/** Used to match leading and trailing whitespace. */\n\tvar reTrim = /^\\s+|\\s+$/g;\n\t\n\t/** Used to detect bad signed hexadecimal string values. */\n\tvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\t\n\t/** Used to detect binary string values. */\n\tvar reIsBinary = /^0b[01]+$/i;\n\t\n\t/** Used to detect octal string values. */\n\tvar reIsOctal = /^0o[0-7]+$/i;\n\t\n\t/** Built-in method references without a dependency on `root`. */\n\tvar freeParseInt = parseInt;\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/**\n\t * Used to resolve the\n\t * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/**\n\t * Creates a function that invokes `func`, with the `this` binding and arguments\n\t * of the created function, while it's called less than `n` times. Subsequent\n\t * calls to the created function return the result of the last `func` invocation.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 3.0.0\n\t * @category Function\n\t * @param {number} n The number of calls at which `func` is no longer invoked.\n\t * @param {Function} func The function to restrict.\n\t * @returns {Function} Returns the new restricted function.\n\t * @example\n\t *\n\t * jQuery(element).on('click', _.before(5, addContactToList));\n\t * // => Allows adding up to 4 contacts to the list.\n\t */\n\tfunction before(n, func) {\n\t var result;\n\t if (typeof func != 'function') {\n\t throw new TypeError(FUNC_ERROR_TEXT);\n\t }\n\t n = toInteger(n);\n\t return function() {\n\t if (--n > 0) {\n\t result = func.apply(this, arguments);\n\t }\n\t if (n <= 1) {\n\t func = undefined;\n\t }\n\t return result;\n\t };\n\t}\n\t\n\t/**\n\t * Creates a function that is restricted to invoking `func` once. Repeat calls\n\t * to the function return the value of the first invocation. The `func` is\n\t * invoked with the `this` binding and arguments of the created function.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Function\n\t * @param {Function} func The function to restrict.\n\t * @returns {Function} Returns the new restricted function.\n\t * @example\n\t *\n\t * var initialize = _.once(createApplication);\n\t * initialize();\n\t * initialize();\n\t * // => `createApplication` is invoked once\n\t */\n\tfunction once(func) {\n\t return before(2, func);\n\t}\n\t\n\t/**\n\t * Checks if `value` is the\n\t * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n\t * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\t/**\n\t * Checks if `value` is object-like. A value is object-like if it's not `null`\n\t * and has a `typeof` result of \"object\".\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n\t * @example\n\t *\n\t * _.isObjectLike({});\n\t * // => true\n\t *\n\t * _.isObjectLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObjectLike(_.noop);\n\t * // => false\n\t *\n\t * _.isObjectLike(null);\n\t * // => false\n\t */\n\tfunction isObjectLike(value) {\n\t return !!value && typeof value == 'object';\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `Symbol` primitive or object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n\t * @example\n\t *\n\t * _.isSymbol(Symbol.iterator);\n\t * // => true\n\t *\n\t * _.isSymbol('abc');\n\t * // => false\n\t */\n\tfunction isSymbol(value) {\n\t return typeof value == 'symbol' ||\n\t (isObjectLike(value) && objectToString.call(value) == symbolTag);\n\t}\n\t\n\t/**\n\t * Converts `value` to a finite number.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.12.0\n\t * @category Lang\n\t * @param {*} value The value to convert.\n\t * @returns {number} Returns the converted number.\n\t * @example\n\t *\n\t * _.toFinite(3.2);\n\t * // => 3.2\n\t *\n\t * _.toFinite(Number.MIN_VALUE);\n\t * // => 5e-324\n\t *\n\t * _.toFinite(Infinity);\n\t * // => 1.7976931348623157e+308\n\t *\n\t * _.toFinite('3.2');\n\t * // => 3.2\n\t */\n\tfunction toFinite(value) {\n\t if (!value) {\n\t return value === 0 ? value : 0;\n\t }\n\t value = toNumber(value);\n\t if (value === INFINITY || value === -INFINITY) {\n\t var sign = (value < 0 ? -1 : 1);\n\t return sign * MAX_INTEGER;\n\t }\n\t return value === value ? value : 0;\n\t}\n\t\n\t/**\n\t * Converts `value` to an integer.\n\t *\n\t * **Note:** This method is loosely based on\n\t * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to convert.\n\t * @returns {number} Returns the converted integer.\n\t * @example\n\t *\n\t * _.toInteger(3.2);\n\t * // => 3\n\t *\n\t * _.toInteger(Number.MIN_VALUE);\n\t * // => 0\n\t *\n\t * _.toInteger(Infinity);\n\t * // => 1.7976931348623157e+308\n\t *\n\t * _.toInteger('3.2');\n\t * // => 3\n\t */\n\tfunction toInteger(value) {\n\t var result = toFinite(value),\n\t remainder = result % 1;\n\t\n\t return result === result ? (remainder ? result - remainder : result) : 0;\n\t}\n\t\n\t/**\n\t * Converts `value` to a number.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to process.\n\t * @returns {number} Returns the number.\n\t * @example\n\t *\n\t * _.toNumber(3.2);\n\t * // => 3.2\n\t *\n\t * _.toNumber(Number.MIN_VALUE);\n\t * // => 5e-324\n\t *\n\t * _.toNumber(Infinity);\n\t * // => Infinity\n\t *\n\t * _.toNumber('3.2');\n\t * // => 3.2\n\t */\n\tfunction toNumber(value) {\n\t if (typeof value == 'number') {\n\t return value;\n\t }\n\t if (isSymbol(value)) {\n\t return NAN;\n\t }\n\t if (isObject(value)) {\n\t var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n\t value = isObject(other) ? (other + '') : other;\n\t }\n\t if (typeof value != 'string') {\n\t return value === 0 ? value : +value;\n\t }\n\t value = value.replace(reTrim, '');\n\t var isBinary = reIsBinary.test(value);\n\t return (isBinary || reIsOctal.test(value))\n\t ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n\t : (reIsBadHex.test(value) ? NAN : +value);\n\t}\n\t\n\tmodule.exports = once;\n\n\n/***/ },\n/* 102 */\n/*!**********************************!*\\\n !*** ./~/lodash.result/index.js ***!\n \\**********************************/\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * lodash (Custom Build) <https://lodash.com/>\n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n\t * Released under MIT license <https://lodash.com/license>\n\t * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n\t * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t */\n\t\n\t/** Used as the `TypeError` message for \"Functions\" methods. */\n\tvar FUNC_ERROR_TEXT = 'Expected a function';\n\t\n\t/** Used to stand-in for `undefined` hash values. */\n\tvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar INFINITY = 1 / 0;\n\t\n\t/** `Object#toString` result references. */\n\tvar funcTag = '[object Function]',\n\t genTag = '[object GeneratorFunction]',\n\t symbolTag = '[object Symbol]';\n\t\n\t/** Used to match property names within property paths. */\n\tvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n\t reIsPlainProp = /^\\w*$/,\n\t reLeadingDot = /^\\./,\n\t rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\t\n\t/**\n\t * Used to match `RegExp`\n\t * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n\t */\n\tvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\t\n\t/** Used to match backslashes in property paths. */\n\tvar reEscapeChar = /\\\\(\\\\)?/g;\n\t\n\t/** Used to detect host constructors (Safari). */\n\tvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\t\n\t/** Detect free variable `global` from Node.js. */\n\tvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\t\n\t/** Detect free variable `self`. */\n\tvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\t\n\t/** Used as a reference to the global object. */\n\tvar root = freeGlobal || freeSelf || Function('return this')();\n\t\n\t/**\n\t * Gets the value at `key` of `object`.\n\t *\n\t * @private\n\t * @param {Object} [object] The object to query.\n\t * @param {string} key The key of the property to get.\n\t * @returns {*} Returns the property value.\n\t */\n\tfunction getValue(object, key) {\n\t return object == null ? undefined : object[key];\n\t}\n\t\n\t/**\n\t * Checks if `value` is a host object in IE < 9.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n\t */\n\tfunction isHostObject(value) {\n\t // Many host objects are `Object` objects that can coerce to strings\n\t // despite having improperly defined `toString` methods.\n\t var result = false;\n\t if (value != null && typeof value.toString != 'function') {\n\t try {\n\t result = !!(value + '');\n\t } catch (e) {}\n\t }\n\t return result;\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar arrayProto = Array.prototype,\n\t funcProto = Function.prototype,\n\t objectProto = Object.prototype;\n\t\n\t/** Used to detect overreaching core-js shims. */\n\tvar coreJsData = root['__core-js_shared__'];\n\t\n\t/** Used to detect methods masquerading as native. */\n\tvar maskSrcKey = (function() {\n\t var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n\t return uid ? ('Symbol(src)_1.' + uid) : '';\n\t}());\n\t\n\t/** Used to resolve the decompiled source of functions. */\n\tvar funcToString = funcProto.toString;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/**\n\t * Used to resolve the\n\t * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/** Used to detect if a method is native. */\n\tvar reIsNative = RegExp('^' +\n\t funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n\t .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n\t);\n\t\n\t/** Built-in value references. */\n\tvar Symbol = root.Symbol,\n\t splice = arrayProto.splice;\n\t\n\t/* Built-in method references that are verified to be native. */\n\tvar Map = getNative(root, 'Map'),\n\t nativeCreate = getNative(Object, 'create');\n\t\n\t/** Used to convert symbols to primitives and strings. */\n\tvar symbolProto = Symbol ? Symbol.prototype : undefined,\n\t symbolToString = symbolProto ? symbolProto.toString : undefined;\n\t\n\t/**\n\t * Creates a hash object.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction Hash(entries) {\n\t var index = -1,\n\t length = entries ? entries.length : 0;\n\t\n\t this.clear();\n\t while (++index < length) {\n\t var entry = entries[index];\n\t this.set(entry[0], entry[1]);\n\t }\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the hash.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf Hash\n\t */\n\tfunction hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the hash.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf Hash\n\t * @param {Object} hash The hash to modify.\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction hashDelete(key) {\n\t return this.has(key) && delete this.__data__[key];\n\t}\n\t\n\t/**\n\t * Gets the hash value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf Hash\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction hashGet(key) {\n\t var data = this.__data__;\n\t if (nativeCreate) {\n\t var result = data[key];\n\t return result === HASH_UNDEFINED ? undefined : result;\n\t }\n\t return hasOwnProperty.call(data, key) ? data[key] : undefined;\n\t}\n\t\n\t/**\n\t * Checks if a hash value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf Hash\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction hashHas(key) {\n\t var data = this.__data__;\n\t return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n\t}\n\t\n\t/**\n\t * Sets the hash `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf Hash\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the hash instance.\n\t */\n\tfunction hashSet(key, value) {\n\t var data = this.__data__;\n\t data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n\t return this;\n\t}\n\t\n\t// Add methods to `Hash`.\n\tHash.prototype.clear = hashClear;\n\tHash.prototype['delete'] = hashDelete;\n\tHash.prototype.get = hashGet;\n\tHash.prototype.has = hashHas;\n\tHash.prototype.set = hashSet;\n\t\n\t/**\n\t * Creates an list cache object.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction ListCache(entries) {\n\t var index = -1,\n\t length = entries ? entries.length : 0;\n\t\n\t this.clear();\n\t while (++index < length) {\n\t var entry = entries[index];\n\t this.set(entry[0], entry[1]);\n\t }\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the list cache.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf ListCache\n\t */\n\tfunction listCacheClear() {\n\t this.__data__ = [];\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the list cache.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction listCacheDelete(key) {\n\t var data = this.__data__,\n\t index = assocIndexOf(data, key);\n\t\n\t if (index < 0) {\n\t return false;\n\t }\n\t var lastIndex = data.length - 1;\n\t if (index == lastIndex) {\n\t data.pop();\n\t } else {\n\t splice.call(data, index, 1);\n\t }\n\t return true;\n\t}\n\t\n\t/**\n\t * Gets the list cache value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction listCacheGet(key) {\n\t var data = this.__data__,\n\t index = assocIndexOf(data, key);\n\t\n\t return index < 0 ? undefined : data[index][1];\n\t}\n\t\n\t/**\n\t * Checks if a list cache value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf ListCache\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction listCacheHas(key) {\n\t return assocIndexOf(this.__data__, key) > -1;\n\t}\n\t\n\t/**\n\t * Sets the list cache `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the list cache instance.\n\t */\n\tfunction listCacheSet(key, value) {\n\t var data = this.__data__,\n\t index = assocIndexOf(data, key);\n\t\n\t if (index < 0) {\n\t data.push([key, value]);\n\t } else {\n\t data[index][1] = value;\n\t }\n\t return this;\n\t}\n\t\n\t// Add methods to `ListCache`.\n\tListCache.prototype.clear = listCacheClear;\n\tListCache.prototype['delete'] = listCacheDelete;\n\tListCache.prototype.get = listCacheGet;\n\tListCache.prototype.has = listCacheHas;\n\tListCache.prototype.set = listCacheSet;\n\t\n\t/**\n\t * Creates a map cache object to store key-value pairs.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction MapCache(entries) {\n\t var index = -1,\n\t length = entries ? entries.length : 0;\n\t\n\t this.clear();\n\t while (++index < length) {\n\t var entry = entries[index];\n\t this.set(entry[0], entry[1]);\n\t }\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the map.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf MapCache\n\t */\n\tfunction mapCacheClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': new (Map || ListCache),\n\t 'string': new Hash\n\t };\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the map.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction mapCacheDelete(key) {\n\t return getMapData(this, key)['delete'](key);\n\t}\n\t\n\t/**\n\t * Gets the map value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction mapCacheGet(key) {\n\t return getMapData(this, key).get(key);\n\t}\n\t\n\t/**\n\t * Checks if a map value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf MapCache\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction mapCacheHas(key) {\n\t return getMapData(this, key).has(key);\n\t}\n\t\n\t/**\n\t * Sets the map `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the map cache instance.\n\t */\n\tfunction mapCacheSet(key, value) {\n\t getMapData(this, key).set(key, value);\n\t return this;\n\t}\n\t\n\t// Add methods to `MapCache`.\n\tMapCache.prototype.clear = mapCacheClear;\n\tMapCache.prototype['delete'] = mapCacheDelete;\n\tMapCache.prototype.get = mapCacheGet;\n\tMapCache.prototype.has = mapCacheHas;\n\tMapCache.prototype.set = mapCacheSet;\n\t\n\t/**\n\t * Gets the index at which the `key` is found in `array` of key-value pairs.\n\t *\n\t * @private\n\t * @param {Array} array The array to inspect.\n\t * @param {*} key The key to search for.\n\t * @returns {number} Returns the index of the matched value, else `-1`.\n\t */\n\tfunction assocIndexOf(array, key) {\n\t var length = array.length;\n\t while (length--) {\n\t if (eq(array[length][0], key)) {\n\t return length;\n\t }\n\t }\n\t return -1;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.isNative` without bad shim checks.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a native function,\n\t * else `false`.\n\t */\n\tfunction baseIsNative(value) {\n\t if (!isObject(value) || isMasked(value)) {\n\t return false;\n\t }\n\t var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n\t return pattern.test(toSource(value));\n\t}\n\t\n\t/**\n\t * The base implementation of `_.toString` which doesn't convert nullish\n\t * values to empty strings.\n\t *\n\t * @private\n\t * @param {*} value The value to process.\n\t * @returns {string} Returns the string.\n\t */\n\tfunction baseToString(value) {\n\t // Exit early for strings to avoid a performance hit in some environments.\n\t if (typeof value == 'string') {\n\t return value;\n\t }\n\t if (isSymbol(value)) {\n\t return symbolToString ? symbolToString.call(value) : '';\n\t }\n\t var result = (value + '');\n\t return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n\t}\n\t\n\t/**\n\t * Casts `value` to a path array if it's not one.\n\t *\n\t * @private\n\t * @param {*} value The value to inspect.\n\t * @returns {Array} Returns the cast property path array.\n\t */\n\tfunction castPath(value) {\n\t return isArray(value) ? value : stringToPath(value);\n\t}\n\t\n\t/**\n\t * Gets the data for `map`.\n\t *\n\t * @private\n\t * @param {Object} map The map to query.\n\t * @param {string} key The reference key.\n\t * @returns {*} Returns the map data.\n\t */\n\tfunction getMapData(map, key) {\n\t var data = map.__data__;\n\t return isKeyable(key)\n\t ? data[typeof key == 'string' ? 'string' : 'hash']\n\t : data.map;\n\t}\n\t\n\t/**\n\t * Gets the native function at `key` of `object`.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @param {string} key The key of the method to get.\n\t * @returns {*} Returns the function if it's native, else `undefined`.\n\t */\n\tfunction getNative(object, key) {\n\t var value = getValue(object, key);\n\t return baseIsNative(value) ? value : undefined;\n\t}\n\t\n\t/**\n\t * Checks if `value` is a property name and not a property path.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {Object} [object] The object to query keys on.\n\t * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n\t */\n\tfunction isKey(value, object) {\n\t if (isArray(value)) {\n\t return false;\n\t }\n\t var type = typeof value;\n\t if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n\t value == null || isSymbol(value)) {\n\t return true;\n\t }\n\t return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n\t (object != null && value in Object(object));\n\t}\n\t\n\t/**\n\t * Checks if `value` is suitable for use as unique object key.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n\t */\n\tfunction isKeyable(value) {\n\t var type = typeof value;\n\t return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n\t ? (value !== '__proto__')\n\t : (value === null);\n\t}\n\t\n\t/**\n\t * Checks if `func` has its source masked.\n\t *\n\t * @private\n\t * @param {Function} func The function to check.\n\t * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n\t */\n\tfunction isMasked(func) {\n\t return !!maskSrcKey && (maskSrcKey in func);\n\t}\n\t\n\t/**\n\t * Converts `string` to a property path array.\n\t *\n\t * @private\n\t * @param {string} string The string to convert.\n\t * @returns {Array} Returns the property path array.\n\t */\n\tvar stringToPath = memoize(function(string) {\n\t string = toString(string);\n\t\n\t var result = [];\n\t if (reLeadingDot.test(string)) {\n\t result.push('');\n\t }\n\t string.replace(rePropName, function(match, number, quote, string) {\n\t result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n\t });\n\t return result;\n\t});\n\t\n\t/**\n\t * Converts `value` to a string key if it's not a string or symbol.\n\t *\n\t * @private\n\t * @param {*} value The value to inspect.\n\t * @returns {string|symbol} Returns the key.\n\t */\n\tfunction toKey(value) {\n\t if (typeof value == 'string' || isSymbol(value)) {\n\t return value;\n\t }\n\t var result = (value + '');\n\t return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n\t}\n\t\n\t/**\n\t * Converts `func` to its source code.\n\t *\n\t * @private\n\t * @param {Function} func The function to process.\n\t * @returns {string} Returns the source code.\n\t */\n\tfunction toSource(func) {\n\t if (func != null) {\n\t try {\n\t return funcToString.call(func);\n\t } catch (e) {}\n\t try {\n\t return (func + '');\n\t } catch (e) {}\n\t }\n\t return '';\n\t}\n\t\n\t/**\n\t * Creates a function that memoizes the result of `func`. If `resolver` is\n\t * provided, it determines the cache key for storing the result based on the\n\t * arguments provided to the memoized function. By default, the first argument\n\t * provided to the memoized function is used as the map cache key. The `func`\n\t * is invoked with the `this` binding of the memoized function.\n\t *\n\t * **Note:** The cache is exposed as the `cache` property on the memoized\n\t * function. Its creation may be customized by replacing the `_.memoize.Cache`\n\t * constructor with one whose instances implement the\n\t * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n\t * method interface of `delete`, `get`, `has`, and `set`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Function\n\t * @param {Function} func The function to have its output memoized.\n\t * @param {Function} [resolver] The function to resolve the cache key.\n\t * @returns {Function} Returns the new memoized function.\n\t * @example\n\t *\n\t * var object = { 'a': 1, 'b': 2 };\n\t * var other = { 'c': 3, 'd': 4 };\n\t *\n\t * var values = _.memoize(_.values);\n\t * values(object);\n\t * // => [1, 2]\n\t *\n\t * values(other);\n\t * // => [3, 4]\n\t *\n\t * object.a = 2;\n\t * values(object);\n\t * // => [1, 2]\n\t *\n\t * // Modify the result cache.\n\t * values.cache.set(object, ['a', 'b']);\n\t * values(object);\n\t * // => ['a', 'b']\n\t *\n\t * // Replace `_.memoize.Cache`.\n\t * _.memoize.Cache = WeakMap;\n\t */\n\tfunction memoize(func, resolver) {\n\t if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n\t throw new TypeError(FUNC_ERROR_TEXT);\n\t }\n\t var memoized = function() {\n\t var args = arguments,\n\t key = resolver ? resolver.apply(this, args) : args[0],\n\t cache = memoized.cache;\n\t\n\t if (cache.has(key)) {\n\t return cache.get(key);\n\t }\n\t var result = func.apply(this, args);\n\t memoized.cache = cache.set(key, result);\n\t return result;\n\t };\n\t memoized.cache = new (memoize.Cache || MapCache);\n\t return memoized;\n\t}\n\t\n\t// Assign cache to `_.memoize`.\n\tmemoize.Cache = MapCache;\n\t\n\t/**\n\t * Performs a\n\t * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n\t * comparison between two values to determine if they are equivalent.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to compare.\n\t * @param {*} other The other value to compare.\n\t * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n\t * @example\n\t *\n\t * var object = { 'a': 1 };\n\t * var other = { 'a': 1 };\n\t *\n\t * _.eq(object, object);\n\t * // => true\n\t *\n\t * _.eq(object, other);\n\t * // => false\n\t *\n\t * _.eq('a', 'a');\n\t * // => true\n\t *\n\t * _.eq('a', Object('a'));\n\t * // => false\n\t *\n\t * _.eq(NaN, NaN);\n\t * // => true\n\t */\n\tfunction eq(value, other) {\n\t return value === other || (value !== value && other !== other);\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as an `Array` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n\t * @example\n\t *\n\t * _.isArray([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArray(document.body.children);\n\t * // => false\n\t *\n\t * _.isArray('abc');\n\t * // => false\n\t *\n\t * _.isArray(_.noop);\n\t * // => false\n\t */\n\tvar isArray = Array.isArray;\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 8-9 which returns 'object' for typed array and other constructors.\n\t var tag = isObject(value) ? objectToString.call(value) : '';\n\t return tag == funcTag || tag == genTag;\n\t}\n\t\n\t/**\n\t * Checks if `value` is the\n\t * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n\t * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\t/**\n\t * Checks if `value` is object-like. A value is object-like if it's not `null`\n\t * and has a `typeof` result of \"object\".\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n\t * @example\n\t *\n\t * _.isObjectLike({});\n\t * // => true\n\t *\n\t * _.isObjectLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObjectLike(_.noop);\n\t * // => false\n\t *\n\t * _.isObjectLike(null);\n\t * // => false\n\t */\n\tfunction isObjectLike(value) {\n\t return !!value && typeof value == 'object';\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `Symbol` primitive or object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n\t * @example\n\t *\n\t * _.isSymbol(Symbol.iterator);\n\t * // => true\n\t *\n\t * _.isSymbol('abc');\n\t * // => false\n\t */\n\tfunction isSymbol(value) {\n\t return typeof value == 'symbol' ||\n\t (isObjectLike(value) && objectToString.call(value) == symbolTag);\n\t}\n\t\n\t/**\n\t * Converts `value` to a string. An empty string is returned for `null`\n\t * and `undefined` values. The sign of `-0` is preserved.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to process.\n\t * @returns {string} Returns the string.\n\t * @example\n\t *\n\t * _.toString(null);\n\t * // => ''\n\t *\n\t * _.toString(-0);\n\t * // => '-0'\n\t *\n\t * _.toString([1, 2, 3]);\n\t * // => '1,2,3'\n\t */\n\tfunction toString(value) {\n\t return value == null ? '' : baseToString(value);\n\t}\n\t\n\t/**\n\t * This method is like `_.get` except that if the resolved value is a\n\t * function it's invoked with the `this` binding of its parent object and\n\t * its result is returned.\n\t *\n\t * @static\n\t * @since 0.1.0\n\t * @memberOf _\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @param {Array|string} path The path of the property to resolve.\n\t * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n\t * @returns {*} Returns the resolved value.\n\t * @example\n\t *\n\t * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n\t *\n\t * _.result(object, 'a[0].b.c1');\n\t * // => 3\n\t *\n\t * _.result(object, 'a[0].b.c2');\n\t * // => 4\n\t *\n\t * _.result(object, 'a[0].b.c3', 'default');\n\t * // => 'default'\n\t *\n\t * _.result(object, 'a[0].b.c3', _.constant('default'));\n\t * // => 'default'\n\t */\n\tfunction result(object, path, defaultValue) {\n\t path = isKey(path, object) ? [path] : castPath(path);\n\t\n\t var index = -1,\n\t length = path.length;\n\t\n\t // Ensure the loop is entered when path is empty.\n\t if (!length) {\n\t object = undefined;\n\t length = 1;\n\t }\n\t while (++index < length) {\n\t var value = object == null ? undefined : object[toKey(path[index])];\n\t if (value === undefined) {\n\t index = length;\n\t value = defaultValue;\n\t }\n\t object = isFunction(value) ? value.call(object) : value;\n\t }\n\t return object;\n\t}\n\t\n\tmodule.exports = result;\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 103 */\n/*!**********************************!*\\\n !*** ./~/lodash.uniqby/index.js ***!\n \\**********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global, module) {/**\n\t * lodash (Custom Build) <https://lodash.com/>\n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n\t * Released under MIT license <https://lodash.com/license>\n\t * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n\t * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t */\n\t\n\t/** Used as the size to enable large array optimizations. */\n\tvar LARGE_ARRAY_SIZE = 200;\n\t\n\t/** Used as the `TypeError` message for \"Functions\" methods. */\n\tvar FUNC_ERROR_TEXT = 'Expected a function';\n\t\n\t/** Used to stand-in for `undefined` hash values. */\n\tvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\t\n\t/** Used to compose bitmasks for comparison styles. */\n\tvar UNORDERED_COMPARE_FLAG = 1,\n\t PARTIAL_COMPARE_FLAG = 2;\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar INFINITY = 1 / 0,\n\t MAX_SAFE_INTEGER = 9007199254740991;\n\t\n\t/** `Object#toString` result references. */\n\tvar argsTag = '[object Arguments]',\n\t arrayTag = '[object Array]',\n\t boolTag = '[object Boolean]',\n\t dateTag = '[object Date]',\n\t errorTag = '[object Error]',\n\t funcTag = '[object Function]',\n\t genTag = '[object GeneratorFunction]',\n\t mapTag = '[object Map]',\n\t numberTag = '[object Number]',\n\t objectTag = '[object Object]',\n\t promiseTag = '[object Promise]',\n\t regexpTag = '[object RegExp]',\n\t setTag = '[object Set]',\n\t stringTag = '[object String]',\n\t symbolTag = '[object Symbol]',\n\t weakMapTag = '[object WeakMap]';\n\t\n\tvar arrayBufferTag = '[object ArrayBuffer]',\n\t dataViewTag = '[object DataView]',\n\t float32Tag = '[object Float32Array]',\n\t float64Tag = '[object Float64Array]',\n\t int8Tag = '[object Int8Array]',\n\t int16Tag = '[object Int16Array]',\n\t int32Tag = '[object Int32Array]',\n\t uint8Tag = '[object Uint8Array]',\n\t uint8ClampedTag = '[object Uint8ClampedArray]',\n\t uint16Tag = '[object Uint16Array]',\n\t uint32Tag = '[object Uint32Array]';\n\t\n\t/** Used to match property names within property paths. */\n\tvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n\t reIsPlainProp = /^\\w*$/,\n\t reLeadingDot = /^\\./,\n\t rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\t\n\t/**\n\t * Used to match `RegExp`\n\t * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n\t */\n\tvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\t\n\t/** Used to match backslashes in property paths. */\n\tvar reEscapeChar = /\\\\(\\\\)?/g;\n\t\n\t/** Used to detect host constructors (Safari). */\n\tvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\t\n\t/** Used to detect unsigned integer values. */\n\tvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\t\n\t/** Used to identify `toStringTag` values of typed arrays. */\n\tvar typedArrayTags = {};\n\ttypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n\ttypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n\ttypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n\ttypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n\ttypedArrayTags[uint32Tag] = true;\n\ttypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n\ttypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n\ttypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n\ttypedArrayTags[errorTag] = typedArrayTags[funcTag] =\n\ttypedArrayTags[mapTag] = typedArrayTags[numberTag] =\n\ttypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n\ttypedArrayTags[setTag] = typedArrayTags[stringTag] =\n\ttypedArrayTags[weakMapTag] = false;\n\t\n\t/** Detect free variable `global` from Node.js. */\n\tvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\t\n\t/** Detect free variable `self`. */\n\tvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\t\n\t/** Used as a reference to the global object. */\n\tvar root = freeGlobal || freeSelf || Function('return this')();\n\t\n\t/** Detect free variable `exports`. */\n\tvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\t\n\t/** Detect free variable `module`. */\n\tvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\t\n\t/** Detect the popular CommonJS extension `module.exports`. */\n\tvar moduleExports = freeModule && freeModule.exports === freeExports;\n\t\n\t/** Detect free variable `process` from Node.js. */\n\tvar freeProcess = moduleExports && freeGlobal.process;\n\t\n\t/** Used to access faster Node.js helpers. */\n\tvar nodeUtil = (function() {\n\t try {\n\t return freeProcess && freeProcess.binding('util');\n\t } catch (e) {}\n\t}());\n\t\n\t/* Node.js helper references. */\n\tvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\t\n\t/**\n\t * A specialized version of `_.includes` for arrays without support for\n\t * specifying an index to search from.\n\t *\n\t * @private\n\t * @param {Array} [array] The array to inspect.\n\t * @param {*} target The value to search for.\n\t * @returns {boolean} Returns `true` if `target` is found, else `false`.\n\t */\n\tfunction arrayIncludes(array, value) {\n\t var length = array ? array.length : 0;\n\t return !!length && baseIndexOf(array, value, 0) > -1;\n\t}\n\t\n\t/**\n\t * This function is like `arrayIncludes` except that it accepts a comparator.\n\t *\n\t * @private\n\t * @param {Array} [array] The array to inspect.\n\t * @param {*} target The value to search for.\n\t * @param {Function} comparator The comparator invoked per element.\n\t * @returns {boolean} Returns `true` if `target` is found, else `false`.\n\t */\n\tfunction arrayIncludesWith(array, value, comparator) {\n\t var index = -1,\n\t length = array ? array.length : 0;\n\t\n\t while (++index < length) {\n\t if (comparator(value, array[index])) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t}\n\t\n\t/**\n\t * A specialized version of `_.some` for arrays without support for iteratee\n\t * shorthands.\n\t *\n\t * @private\n\t * @param {Array} [array] The array to iterate over.\n\t * @param {Function} predicate The function invoked per iteration.\n\t * @returns {boolean} Returns `true` if any element passes the predicate check,\n\t * else `false`.\n\t */\n\tfunction arraySome(array, predicate) {\n\t var index = -1,\n\t length = array ? array.length : 0;\n\t\n\t while (++index < length) {\n\t if (predicate(array[index], index, array)) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.findIndex` and `_.findLastIndex` without\n\t * support for iteratee shorthands.\n\t *\n\t * @private\n\t * @param {Array} array The array to inspect.\n\t * @param {Function} predicate The function invoked per iteration.\n\t * @param {number} fromIndex The index to search from.\n\t * @param {boolean} [fromRight] Specify iterating from right to left.\n\t * @returns {number} Returns the index of the matched value, else `-1`.\n\t */\n\tfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n\t var length = array.length,\n\t index = fromIndex + (fromRight ? 1 : -1);\n\t\n\t while ((fromRight ? index-- : ++index < length)) {\n\t if (predicate(array[index], index, array)) {\n\t return index;\n\t }\n\t }\n\t return -1;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n\t *\n\t * @private\n\t * @param {Array} array The array to inspect.\n\t * @param {*} value The value to search for.\n\t * @param {number} fromIndex The index to search from.\n\t * @returns {number} Returns the index of the matched value, else `-1`.\n\t */\n\tfunction baseIndexOf(array, value, fromIndex) {\n\t if (value !== value) {\n\t return baseFindIndex(array, baseIsNaN, fromIndex);\n\t }\n\t var index = fromIndex - 1,\n\t length = array.length;\n\t\n\t while (++index < length) {\n\t if (array[index] === value) {\n\t return index;\n\t }\n\t }\n\t return -1;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.isNaN` without support for number objects.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n\t */\n\tfunction baseIsNaN(value) {\n\t return value !== value;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.property` without support for deep paths.\n\t *\n\t * @private\n\t * @param {string} key The key of the property to get.\n\t * @returns {Function} Returns the new accessor function.\n\t */\n\tfunction baseProperty(key) {\n\t return function(object) {\n\t return object == null ? undefined : object[key];\n\t };\n\t}\n\t\n\t/**\n\t * The base implementation of `_.times` without support for iteratee shorthands\n\t * or max array length checks.\n\t *\n\t * @private\n\t * @param {number} n The number of times to invoke `iteratee`.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @returns {Array} Returns the array of results.\n\t */\n\tfunction baseTimes(n, iteratee) {\n\t var index = -1,\n\t result = Array(n);\n\t\n\t while (++index < n) {\n\t result[index] = iteratee(index);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.unary` without support for storing metadata.\n\t *\n\t * @private\n\t * @param {Function} func The function to cap arguments for.\n\t * @returns {Function} Returns the new capped function.\n\t */\n\tfunction baseUnary(func) {\n\t return function(value) {\n\t return func(value);\n\t };\n\t}\n\t\n\t/**\n\t * Checks if a cache value for `key` exists.\n\t *\n\t * @private\n\t * @param {Object} cache The cache to query.\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction cacheHas(cache, key) {\n\t return cache.has(key);\n\t}\n\t\n\t/**\n\t * Gets the value at `key` of `object`.\n\t *\n\t * @private\n\t * @param {Object} [object] The object to query.\n\t * @param {string} key The key of the property to get.\n\t * @returns {*} Returns the property value.\n\t */\n\tfunction getValue(object, key) {\n\t return object == null ? undefined : object[key];\n\t}\n\t\n\t/**\n\t * Checks if `value` is a host object in IE < 9.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n\t */\n\tfunction isHostObject(value) {\n\t // Many host objects are `Object` objects that can coerce to strings\n\t // despite having improperly defined `toString` methods.\n\t var result = false;\n\t if (value != null && typeof value.toString != 'function') {\n\t try {\n\t result = !!(value + '');\n\t } catch (e) {}\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Converts `map` to its key-value pairs.\n\t *\n\t * @private\n\t * @param {Object} map The map to convert.\n\t * @returns {Array} Returns the key-value pairs.\n\t */\n\tfunction mapToArray(map) {\n\t var index = -1,\n\t result = Array(map.size);\n\t\n\t map.forEach(function(value, key) {\n\t result[++index] = [key, value];\n\t });\n\t return result;\n\t}\n\t\n\t/**\n\t * Creates a unary function that invokes `func` with its argument transformed.\n\t *\n\t * @private\n\t * @param {Function} func The function to wrap.\n\t * @param {Function} transform The argument transform.\n\t * @returns {Function} Returns the new function.\n\t */\n\tfunction overArg(func, transform) {\n\t return function(arg) {\n\t return func(transform(arg));\n\t };\n\t}\n\t\n\t/**\n\t * Converts `set` to an array of its values.\n\t *\n\t * @private\n\t * @param {Object} set The set to convert.\n\t * @returns {Array} Returns the values.\n\t */\n\tfunction setToArray(set) {\n\t var index = -1,\n\t result = Array(set.size);\n\t\n\t set.forEach(function(value) {\n\t result[++index] = value;\n\t });\n\t return result;\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar arrayProto = Array.prototype,\n\t funcProto = Function.prototype,\n\t objectProto = Object.prototype;\n\t\n\t/** Used to detect overreaching core-js shims. */\n\tvar coreJsData = root['__core-js_shared__'];\n\t\n\t/** Used to detect methods masquerading as native. */\n\tvar maskSrcKey = (function() {\n\t var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n\t return uid ? ('Symbol(src)_1.' + uid) : '';\n\t}());\n\t\n\t/** Used to resolve the decompiled source of functions. */\n\tvar funcToString = funcProto.toString;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/**\n\t * Used to resolve the\n\t * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/** Used to detect if a method is native. */\n\tvar reIsNative = RegExp('^' +\n\t funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n\t .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n\t);\n\t\n\t/** Built-in value references. */\n\tvar Symbol = root.Symbol,\n\t Uint8Array = root.Uint8Array,\n\t propertyIsEnumerable = objectProto.propertyIsEnumerable,\n\t splice = arrayProto.splice;\n\t\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeKeys = overArg(Object.keys, Object);\n\t\n\t/* Built-in method references that are verified to be native. */\n\tvar DataView = getNative(root, 'DataView'),\n\t Map = getNative(root, 'Map'),\n\t Promise = getNative(root, 'Promise'),\n\t Set = getNative(root, 'Set'),\n\t WeakMap = getNative(root, 'WeakMap'),\n\t nativeCreate = getNative(Object, 'create');\n\t\n\t/** Used to detect maps, sets, and weakmaps. */\n\tvar dataViewCtorString = toSource(DataView),\n\t mapCtorString = toSource(Map),\n\t promiseCtorString = toSource(Promise),\n\t setCtorString = toSource(Set),\n\t weakMapCtorString = toSource(WeakMap);\n\t\n\t/** Used to convert symbols to primitives and strings. */\n\tvar symbolProto = Symbol ? Symbol.prototype : undefined,\n\t symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n\t symbolToString = symbolProto ? symbolProto.toString : undefined;\n\t\n\t/**\n\t * Creates a hash object.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction Hash(entries) {\n\t var index = -1,\n\t length = entries ? entries.length : 0;\n\t\n\t this.clear();\n\t while (++index < length) {\n\t var entry = entries[index];\n\t this.set(entry[0], entry[1]);\n\t }\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the hash.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf Hash\n\t */\n\tfunction hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the hash.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf Hash\n\t * @param {Object} hash The hash to modify.\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction hashDelete(key) {\n\t return this.has(key) && delete this.__data__[key];\n\t}\n\t\n\t/**\n\t * Gets the hash value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf Hash\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction hashGet(key) {\n\t var data = this.__data__;\n\t if (nativeCreate) {\n\t var result = data[key];\n\t return result === HASH_UNDEFINED ? undefined : result;\n\t }\n\t return hasOwnProperty.call(data, key) ? data[key] : undefined;\n\t}\n\t\n\t/**\n\t * Checks if a hash value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf Hash\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction hashHas(key) {\n\t var data = this.__data__;\n\t return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n\t}\n\t\n\t/**\n\t * Sets the hash `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf Hash\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the hash instance.\n\t */\n\tfunction hashSet(key, value) {\n\t var data = this.__data__;\n\t data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n\t return this;\n\t}\n\t\n\t// Add methods to `Hash`.\n\tHash.prototype.clear = hashClear;\n\tHash.prototype['delete'] = hashDelete;\n\tHash.prototype.get = hashGet;\n\tHash.prototype.has = hashHas;\n\tHash.prototype.set = hashSet;\n\t\n\t/**\n\t * Creates an list cache object.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction ListCache(entries) {\n\t var index = -1,\n\t length = entries ? entries.length : 0;\n\t\n\t this.clear();\n\t while (++index < length) {\n\t var entry = entries[index];\n\t this.set(entry[0], entry[1]);\n\t }\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the list cache.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf ListCache\n\t */\n\tfunction listCacheClear() {\n\t this.__data__ = [];\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the list cache.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction listCacheDelete(key) {\n\t var data = this.__data__,\n\t index = assocIndexOf(data, key);\n\t\n\t if (index < 0) {\n\t return false;\n\t }\n\t var lastIndex = data.length - 1;\n\t if (index == lastIndex) {\n\t data.pop();\n\t } else {\n\t splice.call(data, index, 1);\n\t }\n\t return true;\n\t}\n\t\n\t/**\n\t * Gets the list cache value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction listCacheGet(key) {\n\t var data = this.__data__,\n\t index = assocIndexOf(data, key);\n\t\n\t return index < 0 ? undefined : data[index][1];\n\t}\n\t\n\t/**\n\t * Checks if a list cache value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf ListCache\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction listCacheHas(key) {\n\t return assocIndexOf(this.__data__, key) > -1;\n\t}\n\t\n\t/**\n\t * Sets the list cache `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the list cache instance.\n\t */\n\tfunction listCacheSet(key, value) {\n\t var data = this.__data__,\n\t index = assocIndexOf(data, key);\n\t\n\t if (index < 0) {\n\t data.push([key, value]);\n\t } else {\n\t data[index][1] = value;\n\t }\n\t return this;\n\t}\n\t\n\t// Add methods to `ListCache`.\n\tListCache.prototype.clear = listCacheClear;\n\tListCache.prototype['delete'] = listCacheDelete;\n\tListCache.prototype.get = listCacheGet;\n\tListCache.prototype.has = listCacheHas;\n\tListCache.prototype.set = listCacheSet;\n\t\n\t/**\n\t * Creates a map cache object to store key-value pairs.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction MapCache(entries) {\n\t var index = -1,\n\t length = entries ? entries.length : 0;\n\t\n\t this.clear();\n\t while (++index < length) {\n\t var entry = entries[index];\n\t this.set(entry[0], entry[1]);\n\t }\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the map.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf MapCache\n\t */\n\tfunction mapCacheClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': new (Map || ListCache),\n\t 'string': new Hash\n\t };\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the map.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction mapCacheDelete(key) {\n\t return getMapData(this, key)['delete'](key);\n\t}\n\t\n\t/**\n\t * Gets the map value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction mapCacheGet(key) {\n\t return getMapData(this, key).get(key);\n\t}\n\t\n\t/**\n\t * Checks if a map value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf MapCache\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction mapCacheHas(key) {\n\t return getMapData(this, key).has(key);\n\t}\n\t\n\t/**\n\t * Sets the map `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the map cache instance.\n\t */\n\tfunction mapCacheSet(key, value) {\n\t getMapData(this, key).set(key, value);\n\t return this;\n\t}\n\t\n\t// Add methods to `MapCache`.\n\tMapCache.prototype.clear = mapCacheClear;\n\tMapCache.prototype['delete'] = mapCacheDelete;\n\tMapCache.prototype.get = mapCacheGet;\n\tMapCache.prototype.has = mapCacheHas;\n\tMapCache.prototype.set = mapCacheSet;\n\t\n\t/**\n\t *\n\t * Creates an array cache object to store unique values.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [values] The values to cache.\n\t */\n\tfunction SetCache(values) {\n\t var index = -1,\n\t length = values ? values.length : 0;\n\t\n\t this.__data__ = new MapCache;\n\t while (++index < length) {\n\t this.add(values[index]);\n\t }\n\t}\n\t\n\t/**\n\t * Adds `value` to the array cache.\n\t *\n\t * @private\n\t * @name add\n\t * @memberOf SetCache\n\t * @alias push\n\t * @param {*} value The value to cache.\n\t * @returns {Object} Returns the cache instance.\n\t */\n\tfunction setCacheAdd(value) {\n\t this.__data__.set(value, HASH_UNDEFINED);\n\t return this;\n\t}\n\t\n\t/**\n\t * Checks if `value` is in the array cache.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf SetCache\n\t * @param {*} value The value to search for.\n\t * @returns {number} Returns `true` if `value` is found, else `false`.\n\t */\n\tfunction setCacheHas(value) {\n\t return this.__data__.has(value);\n\t}\n\t\n\t// Add methods to `SetCache`.\n\tSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n\tSetCache.prototype.has = setCacheHas;\n\t\n\t/**\n\t * Creates a stack cache object to store key-value pairs.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction Stack(entries) {\n\t this.__data__ = new ListCache(entries);\n\t}\n\t\n\t/**\n\t * Removes all key-value entries from the stack.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf Stack\n\t */\n\tfunction stackClear() {\n\t this.__data__ = new ListCache;\n\t}\n\t\n\t/**\n\t * Removes `key` and its value from the stack.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf Stack\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction stackDelete(key) {\n\t return this.__data__['delete'](key);\n\t}\n\t\n\t/**\n\t * Gets the stack value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf Stack\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction stackGet(key) {\n\t return this.__data__.get(key);\n\t}\n\t\n\t/**\n\t * Checks if a stack value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf Stack\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction stackHas(key) {\n\t return this.__data__.has(key);\n\t}\n\t\n\t/**\n\t * Sets the stack `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf Stack\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the stack cache instance.\n\t */\n\tfunction stackSet(key, value) {\n\t var cache = this.__data__;\n\t if (cache instanceof ListCache) {\n\t var pairs = cache.__data__;\n\t if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n\t pairs.push([key, value]);\n\t return this;\n\t }\n\t cache = this.__data__ = new MapCache(pairs);\n\t }\n\t cache.set(key, value);\n\t return this;\n\t}\n\t\n\t// Add methods to `Stack`.\n\tStack.prototype.clear = stackClear;\n\tStack.prototype['delete'] = stackDelete;\n\tStack.prototype.get = stackGet;\n\tStack.prototype.has = stackHas;\n\tStack.prototype.set = stackSet;\n\t\n\t/**\n\t * Creates an array of the enumerable property names of the array-like `value`.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @param {boolean} inherited Specify returning inherited property names.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction arrayLikeKeys(value, inherited) {\n\t // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n\t // Safari 9 makes `arguments.length` enumerable in strict mode.\n\t var result = (isArray(value) || isArguments(value))\n\t ? baseTimes(value.length, String)\n\t : [];\n\t\n\t var length = result.length,\n\t skipIndexes = !!length;\n\t\n\t for (var key in value) {\n\t if ((inherited || hasOwnProperty.call(value, key)) &&\n\t !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Gets the index at which the `key` is found in `array` of key-value pairs.\n\t *\n\t * @private\n\t * @param {Array} array The array to inspect.\n\t * @param {*} key The key to search for.\n\t * @returns {number} Returns the index of the matched value, else `-1`.\n\t */\n\tfunction assocIndexOf(array, key) {\n\t var length = array.length;\n\t while (length--) {\n\t if (eq(array[length][0], key)) {\n\t return length;\n\t }\n\t }\n\t return -1;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.get` without support for default values.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @param {Array|string} path The path of the property to get.\n\t * @returns {*} Returns the resolved value.\n\t */\n\tfunction baseGet(object, path) {\n\t path = isKey(path, object) ? [path] : castPath(path);\n\t\n\t var index = 0,\n\t length = path.length;\n\t\n\t while (object != null && index < length) {\n\t object = object[toKey(path[index++])];\n\t }\n\t return (index && index == length) ? object : undefined;\n\t}\n\t\n\t/**\n\t * The base implementation of `getTag`.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @returns {string} Returns the `toStringTag`.\n\t */\n\tfunction baseGetTag(value) {\n\t return objectToString.call(value);\n\t}\n\t\n\t/**\n\t * The base implementation of `_.hasIn` without support for deep paths.\n\t *\n\t * @private\n\t * @param {Object} [object] The object to query.\n\t * @param {Array|string} key The key to check.\n\t * @returns {boolean} Returns `true` if `key` exists, else `false`.\n\t */\n\tfunction baseHasIn(object, key) {\n\t return object != null && key in Object(object);\n\t}\n\t\n\t/**\n\t * The base implementation of `_.isEqual` which supports partial comparisons\n\t * and tracks traversed objects.\n\t *\n\t * @private\n\t * @param {*} value The value to compare.\n\t * @param {*} other The other value to compare.\n\t * @param {Function} [customizer] The function to customize comparisons.\n\t * @param {boolean} [bitmask] The bitmask of comparison flags.\n\t * The bitmask may be composed of the following flags:\n\t * 1 - Unordered comparison\n\t * 2 - Partial comparison\n\t * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n\t * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n\t */\n\tfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n\t if (value === other) {\n\t return true;\n\t }\n\t if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n\t return value !== value && other !== other;\n\t }\n\t return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n\t}\n\t\n\t/**\n\t * A specialized version of `baseIsEqual` for arrays and objects which performs\n\t * deep comparisons and tracks traversed objects enabling objects with circular\n\t * references to be compared.\n\t *\n\t * @private\n\t * @param {Object} object The object to compare.\n\t * @param {Object} other The other object to compare.\n\t * @param {Function} equalFunc The function to determine equivalents of values.\n\t * @param {Function} [customizer] The function to customize comparisons.\n\t * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n\t * for more details.\n\t * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n\t * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n\t */\n\tfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n\t var objIsArr = isArray(object),\n\t othIsArr = isArray(other),\n\t objTag = arrayTag,\n\t othTag = arrayTag;\n\t\n\t if (!objIsArr) {\n\t objTag = getTag(object);\n\t objTag = objTag == argsTag ? objectTag : objTag;\n\t }\n\t if (!othIsArr) {\n\t othTag = getTag(other);\n\t othTag = othTag == argsTag ? objectTag : othTag;\n\t }\n\t var objIsObj = objTag == objectTag && !isHostObject(object),\n\t othIsObj = othTag == objectTag && !isHostObject(other),\n\t isSameTag = objTag == othTag;\n\t\n\t if (isSameTag && !objIsObj) {\n\t stack || (stack = new Stack);\n\t return (objIsArr || isTypedArray(object))\n\t ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n\t : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n\t }\n\t if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n\t var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n\t othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\t\n\t if (objIsWrapped || othIsWrapped) {\n\t var objUnwrapped = objIsWrapped ? object.value() : object,\n\t othUnwrapped = othIsWrapped ? other.value() : other;\n\t\n\t stack || (stack = new Stack);\n\t return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n\t }\n\t }\n\t if (!isSameTag) {\n\t return false;\n\t }\n\t stack || (stack = new Stack);\n\t return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n\t}\n\t\n\t/**\n\t * The base implementation of `_.isMatch` without support for iteratee shorthands.\n\t *\n\t * @private\n\t * @param {Object} object The object to inspect.\n\t * @param {Object} source The object of property values to match.\n\t * @param {Array} matchData The property names, values, and compare flags to match.\n\t * @param {Function} [customizer] The function to customize comparisons.\n\t * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n\t */\n\tfunction baseIsMatch(object, source, matchData, customizer) {\n\t var index = matchData.length,\n\t length = index,\n\t noCustomizer = !customizer;\n\t\n\t if (object == null) {\n\t return !length;\n\t }\n\t object = Object(object);\n\t while (index--) {\n\t var data = matchData[index];\n\t if ((noCustomizer && data[2])\n\t ? data[1] !== object[data[0]]\n\t : !(data[0] in object)\n\t ) {\n\t return false;\n\t }\n\t }\n\t while (++index < length) {\n\t data = matchData[index];\n\t var key = data[0],\n\t objValue = object[key],\n\t srcValue = data[1];\n\t\n\t if (noCustomizer && data[2]) {\n\t if (objValue === undefined && !(key in object)) {\n\t return false;\n\t }\n\t } else {\n\t var stack = new Stack;\n\t if (customizer) {\n\t var result = customizer(objValue, srcValue, key, object, source, stack);\n\t }\n\t if (!(result === undefined\n\t ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n\t : result\n\t )) {\n\t return false;\n\t }\n\t }\n\t }\n\t return true;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.isNative` without bad shim checks.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a native function,\n\t * else `false`.\n\t */\n\tfunction baseIsNative(value) {\n\t if (!isObject(value) || isMasked(value)) {\n\t return false;\n\t }\n\t var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n\t return pattern.test(toSource(value));\n\t}\n\t\n\t/**\n\t * The base implementation of `_.isTypedArray` without Node.js optimizations.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n\t */\n\tfunction baseIsTypedArray(value) {\n\t return isObjectLike(value) &&\n\t isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n\t}\n\t\n\t/**\n\t * The base implementation of `_.iteratee`.\n\t *\n\t * @private\n\t * @param {*} [value=_.identity] The value to convert to an iteratee.\n\t * @returns {Function} Returns the iteratee.\n\t */\n\tfunction baseIteratee(value) {\n\t // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n\t // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n\t if (typeof value == 'function') {\n\t return value;\n\t }\n\t if (value == null) {\n\t return identity;\n\t }\n\t if (typeof value == 'object') {\n\t return isArray(value)\n\t ? baseMatchesProperty(value[0], value[1])\n\t : baseMatches(value);\n\t }\n\t return property(value);\n\t}\n\t\n\t/**\n\t * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction baseKeys(object) {\n\t if (!isPrototype(object)) {\n\t return nativeKeys(object);\n\t }\n\t var result = [];\n\t for (var key in Object(object)) {\n\t if (hasOwnProperty.call(object, key) && key != 'constructor') {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.matches` which doesn't clone `source`.\n\t *\n\t * @private\n\t * @param {Object} source The object of property values to match.\n\t * @returns {Function} Returns the new spec function.\n\t */\n\tfunction baseMatches(source) {\n\t var matchData = getMatchData(source);\n\t if (matchData.length == 1 && matchData[0][2]) {\n\t return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n\t }\n\t return function(object) {\n\t return object === source || baseIsMatch(object, source, matchData);\n\t };\n\t}\n\t\n\t/**\n\t * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n\t *\n\t * @private\n\t * @param {string} path The path of the property to get.\n\t * @param {*} srcValue The value to match.\n\t * @returns {Function} Returns the new spec function.\n\t */\n\tfunction baseMatchesProperty(path, srcValue) {\n\t if (isKey(path) && isStrictComparable(srcValue)) {\n\t return matchesStrictComparable(toKey(path), srcValue);\n\t }\n\t return function(object) {\n\t var objValue = get(object, path);\n\t return (objValue === undefined && objValue === srcValue)\n\t ? hasIn(object, path)\n\t : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n\t };\n\t}\n\t\n\t/**\n\t * A specialized version of `baseProperty` which supports deep paths.\n\t *\n\t * @private\n\t * @param {Array|string} path The path of the property to get.\n\t * @returns {Function} Returns the new accessor function.\n\t */\n\tfunction basePropertyDeep(path) {\n\t return function(object) {\n\t return baseGet(object, path);\n\t };\n\t}\n\t\n\t/**\n\t * The base implementation of `_.toString` which doesn't convert nullish\n\t * values to empty strings.\n\t *\n\t * @private\n\t * @param {*} value The value to process.\n\t * @returns {string} Returns the string.\n\t */\n\tfunction baseToString(value) {\n\t // Exit early for strings to avoid a performance hit in some environments.\n\t if (typeof value == 'string') {\n\t return value;\n\t }\n\t if (isSymbol(value)) {\n\t return symbolToString ? symbolToString.call(value) : '';\n\t }\n\t var result = (value + '');\n\t return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n\t *\n\t * @private\n\t * @param {Array} array The array to inspect.\n\t * @param {Function} [iteratee] The iteratee invoked per element.\n\t * @param {Function} [comparator] The comparator invoked per element.\n\t * @returns {Array} Returns the new duplicate free array.\n\t */\n\tfunction baseUniq(array, iteratee, comparator) {\n\t var index = -1,\n\t includes = arrayIncludes,\n\t length = array.length,\n\t isCommon = true,\n\t result = [],\n\t seen = result;\n\t\n\t if (comparator) {\n\t isCommon = false;\n\t includes = arrayIncludesWith;\n\t }\n\t else if (length >= LARGE_ARRAY_SIZE) {\n\t var set = iteratee ? null : createSet(array);\n\t if (set) {\n\t return setToArray(set);\n\t }\n\t isCommon = false;\n\t includes = cacheHas;\n\t seen = new SetCache;\n\t }\n\t else {\n\t seen = iteratee ? [] : result;\n\t }\n\t outer:\n\t while (++index < length) {\n\t var value = array[index],\n\t computed = iteratee ? iteratee(value) : value;\n\t\n\t value = (comparator || value !== 0) ? value : 0;\n\t if (isCommon && computed === computed) {\n\t var seenIndex = seen.length;\n\t while (seenIndex--) {\n\t if (seen[seenIndex] === computed) {\n\t continue outer;\n\t }\n\t }\n\t if (iteratee) {\n\t seen.push(computed);\n\t }\n\t result.push(value);\n\t }\n\t else if (!includes(seen, computed, comparator)) {\n\t if (seen !== result) {\n\t seen.push(computed);\n\t }\n\t result.push(value);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Casts `value` to a path array if it's not one.\n\t *\n\t * @private\n\t * @param {*} value The value to inspect.\n\t * @returns {Array} Returns the cast property path array.\n\t */\n\tfunction castPath(value) {\n\t return isArray(value) ? value : stringToPath(value);\n\t}\n\t\n\t/**\n\t * Creates a set object of `values`.\n\t *\n\t * @private\n\t * @param {Array} values The values to add to the set.\n\t * @returns {Object} Returns the new set.\n\t */\n\tvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n\t return new Set(values);\n\t};\n\t\n\t/**\n\t * A specialized version of `baseIsEqualDeep` for arrays with support for\n\t * partial deep comparisons.\n\t *\n\t * @private\n\t * @param {Array} array The array to compare.\n\t * @param {Array} other The other array to compare.\n\t * @param {Function} equalFunc The function to determine equivalents of values.\n\t * @param {Function} customizer The function to customize comparisons.\n\t * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n\t * for more details.\n\t * @param {Object} stack Tracks traversed `array` and `other` objects.\n\t * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n\t */\n\tfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n\t var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n\t arrLength = array.length,\n\t othLength = other.length;\n\t\n\t if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n\t return false;\n\t }\n\t // Assume cyclic values are equal.\n\t var stacked = stack.get(array);\n\t if (stacked && stack.get(other)) {\n\t return stacked == other;\n\t }\n\t var index = -1,\n\t result = true,\n\t seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\t\n\t stack.set(array, other);\n\t stack.set(other, array);\n\t\n\t // Ignore non-index properties.\n\t while (++index < arrLength) {\n\t var arrValue = array[index],\n\t othValue = other[index];\n\t\n\t if (customizer) {\n\t var compared = isPartial\n\t ? customizer(othValue, arrValue, index, other, array, stack)\n\t : customizer(arrValue, othValue, index, array, other, stack);\n\t }\n\t if (compared !== undefined) {\n\t if (compared) {\n\t continue;\n\t }\n\t result = false;\n\t break;\n\t }\n\t // Recursively compare arrays (susceptible to call stack limits).\n\t if (seen) {\n\t if (!arraySome(other, function(othValue, othIndex) {\n\t if (!seen.has(othIndex) &&\n\t (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n\t return seen.add(othIndex);\n\t }\n\t })) {\n\t result = false;\n\t break;\n\t }\n\t } else if (!(\n\t arrValue === othValue ||\n\t equalFunc(arrValue, othValue, customizer, bitmask, stack)\n\t )) {\n\t result = false;\n\t break;\n\t }\n\t }\n\t stack['delete'](array);\n\t stack['delete'](other);\n\t return result;\n\t}\n\t\n\t/**\n\t * A specialized version of `baseIsEqualDeep` for comparing objects of\n\t * the same `toStringTag`.\n\t *\n\t * **Note:** This function only supports comparing values with tags of\n\t * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n\t *\n\t * @private\n\t * @param {Object} object The object to compare.\n\t * @param {Object} other The other object to compare.\n\t * @param {string} tag The `toStringTag` of the objects to compare.\n\t * @param {Function} equalFunc The function to determine equivalents of values.\n\t * @param {Function} customizer The function to customize comparisons.\n\t * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n\t * for more details.\n\t * @param {Object} stack Tracks traversed `object` and `other` objects.\n\t * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n\t */\n\tfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n\t switch (tag) {\n\t case dataViewTag:\n\t if ((object.byteLength != other.byteLength) ||\n\t (object.byteOffset != other.byteOffset)) {\n\t return false;\n\t }\n\t object = object.buffer;\n\t other = other.buffer;\n\t\n\t case arrayBufferTag:\n\t if ((object.byteLength != other.byteLength) ||\n\t !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n\t return false;\n\t }\n\t return true;\n\t\n\t case boolTag:\n\t case dateTag:\n\t case numberTag:\n\t // Coerce booleans to `1` or `0` and dates to milliseconds.\n\t // Invalid dates are coerced to `NaN`.\n\t return eq(+object, +other);\n\t\n\t case errorTag:\n\t return object.name == other.name && object.message == other.message;\n\t\n\t case regexpTag:\n\t case stringTag:\n\t // Coerce regexes to strings and treat strings, primitives and objects,\n\t // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n\t // for more details.\n\t return object == (other + '');\n\t\n\t case mapTag:\n\t var convert = mapToArray;\n\t\n\t case setTag:\n\t var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n\t convert || (convert = setToArray);\n\t\n\t if (object.size != other.size && !isPartial) {\n\t return false;\n\t }\n\t // Assume cyclic values are equal.\n\t var stacked = stack.get(object);\n\t if (stacked) {\n\t return stacked == other;\n\t }\n\t bitmask |= UNORDERED_COMPARE_FLAG;\n\t\n\t // Recursively compare objects (susceptible to call stack limits).\n\t stack.set(object, other);\n\t var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n\t stack['delete'](object);\n\t return result;\n\t\n\t case symbolTag:\n\t if (symbolValueOf) {\n\t return symbolValueOf.call(object) == symbolValueOf.call(other);\n\t }\n\t }\n\t return false;\n\t}\n\t\n\t/**\n\t * A specialized version of `baseIsEqualDeep` for objects with support for\n\t * partial deep comparisons.\n\t *\n\t * @private\n\t * @param {Object} object The object to compare.\n\t * @param {Object} other The other object to compare.\n\t * @param {Function} equalFunc The function to determine equivalents of values.\n\t * @param {Function} customizer The function to customize comparisons.\n\t * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n\t * for more details.\n\t * @param {Object} stack Tracks traversed `object` and `other` objects.\n\t * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n\t */\n\tfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n\t var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n\t objProps = keys(object),\n\t objLength = objProps.length,\n\t othProps = keys(other),\n\t othLength = othProps.length;\n\t\n\t if (objLength != othLength && !isPartial) {\n\t return false;\n\t }\n\t var index = objLength;\n\t while (index--) {\n\t var key = objProps[index];\n\t if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n\t return false;\n\t }\n\t }\n\t // Assume cyclic values are equal.\n\t var stacked = stack.get(object);\n\t if (stacked && stack.get(other)) {\n\t return stacked == other;\n\t }\n\t var result = true;\n\t stack.set(object, other);\n\t stack.set(other, object);\n\t\n\t var skipCtor = isPartial;\n\t while (++index < objLength) {\n\t key = objProps[index];\n\t var objValue = object[key],\n\t othValue = other[key];\n\t\n\t if (customizer) {\n\t var compared = isPartial\n\t ? customizer(othValue, objValue, key, other, object, stack)\n\t : customizer(objValue, othValue, key, object, other, stack);\n\t }\n\t // Recursively compare objects (susceptible to call stack limits).\n\t if (!(compared === undefined\n\t ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n\t : compared\n\t )) {\n\t result = false;\n\t break;\n\t }\n\t skipCtor || (skipCtor = key == 'constructor');\n\t }\n\t if (result && !skipCtor) {\n\t var objCtor = object.constructor,\n\t othCtor = other.constructor;\n\t\n\t // Non `Object` object instances with different constructors are not equal.\n\t if (objCtor != othCtor &&\n\t ('constructor' in object && 'constructor' in other) &&\n\t !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n\t typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n\t result = false;\n\t }\n\t }\n\t stack['delete'](object);\n\t stack['delete'](other);\n\t return result;\n\t}\n\t\n\t/**\n\t * Gets the data for `map`.\n\t *\n\t * @private\n\t * @param {Object} map The map to query.\n\t * @param {string} key The reference key.\n\t * @returns {*} Returns the map data.\n\t */\n\tfunction getMapData(map, key) {\n\t var data = map.__data__;\n\t return isKeyable(key)\n\t ? data[typeof key == 'string' ? 'string' : 'hash']\n\t : data.map;\n\t}\n\t\n\t/**\n\t * Gets the property names, values, and compare flags of `object`.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the match data of `object`.\n\t */\n\tfunction getMatchData(object) {\n\t var result = keys(object),\n\t length = result.length;\n\t\n\t while (length--) {\n\t var key = result[length],\n\t value = object[key];\n\t\n\t result[length] = [key, value, isStrictComparable(value)];\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Gets the native function at `key` of `object`.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @param {string} key The key of the method to get.\n\t * @returns {*} Returns the function if it's native, else `undefined`.\n\t */\n\tfunction getNative(object, key) {\n\t var value = getValue(object, key);\n\t return baseIsNative(value) ? value : undefined;\n\t}\n\t\n\t/**\n\t * Gets the `toStringTag` of `value`.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @returns {string} Returns the `toStringTag`.\n\t */\n\tvar getTag = baseGetTag;\n\t\n\t// Fallback for data views, maps, sets, and weak maps in IE 11,\n\t// for data views in Edge < 14, and promises in Node.js.\n\tif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n\t (Map && getTag(new Map) != mapTag) ||\n\t (Promise && getTag(Promise.resolve()) != promiseTag) ||\n\t (Set && getTag(new Set) != setTag) ||\n\t (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n\t getTag = function(value) {\n\t var result = objectToString.call(value),\n\t Ctor = result == objectTag ? value.constructor : undefined,\n\t ctorString = Ctor ? toSource(Ctor) : undefined;\n\t\n\t if (ctorString) {\n\t switch (ctorString) {\n\t case dataViewCtorString: return dataViewTag;\n\t case mapCtorString: return mapTag;\n\t case promiseCtorString: return promiseTag;\n\t case setCtorString: return setTag;\n\t case weakMapCtorString: return weakMapTag;\n\t }\n\t }\n\t return result;\n\t };\n\t}\n\t\n\t/**\n\t * Checks if `path` exists on `object`.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @param {Array|string} path The path to check.\n\t * @param {Function} hasFunc The function to check properties.\n\t * @returns {boolean} Returns `true` if `path` exists, else `false`.\n\t */\n\tfunction hasPath(object, path, hasFunc) {\n\t path = isKey(path, object) ? [path] : castPath(path);\n\t\n\t var result,\n\t index = -1,\n\t length = path.length;\n\t\n\t while (++index < length) {\n\t var key = toKey(path[index]);\n\t if (!(result = object != null && hasFunc(object, key))) {\n\t break;\n\t }\n\t object = object[key];\n\t }\n\t if (result) {\n\t return result;\n\t }\n\t var length = object ? object.length : 0;\n\t return !!length && isLength(length) && isIndex(key, length) &&\n\t (isArray(object) || isArguments(object));\n\t}\n\t\n\t/**\n\t * Checks if `value` is a valid array-like index.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n\t * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n\t */\n\tfunction isIndex(value, length) {\n\t length = length == null ? MAX_SAFE_INTEGER : length;\n\t return !!length &&\n\t (typeof value == 'number' || reIsUint.test(value)) &&\n\t (value > -1 && value % 1 == 0 && value < length);\n\t}\n\t\n\t/**\n\t * Checks if `value` is a property name and not a property path.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {Object} [object] The object to query keys on.\n\t * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n\t */\n\tfunction isKey(value, object) {\n\t if (isArray(value)) {\n\t return false;\n\t }\n\t var type = typeof value;\n\t if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n\t value == null || isSymbol(value)) {\n\t return true;\n\t }\n\t return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n\t (object != null && value in Object(object));\n\t}\n\t\n\t/**\n\t * Checks if `value` is suitable for use as unique object key.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n\t */\n\tfunction isKeyable(value) {\n\t var type = typeof value;\n\t return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n\t ? (value !== '__proto__')\n\t : (value === null);\n\t}\n\t\n\t/**\n\t * Checks if `func` has its source masked.\n\t *\n\t * @private\n\t * @param {Function} func The function to check.\n\t * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n\t */\n\tfunction isMasked(func) {\n\t return !!maskSrcKey && (maskSrcKey in func);\n\t}\n\t\n\t/**\n\t * Checks if `value` is likely a prototype object.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n\t */\n\tfunction isPrototype(value) {\n\t var Ctor = value && value.constructor,\n\t proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\t\n\t return value === proto;\n\t}\n\t\n\t/**\n\t * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` if suitable for strict\n\t * equality comparisons, else `false`.\n\t */\n\tfunction isStrictComparable(value) {\n\t return value === value && !isObject(value);\n\t}\n\t\n\t/**\n\t * A specialized version of `matchesProperty` for source values suitable\n\t * for strict equality comparisons, i.e. `===`.\n\t *\n\t * @private\n\t * @param {string} key The key of the property to get.\n\t * @param {*} srcValue The value to match.\n\t * @returns {Function} Returns the new spec function.\n\t */\n\tfunction matchesStrictComparable(key, srcValue) {\n\t return function(object) {\n\t if (object == null) {\n\t return false;\n\t }\n\t return object[key] === srcValue &&\n\t (srcValue !== undefined || (key in Object(object)));\n\t };\n\t}\n\t\n\t/**\n\t * Converts `string` to a property path array.\n\t *\n\t * @private\n\t * @param {string} string The string to convert.\n\t * @returns {Array} Returns the property path array.\n\t */\n\tvar stringToPath = memoize(function(string) {\n\t string = toString(string);\n\t\n\t var result = [];\n\t if (reLeadingDot.test(string)) {\n\t result.push('');\n\t }\n\t string.replace(rePropName, function(match, number, quote, string) {\n\t result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n\t });\n\t return result;\n\t});\n\t\n\t/**\n\t * Converts `value` to a string key if it's not a string or symbol.\n\t *\n\t * @private\n\t * @param {*} value The value to inspect.\n\t * @returns {string|symbol} Returns the key.\n\t */\n\tfunction toKey(value) {\n\t if (typeof value == 'string' || isSymbol(value)) {\n\t return value;\n\t }\n\t var result = (value + '');\n\t return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n\t}\n\t\n\t/**\n\t * Converts `func` to its source code.\n\t *\n\t * @private\n\t * @param {Function} func The function to process.\n\t * @returns {string} Returns the source code.\n\t */\n\tfunction toSource(func) {\n\t if (func != null) {\n\t try {\n\t return funcToString.call(func);\n\t } catch (e) {}\n\t try {\n\t return (func + '');\n\t } catch (e) {}\n\t }\n\t return '';\n\t}\n\t\n\t/**\n\t * This method is like `_.uniq` except that it accepts `iteratee` which is\n\t * invoked for each element in `array` to generate the criterion by which\n\t * uniqueness is computed. The iteratee is invoked with one argument: (value).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Array\n\t * @param {Array} array The array to inspect.\n\t * @param {Function} [iteratee=_.identity]\n\t * The iteratee invoked per element.\n\t * @returns {Array} Returns the new duplicate free array.\n\t * @example\n\t *\n\t * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n\t * // => [2.1, 1.2]\n\t *\n\t * // The `_.property` iteratee shorthand.\n\t * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n\t * // => [{ 'x': 1 }, { 'x': 2 }]\n\t */\n\tfunction uniqBy(array, iteratee) {\n\t return (array && array.length)\n\t ? baseUniq(array, baseIteratee(iteratee, 2))\n\t : [];\n\t}\n\t\n\t/**\n\t * Creates a function that memoizes the result of `func`. If `resolver` is\n\t * provided, it determines the cache key for storing the result based on the\n\t * arguments provided to the memoized function. By default, the first argument\n\t * provided to the memoized function is used as the map cache key. The `func`\n\t * is invoked with the `this` binding of the memoized function.\n\t *\n\t * **Note:** The cache is exposed as the `cache` property on the memoized\n\t * function. Its creation may be customized by replacing the `_.memoize.Cache`\n\t * constructor with one whose instances implement the\n\t * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n\t * method interface of `delete`, `get`, `has`, and `set`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Function\n\t * @param {Function} func The function to have its output memoized.\n\t * @param {Function} [resolver] The function to resolve the cache key.\n\t * @returns {Function} Returns the new memoized function.\n\t * @example\n\t *\n\t * var object = { 'a': 1, 'b': 2 };\n\t * var other = { 'c': 3, 'd': 4 };\n\t *\n\t * var values = _.memoize(_.values);\n\t * values(object);\n\t * // => [1, 2]\n\t *\n\t * values(other);\n\t * // => [3, 4]\n\t *\n\t * object.a = 2;\n\t * values(object);\n\t * // => [1, 2]\n\t *\n\t * // Modify the result cache.\n\t * values.cache.set(object, ['a', 'b']);\n\t * values(object);\n\t * // => ['a', 'b']\n\t *\n\t * // Replace `_.memoize.Cache`.\n\t * _.memoize.Cache = WeakMap;\n\t */\n\tfunction memoize(func, resolver) {\n\t if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n\t throw new TypeError(FUNC_ERROR_TEXT);\n\t }\n\t var memoized = function() {\n\t var args = arguments,\n\t key = resolver ? resolver.apply(this, args) : args[0],\n\t cache = memoized.cache;\n\t\n\t if (cache.has(key)) {\n\t return cache.get(key);\n\t }\n\t var result = func.apply(this, args);\n\t memoized.cache = cache.set(key, result);\n\t return result;\n\t };\n\t memoized.cache = new (memoize.Cache || MapCache);\n\t return memoized;\n\t}\n\t\n\t// Assign cache to `_.memoize`.\n\tmemoize.Cache = MapCache;\n\t\n\t/**\n\t * Performs a\n\t * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n\t * comparison between two values to determine if they are equivalent.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to compare.\n\t * @param {*} other The other value to compare.\n\t * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n\t * @example\n\t *\n\t * var object = { 'a': 1 };\n\t * var other = { 'a': 1 };\n\t *\n\t * _.eq(object, object);\n\t * // => true\n\t *\n\t * _.eq(object, other);\n\t * // => false\n\t *\n\t * _.eq('a', 'a');\n\t * // => true\n\t *\n\t * _.eq('a', Object('a'));\n\t * // => false\n\t *\n\t * _.eq(NaN, NaN);\n\t * // => true\n\t */\n\tfunction eq(value, other) {\n\t return value === other || (value !== value && other !== other);\n\t}\n\t\n\t/**\n\t * Checks if `value` is likely an `arguments` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n\t * else `false`.\n\t * @example\n\t *\n\t * _.isArguments(function() { return arguments; }());\n\t * // => true\n\t *\n\t * _.isArguments([1, 2, 3]);\n\t * // => false\n\t */\n\tfunction isArguments(value) {\n\t // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n\t return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n\t (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as an `Array` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n\t * @example\n\t *\n\t * _.isArray([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArray(document.body.children);\n\t * // => false\n\t *\n\t * _.isArray('abc');\n\t * // => false\n\t *\n\t * _.isArray(_.noop);\n\t * // => false\n\t */\n\tvar isArray = Array.isArray;\n\t\n\t/**\n\t * Checks if `value` is array-like. A value is considered array-like if it's\n\t * not a function and has a `value.length` that's an integer greater than or\n\t * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n\t * @example\n\t *\n\t * _.isArrayLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLike(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLike('abc');\n\t * // => true\n\t *\n\t * _.isArrayLike(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLike(value) {\n\t return value != null && isLength(value.length) && !isFunction(value);\n\t}\n\t\n\t/**\n\t * This method is like `_.isArrayLike` except that it also checks if `value`\n\t * is an object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an array-like object,\n\t * else `false`.\n\t * @example\n\t *\n\t * _.isArrayLikeObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLikeObject(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLikeObject('abc');\n\t * // => false\n\t *\n\t * _.isArrayLikeObject(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLikeObject(value) {\n\t return isObjectLike(value) && isArrayLike(value);\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 8-9 which returns 'object' for typed array and other constructors.\n\t var tag = isObject(value) ? objectToString.call(value) : '';\n\t return tag == funcTag || tag == genTag;\n\t}\n\t\n\t/**\n\t * Checks if `value` is a valid array-like length.\n\t *\n\t * **Note:** This method is loosely based on\n\t * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n\t * @example\n\t *\n\t * _.isLength(3);\n\t * // => true\n\t *\n\t * _.isLength(Number.MIN_VALUE);\n\t * // => false\n\t *\n\t * _.isLength(Infinity);\n\t * // => false\n\t *\n\t * _.isLength('3');\n\t * // => false\n\t */\n\tfunction isLength(value) {\n\t return typeof value == 'number' &&\n\t value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n\t}\n\t\n\t/**\n\t * Checks if `value` is the\n\t * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n\t * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\t/**\n\t * Checks if `value` is object-like. A value is object-like if it's not `null`\n\t * and has a `typeof` result of \"object\".\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n\t * @example\n\t *\n\t * _.isObjectLike({});\n\t * // => true\n\t *\n\t * _.isObjectLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObjectLike(_.noop);\n\t * // => false\n\t *\n\t * _.isObjectLike(null);\n\t * // => false\n\t */\n\tfunction isObjectLike(value) {\n\t return !!value && typeof value == 'object';\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `Symbol` primitive or object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n\t * @example\n\t *\n\t * _.isSymbol(Symbol.iterator);\n\t * // => true\n\t *\n\t * _.isSymbol('abc');\n\t * // => false\n\t */\n\tfunction isSymbol(value) {\n\t return typeof value == 'symbol' ||\n\t (isObjectLike(value) && objectToString.call(value) == symbolTag);\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a typed array.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 3.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n\t * @example\n\t *\n\t * _.isTypedArray(new Uint8Array);\n\t * // => true\n\t *\n\t * _.isTypedArray([]);\n\t * // => false\n\t */\n\tvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\t\n\t/**\n\t * Converts `value` to a string. An empty string is returned for `null`\n\t * and `undefined` values. The sign of `-0` is preserved.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to process.\n\t * @returns {string} Returns the string.\n\t * @example\n\t *\n\t * _.toString(null);\n\t * // => ''\n\t *\n\t * _.toString(-0);\n\t * // => '-0'\n\t *\n\t * _.toString([1, 2, 3]);\n\t * // => '1,2,3'\n\t */\n\tfunction toString(value) {\n\t return value == null ? '' : baseToString(value);\n\t}\n\t\n\t/**\n\t * Gets the value at `path` of `object`. If the resolved value is\n\t * `undefined`, the `defaultValue` is returned in its place.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 3.7.0\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @param {Array|string} path The path of the property to get.\n\t * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n\t * @returns {*} Returns the resolved value.\n\t * @example\n\t *\n\t * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n\t *\n\t * _.get(object, 'a[0].b.c');\n\t * // => 3\n\t *\n\t * _.get(object, ['a', '0', 'b', 'c']);\n\t * // => 3\n\t *\n\t * _.get(object, 'a.b.c', 'default');\n\t * // => 'default'\n\t */\n\tfunction get(object, path, defaultValue) {\n\t var result = object == null ? undefined : baseGet(object, path);\n\t return result === undefined ? defaultValue : result;\n\t}\n\t\n\t/**\n\t * Checks if `path` is a direct or inherited property of `object`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @param {Array|string} path The path to check.\n\t * @returns {boolean} Returns `true` if `path` exists, else `false`.\n\t * @example\n\t *\n\t * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n\t *\n\t * _.hasIn(object, 'a');\n\t * // => true\n\t *\n\t * _.hasIn(object, 'a.b');\n\t * // => true\n\t *\n\t * _.hasIn(object, ['a', 'b']);\n\t * // => true\n\t *\n\t * _.hasIn(object, 'b');\n\t * // => false\n\t */\n\tfunction hasIn(object, path) {\n\t return object != null && hasPath(object, path, baseHasIn);\n\t}\n\t\n\t/**\n\t * Creates an array of the own enumerable property names of `object`.\n\t *\n\t * **Note:** Non-object values are coerced to objects. See the\n\t * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n\t * for more details.\n\t *\n\t * @static\n\t * @since 0.1.0\n\t * @memberOf _\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.a = 1;\n\t * this.b = 2;\n\t * }\n\t *\n\t * Foo.prototype.c = 3;\n\t *\n\t * _.keys(new Foo);\n\t * // => ['a', 'b'] (iteration order is not guaranteed)\n\t *\n\t * _.keys('hi');\n\t * // => ['0', '1']\n\t */\n\tfunction keys(object) {\n\t return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n\t}\n\t\n\t/**\n\t * This method returns the first argument it receives.\n\t *\n\t * @static\n\t * @since 0.1.0\n\t * @memberOf _\n\t * @category Util\n\t * @param {*} value Any value.\n\t * @returns {*} Returns `value`.\n\t * @example\n\t *\n\t * var object = { 'a': 1 };\n\t *\n\t * console.log(_.identity(object) === object);\n\t * // => true\n\t */\n\tfunction identity(value) {\n\t return value;\n\t}\n\t\n\t/**\n\t * This method returns `undefined`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 2.3.0\n\t * @category Util\n\t * @example\n\t *\n\t * _.times(2, _.noop);\n\t * // => [undefined, undefined]\n\t */\n\tfunction noop() {\n\t // No operation performed.\n\t}\n\t\n\t/**\n\t * Creates a function that returns the value at `path` of a given object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 2.4.0\n\t * @category Util\n\t * @param {Array|string} path The path of the property to get.\n\t * @returns {Function} Returns the new accessor function.\n\t * @example\n\t *\n\t * var objects = [\n\t * { 'a': { 'b': 2 } },\n\t * { 'a': { 'b': 1 } }\n\t * ];\n\t *\n\t * _.map(objects, _.property('a.b'));\n\t * // => [2, 1]\n\t *\n\t * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n\t * // => [1, 2]\n\t */\n\tfunction property(path) {\n\t return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n\t}\n\t\n\tmodule.exports = uniqBy;\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(/*! ./../webpack/buildin/module.js */ 23)(module)))\n\n/***/ },\n/* 104 */\n/*!*******************************!*\\\n !*** ./src/icons/03-stop.svg ***!\n \\*******************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" fill=\\\"#010101\\\" d=\\\"M1.712 1.24h12.6v13.52h-12.6z\\\"></path></svg>\"\n\n/***/ },\n/* 105 */\n/*!*********************************!*\\\n !*** ./src/icons/04-volume.svg ***!\n \\*********************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" fill=\\\"#010101\\\" d=\\\"M11.5 11h-.002v1.502L7.798 10H4.5V6h3.297l3.7-2.502V4.5h.003V11zM11 4.49L7.953 6.5H5v3h2.953L11 11.51V4.49z\\\"></path></svg>\"\n\n/***/ },\n/* 106 */\n/*!*******************************!*\\\n !*** ./src/icons/05-mute.svg ***!\n \\*******************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" fill=\\\"#010101\\\" d=\\\"M9.75 11.51L6.7 9.5H3.75v-3H6.7L9.75 4.49v.664l.497.498V3.498L6.547 6H3.248v4h3.296l3.7 2.502v-2.154l-.497.5v.662zm3-5.165L12.404 6l-1.655 1.653L9.093 6l-.346.345L10.402 8 8.747 9.654l.346.347 1.655-1.653L12.403 10l.348-.346L11.097 8l1.655-1.655z\\\"></path></svg>\"\n\n/***/ },\n/* 107 */\n/*!*********************************!*\\\n !*** ./src/icons/06-expand.svg ***!\n \\*********************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill=\\\"#010101\\\" d=\\\"M7.156 8L4 11.156V8.5H3V13h4.5v-1H4.844L8 8.844 7.156 8zM8.5 3v1h2.657L8 7.157 8.846 8 12 4.844V7.5h1V3H8.5z\\\"></path></svg>\"\n\n/***/ },\n/* 108 */\n/*!*********************************!*\\\n !*** ./src/icons/07-shrink.svg ***!\n \\*********************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill=\\\"#010101\\\" d=\\\"M13.5 3.344l-.844-.844L9.5 5.656V3h-1v4.5H13v-1h-2.656L13.5 3.344zM3 9.5h2.656L2.5 12.656l.844.844L6.5 10.344V13h1V8.5H3v1z\\\"></path></svg>\"\n\n/***/ },\n/* 109 */\n/*!*****************************!*\\\n !*** ./src/icons/08-hd.svg ***!\n \\*****************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill=\\\"#010101\\\" d=\\\"M5.375 7.062H2.637V4.26H.502v7.488h2.135V8.9h2.738v2.848h2.133V4.26H5.375v2.802zm5.97-2.81h-2.84v7.496h2.798c2.65 0 4.195-1.607 4.195-3.77v-.022c0-2.162-1.523-3.704-4.154-3.704zm2.06 3.758c0 1.21-.81 1.896-2.03 1.896h-.83V6.093h.83c1.22 0 2.03.696 2.03 1.896v.02z\\\"></path></svg>\"\n\n/***/ },\n/* 110 */\n/*!***********************************************!*\\\n !*** ./src/components/core/public/Roboto.ttf ***!\n \\***********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__.p + \"38861cba61c66739c1452c3a71e39852.ttf\";\n\n/***/ },\n/* 111 */\n/*!***********************************************!*\\\n !*** ./src/playbacks/flash/public/Player.swf ***!\n \\***********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__.p + \"4b76590b32dab62bc95c1b7951efae78.swf\";\n\n/***/ },\n/* 112 */\n/*!****************************************************!*\\\n !*** ./src/playbacks/flashls/public/HLSPlayer.swf ***!\n \\****************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__.p + \"809981e5b09d5336c45d72d0869ada2a.swf\";\n\n/***/ }\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// clappr.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"<%=baseUrl%>/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d556a0cfcd71319135ca","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport Player from 'components/player'\nimport Utils from 'base/utils'\nimport Events from 'base/events'\nimport Playback from 'base/playback'\nimport ContainerPlugin from 'base/container_plugin'\nimport CorePlugin from 'base/core_plugin'\nimport UICorePlugin from 'base/ui_core_plugin'\nimport UIContainerPlugin from 'base/ui_container_plugin'\nimport BaseObject from 'base/base_object'\nimport UIObject from 'base/ui_object'\nimport Browser from 'components/browser'\nimport Container from 'components/container'\nimport Core from 'components/core'\nimport Loader from 'components/loader'\nimport Mediator from 'components/mediator'\nimport MediaControl from 'components/media_control'\nimport PlayerInfo from 'components/player_info'\nimport BaseFlashPlayback from 'playbacks/base_flash_playback'\nimport Flash from 'playbacks/flash'\nimport FlasHLS from 'playbacks/flashls'\nimport HLS from 'playbacks/hls'\nimport HTML5Audio from 'playbacks/html5_audio'\nimport HTML5Video from 'playbacks/html5_video'\nimport HTMLImg from 'playbacks/html_img'\nimport NoOp from 'playbacks/no_op'\nimport Poster from 'plugins/poster'\nimport Log from 'plugins/log'\nimport Styler from 'base/styler'\nimport Vendor from 'vendor'\nimport template from 'base/template'\n\nimport $ from 'clappr-zepto'\n\nconst version = VERSION\n\nexport default {\n Player,\n Mediator,\n Events,\n Browser,\n PlayerInfo,\n MediaControl,\n ContainerPlugin,\n UIContainerPlugin,\n CorePlugin,\n UICorePlugin,\n Playback,\n Container,\n Core,\n Loader,\n BaseObject,\n UIObject,\n Utils,\n BaseFlashPlayback,\n Flash,\n FlasHLS,\n HLS,\n HTML5Audio,\n HTML5Video,\n HTMLImg,\n NoOp,\n Poster,\n Log,\n Styler,\n Vendor,\n version,\n template,\n $\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport Log from 'plugins/log'\nimport {uniqueId} from './utils'\nimport execOnce from 'lodash.once'\n\nconst slice = Array.prototype.slice\n\nconst eventSplitter = /\\s+/\n\nconst eventsApi = function(obj, action, name, rest) {\n if (!name) {return true}\n\n // Handle event maps.\n if (typeof name === 'object') {\n for (const key in name) {\n obj[action].apply(obj, [key, name[key]].concat(rest))\n }\n return false\n }\n\n // Handle space separated event names.\n if (eventSplitter.test(name)) {\n const names = name.split(eventSplitter)\n for (let i = 0, l = names.length; i < l; i++) {\n obj[action].apply(obj, [names[i]].concat(rest))\n }\n return false\n }\n\n return true\n}\n\nconst triggerEvents = function(events, args, klass, name) {\n let ev, i = -1\n const l = events.length, a1 = args[0], a2 = args[1], a3 = args[2]\n run()\n\n function run() {\n try {\n switch (args.length) {\n case 0: while (++i < l) { (ev = events[i]).callback.call(ev.ctx) } return\n case 1: while (++i < l) { (ev = events[i]).callback.call(ev.ctx, a1) } return\n case 2: while (++i < l) { (ev = events[i]).callback.call(ev.ctx, a1, a2) } return\n case 3: while (++i < l) { (ev = events[i]).callback.call(ev.ctx, a1, a2, a3) } return\n default: while (++i < l) { (ev = events[i]).callback.apply(ev.ctx, args) } return\n }\n } catch (exception) {\n Log.error.apply(Log, [klass, 'error on event', name, 'trigger','-', exception])\n run()\n }\n }\n}\n\n/**\n * @class Events\n * @constructor\n * @module base\n */\nexport default class Events {\n /**\n * listen to an event indefinitely, if you want to stop you need to call `off`\n * @method on\n * @param {String} name\n * @param {Function} callback\n * @param {Object} context\n */\n on(name, callback, context) {\n if (!eventsApi(this, 'on', name, [callback, context]) || !callback) {return this}\n this._events || (this._events = {})\n const events = this._events[name] || (this._events[name] = [])\n events.push({callback: callback, context: context, ctx: context || this})\n return this\n }\n\n /**\n * listen to an event only once\n * @method once\n * @param {String} name\n * @param {Function} callback\n * @param {Object} context\n */\n once(name, callback, context) {\n if (!eventsApi(this, 'once', name, [callback, context]) || !callback) {return this}\n const self = this\n const once = execOnce(function() {\n self.off(name, once)\n callback.apply(this, arguments)\n })\n once._callback = callback\n return this.on(name, once, context)\n }\n\n /**\n * stop listening to an event\n * @method off\n * @param {String} name\n * @param {Function} callback\n * @param {Object} context\n */\n off(name, callback, context) {\n let retain, ev, events, names, i, l, j, k\n if (!this._events || !eventsApi(this, 'off', name, [callback, context])) {return this}\n if (!name && !callback && !context) {\n this._events = void 0\n return this\n }\n names = name ? [name] : Object.keys(this._events)\n // jshint maxdepth:5\n for (i = 0, l = names.length; i < l; i++) {\n name = names[i]\n events = this._events[name]\n if (events) {\n this._events[name] = retain = []\n if (callback || context) {\n for (j = 0, k = events.length; j < k; j++) {\n ev = events[j]\n if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||\n (context && context !== ev.context)) {\n retain.push(ev)\n }\n }\n }\n if (!retain.length) {delete this._events[name]}\n }\n }\n return this\n }\n\n /**\n * triggers an event given its `name`\n * @method trigger\n * @param {String} name\n */\n trigger(name) {\n const klass = this.name || this.constructor.name\n Log.debug.apply(Log, [klass].concat(Array.prototype.slice.call(arguments)))\n if (!this._events) {return this}\n const args = slice.call(arguments, 1)\n if (!eventsApi(this, 'trigger', name, args)) {return this}\n const events = this._events[name]\n const allEvents = this._events.all\n if (events) {triggerEvents(events, args, klass, name)}\n if (allEvents) {triggerEvents(allEvents, arguments, klass, name)}\n return this\n }\n\n /**\n * stop listening an event for a given object\n * @method stopListening\n * @param {Object} obj\n * @param {String} name\n * @param {Function} callback\n */\n stopListening(obj, name, callback) {\n let listeningTo = this._listeningTo\n if (!listeningTo) {return this}\n const remove = !name && !callback\n if (!callback && typeof name === 'object') {callback = this}\n if (obj) {(listeningTo = {})[obj._listenId] = obj}\n for (const id in listeningTo) {\n obj = listeningTo[id]\n obj.off(name, callback, this)\n if (remove || Object.keys(obj._events).length === 0) {delete this._listeningTo[id]}\n }\n return this\n }\n}\n\n\n/**\n * listen to an event indefinitely for a given `obj`\n * @method listenTo\n * @param {Object} obj\n * @param {String} name\n * @param {Function} callback\n * @param {Object} context\n * @example\n * ```javascript\n * this.listenTo(this.core.playback, Events.PLAYBACK_PAUSE, this.callback)\n * ```\n */\n/**\n * listen to an event once for a given `obj`\n * @method listenToOnce\n * @param {Object} obj\n * @param {String} name\n * @param {Function} callback\n * @param {Object} context\n * @example\n * ```javascript\n * this.listenToOnce(this.core.playback, Events.PLAYBACK_PAUSE, this.callback)\n * ```\n */\nconst listenMethods = {listenTo: 'on', listenToOnce: 'once'}\n\nObject.keys(listenMethods).forEach(function(method) {\n Events.prototype[method] = function(obj, name, callback) {\n const listeningTo = this._listeningTo || (this._listeningTo = {})\n const id = obj._listenId || (obj._listenId = uniqueId('l'))\n listeningTo[id] = obj\n if (!callback && typeof name === 'object') {callback = this}\n obj[listenMethods[method]](name, callback, this)\n return this\n }\n})\n\n// PLAYER EVENTS\n/**\n * Fired when the player is ready on startup\n *\n * @event PLAYER_READY\n */\nEvents.PLAYER_READY = 'ready'\n/**\n * Fired when player resizes\n *\n * @event PLAYER_RESIZE\n * @param {Object} currentSize an object with the current size\n */\nEvents.PLAYER_RESIZE = 'resize'\n/**\n * Fired when player changes its fullscreen state\n *\n * @event PLAYER_FULLSCREEN\n * @param {Boolean} whether or not the player is on fullscreen mode\n */\nEvents.PLAYER_FULLSCREEN = 'fullscreen'\n/**\n * Fired when player starts to play\n *\n * @event PLAYER_PLAY\n */\nEvents.PLAYER_PLAY = 'play'\n/**\n * Fired when player pauses\n *\n * @event PLAYER_PAUSE\n */\nEvents.PLAYER_PAUSE = 'pause'\n/**\n * Fired when player stops\n *\n * @event PLAYER_STOP\n */\nEvents.PLAYER_STOP = 'stop'\n/**\n * Fired when player ends the video\n *\n * @event PLAYER_ENDED\n */\nEvents.PLAYER_ENDED = 'ended'\n/**\n * Fired when player seeks the video\n *\n * @event PLAYER_SEEK\n * @param {Number} time the current time in seconds\n */\nEvents.PLAYER_SEEK = 'seek'\n/**\n * Fired when player receives an error\n *\n * @event PLAYER_ERROR\n * @param {Object} error the error\n */\nEvents.PLAYER_ERROR = 'error'\n/**\n * Fired when the time is updated on player\n *\n * @event PLAYER_TIMEUPDATE\n * @param {Object} progress Data\n * progress object\n * @param {Number} [progress.current]\n * current time\n * @param {Number} [progress.total]\n * total time\n */\nEvents.PLAYER_TIMEUPDATE = 'timeupdate'\n/**\n * Fired when player updates its volume\n *\n * @event PLAYER_VOLUMEUPDATE\n * @param {Number} volume the current volume\n */\nEvents.PLAYER_VOLUMEUPDATE = 'volumeupdate'\n\n// Playback Events\n/**\n * Fired when the playback is downloading the media\n *\n * @event PLAYBACK_PROGRESS\n * @param progress {Object}\n * Data progress object\n * @param [progress.start] {Number}\n * start position of buffered content at current position\n * @param [progress.current] {Number}\n * end position of buffered content at current position\n * @param [progress.total] {Number}\n * total content to be downloaded\n * @param buffered {Array}\n * array of buffered segments ({start, end}). [Only for supported playbacks]\n */\nEvents.PLAYBACK_PROGRESS = 'playback:progress'\n/**\n * Fired when the time is updated on playback\n *\n * @event PLAYBACK_TIMEUPDATE\n * @param {Object} progress Data\n * progress object\n * @param {Number} [progress.current]\n * current time\n * @param {Number} [progress.total]\n * total time\n */\nEvents.PLAYBACK_TIMEUPDATE = 'playback:timeupdate'\n/**\n * Fired when playback is ready\n *\n * @event PLAYBACK_READY\n */\nEvents.PLAYBACK_READY = 'playback:ready'\n/**\n * Fired when the playback starts having to buffer because\n * playback can currently not be smooth.\n *\n * This corresponds to the playback `buffering` property being\n * `true`.\n *\n * @event PLAYBACK_BUFFERING\n */\nEvents.PLAYBACK_BUFFERING = 'playback:buffering'\n/**\n * Fired when the playback has enough in the buffer to be\n * able to play smoothly, after previously being unable to\n * do this.\n *\n * This corresponds to the playback `buffering` property being\n * `false`.\n *\n * @event PLAYBACK_BUFFERFULL\n */\nEvents.PLAYBACK_BUFFERFULL = 'playback:bufferfull'\n/**\n * Fired when playback changes any settings (volume, seek and etc)\n *\n * @event PLAYBACK_SETTINGSUPDATE\n */\nEvents.PLAYBACK_SETTINGSUPDATE = 'playback:settingsupdate'\n/**\n * Fired when playback loaded its metadata\n *\n * @event PLAYBACK_LOADEDMETADATA\n * @param {Object} metadata Data\n * settings object\n * @param {Number} [metadata.duration]\n * the playback duration\n * @param {Object} [metadata.data]\n * extra meta data\n */\nEvents.PLAYBACK_LOADEDMETADATA = 'playback:loadedmetadata'\n/**\n * Fired when playback updates its video quality\n *\n * @event PLAYBACK_HIGHDEFINITIONUPDATE\n * @param {Boolean} isHD\n * true when is on HD, false otherwise\n */\nEvents.PLAYBACK_HIGHDEFINITIONUPDATE = 'playback:highdefinitionupdate'\n/**\n * Fired when playback updates its bitrate\n *\n * @event PLAYBACK_BITRATE\n * @param {Object} bitrate Data\n * bitrate object\n * @param {Number} [bitrate.bandwidth]\n * bitrate bandwidth when it's available\n * @param {Number} [bitrate.width]\n * playback width (ex: 720, 640, 1080)\n * @param {Number} [bitrate.height]\n * playback height (ex: 240, 480, 720)\n * @param {Number} [bitrate.level]\n * playback level when it's available, it could be just a map for width (0 => 240, 1 => 480, 2 => 720)\n */\nEvents.PLAYBACK_BITRATE = 'playback:bitrate'\n/**\n * Fired when the playback has its levels\n *\n * @event PLAYBACK_LEVELS_AVAILABLE\n * @param {Array} levels\n * the ordered levels, each one with the following format `{id: 1, label: '500kbps'}` ps: id should be a number >= 0\n * @param {Number} initial\n * the initial level otherwise -1 (AUTO)\n */\nEvents.PLAYBACK_LEVELS_AVAILABLE = 'playback:levels:available'\n/**\n * Fired when the playback starts to switch level\n *\n * @event PLAYBACK_LEVEL_SWITCH_START\n *\n */\nEvents.PLAYBACK_LEVEL_SWITCH_START = 'playback:levels:switch:start'\n/**\n * Fired when the playback ends the level switch\n *\n * @event PLAYBACK_LEVEL_SWITCH_END\n *\n */\nEvents.PLAYBACK_LEVEL_SWITCH_END = 'playback:levels:switch:end'\n\n/**\n * Fired when playback internal state changes\n *\n * @event PLAYBACK_PLAYBACKSTATE\n * @param {Object} state Data\n * state object\n * @param {String} [state.type]\n * the playback type\n */\nEvents.PLAYBACK_PLAYBACKSTATE = 'playback:playbackstate'\n/**\n * Fired when DVR becomes enabled/disabled.\n *\n * @event PLAYBACK_DVR\n * @param {boolean} state true if dvr enabled\n */\nEvents.PLAYBACK_DVR = 'playback:dvr'\n// TODO doc\nEvents.PLAYBACK_MEDIACONTROL_DISABLE = 'playback:mediacontrol:disable'\n// TODO doc\nEvents.PLAYBACK_MEDIACONTROL_ENABLE = 'playback:mediacontrol:enable'\n/**\n * Fired when the media for a playback ends.\n *\n * @event PLAYBACK_ENDED\n * @param {String} name the name of the playback\n */\nEvents.PLAYBACK_ENDED = 'playback:ended'\n/**\n * Fired when user requests `play()`\n *\n * @event PLAYBACK_PLAY_INTENT\n */\nEvents.PLAYBACK_PLAY_INTENT = 'playback:play:intent'\n/**\n * Fired when the media for a playback starts playing.\n * This is not necessarily when the user requests `play()`\n * The media may have to buffer first.\n * I.e. `isPlaying()` might return `true` before this event is fired,\n * because `isPlaying()` represents the intended state.\n *\n * @event PLAYBACK_PLAY\n */\nEvents.PLAYBACK_PLAY = 'playback:play'\n/**\n * Fired when the media for a playback pauses.\n *\n * @event PLAYBACK_PAUSE\n */\nEvents.PLAYBACK_PAUSE = 'playback:pause'\n/**\n * Fired when the media for a playback is stopped.\n *\n * @event PLAYBACK_STOP\n */\nEvents.PLAYBACK_STOP = 'playback:stop'\n/**\n * Fired if an error occurs in the playback.\n *\n * @event PLAYBACK_ERROR\n * @param {Object} error An object containing the error details\n * @param {String} name Playback name\n */\nEvents.PLAYBACK_ERROR = 'playback:error'\n// TODO doc\nEvents.PLAYBACK_STATS_ADD = 'playback:stats:add'\n// TODO doc\nEvents.PLAYBACK_FRAGMENT_LOADED = 'playback:fragment:loaded'\n// TODO doc\nEvents.PLAYBACK_LEVEL_SWITCH = 'playback:level:switch'\n\n/**\n * Fired when the options were changed for the core\n *\n * @event CORE_OPTIONS_CHANGE\n */\nEvents.CORE_OPTIONS_CHANGE = 'core:options:change'\n/**\n * Fired after creating containers, when the core is ready\n *\n * @event CORE_READY\n */\nEvents.CORE_READY = 'core:ready'\n/**\n * Fired when the fullscreen state change\n *\n * @param {Boolean} whether or not the player is on fullscreen mode\n * @event CORE_READY\n */\nEvents.CORE_FULLSCREEN = 'core:fullscreen'\n\n// Container Events\n/**\n * Fired when the container internal state changes\n *\n * @event CONTAINER_PLAYBACKSTATE\n * @param {Object} state Data\n * state object\n * @param {String} [state.type]\n * the playback type\n */\nEvents.CONTAINER_PLAYBACKSTATE = 'container:playbackstate'\nEvents.CONTAINER_PLAYBACKDVRSTATECHANGED = 'container:dvr'\n/**\n * Fired when the container updates its bitrate\n *\n * @event CONTAINER_BITRATE\n * @param {Object} bitrate Data\n * bitrate object\n * @param {Number} [bitrate.bandwidth]\n * bitrate bandwidth when it's available\n * @param {Number} [bitrate.width]\n * playback width (ex: 720, 640, 1080)\n * @param {Number} [bitrate.height]\n * playback height (ex: 240, 480, 720)\n * @param {Number} [bitrate.level]\n * playback level when it's available, it could be just a map for width (0 => 240, 1 => 480, 2 => 720)\n */\nEvents.CONTAINER_BITRATE = 'container:bitrate'\nEvents.CONTAINER_STATS_REPORT = 'container:stats:report'\nEvents.CONTAINER_DESTROYED = 'container:destroyed'\n/**\n * Fired when the container is ready\n *\n * @event CONTAINER_READY\n */\nEvents.CONTAINER_READY = 'container:ready'\nEvents.CONTAINER_ERROR = 'container:error'\n/**\n * Fired when the container loaded its metadata\n *\n * @event CONTAINER_LOADEDMETADATA\n * @param {Object} metadata Data\n * settings object\n * @param {Number} [metadata.duration]\n * the playback duration\n * @param {Object} [metadata.data]\n * extra meta data\n */\nEvents.CONTAINER_LOADEDMETADATA = 'container:loadedmetadata'\n/**\n * Fired when the time is updated on container\n *\n * @event CONTAINER_TIMEUPDATE\n * @param {Object} progress Data\n * progress object\n * @param {Number} [progress.current]\n * current time\n * @param {Number} [progress.total]\n * total time\n */\nEvents.CONTAINER_TIMEUPDATE = 'container:timeupdate'\n/**\n * Fired when the container is downloading the media\n *\n * @event CONTAINER_PROGRESS\n * @param {Object} progress Data\n * progress object\n * @param {Number} [progress.start]\n * initial downloaded content\n * @param {Number} [progress.current]\n * current dowloaded content\n * @param {Number} [progress.total]\n * total content to be downloaded\n */\nEvents.CONTAINER_PROGRESS = 'container:progress'\nEvents.CONTAINER_PLAY = 'container:play'\nEvents.CONTAINER_STOP = 'container:stop'\nEvents.CONTAINER_PAUSE = 'container:pause'\nEvents.CONTAINER_ENDED = 'container:ended'\nEvents.CONTAINER_CLICK = 'container:click'\nEvents.CONTAINER_DBLCLICK = 'container:dblclick'\nEvents.CONTAINER_CONTEXTMENU = 'container:contextmenu'\nEvents.CONTAINER_MOUSE_ENTER = 'container:mouseenter'\nEvents.CONTAINER_MOUSE_LEAVE = 'container:mouseleave'\n/**\n * Fired when the container seeks the video\n *\n * @event CONTAINER_SEEK\n * @param {Number} time the current time in seconds\n */\nEvents.CONTAINER_SEEK = 'container:seek'\nEvents.CONTAINER_VOLUME = 'container:volume'\nEvents.CONTAINER_FULLSCREEN = 'container:fullscreen'\n/**\n * Fired when container is buffering\n *\n * @event CONTAINER_STATE_BUFFERING\n */\nEvents.CONTAINER_STATE_BUFFERING = 'container:state:buffering'\n/**\n * Fired when the container filled the buffer\n *\n * @event CONTAINER_STATE_BUFFERFULL\n */\nEvents.CONTAINER_STATE_BUFFERFULL = 'container:state:bufferfull'\n/**\n * Fired when the container changes any settings (volume, seek and etc)\n *\n * @event CONTAINER_SETTINGSUPDATE\n */\nEvents.CONTAINER_SETTINGSUPDATE = 'container:settingsupdate'\n/**\n * Fired when container updates its video quality\n *\n * @event CONTAINER_HIGHDEFINITIONUPDATE\n * @param {Boolean} isHD\n * true when is on HD, false otherwise\n */\nEvents.CONTAINER_HIGHDEFINITIONUPDATE = 'container:highdefinitionupdate'\n\n/**\n * Fired when the media control shows\n *\n * @event CONTAINER_MEDIACONTROL_SHOW\n */\nEvents.CONTAINER_MEDIACONTROL_SHOW = 'container:mediacontrol:show'\n/**\n * Fired when the media control hides\n *\n * @event CONTAINER_MEDIACONTROL_HIDE\n */\nEvents.CONTAINER_MEDIACONTROL_HIDE = 'container:mediacontrol:hide'\n\nEvents.CONTAINER_MEDIACONTROL_DISABLE = 'container:mediacontrol:disable'\nEvents.CONTAINER_MEDIACONTROL_ENABLE = 'container:mediacontrol:enable'\nEvents.CONTAINER_STATS_ADD = 'container:stats:add'\n/**\n * Fired when the options were changed for the container\n *\n * @event CONTAINER_OPTIONS_CHANGE\n */\nEvents.CONTAINER_OPTIONS_CHANGE = 'container:options:change'\n\n// MediaControl Events\nEvents.MEDIACONTROL_RENDERED = 'mediacontrol:rendered'\n/**\n * Fired when the player enters/exit on fullscreen\n *\n * @event MEDIACONTROL_FULLSCREEN\n */\nEvents.MEDIACONTROL_FULLSCREEN = 'mediacontrol:fullscreen'\n/**\n * Fired when the media control shows\n *\n * @event MEDIACONTROL_SHOW\n */\nEvents.MEDIACONTROL_SHOW = 'mediacontrol:show'\n/**\n * Fired when the media control hides\n *\n * @event MEDIACONTROL_HIDE\n */\nEvents.MEDIACONTROL_HIDE = 'mediacontrol:hide'\n/**\n * Fired when mouse enters on the seekbar\n *\n * @event MEDIACONTROL_MOUSEMOVE_SEEKBAR\n * @param {Object} event\n * the javascript event\n */\nEvents.MEDIACONTROL_MOUSEMOVE_SEEKBAR = 'mediacontrol:mousemove:seekbar'\n/**\n * Fired when mouse leaves the seekbar\n *\n * @event MEDIACONTROL_MOUSELEAVE_SEEKBAR\n * @param {Object} event\n * the javascript event\n */\nEvents.MEDIACONTROL_MOUSELEAVE_SEEKBAR = 'mediacontrol:mouseleave:seekbar'\n/**\n * Fired when the media is being played\n *\n * @event MEDIACONTROL_PLAYING\n */\nEvents.MEDIACONTROL_PLAYING = 'mediacontrol:playing'\n/**\n * Fired when the media is not being played\n *\n * @event MEDIACONTROL_NOTPLAYING\n */\nEvents.MEDIACONTROL_NOTPLAYING = 'mediacontrol:notplaying'\n/**\n * Fired when the container was changed\n *\n * @event MEDIACONTROL_CONTAINERCHANGED\n */\nEvents.MEDIACONTROL_CONTAINERCHANGED = 'mediacontrol:containerchanged'\n\n// Core Events\nEvents.CORE_CONTAINERS_CREATED = 'core:containers:created'\n\n\n\n// WEBPACK FOOTER //\n// ./src/base/events.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n/*jshint -W079 */\n\nimport Browser from 'components/browser'\n\nfunction assign(obj, source) {\n if (source) {\n for (const prop in source) {\n const propDescriptor = Object.getOwnPropertyDescriptor(source, prop)\n propDescriptor ? Object.defineProperty(obj, prop, propDescriptor) : obj[prop] = source[prop]\n }\n }\n return obj\n}\n\nexport function extend(parent, properties) {\n class Surrogate extends parent {\n constructor(...args) {\n super(...args)\n if (properties.initialize) {\n properties.initialize.apply(this, args)\n }\n }\n }\n assign(Surrogate.prototype, properties)\n return Surrogate\n}\n\nexport function formatTime(time, paddedHours) {\n if (!isFinite(time)) {\n return '--:--'\n }\n time = time * 1000\n time = parseInt(time/1000)\n const seconds = time % 60\n time = parseInt(time/60)\n const minutes = time % 60\n time = parseInt(time/60)\n const hours = time % 24\n const days = parseInt(time/24)\n let out = ''\n if (days && days > 0) {\n out += days + ':'\n if (hours < 1) {out += '00:'}\n }\n if (hours && hours > 0 || paddedHours) {out += ('0' + hours).slice(-2) + ':'}\n out += ('0' + minutes).slice(-2) + ':'\n out += ('0' + seconds).slice(-2)\n return out.trim()\n}\n\nexport const Fullscreen = {\n isFullscreen: function() {\n return !!(\n document.webkitFullscreenElement ||\n document.webkitIsFullScreen ||\n document.mozFullScreen ||\n document.msFullscreenElement\n )\n },\n requestFullscreen: function(el) {\n if(el.requestFullscreen) {\n el.requestFullscreen()\n } else if(el.webkitRequestFullscreen) {\n el.webkitRequestFullscreen()\n } else if(el.mozRequestFullScreen) {\n el.mozRequestFullScreen()\n } else if(el.msRequestFullscreen) {\n el.msRequestFullscreen()\n } else if (el.querySelector && el.querySelector('video') && el.querySelector('video').webkitEnterFullScreen) {\n el.querySelector('video').webkitEnterFullScreen()\n }\n },\n cancelFullscreen: function() {\n if(document.exitFullscreen) {\n document.exitFullscreen()\n } else if(document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen()\n } else if(document.webkitExitFullscreen) {\n document.webkitExitFullscreen()\n } else if(document.mozCancelFullScreen) {\n document.mozCancelFullScreen()\n } else if(document.msExitFullscreen) {\n document.msExitFullscreen()\n }\n },\n fullscreenEnabled: function() {\n return !!(\n document.fullscreenEnabled ||\n document.webkitFullscreenEnabled ||\n document.mozFullScreenEnabled ||\n document.msFullscreenEnabled\n )\n }\n}\n\nexport class Config {\n\n static _defaultConfig() {\n return {\n volume: {\n value: 100,\n parse: parseInt\n }\n }\n }\n\n static _defaultValueFor(key) {\n try {\n return this._defaultConfig()[key].parse(this._defaultConfig()[key].value)\n } catch(e) {\n return undefined\n }\n }\n\n static _createKeyspace(key){\n return `clappr.${document.domain}.${key}`\n }\n\n static restore(key) {\n if (Browser.hasLocalstorage && localStorage[this._createKeyspace(key)]){\n return this._defaultConfig()[key].parse(localStorage[this._createKeyspace(key)])\n }\n return this._defaultValueFor(key)\n }\n\n static persist(key, value) {\n if (Browser.hasLocalstorage) {\n try {\n localStorage[this._createKeyspace(key)] = value\n return true\n } catch(e) {\n return false\n }\n }\n }\n}\n\nexport class QueryString {\n static get params() {\n const query = window.location.search.substring(1)\n if (query !== this.query) {\n this._urlParams = this.parse(query)\n this.query = query\n }\n return this._urlParams\n }\n\n static get hashParams() {\n const hash = window.location.hash.substring(1)\n if (hash !== this.hash) {\n this._hashParams = this.parse(hash)\n this.hash = hash\n }\n return this._hashParams\n }\n\n static parse(paramsString) {\n let match\n const pl = /\\+/g, // Regex for replacing addition symbol with a space\n search = /([^&=]+)=?([^&]*)/g,\n decode = (s) => decodeURIComponent(s.replace(pl, ' ')),\n params = {}\n while (match = search.exec(paramsString)) { // eslint-disable-line no-cond-assign\n params[decode(match[1]).toLowerCase()] = decode(match[2])\n }\n return params\n }\n}\n\nexport function seekStringToSeconds(paramName = 't') {\n let seconds = 0\n const seekString = QueryString.params[paramName] || QueryString.hashParams[paramName] || ''\n const parts = seekString.match(/[0-9]+[hms]+/g) || []\n if (parts.length > 0) {\n const factor = {'h': 3600, 'm': 60, 's': 1}\n parts.forEach(function(el) {\n if (el) {\n const suffix = el[el.length - 1]\n const time = parseInt(el.slice(0, el.length - 1), 10)\n seconds += time * (factor[suffix])\n }\n })\n } else if (seekString) {\n seconds = parseInt(seekString, 10)\n }\n return seconds\n}\n\nconst idsCounter = {}\n\nexport function uniqueId(prefix) {\n idsCounter[prefix] || (idsCounter[prefix] = 0)\n const id = ++idsCounter[prefix]\n return prefix + id\n}\n\nexport function isNumber(value) {\n return value - parseFloat(value) + 1 >= 0\n}\n\nexport function currentScriptUrl() {\n const scripts = document.getElementsByTagName('script')\n return scripts.length ? scripts[scripts.length - 1].src : ''\n}\n\nexport const requestAnimationFrame = (window.requestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n function(fn) { window.setTimeout(fn, 1000/60) }).bind(window)\n\nexport const cancelAnimationFrame = (window.cancelAnimationFrame ||\n window.mozCancelAnimationFrame ||\n window.webkitCancelAnimationFrame ||\n window.clearTimeout).bind(window)\n\nexport function getBrowserLanguage() {\n return window.navigator && window.navigator.language\n}\n\nexport function now() {\n if (window.performance && window.performance.now) {\n return performance.now()\n }\n return Date.now()\n}\n\n// remove the item from the array if it exists in the array\nexport function removeArrayItem(arr, item) {\n const i = arr.indexOf(item)\n if (i >= 0) {\n arr.splice(i, 1)\n }\n}\n\nexport default {\n Config,\n Fullscreen,\n QueryString,\n extend,\n formatTime,\n seekStringToSeconds,\n uniqueId,\n currentScriptUrl,\n isNumber,\n requestAnimationFrame,\n cancelAnimationFrame,\n getBrowserLanguage,\n now,\n removeArrayItem\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/base/utils.js","import {extend} from './utils'\nimport UIObject from './ui_object'\n\n/**\n * An abstraction to represent a generic playback, it's like an interface to be implemented by subclasses.\n * @class Playback\n * @constructor\n * @extends UIObject\n * @module base\n */\nexport default class Playback extends UIObject {\n /**\n * Determine if the playback does not contain video/has video but video should be ignored.\n * @property isAudioOnly\n * @type Boolean\n */\n get isAudioOnly() {\n return false\n }\n\n /**\n * Determine if the playback has ended.\n * @property ended\n * @type Boolean\n */\n get ended() {\n return false\n }\n\n /**\n * The internationalization plugin.\n * @property i18n\n * @type {Strings}\n */\n get i18n() {\n return this._i18n\n }\n\n /**\n * Determine if the playback is having to buffer in order for\n * playback to be smooth.\n * (i.e if a live stream is playing smoothly, this will be false)\n * @property buffering\n * @type Boolean\n */\n get buffering() {\n return false\n }\n\n /**\n * @method constructor\n * @param {Object} options the options object\n * @param {Strings} i18n the internationalization component\n */\n constructor(options, i18n) {\n super(options)\n this.settings = {}\n this._i18n = i18n\n }\n\n /**\n * plays the playback.\n * @method play\n */\n play() {}\n\n /**\n * pauses the playback.\n * @method pause\n */\n pause() {}\n\n /**\n * stops the playback.\n * @method stop\n */\n stop() {}\n\n /**\n * seeks the playback to a given `time` in seconds\n * @method seek\n * @param {Number} time should be a number between 0 and the video duration\n */\n seek(time) {} // eslint-disable-line no-unused-vars\n\n /**\n * seeks the playback to a given `percentage` in percentage\n * @method seekPercentage\n * @param {Number} time should be a number between 0 and 100\n */\n seekPercentage(percentage) {} // eslint-disable-line no-unused-vars\n\n\n /**\n * The time that \"0\" now represents relative to when playback started.\n * For a stream with a sliding window this will increase as content is\n * removed from the beginning.\n * @method getStartTimeOffset\n * @return {Number} time (in seconds) that time \"0\" represents.\n */\n getStartTimeOffset() { return 0 }\n\n /**\n * gets the duration in seconds\n * @method getDuration\n * @return {Number} duration (in seconds) of the current source\n */\n getDuration() { return 0 }\n\n /**\n * checks if the playback is playing.\n * @method isPlaying\n * @return {Boolean} `true` if the current playback is playing, otherwise `false`\n */\n isPlaying() {\n return false\n }\n\n /**\n * checks if the playback is ready.\n * @property isReady\n * @type {Boolean} `true` if the current playback is ready, otherwise `false`\n */\n get isReady() {\n return false\n }\n\n /**\n * gets the playback type (`'vod', 'live', 'aod'`)\n * @method getPlaybackType\n * @return {String} you should write the playback type otherwise it'll assume `'no_op'`\n * @example\n * ```javascript\n * html5VideoPlayback.getPlaybackType() //vod\n * html5AudioPlayback.getPlaybackType() //aod\n * html5VideoPlayback.getPlaybackType() //live\n * flashHlsPlayback.getPlaybackType() //live\n * ```\n */\n getPlaybackType() {\n return Playback.NO_OP\n }\n\n /**\n * checks if the playback is in HD.\n * @method isHighDefinitionInUse\n * @return {Boolean} `true` if the playback is playing in HD, otherwise `false`\n */\n isHighDefinitionInUse() {\n return false\n }\n\n /**\n * sets the volume for the playback\n * @method volume\n * @param {Number} value a number between 0 (`muted`) to 100 (`max`)\n */\n volume(value) {} // eslint-disable-line no-unused-vars\n\n /**\n * destroys the playback, removing it from DOM\n * @method destroy\n */\n destroy() {\n this.$el.remove()\n }\n}\n\nPlayback.extend = function(properties) {\n return extend(Playback, properties)\n}\n\n/**\n * checks if the playback can play a given `source`\n * If a mimeType is provided then this will be used instead of inferring the mimetype\n * from the source extension.\n * @method canPlay\n * @static\n * @param {String} source the given source ex: `http://example.com/play.mp4`\n * @param {String} [mimeType] the given mime type, ex: `'application/vnd.apple.mpegurl'`\n * @return {Boolean} `true` if the playback is playable, otherwise `false`\n */\nPlayback.canPlay = (source, mimeType) => { // eslint-disable-line no-unused-vars\n return false\n}\n\n/**\n * a playback type for video on demand\n *\n * @property VOD\n * @static\n * @type String\n */\nPlayback.VOD = 'vod'\n/**\n * a playback type for audio on demand\n *\n * @property AOD\n * @static\n * @type String\n */\nPlayback.AOD = 'aod'\n/**\n * a playback type for live video\n *\n * @property LIVE\n * @static\n * @type String\n */\nPlayback.LIVE = 'live'\n/**\n * a default playback type\n *\n * @property NO_OP\n * @static\n * @type String\n */\nPlayback.NO_OP = 'no_op'\n/**\n * the plugin type\n *\n * @property type\n * @static\n * @type String\n */\nPlayback.type = 'playback'\n\n\n\n// WEBPACK FOOTER //\n// ./src/base/playback.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport $ from 'clappr-zepto'\nimport template from './template'\n\nconst Styler = {\n getStyleFor: function(style, options={baseUrl: ''}) {\n return $('<style class=\"clappr-style\"></style>').html(template(style.toString())(options))\n }\n}\n\nexport default Styler\n\n\n\n// WEBPACK FOOTER //\n// ./src/base/styler.js","/* Zepto v1.1.4-80-ga9184b2 - zepto event ajax callbacks deferred touch selector ie - zeptojs.com/license */\nvar Zepto=function(){function D(t){return null==t?String(t):j[S.call(t)]||\"object\"}function L(t){return\"function\"==D(t)}function k(t){return null!=t&&t==t.window}function Z(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function $(t){return\"object\"==D(t)}function F(t){return $(t)&&!k(t)&&Object.getPrototypeOf(t)==Object.prototype}function R(t){return\"number\"==typeof t.length}function q(t){return s.call(t,function(t){return null!=t})}function W(t){return t.length>0?n.fn.concat.apply([],t):t}function z(t){return t.replace(/::/g,\"/\").replace(/([A-Z]+)([A-Z][a-z])/g,\"$1_$2\").replace(/([a-z\\d])([A-Z])/g,\"$1_$2\").replace(/_/g,\"-\").toLowerCase()}function H(t){return t in c?c[t]:c[t]=new RegExp(\"(^|\\\\s)\"+t+\"(\\\\s|$)\")}function _(t,e){return\"number\"!=typeof e||l[z(t)]?e:e+\"px\"}function I(t){var e,n;return f[t]||(e=u.createElement(t),u.body.appendChild(e),n=getComputedStyle(e,\"\").getPropertyValue(\"display\"),e.parentNode.removeChild(e),\"none\"==n&&(n=\"block\"),f[t]=n),f[t]}function U(t){return\"children\"in t?a.call(t.children):n.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function X(t,e){var n,i=t?t.length:0;for(n=0;i>n;n++)this[n]=t[n];this.length=i,this.selector=e||\"\"}function B(n,i,r){for(e in i)r&&(F(i[e])||A(i[e]))?(F(i[e])&&!F(n[e])&&(n[e]={}),A(i[e])&&!A(n[e])&&(n[e]=[]),B(n[e],i[e],r)):i[e]!==t&&(n[e]=i[e])}function V(t,e){return null==e?n(t):n(t).filter(e)}function Y(t,e,n,i){return L(e)?e.call(t,n,i):e}function J(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function G(e,n){var i=e.className||\"\",r=i&&i.baseVal!==t;return n===t?r?i.baseVal:i:void(r?i.baseVal=n:e.className=n)}function K(t){try{return t?\"true\"==t||(\"false\"==t?!1:\"null\"==t?null:+t+\"\"==t?+t:/^[\\[\\{]/.test(t)?n.parseJSON(t):t):t}catch(e){return t}}function Q(t,e){e(t);for(var n=0,i=t.childNodes.length;i>n;n++)Q(t.childNodes[n],e)}var t,e,n,i,N,P,r=[],o=r.concat,s=r.filter,a=r.slice,u=window.document,f={},c={},l={\"column-count\":1,columns:1,\"font-weight\":1,\"line-height\":1,opacity:1,\"z-index\":1,zoom:1},h=/^\\s*<(\\w+|!)[^>]*>/,p=/^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,d=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi,m=/^(?:body|html)$/i,g=/([A-Z])/g,v=[\"val\",\"css\",\"html\",\"text\",\"data\",\"width\",\"height\",\"offset\"],y=[\"after\",\"prepend\",\"before\",\"append\"],w=u.createElement(\"table\"),x=u.createElement(\"tr\"),b={tr:u.createElement(\"tbody\"),tbody:w,thead:w,tfoot:w,td:x,th:x,\"*\":u.createElement(\"div\")},E=/complete|loaded|interactive/,T=/^[\\w-]*$/,j={},S=j.toString,C={},O=u.createElement(\"div\"),M={tabindex:\"tabIndex\",readonly:\"readOnly\",\"for\":\"htmlFor\",\"class\":\"className\",maxlength:\"maxLength\",cellspacing:\"cellSpacing\",cellpadding:\"cellPadding\",rowspan:\"rowSpan\",colspan:\"colSpan\",usemap:\"useMap\",frameborder:\"frameBorder\",contenteditable:\"contentEditable\"},A=Array.isArray||function(t){return t instanceof Array};return C.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var i,r=t.parentNode,o=!r;return o&&(r=O).appendChild(t),i=~C.qsa(r,e).indexOf(t),o&&O.removeChild(t),i},N=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():\"\"})},P=function(t){return s.call(t,function(e,n){return t.indexOf(e)==n})},C.fragment=function(e,i,r){var o,s,f;return p.test(e)&&(o=n(u.createElement(RegExp.$1))),o||(e.replace&&(e=e.replace(d,\"<$1></$2>\")),i===t&&(i=h.test(e)&&RegExp.$1),i in b||(i=\"*\"),f=b[i],f.innerHTML=\"\"+e,o=n.each(a.call(f.childNodes),function(){f.removeChild(this)})),F(r)&&(s=n(o),n.each(r,function(t,e){v.indexOf(t)>-1?s[t](e):s.attr(t,e)})),o},C.Z=function(t,e){return new X(t,e)},C.isZ=function(t){return t instanceof C.Z},C.init=function(e,i){var r;if(!e)return C.Z();if(\"string\"==typeof e)if(e=e.trim(),\"<\"==e[0]&&h.test(e))r=C.fragment(e,RegExp.$1,i),e=null;else{if(i!==t)return n(i).find(e);r=C.qsa(u,e)}else{if(L(e))return n(u).ready(e);if(C.isZ(e))return e;if(A(e))r=q(e);else if($(e))r=[e],e=null;else if(h.test(e))r=C.fragment(e.trim(),RegExp.$1,i),e=null;else{if(i!==t)return n(i).find(e);r=C.qsa(u,e)}}return C.Z(r,e)},n=function(t,e){return C.init(t,e)},n.extend=function(t){var e,n=a.call(arguments,1);return\"boolean\"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){B(t,n,e)}),t},C.qsa=function(t,e){var n,i=\"#\"==e[0],r=!i&&\".\"==e[0],o=i||r?e.slice(1):e,s=T.test(o);return t.getElementById&&s&&i?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:a.call(s&&!i&&t.getElementsByClassName?r?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},n.contains=u.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},n.type=D,n.isFunction=L,n.isWindow=k,n.isArray=A,n.isPlainObject=F,n.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},n.inArray=function(t,e,n){return r.indexOf.call(e,t,n)},n.camelCase=N,n.trim=function(t){return null==t?\"\":String.prototype.trim.call(t)},n.uuid=0,n.support={},n.expr={},n.noop=function(){},n.map=function(t,e){var n,r,o,i=[];if(R(t))for(r=0;r<t.length;r++)n=e(t[r],r),null!=n&&i.push(n);else for(o in t)n=e(t[o],o),null!=n&&i.push(n);return W(i)},n.each=function(t,e){var n,i;if(R(t)){for(n=0;n<t.length;n++)if(e.call(t[n],n,t[n])===!1)return t}else for(i in t)if(e.call(t[i],i,t[i])===!1)return t;return t},n.grep=function(t,e){return s.call(t,e)},window.JSON&&(n.parseJSON=JSON.parse),n.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"),function(t,e){j[\"[object \"+e+\"]\"]=e.toLowerCase()}),n.fn={constructor:C.Z,length:0,forEach:r.forEach,reduce:r.reduce,push:r.push,sort:r.sort,splice:r.splice,indexOf:r.indexOf,concat:function(){var t,e,n=[];for(t=0;t<arguments.length;t++)e=arguments[t],n[t]=C.isZ(e)?e.toArray():e;return o.apply(C.isZ(this)?this.toArray():this,n)},map:function(t){return n(n.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return n(a.apply(this,arguments))},ready:function(t){return E.test(u.readyState)&&u.body?t(n):u.addEventListener(\"DOMContentLoaded\",function(){t(n)},!1),this},get:function(e){return e===t?a.call(this):this[e>=0?e:e+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return r.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return L(t)?this.not(this.not(t)):n(s.call(this,function(e){return C.matches(e,t)}))},add:function(t,e){return n(P(this.concat(n(t,e))))},is:function(t){return this.length>0&&C.matches(this[0],t)},not:function(e){var i=[];if(L(e)&&e.call!==t)this.each(function(t){e.call(this,t)||i.push(this)});else{var r=\"string\"==typeof e?this.filter(e):R(e)&&L(e.item)?a.call(e):n(e);this.forEach(function(t){r.indexOf(t)<0&&i.push(t)})}return n(i)},has:function(t){return this.filter(function(){return $(t)?n.contains(this,t):n(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!$(t)?t:n(t)},last:function(){var t=this[this.length-1];return t&&!$(t)?t:n(t)},find:function(t){var e,i=this;return e=t?\"object\"==typeof t?n(t).filter(function(){var t=this;return r.some.call(i,function(e){return n.contains(e,t)})}):1==this.length?n(C.qsa(this[0],t)):this.map(function(){return C.qsa(this,t)}):n()},closest:function(t,e){var i=this[0],r=!1;for(\"object\"==typeof t&&(r=n(t));i&&!(r?r.indexOf(i)>=0:C.matches(i,t));)i=i!==e&&!Z(i)&&i.parentNode;return n(i)},parents:function(t){for(var e=[],i=this;i.length>0;)i=n.map(i,function(t){return(t=t.parentNode)&&!Z(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return V(e,t)},parent:function(t){return V(P(this.pluck(\"parentNode\")),t)},children:function(t){return V(this.map(function(){return U(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||a.call(this.childNodes)})},siblings:function(t){return V(this.map(function(t,e){return s.call(U(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=\"\"})},pluck:function(t){return n.map(this,function(e){return e[t]})},show:function(){return this.each(function(){\"none\"==this.style.display&&(this.style.display=\"\"),\"none\"==getComputedStyle(this,\"\").getPropertyValue(\"display\")&&(this.style.display=I(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var e=L(t);if(this[0]&&!e)var i=n(t).get(0),r=i.parentNode||this.length>1;return this.each(function(o){n(this).wrapAll(e?t.call(this,o):r?i.cloneNode(!0):i)})},wrapAll:function(t){if(this[0]){n(this[0]).before(t=n(t));for(var e;(e=t.children()).length;)t=e.first();n(t).append(this)}return this},wrapInner:function(t){var e=L(t);return this.each(function(i){var r=n(this),o=r.contents(),s=e?t.call(this,i):t;o.length?o.wrapAll(s):r.append(s)})},unwrap:function(){return this.parent().each(function(){n(this).replaceWith(n(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css(\"display\",\"none\")},toggle:function(e){return this.each(function(){var i=n(this);(e===t?\"none\"==i.css(\"display\"):e)?i.show():i.hide()})},prev:function(t){return n(this.pluck(\"previousElementSibling\")).filter(t||\"*\")},next:function(t){return n(this.pluck(\"nextElementSibling\")).filter(t||\"*\")},html:function(t){return 0 in arguments?this.each(function(e){var i=this.innerHTML;n(this).empty().append(Y(this,t,e,i))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=Y(this,t,e,this.textContent);this.textContent=null==n?\"\":\"\"+n}):0 in this?this[0].textContent:null},attr:function(n,i){var r;return\"string\"!=typeof n||1 in arguments?this.each(function(t){if(1===this.nodeType)if($(n))for(e in n)J(this,e,n[e]);else J(this,n,Y(this,i,t,this.getAttribute(n)))}):this.length&&1===this[0].nodeType?!(r=this[0].getAttribute(n))&&n in this[0]?this[0][n]:r:t},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(\" \").forEach(function(t){J(this,t)},this)})},prop:function(t,e){return t=M[t]||t,1 in arguments?this.each(function(n){this[t]=Y(this,e,n,this[t])}):this[0]&&this[0][t]},data:function(e,n){var i=\"data-\"+e.replace(g,\"-$1\").toLowerCase(),r=1 in arguments?this.attr(i,n):this.attr(i);return null!==r?K(r):t},val:function(t){return 0 in arguments?this.each(function(e){this.value=Y(this,t,e,this.value)}):this[0]&&(this[0].multiple?n(this[0]).find(\"option\").filter(function(){return this.selected}).pluck(\"value\"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var i=n(this),r=Y(this,t,e,i.offset()),o=i.offsetParent().offset(),s={top:r.top-o.top,left:r.left-o.left};\"static\"==i.css(\"position\")&&(s.position=\"relative\"),i.css(s)});if(!this.length)return null;if(!n.contains(u.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(t,i){if(arguments.length<2){var r,o=this[0];if(!o)return;if(r=getComputedStyle(o,\"\"),\"string\"==typeof t)return o.style[N(t)]||r.getPropertyValue(t);if(A(t)){var s={};return n.each(t,function(t,e){s[e]=o.style[N(e)]||r.getPropertyValue(e)}),s}}var a=\"\";if(\"string\"==D(t))i||0===i?a=z(t)+\":\"+_(t,i):this.each(function(){this.style.removeProperty(z(t))});else for(e in t)t[e]||0===t[e]?a+=z(e)+\":\"+_(e,t[e])+\";\":this.each(function(){this.style.removeProperty(z(e))});return this.each(function(){this.style.cssText+=\";\"+a})},index:function(t){return t?this.indexOf(n(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?r.some.call(this,function(t){return this.test(G(t))},H(t)):!1},addClass:function(t){return t?this.each(function(e){if(\"className\"in this){i=[];var r=G(this),o=Y(this,t,e,r);o.split(/\\s+/g).forEach(function(t){n(this).hasClass(t)||i.push(t)},this),i.length&&G(this,r+(r?\" \":\"\")+i.join(\" \"))}}):this},removeClass:function(e){return this.each(function(n){if(\"className\"in this){if(e===t)return G(this,\"\");i=G(this),Y(this,e,n,i).split(/\\s+/g).forEach(function(t){i=i.replace(H(t),\" \")}),G(this,i.trim())}})},toggleClass:function(e,i){return e?this.each(function(r){var o=n(this),s=Y(this,e,r,G(this));s.split(/\\s+/g).forEach(function(e){(i===t?!o.hasClass(e):i)?o.addClass(e):o.removeClass(e)})}):this},scrollTop:function(e){if(this.length){var n=\"scrollTop\"in this[0];return e===t?n?this[0].scrollTop:this[0].pageYOffset:this.each(n?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var n=\"scrollLeft\"in this[0];return e===t?n?this[0].scrollLeft:this[0].pageXOffset:this.each(n?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),i=this.offset(),r=m.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat(n(t).css(\"margin-top\"))||0,i.left-=parseFloat(n(t).css(\"margin-left\"))||0,r.top+=parseFloat(n(e[0]).css(\"border-top-width\"))||0,r.left+=parseFloat(n(e[0]).css(\"border-left-width\"))||0,{top:i.top-r.top,left:i.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||u.body;t&&!m.test(t.nodeName)&&\"static\"==n(t).css(\"position\");)t=t.offsetParent;return t})}},n.fn.detach=n.fn.remove,[\"width\",\"height\"].forEach(function(e){var i=e.replace(/./,function(t){return t[0].toUpperCase()});n.fn[e]=function(r){var o,s=this[0];return r===t?k(s)?s[\"inner\"+i]:Z(s)?s.documentElement[\"scroll\"+i]:(o=this.offset())&&o[e]:this.each(function(t){s=n(this),s.css(e,Y(this,r,t,s[e]()))})}}),y.forEach(function(t,e){var i=e%2;n.fn[t]=function(){var t,o,r=n.map(arguments,function(e){return t=D(e),\"object\"==t||\"array\"==t||null==e?e:C.fragment(e)}),s=this.length>1;return r.length<1?this:this.each(function(t,a){o=i?a:a.parentNode,a=0==e?a.nextSibling:1==e?a.firstChild:2==e?a:null;var f=n.contains(u.documentElement,o);r.forEach(function(t){if(s)t=t.cloneNode(!0);else if(!o)return n(t).remove();o.insertBefore(t,a),f&&Q(t,function(t){null==t.nodeName||\"SCRIPT\"!==t.nodeName.toUpperCase()||t.type&&\"text/javascript\"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},n.fn[i?t+\"To\":\"insert\"+(e?\"Before\":\"After\")]=function(e){return n(e)[t](this),this}}),C.Z.prototype=X.prototype=n.fn,C.uniq=P,C.deserializeValue=K,n.zepto=C,n}();window.Zepto=Zepto,void 0===window.$&&(window.$=Zepto),function(t){function l(t){return t._zid||(t._zid=e++)}function h(t,e,n,i){if(e=p(e),e.ns)var r=d(e.ns);return(s[l(t)]||[]).filter(function(t){return!(!t||e.e&&t.e!=e.e||e.ns&&!r.test(t.ns)||n&&l(t.fn)!==l(n)||i&&t.sel!=i)})}function p(t){var e=(\"\"+t).split(\".\");return{e:e[0],ns:e.slice(1).sort().join(\" \")}}function d(t){return new RegExp(\"(?:^| )\"+t.replace(\" \",\" .* ?\")+\"(?: |$)\")}function m(t,e){return t.del&&!u&&t.e in f||!!e}function g(t){return c[t]||u&&f[t]||t}function v(e,i,r,o,a,u,f){var h=l(e),d=s[h]||(s[h]=[]);i.split(/\\s/).forEach(function(i){if(\"ready\"==i)return t(document).ready(r);var s=p(i);s.fn=r,s.sel=a,s.e in c&&(r=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?s.fn.apply(this,arguments):void 0}),s.del=u;var l=u||r;s.proxy=function(t){if(t=T(t),!t.isImmediatePropagationStopped()){t.data=o;var i=l.apply(e,t._args==n?[t]:[t].concat(t._args));return i===!1&&(t.preventDefault(),t.stopPropagation()),i}},s.i=d.length,d.push(s),\"addEventListener\"in e&&e.addEventListener(g(s.e),s.proxy,m(s,f))})}function y(t,e,n,i,r){var o=l(t);(e||\"\").split(/\\s/).forEach(function(e){h(t,e,n,i).forEach(function(e){delete s[o][e.i],\"removeEventListener\"in t&&t.removeEventListener(g(e.e),e.proxy,m(e,r))})})}function T(e,i){return(i||!e.isDefaultPrevented)&&(i||(i=e),t.each(E,function(t,n){var r=i[t];e[t]=function(){return this[n]=w,r&&r.apply(i,arguments)},e[n]=x}),(i.defaultPrevented!==n?i.defaultPrevented:\"returnValue\"in i?i.returnValue===!1:i.getPreventDefault&&i.getPreventDefault())&&(e.isDefaultPrevented=w)),e}function j(t){var e,i={originalEvent:t};for(e in t)b.test(e)||t[e]===n||(i[e]=t[e]);return T(i,t)}var n,e=1,i=Array.prototype.slice,r=t.isFunction,o=function(t){return\"string\"==typeof t},s={},a={},u=\"onfocusin\"in window,f={focus:\"focusin\",blur:\"focusout\"},c={mouseenter:\"mouseover\",mouseleave:\"mouseout\"};a.click=a.mousedown=a.mouseup=a.mousemove=\"MouseEvents\",t.event={add:v,remove:y},t.proxy=function(e,n){var s=2 in arguments&&i.call(arguments,2);if(r(e)){var a=function(){return e.apply(n,s?s.concat(i.call(arguments)):arguments)};return a._zid=l(e),a}if(o(n))return s?(s.unshift(e[n],e),t.proxy.apply(null,s)):t.proxy(e[n],e);throw new TypeError(\"expected function\")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,i){return this.on(t,e,n,i,1)};var w=function(){return!0},x=function(){return!1},b=/^([A-Z]|returnValue$|layer[XY]$)/,E={preventDefault:\"isDefaultPrevented\",stopImmediatePropagation:\"isImmediatePropagationStopped\",stopPropagation:\"isPropagationStopped\"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,s,a,u,f){var c,l,h=this;return e&&!o(e)?(t.each(e,function(t,e){h.on(t,s,a,e,f)}),h):(o(s)||r(u)||u===!1||(u=a,a=s,s=n),(u===n||a===!1)&&(u=a,a=n),u===!1&&(u=x),h.each(function(n,r){f&&(c=function(t){return y(r,t.type,u),u.apply(this,arguments)}),s&&(l=function(e){var n,o=t(e.target).closest(s,r).get(0);return o&&o!==r?(n=t.extend(j(e),{currentTarget:o,liveFired:r}),(c||u).apply(o,[n].concat(i.call(arguments,1)))):void 0}),v(r,e,u,a,s,l||c)}))},t.fn.off=function(e,i,s){var a=this;return e&&!o(e)?(t.each(e,function(t,e){a.off(t,i,e)}),a):(o(i)||r(s)||s===!1||(s=i,i=n),s===!1&&(s=x),a.each(function(){y(this,e,s,i)}))},t.fn.trigger=function(e,n){return e=o(e)||t.isPlainObject(e)?t.Event(e):T(e),e._args=n,this.each(function(){e.type in f&&\"function\"==typeof this[e.type]?this[e.type]():\"dispatchEvent\"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,n){var i,r;return this.each(function(s,a){i=j(o(e)?t.Event(e):e),i._args=n,i.target=a,t.each(h(a,e.type||e),function(t,e){return r=e.proxy(i),i.isImmediatePropagationStopped()?!1:void 0})}),r},\"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error\".split(\" \").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){o(t)||(e=t,t=e.type);var n=document.createEvent(a[t]||\"Events\"),i=!0;if(e)for(var r in e)\"bubbles\"==r?i=!!e[r]:n[r]=e[r];return n.initEvent(t,i,!0),T(n)}}(Zepto),function(t){function h(e,n,i){var r=t.Event(n);return t(e).trigger(r,i),!r.isDefaultPrevented()}function p(t,e,i,r){return t.global?h(e||n,i,r):void 0}function d(e){e.global&&0===t.active++&&p(e,null,\"ajaxStart\")}function m(e){e.global&&!--t.active&&p(e,null,\"ajaxStop\")}function g(t,e){var n=e.context;return e.beforeSend.call(n,t,e)===!1||p(e,n,\"ajaxBeforeSend\",[t,e])===!1?!1:void p(e,n,\"ajaxSend\",[t,e])}function v(t,e,n,i){var r=n.context,o=\"success\";n.success.call(r,t,o,e),i&&i.resolveWith(r,[t,o,e]),p(n,r,\"ajaxSuccess\",[e,n,t]),w(o,e,n)}function y(t,e,n,i,r){var o=i.context;i.error.call(o,n,e,t),r&&r.rejectWith(o,[n,e,t]),p(i,o,\"ajaxError\",[n,i,t||e]),w(e,n,i)}function w(t,e,n){var i=n.context;n.complete.call(i,e,t),p(n,i,\"ajaxComplete\",[e,n]),m(n)}function x(){}function b(t){return t&&(t=t.split(\";\",2)[0]),t&&(t==f?\"html\":t==u?\"json\":s.test(t)?\"script\":a.test(t)&&\"xml\")||\"text\"}function E(t,e){return\"\"==e?t:(t+\"&\"+e).replace(/[&?]{1,2}/,\"?\")}function T(e){e.processData&&e.data&&\"string\"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&\"GET\"!=e.type.toUpperCase()||(e.url=E(e.url,e.data),e.data=void 0)}function j(e,n,i,r){return t.isFunction(n)&&(r=i,i=n,n=void 0),t.isFunction(i)||(r=i,i=void 0),{url:e,data:n,success:i,dataType:r}}function C(e,n,i,r){var o,s=t.isArray(n),a=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),r&&(n=i?r:r+\"[\"+(a||\"object\"==o||\"array\"==o?n:\"\")+\"]\"),!r&&s?e.add(u.name,u.value):\"array\"==o||!i&&\"object\"==o?C(e,u,i,n):e.add(n,u)})}var i,r,e=0,n=window.document,o=/<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi,s=/^(?:text|application)\\/javascript/i,a=/^(?:text|application)\\/xml/i,u=\"application/json\",f=\"text/html\",c=/^\\s*$/,l=n.createElement(\"a\");l.href=window.location.href,t.active=0,t.ajaxJSONP=function(i,r){if(!(\"type\"in i))return t.ajax(i);var f,h,o=i.jsonpCallback,s=(t.isFunction(o)?o():o)||\"jsonp\"+ ++e,a=n.createElement(\"script\"),u=window[s],c=function(e){t(a).triggerHandler(\"error\",e||\"abort\")},l={abort:c};return r&&r.promise(l),t(a).on(\"load error\",function(e,n){clearTimeout(h),t(a).off().remove(),\"error\"!=e.type&&f?v(f[0],l,i,r):y(null,n||\"error\",l,i,r),window[s]=u,f&&t.isFunction(u)&&u(f[0]),u=f=void 0}),g(l,i)===!1?(c(\"abort\"),l):(window[s]=function(){f=arguments},a.src=i.url.replace(/\\?(.+)=\\?/,\"?$1=\"+s),n.head.appendChild(a),i.timeout>0&&(h=setTimeout(function(){c(\"timeout\")},i.timeout)),l)},t.ajaxSettings={type:\"GET\",beforeSend:x,success:x,error:x,complete:x,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:\"text/javascript, application/javascript, application/x-javascript\",json:u,xml:\"application/xml, text/xml\",html:f,text:\"text/plain\"},crossDomain:!1,timeout:0,processData:!0,cache:!0},t.ajax=function(e){var a,u,o=t.extend({},e||{}),s=t.Deferred&&t.Deferred();for(i in t.ajaxSettings)void 0===o[i]&&(o[i]=t.ajaxSettings[i]);d(o),o.crossDomain||(a=n.createElement(\"a\"),a.href=o.url,a.href=a.href,o.crossDomain=l.protocol+\"//\"+l.host!=a.protocol+\"//\"+a.host),o.url||(o.url=window.location.toString()),(u=o.url.indexOf(\"#\"))>-1&&(o.url=o.url.slice(0,u)),T(o);var f=o.dataType,h=/\\?.+=\\?/.test(o.url);if(h&&(f=\"jsonp\"),o.cache!==!1&&(e&&e.cache===!0||\"script\"!=f&&\"jsonp\"!=f)||(o.url=E(o.url,\"_=\"+Date.now())),\"jsonp\"==f)return h||(o.url=E(o.url,o.jsonp?o.jsonp+\"=?\":o.jsonp===!1?\"\":\"callback=?\")),t.ajaxJSONP(o,s);var N,p=o.accepts[f],m={},w=function(t,e){m[t.toLowerCase()]=[t,e]},j=/^([\\w-]+:)\\/\\//.test(o.url)?RegExp.$1:window.location.protocol,S=o.xhr(),C=S.setRequestHeader;if(s&&s.promise(S),o.crossDomain||w(\"X-Requested-With\",\"XMLHttpRequest\"),w(\"Accept\",p||\"*/*\"),(p=o.mimeType||p)&&(p.indexOf(\",\")>-1&&(p=p.split(\",\",2)[0]),S.overrideMimeType&&S.overrideMimeType(p)),(o.contentType||o.contentType!==!1&&o.data&&\"GET\"!=o.type.toUpperCase())&&w(\"Content-Type\",o.contentType||\"application/x-www-form-urlencoded\"),o.headers)for(r in o.headers)w(r,o.headers[r]);if(S.setRequestHeader=w,S.onreadystatechange=function(){if(4==S.readyState){S.onreadystatechange=x,clearTimeout(N);var e,n=!1;if(S.status>=200&&S.status<300||304==S.status||0==S.status&&\"file:\"==j){f=f||b(o.mimeType||S.getResponseHeader(\"content-type\")),e=S.responseText;try{\"script\"==f?(1,eval)(e):\"xml\"==f?e=S.responseXML:\"json\"==f&&(e=c.test(e)?null:t.parseJSON(e))}catch(i){n=i}n?y(n,\"parsererror\",S,o,s):v(e,S,o,s)}else y(S.statusText||null,S.status?\"error\":\"abort\",S,o,s)}},g(S,o)===!1)return S.abort(),y(null,\"abort\",S,o,s),S;if(o.xhrFields)for(r in o.xhrFields)S[r]=o.xhrFields[r];var P=\"async\"in o?o.async:!0;S.open(o.type,o.url,P,o.username,o.password);for(r in m)C.apply(S,m[r]);return o.timeout>0&&(N=setTimeout(function(){S.onreadystatechange=x,S.abort(),y(null,\"timeout\",S,o,s)},o.timeout)),S.send(o.data?o.data:null),S},t.get=function(){return t.ajax(j.apply(null,arguments))},t.post=function(){var e=j.apply(null,arguments);return e.type=\"POST\",t.ajax(e)},t.getJSON=function(){var e=j.apply(null,arguments);return e.dataType=\"json\",t.ajax(e)},t.fn.load=function(e,n,i){if(!this.length)return this;var a,r=this,s=e.split(/\\s/),u=j(e,n,i),f=u.success;return s.length>1&&(u.url=s[0],a=s[1]),u.success=function(e){r.html(a?t(\"<div>\").html(e.replace(o,\"\")).find(a):e),f&&f.apply(r,arguments)},t.ajax(u),this};var S=encodeURIComponent;t.param=function(e,n){var i=[];return i.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=\"\"),this.push(S(e)+\"=\"+S(n))},C(i,e,n),i.join(\"&\").replace(/%20/g,\"+\")}}(Zepto),function(t){t.Callbacks=function(e){e=t.extend({},e);var n,i,r,o,s,a,u=[],f=!e.once&&[],c=function(t){for(n=e.memory&&t,i=!0,a=o||0,o=0,s=u.length,r=!0;u&&s>a;++a)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}r=!1,u&&(f?f.length&&c(f.shift()):n?u.length=0:l.disable())},l={add:function(){if(u){var i=u.length,a=function(n){t.each(n,function(t,n){\"function\"==typeof n?e.unique&&l.has(n)||u.push(n):n&&n.length&&\"string\"!=typeof n&&a(n)})};a(arguments),r?s=u.length:n&&(o=i,c(n))}return this},remove:function(){return u&&t.each(arguments,function(e,n){for(var i;(i=t.inArray(n,u,i))>-1;)u.splice(i,1),r&&(s>=i&&--s,a>=i&&--a)}),this},has:function(e){return!(!u||!(e?t.inArray(e,u)>-1:u.length))},empty:function(){return s=u.length=0,this},disable:function(){return u=f=n=void 0,this},disabled:function(){return!u},lock:function(){return f=void 0,n||l.disable(),this},locked:function(){return!f},fireWith:function(t,e){return!u||i&&!f||(e=e||[],e=[t,e.slice?e.slice():e],r?f.push(e):c(e)),this},fire:function(){return l.fireWith(this,arguments)},fired:function(){return!!i}};return l}}(Zepto),function(t){function n(e){var i=[[\"resolve\",\"done\",t.Callbacks({once:1,memory:1}),\"resolved\"],[\"reject\",\"fail\",t.Callbacks({once:1,memory:1}),\"rejected\"],[\"notify\",\"progress\",t.Callbacks({memory:1})]],r=\"pending\",o={state:function(){return r},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var e=arguments;return n(function(n){t.each(i,function(i,r){var a=t.isFunction(e[i])&&e[i];s[r[1]](function(){var e=a&&a.apply(this,arguments);if(e&&t.isFunction(e.promise))e.promise().done(n.resolve).fail(n.reject).progress(n.notify);else{var i=this===o?n.promise():this,s=a?[e]:arguments;n[r[0]+\"With\"](i,s)}})}),e=null}).promise()},promise:function(e){return null!=e?t.extend(e,o):o}},s={};return t.each(i,function(t,e){var n=e[2],a=e[3];o[e[1]]=n.add,a&&n.add(function(){r=a},i[1^t][2].disable,i[2][2].lock),s[e[0]]=function(){return s[e[0]+\"With\"](this===s?o:this,arguments),this},s[e[0]+\"With\"]=n.fireWith}),o.promise(s),e&&e.call(s,s),s}var e=Array.prototype.slice;t.when=function(i){var f,c,l,r=e.call(arguments),o=r.length,s=0,a=1!==o||i&&t.isFunction(i.promise)?o:0,u=1===a?i:n(),h=function(t,n,i){return function(r){n[t]=this,i[t]=arguments.length>1?e.call(arguments):r,i===f?u.notifyWith(n,i):--a||u.resolveWith(n,i)}};if(o>1)for(f=new Array(o),c=new Array(o),l=new Array(o);o>s;++s)r[s]&&t.isFunction(r[s].promise)?r[s].promise().done(h(s,l,r)).fail(u.reject).progress(h(s,c,f)):--a;return a||u.resolveWith(l,r),u.promise()},t.Deferred=n}(Zepto),function(t){function u(t,e,n,i){return Math.abs(t-e)>=Math.abs(n-i)?t-e>0?\"Left\":\"Right\":n-i>0?\"Up\":\"Down\"}function f(){o=null,e.last&&(e.el.trigger(\"longTap\"),e={})}function c(){o&&clearTimeout(o),o=null}function l(){n&&clearTimeout(n),i&&clearTimeout(i),r&&clearTimeout(r),o&&clearTimeout(o),n=i=r=o=null,e={}}function h(t){return(\"touch\"==t.pointerType||t.pointerType==t.MSPOINTER_TYPE_TOUCH)&&t.isPrimary}function p(t,e){return t.type==\"pointer\"+e||t.type.toLowerCase()==\"mspointer\"+e}var n,i,r,o,a,e={},s=750;t(document).ready(function(){var d,m,y,w,g=0,v=0;\"MSGesture\"in window&&(a=new MSGesture,a.target=document.body),t(document).bind(\"MSGestureEnd\",function(t){var n=t.velocityX>1?\"Right\":t.velocityX<-1?\"Left\":t.velocityY>1?\"Down\":t.velocityY<-1?\"Up\":null;n&&(e.el.trigger(\"swipe\"),e.el.trigger(\"swipe\"+n))}).on(\"touchstart MSPointerDown pointerdown\",function(i){(!(w=p(i,\"down\"))||h(i))&&(y=w?i:i.touches[0],i.touches&&1===i.touches.length&&e.x2&&(e.x2=void 0,e.y2=void 0),d=Date.now(),m=d-(e.last||d),e.el=t(\"tagName\"in y.target?y.target:y.target.parentNode),n&&clearTimeout(n),e.x1=y.pageX,e.y1=y.pageY,m>0&&250>=m&&(e.isDoubleTap=!0),e.last=d,o=setTimeout(f,s),a&&w&&a.addPointer(i.pointerId))}).on(\"touchmove MSPointerMove pointermove\",function(t){(!(w=p(t,\"move\"))||h(t))&&(y=w?t:t.touches[0],c(),e.x2=y.pageX,e.y2=y.pageY,g+=Math.abs(e.x1-e.x2),v+=Math.abs(e.y1-e.y2))}).on(\"touchend MSPointerUp pointerup\",function(o){(!(w=p(o,\"up\"))||h(o))&&(c(),e.x2&&Math.abs(e.x1-e.x2)>30||e.y2&&Math.abs(e.y1-e.y2)>30?r=setTimeout(function(){e.el.trigger(\"swipe\"),e.el.trigger(\"swipe\"+u(e.x1,e.x2,e.y1,e.y2)),e={}},0):\"last\"in e&&(30>g&&30>v?i=setTimeout(function(){var i=t.Event(\"tap\");i.cancelTouch=l,e.el.trigger(i),e.isDoubleTap?(e.el&&e.el.trigger(\"doubleTap\"),e={}):n=setTimeout(function(){n=null,e.el&&e.el.trigger(\"singleTap\"),e={}},250)},0):e={}),g=v=0)}).on(\"touchcancel MSPointerCancel pointercancel\",l),t(window).on(\"scroll\",l)}),[\"swipe\",\"swipeLeft\",\"swipeRight\",\"swipeUp\",\"swipeDown\",\"doubleTap\",\"tap\",\"singleTap\",\"longTap\"].forEach(function(e){t.fn[e]=function(t){return this.on(e,t)}})}(Zepto),function(t){function r(e){return e=t(e),!(!e.width()&&!e.height())&&\"none\"!==e.css(\"display\")}function f(t,e){t=t.replace(/=#\\]/g,'=\"#\"]');var n,i,r=s.exec(t);if(r&&r[2]in o&&(n=o[r[2]],i=r[3],t=r[1],i)){var a=Number(i);i=isNaN(a)?i.replace(/^[\"']|[\"']$/g,\"\"):a}return e(t,n,i)}var e=t.zepto,n=e.qsa,i=e.matches,o=t.expr[\":\"]={visible:function(){return r(this)?this:void 0},hidden:function(){return r(this)?void 0:this},selected:function(){return this.selected?this:void 0},checked:function(){return this.checked?this:void 0},parent:function(){return this.parentNode},first:function(t){return 0===t?this:void 0},last:function(t,e){return t===e.length-1?this:void 0},eq:function(t,e,n){return t===n?this:void 0},contains:function(e,n,i){return t(this).text().indexOf(i)>-1?this:void 0},has:function(t,n,i){return e.qsa(this,i).length?this:void 0}},s=new RegExp(\"(.*):(\\\\w+)(?:\\\\(([^)]+)\\\\))?$\\\\s*\"),a=/^\\s*>/,u=\"Zepto\"+ +new Date;e.qsa=function(i,r){return f(r,function(o,s,f){try{var c;!o&&s?o=\"*\":a.test(o)&&(c=t(i).addClass(u),o=\".\"+u+\" \"+o);var l=n(i,o)}catch(h){throw console.error(\"error performing selector: %o\",r),h}finally{c&&c.removeClass(u)}return s?e.uniq(t.map(l,function(t,e){return s.call(t,e,l,f)})):l})},e.matches=function(t,e){return f(e,function(e,n,r){return!(e&&!i(t,e)||n&&n.call(t,null,r)!==t)})}}(Zepto),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t){try{return e(t)}catch(n){return null}}}}();\nmodule.exports = Zepto;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/clappr-zepto/zepto.min.js\n// module id = 5\n// module chunks = 0","/* eslint-disable no-var */\n// Simple JavaScript Templating\n// Paul Miller (http://paulmillr.com)\n// http://underscorejs.org\n// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\n// By default, Underscore uses ERB-style template delimiters, change the\n// following template settings to use alternative delimiters.\nvar settings = {\n evaluate : /<%([\\s\\S]+?)%>/g,\n interpolate : /<%=([\\s\\S]+?)%>/g,\n escape : /<%-([\\s\\S]+?)%>/g\n}\n\n// When customizing `templateSettings`, if you don't want to define an\n// interpolation, evaluation or escaping regex, we need one that is\n// guaranteed not to match.\nvar noMatch = /(.)^/\n\n// Certain characters need to be escaped so that they can be put into a\n// string literal.\nvar escapes = {\n '\\'': '\\'',\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\t': 't',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n}\n\nvar escaper = /\\\\|'|\\r|\\n|\\t|\\u2028|\\u2029/g\n\n// List of HTML entities for escaping.\nvar htmlEntities = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n '\\'': '&#x27;'\n}\n\nvar entityRe = new RegExp('[&<>\"\\']', 'g')\n\nvar escapeExpr = function(string) {\n if (string === null) {return ''}\n return ('' + string).replace(entityRe, function(match) {\n return htmlEntities[match]\n })\n}\n\nvar counter = 0\n\n// JavaScript micro-templating, similar to John Resig's implementation.\n// Underscore templating handles arbitrary delimiters, preserves whitespace,\n// and correctly escapes quotes within interpolated code.\nvar tmpl = function(text, data) {\n var render\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = new RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g')\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0\n var source = '__p+=\\''\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset)\n .replace(escaper, function(match) { return '\\\\' + escapes[match] })\n\n if (escape) {\n source += '\\'+\\n((__t=(' + escape + '))==null?\\'\\':escapeExpr(__t))+\\n\\''\n }\n if (interpolate) {\n source += '\\'+\\n((__t=(' + interpolate + '))==null?\\'\\':__t)+\\n\\''\n }\n if (evaluate) {\n source += '\\';\\n' + evaluate + '\\n__p+=\\''\n }\n index = offset + match.length\n return match\n })\n source += '\\';\\n'\n\n // If a variable is not specified, place data values in local scope.\n if (!settings.variable) {source = 'with(obj||{}){\\n' + source + '}\\n'}\n\n source = 'var __t,__p=\\'\\',__j=Array.prototype.join,' +\n 'print=function(){__p+=__j.call(arguments,\\'\\');};\\n' +\n source + 'return __p;\\n//# sourceURL=/microtemplates/source[' + counter++ + ']'\n\n try {\n /*jshint -W054 */\n // TODO: find a way to avoid eval\n render = new Function(settings.variable || 'obj', 'escapeExpr', source)\n } catch (e) {\n e.source = source\n throw e\n }\n\n if (data) {return render(data, escapeExpr)}\n var template = function(data) {\n return render.call(this, data, escapeExpr)\n }\n\n // Provide the compiled function source as a convenience for precompilation.\n template.source = 'function(' + (settings.variable || 'obj') + '){\\n' + source + '}'\n\n return template\n}\ntmpl.settings = settings\n\nmodule.exports = tmpl\n\n\n\n// WEBPACK FOOTER //\n// ./src/base/template.js","/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/css-loader/lib/css-base.js\n// module id = 7\n// module chunks = 0","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nconst Browser = {}\n\nconst hasLocalstorage = function(){\n try {\n localStorage.setItem('clappr', 'clappr')\n localStorage.removeItem('clappr')\n return true\n } catch(e) {\n return false\n }\n}\n\nconst hasFlash = function() {\n try {\n const fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash')\n return !!fo\n } catch (e) {\n return !!(navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash'] !== undefined &&\n navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin)\n }\n}\n\nconst getBrowserInfo = function() {\n const ua = navigator.userAgent\n let parts = ua.match(/\\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [],\n extra\n if (/trident/i.test(parts[1])) {\n extra = /\\brv[ :]+(\\d+)/g.exec(ua) || []\n return { name: 'IE', version: parseInt(extra[1] || '') }\n } else if (parts[1] === 'Chrome' ) {\n extra = ua.match(/\\bOPR\\/(\\d+)/)\n if (extra != null) {\n return { name:'Opera', version: parseInt(extra[1]) }\n }\n }\n parts = parts[2] ? [parts[1], parts[2]] : [navigator.appName, navigator.appVersion, '-?']\n\n if ((extra = ua.match(/version\\/(\\d+)/i))) {\n parts.splice(1, 1, extra[1])\n }\n return { name: parts[0], version: parseInt(parts[1]) }\n}\n\nconst browserInfo = getBrowserInfo()\n\nBrowser.isSafari = /safari/i.test(navigator.userAgent) && navigator.userAgent.indexOf('Chrome') === -1\nBrowser.isChrome = /chrome/i.test(navigator.userAgent)\nBrowser.isFirefox = /firefox/i.test(navigator.userAgent)\nBrowser.isLegacyIE = !!(window.ActiveXObject)\nBrowser.isIE = Browser.isLegacyIE || /trident.*rv:1\\d/i.test(navigator.userAgent)\nBrowser.isIE11 = /trident.*rv:11/i.test(navigator.userAgent)\nBrowser.isChromecast = Browser.isChrome && /CrKey/i.test(navigator.userAgent)\nBrowser.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone|IEMobile|Opera Mini/i.test(navigator.userAgent)\nBrowser.isiOS = /iPad|iPhone|iPod/i.test(navigator.userAgent)\nBrowser.isAndroid = /Android/i.test(navigator.userAgent)\nBrowser.isWindowsPhone = /Windows Phone/i.test(navigator.userAgent)\nBrowser.isWin8App = /MSAppHost/i.test(navigator.userAgent)\nBrowser.isWiiU = /WiiU/i.test(navigator.userAgent)\nBrowser.isPS4 = /PlayStation 4/i.test(navigator.userAgent)\nBrowser.hasLocalstorage = hasLocalstorage()\nBrowser.hasFlash = hasFlash()\n\nBrowser.name = browserInfo.name\nBrowser.version = browserInfo.version\n\nexport default Browser\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/browser.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {uniqueId} from './utils'\nimport Events from './events'\n\n/**\n * @class BaseObject\n * @constructor\n * @extends Events\n * @module base\n */\nexport default class BaseObject extends Events {\n /**\n * returns the object options\n * @property options\n * @type Object\n */\n get options() { return this._options }\n\n /**\n * @method constructor\n * @param {Object} options\n */\n constructor(options={}) {\n super(options)\n this._options = options\n this.uniqueId = uniqueId('o')\n }\n /**\n * a unique id prefixed with `'o'`, `o1, o232`\n *\n * @property uniqueId\n * @type String\n */\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/base/base_object.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {uniqueId} from './utils'\nimport $ from 'clappr-zepto'\nimport result from 'lodash.result'\nimport BaseObject from './base_object'\n\nconst delegateEventSplitter = /^(\\S+)\\s*(.*)$/\n\n/**\n * A base class to create ui object.\n * @class UIObject\n * @constructor\n * @extends BaseObject\n * @module base\n */\nexport default class UIObject extends BaseObject {\n /**\n * a unique id prefixed with `'c'`, `c1, c232`\n *\n * @property cid\n * @type String\n */\n /**\n * the dom element itself\n *\n * @property el\n * @type HTMLElement\n */\n /**\n * the dom element wrapped by `$`\n *\n * @property $el\n * @type HTMLElement\n */\n\n /**\n * gets the tag name for the ui component\n * @method tagName\n * @default div\n * @return {String} tag's name\n */\n get tagName() { return 'div' }\n /**\n * a literal object mapping element's events to methods\n * @property events\n * @type Object\n * @example\n *\n *```javascript\n *\n * class MyButton extends UIObject {\n * constructor(options) {\n * super(options)\n * this.myId = 0\n * }\n * get events() { return { 'click': 'myClick' } }\n * myClick(){ this.myId = 42 }\n * }\n *\n * // when you click on MyButton the method `myClick` will be called\n *```\n */\n get events() { return {} }\n /**\n * a literal object mapping attributes and values to the element\n * element's attribute name and the value the attribute value\n * @property attributes\n * @type Object\n * @example\n *\n *```javascript\n *\n * class MyButton extends UIObject {\n * constructor(options) { super(options) }\n * get attributes() { return { class: 'my-button'} }\n * }\n *\n * // MyButton.el.className will be 'my-button'\n * ```\n */\n get attributes() { return {} }\n\n /**\n * it builds an ui component by:\n * * creating an id for the component `cid`\n * * making sure the element is created `$el`\n * * delegating all `events` to the element\n * @method constructor\n * @param {Object} options the options object\n */\n constructor(options) {\n super(options)\n this.cid = uniqueId('c')\n this._ensureElement()\n this.delegateEvents()\n }\n\n /**\n * selects within the component.\n * @method $\n * @param {String} selector a selector to find within the component.\n * @return {HTMLElement} an element, if it exists.\n * @example\n * ```javascript\n * fullScreenBarUIComponent.$('.button-full') //will return only `.button-full` within the component\n * ```\n */\n $(selector) {\n return this.$el.find(selector)\n }\n\n /**\n * render the component, usually attach it to a real existent `element`\n * @method render\n * @return {UIObject} itself\n */\n render() {\n return this\n }\n\n /**\n * removes the ui component from DOM\n * @method remove\n * @return {UIObject} itself\n */\n remove() {\n this.$el.remove()\n this.stopListening()\n this.undelegateEvents()\n return this\n }\n\n /**\n * set element to `el` and `$el`\n * @method setElement\n * @param {HTMLElement} element\n * @param {Boolean} delegate whether is delegate or not\n * @return {UIObject} itself\n */\n setElement(element, delegate) {\n if (this.$el) {this.undelegateEvents()}\n this.$el = element instanceof $ ? element : $(element)\n this.el = this.$el[0]\n if (delegate !== false) {this.delegateEvents()}\n return this\n }\n\n /**\n * delegates all the original `events` on `element` to its callbacks\n * @method delegateEvents\n * @param {Object} events\n * @return {UIObject} itself\n */\n delegateEvents(events) {\n if (!(events || (events = result(this, 'events')))) {return this}\n this.undelegateEvents()\n for (const key in events) {\n let method = events[key]\n if ((method && method.constructor !== Function)) {method = this[events[key]]}\n if (!method) {continue}\n\n const match = key.match(delegateEventSplitter)\n let eventName = match[1], selector = match[2]\n //method = _.bind(method, this)\n eventName += '.delegateEvents' + this.cid\n if (selector === '') {\n this.$el.on(eventName, method.bind(this))\n } else {\n this.$el.on(eventName, selector, method.bind(this))\n }\n }\n return this\n }\n\n /**\n * undelegats all the `events`\n * @method undelegateEvents\n * @return {UIObject} itself\n */\n undelegateEvents() {\n this.$el.off('.delegateEvents' + this.cid)\n return this\n }\n\n /**\n * ensures the creation of this ui component\n * @method _ensureElement\n * @private\n */\n _ensureElement() {\n if (!this.el) {\n const attrs = $.extend({}, result(this, 'attributes'))\n if (this.id) {attrs.id = result(this, 'id')}\n if (this.className) {attrs['class'] = result(this, 'className')}\n const $el = $('<' + result(this, 'tagName') + '>').attr(attrs)\n this.setElement($el, false)\n } else {\n this.setElement(result(this, 'el'), false)\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/base/ui_object.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/**\n * The mediator is a singleton for handling global events.\n */\n\nimport Events from 'base/events'\n\nconst events = new Events()\n\nexport default class Mediator {\n}\n\nMediator.on = function(name, callback, context) {\n events.on(name, callback, context)\n return\n}\n\nMediator.once = function(name, callback, context) {\n events.once(name, callback, context)\n return\n}\n\nMediator.off = function(name, callback, context) {\n events.off(name, callback, context)\n return\n}\n\nMediator.trigger = function(name, ...opts) {\n events.trigger.apply(events, [name, ...opts])\n return\n}\n\nMediator.stopListening = function(obj, name, callback) {\n events.stopListening(obj, name, callback)\n return\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/mediator.js","import {extend} from './utils'\nimport BaseObject from './base_object'\n\nexport default class CorePlugin extends BaseObject {\n constructor(core) {\n super(core.options)\n this.core = core\n this.enabled = true\n this.bindEvents()\n }\n\n bindEvents() {}\n\n enable() {\n if (!this.enabled) {\n this.bindEvents()\n this.enabled = true\n }\n }\n\n disable() {\n if (this.enabled) {\n this.stopListening()\n this.enabled = false\n }\n }\n\n getExternalInterface() { return {} }\n\n destroy() {\n this.stopListening()\n }\n}\n\nCorePlugin.extend = function(properties) {\n return extend(CorePlugin, properties)\n}\n\nCorePlugin.type = 'core'\n\n\n\n// WEBPACK FOOTER //\n// ./src/base/core_plugin.js","import BaseObject from './base_object'\nimport {extend} from './utils'\n\n/**\n * The base class for a container plugin\n * @class ContainerPlugin\n * @constructor\n * @extends UIObject\n * @module base\n */\nexport default class ContainerPlugin extends BaseObject {\n constructor(container) {\n super(container.options)\n this.container = container\n this.enabled = true\n this.bindEvents()\n }\n\n enable() {\n if (!this.enabled) {\n this.bindEvents()\n this.enabled = true\n }\n }\n\n disable() {\n if (this.enabled) {\n this.stopListening()\n this.enabled = false\n }\n }\n\n bindEvents() {}\n\n destroy() {\n this.stopListening()\n }\n}\n\nContainerPlugin.extend = function(properties) {\n return extend(ContainerPlugin, properties)\n}\n\nContainerPlugin.type = 'container'\n\n\n\n// WEBPACK FOOTER //\n// ./src/base/container_plugin.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {extend} from './utils'\n\nimport UIObject from './ui_object'\n\n/**\n * The base class for an ui container plugin\n * @class UIContainerPlugin\n * @constructor\n * @extends UIObject\n * @module base\n */\nexport default class UIContainerPlugin extends UIObject {\n constructor(container) {\n super(container.options)\n this.container = container\n this.enabled = true\n this.bindEvents()\n }\n\n enable() {\n if (!this.enabled) {\n this.bindEvents()\n this.$el.show()\n this.enabled = true\n }\n }\n\n disable() {\n this.stopListening()\n this.$el.hide()\n this.enabled = false\n }\n\n bindEvents() {}\n\n destroy() {\n this.remove()\n }\n}\n\nUIContainerPlugin.extend = function(properties) {\n return extend(UIContainerPlugin, properties)\n}\n\nUIContainerPlugin.type = 'container'\n\n\n\n// WEBPACK FOOTER //\n// ./src/base/ui_container_plugin.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nclass PlayerInfo {\n constructor() {\n this.options = {}\n this.playbackPlugins = []\n this.currentSize = { width: 0, height: 0 }\n }\n}\n\nPlayerInfo._players = {}\n\nPlayerInfo.getInstance = (playerId) => {\n return PlayerInfo._players[playerId] || (PlayerInfo._players[playerId] = new PlayerInfo())\n}\n\nexport default PlayerInfo\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/player_info.js","module.exports = require('./html5_video')\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/html5_video/index.js","import {extend} from './utils'\nimport UIObject from './ui_object'\n\nexport default class UICorePlugin extends UIObject {\n constructor(core) {\n super(core.options)\n this.core = core\n this.enabled = true\n this.bindEvents()\n this.render()\n }\n\n bindEvents() {}\n\n getExternalInterface() { return {} }\n\n enable() {\n if (!this.enabled) {\n this.bindEvents()\n this.$el.show()\n this.enabled = true\n }\n }\n\n disable() {\n this.stopListening()\n this.$el.hide()\n this.enabled = false\n }\n\n destroy() {\n this.remove()\n }\n\n render() {\n return this\n }\n}\n\nUICorePlugin.extend = function(properties) {\n return extend(UICorePlugin, properties)\n}\n\nUICorePlugin.type = 'core'\n\n\n\n// WEBPACK FOOTER //\n// ./src/base/ui_core_plugin.js","export default require('./base_flash_playback')\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/base_flash_playback/index.js","module.exports = require('./log')\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/log/index.js","import Kibo from './kibo'\n\nexport default {Kibo}\n\n\n\n// WEBPACK FOOTER //\n// ./src/vendor/index.js","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process/browser.js\n// module id = 21\n// module chunks = 0","module.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill=\\\"#010101\\\" d=\\\"M1.425.35L14.575 8l-13.15 7.65V.35z\\\"></path></svg>\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/icons/01-play.svg\n// module id = 22\n// module chunks = 0","module.exports = function(module) {\n\tif(!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tmodule.children = [];\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/module.js\n// module id = 23\n// module chunks = 0","module.exports = require('./container')\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/container/index.js","module.exports = require('./core')\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/core/index.js","module.exports = require('./loader')\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/loader/index.js","module.exports = require('./media_control')\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/media_control/index.js","module.exports = require('./flash')\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/flash/index.js","module.exports = require('./flashls')\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/flashls/index.js","module.exports = require('./hls')\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/hls/index.js","module.exports = require('./html5_audio')\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/html5_audio/index.js","module.exports = require('./html_img')\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/html_img/index.js","module.exports = require('./no_op')\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/no_op/index.js","module.exports = require('./poster')\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/poster/index.js","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max;\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (typeof key == 'number' && value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n if (!(isArray(source) || isTypedArray(source))) {\n var props = baseKeysIn(source);\n }\n arrayEach(props || source, function(srcValue, key) {\n if (props) {\n key = srcValue;\n srcValue = source[key];\n }\n if (isObject(srcValue)) {\n stack || (stack = new Stack);\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(object[key], srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n });\n}\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = object[key],\n srcValue = source[key],\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n newValue = srcValue;\n if (isArray(srcValue) || isTypedArray(srcValue)) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else {\n isCommon = false;\n newValue = baseClone(srcValue, true);\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {\n isCommon = false;\n newValue = baseClone(srcValue, true);\n }\n else {\n newValue = objValue;\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) ||\n objectToString.call(value) != objectTag || isHostObject(value)) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return (typeof Ctor == 'function' &&\n Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = merge;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.merge/index.js\n// module id = 35\n// module chunks = 0","module.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" fill=\\\"#010101\\\" d=\\\"M1.712 14.76H6.43V1.24H1.71v13.52zm7.86-13.52v13.52h4.716V1.24H9.573z\\\"></path></svg>\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/icons/02-pause.svg\n// module id = 36\n// module chunks = 0","module.exports = __webpack_public_path__ + \"a8c874b93b3d848f39a71260c57e3863.cur\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/media_control/public/closed-hand.cur\n// module id = 37\n// module chunks = 0","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/**\n * Container is responsible for the video rendering and state\n */\n\nimport Events from 'base/events'\nimport UIObject from 'base/ui_object'\nimport Styler from 'base/styler'\nimport style from './public/style.scss'\nimport $ from 'clappr-zepto'\n\n/**\n * An abstraction to represent a container for a given playback\n * TODO: describe its responsabilities\n * @class Container\n * @constructor\n * @extends UIObject\n * @module base\n */\nexport default class Container extends UIObject {\n /**\n * container's name\n * @method name\n * @default Container\n * @return {String} container's name\n */\n get name() { return 'Container' }\n get attributes() { return { class: 'container', 'data-container': '' } }\n get events() {\n return {\n 'click': 'clicked',\n 'dblclick': 'dblClicked',\n 'doubleTap': 'dblClicked',\n 'contextmenu': 'onContextMenu',\n 'mouseenter': 'mouseEnter',\n 'mouseleave': 'mouseLeave'\n }\n }\n\n /**\n * Determine if the playback has ended.\n * @property ended\n * @type Boolean\n */\n get ended() {\n return this.playback.ended\n }\n\n /**\n * Determine if the playback is having to buffer in order for\n * playback to be smooth.\n * (i.e if a live stream is playing smoothly, this will be false)\n * @property buffering\n * @type Boolean\n */\n get buffering() {\n return this.playback.buffering\n }\n\n /**\n * The internationalization plugin.\n * @property i18n\n * @type {Strings}\n */\n get i18n() {\n return this._i18n\n }\n\n /**\n * it builds a container\n * @method constructor\n * @param {Object} options the options object\n * @param {Strings} i18n the internationalization component\n */\n constructor(options, i18n) {\n super(options)\n this._i18n = i18n\n this.currentTime = 0\n this.volume = 100\n this.playback = options.playback\n this.settings = $.extend({}, this.playback.settings)\n this.isReady = false\n this.mediaControlDisabled = false\n this.plugins = [this.playback]\n this.bindEvents()\n }\n\n /**\n * binds playback events to the methods of the container.\n * it listens to playback's events and triggers them as container events.\n *\n * | Playback |\n * |----------|\n * | progress |\n * | timeupdate |\n * | ready |\n * | buffering |\n * | bufferfull |\n * | settingsupdate |\n * | loadedmetadata |\n * | highdefinitionupdate |\n * | bitrate |\n * | playbackstate |\n * | dvr |\n * | mediacontrol_disable |\n * | mediacontrol_enable |\n * | ended |\n * | play |\n * | pause |\n * | error |\n *\n * ps: the events usually translate from PLABACK_x to CONTAINER_x, you can check all the events at `Event` class.\n *\n * @method bindEvents\n */\n bindEvents() {\n this.listenTo(this.playback, Events.PLAYBACK_PROGRESS, this.progress)\n this.listenTo(this.playback, Events.PLAYBACK_TIMEUPDATE, this.timeUpdated)\n this.listenTo(this.playback, Events.PLAYBACK_READY, this.ready)\n this.listenTo(this.playback, Events.PLAYBACK_BUFFERING, this.onBuffering)\n this.listenTo(this.playback, Events.PLAYBACK_BUFFERFULL, this.bufferfull)\n this.listenTo(this.playback, Events.PLAYBACK_SETTINGSUPDATE, this.settingsUpdate)\n this.listenTo(this.playback, Events.PLAYBACK_LOADEDMETADATA, this.loadedMetadata)\n this.listenTo(this.playback, Events.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate)\n this.listenTo(this.playback, Events.PLAYBACK_BITRATE, this.updateBitrate)\n this.listenTo(this.playback, Events.PLAYBACK_PLAYBACKSTATE, this.playbackStateChanged)\n this.listenTo(this.playback, Events.PLAYBACK_DVR, this.playbackDvrStateChanged)\n this.listenTo(this.playback, Events.PLAYBACK_MEDIACONTROL_DISABLE, this.disableMediaControl)\n this.listenTo(this.playback, Events.PLAYBACK_MEDIACONTROL_ENABLE, this.enableMediaControl)\n this.listenTo(this.playback, Events.PLAYBACK_ENDED, this.onEnded)\n this.listenTo(this.playback, Events.PLAYBACK_PLAY, this.playing)\n this.listenTo(this.playback, Events.PLAYBACK_PAUSE, this.paused)\n this.listenTo(this.playback, Events.PLAYBACK_STOP, this.stopped)\n this.listenTo(this.playback, Events.PLAYBACK_ERROR, this.error)\n }\n\n playbackStateChanged(state) {\n this.trigger(Events.CONTAINER_PLAYBACKSTATE, state)\n }\n\n playbackDvrStateChanged(dvrInUse) {\n this.settings = this.playback.settings\n this.dvrInUse = dvrInUse\n this.trigger(Events.CONTAINER_PLAYBACKDVRSTATECHANGED, dvrInUse)\n }\n\n updateBitrate(newBitrate) {\n this.trigger(Events.CONTAINER_BITRATE, newBitrate)\n }\n\n statsReport(metrics) {\n this.trigger(Events.CONTAINER_STATS_REPORT, metrics)\n }\n\n getPlaybackType() {\n return this.playback.getPlaybackType()\n }\n\n /**\n * returns `true` if DVR is enable otherwise `false`.\n * @method isDvrEnabled\n * @return {Boolean}\n */\n isDvrEnabled() {\n return !!this.playback.dvrEnabled\n }\n\n /**\n * returns `true` if DVR is in use otherwise `false`.\n * @method isDvrInUse\n * @return {Boolean}\n */\n isDvrInUse() {\n return !!this.dvrInUse\n }\n\n /**\n * destroys the container\n * @method destroy\n */\n destroy() {\n this.trigger(Events.CONTAINER_DESTROYED, this, this.name)\n this.stopListening()\n this.plugins.forEach((plugin) => plugin.destroy())\n this.$el.remove()\n }\n\n setStyle(style) {\n this.$el.css(style)\n }\n\n animate(style, duration) {\n return this.$el.animate(style, duration).promise()\n }\n\n ready() {\n this.isReady = true\n this.trigger(Events.CONTAINER_READY, this.name)\n }\n\n isPlaying() {\n return this.playback.isPlaying()\n }\n\n getStartTimeOffset() {\n return this.playback.getStartTimeOffset()\n }\n\n getCurrentTime() {\n return this.currentTime\n }\n\n getDuration() {\n return this.playback.getDuration()\n }\n\n error(errorObj) {\n if (!this.isReady) {\n this.ready()\n }\n this.trigger(Events.CONTAINER_ERROR, {error: errorObj, container: this}, this.name)\n }\n\n loadedMetadata(metadata) {\n this.trigger(Events.CONTAINER_LOADEDMETADATA, metadata)\n }\n\n timeUpdated(timeProgress) {\n this.currentTime = timeProgress.current\n this.trigger(Events.CONTAINER_TIMEUPDATE, timeProgress, this.name)\n }\n\n progress(...args) {\n this.trigger(Events.CONTAINER_PROGRESS, ...args, this.name)\n }\n\n playing() {\n this.trigger(Events.CONTAINER_PLAY, this.name)\n }\n\n paused() {\n this.trigger(Events.CONTAINER_PAUSE, this.name)\n }\n\n /**\n * plays the playback\n * @method play\n */\n play() {\n this.playback.play()\n }\n\n /**\n * stops the playback\n * @method stop\n */\n stop() {\n this.playback.stop()\n this.currentTime = 0\n }\n\n /**\n * pauses the playback\n * @method pause\n */\n pause() {\n this.playback.pause()\n }\n\n onEnded() {\n this.trigger(Events.CONTAINER_ENDED, this, this.name)\n this.currentTime = 0\n }\n\n stopped() {\n this.trigger(Events.CONTAINER_STOP)\n }\n\n clicked() {\n if (!this.options.chromeless || this.options.allowUserInteraction) {\n this.trigger(Events.CONTAINER_CLICK, this, this.name)\n }\n }\n\n dblClicked() {\n if (!this.options.chromeless || this.options.allowUserInteraction) {\n this.trigger(Events.CONTAINER_DBLCLICK, this, this.name)\n }\n }\n\n onContextMenu() {\n if (!this.options.chromeless || this.options.allowUserInteraction) {\n this.trigger(Events.CONTAINER_CONTEXTMENU, this, this.name)\n }\n }\n\n seek(time) {\n this.trigger(Events.CONTAINER_SEEK, time, this.name)\n this.playback.seek(time)\n }\n\n seekPercentage(percentage) {\n const duration = this.getDuration()\n if (percentage >= 0 && percentage <= 100) {\n const time = duration * (percentage / 100)\n this.seek(time)\n }\n }\n\n setVolume(value) {\n this.volume = parseInt(value, 10)\n this.trigger(Events.CONTAINER_VOLUME, value, this.name)\n this.playback.volume(value)\n }\n\n fullscreen() {\n this.trigger(Events.CONTAINER_FULLSCREEN, this.name)\n }\n\n onBuffering() {\n this.trigger(Events.CONTAINER_STATE_BUFFERING, this.name)\n }\n\n bufferfull() {\n this.trigger(Events.CONTAINER_STATE_BUFFERFULL, this.name)\n }\n\n /**\n * adds plugin to the container\n * @method addPlugin\n * @param {Object} plugin\n */\n addPlugin(plugin) {\n this.plugins.push(plugin)\n }\n\n /**\n * checks if a plugin, given its name, exist\n * @method hasPlugin\n * @param {String} name\n * @return {Boolean}\n */\n hasPlugin(name) {\n return !!this.getPlugin(name)\n }\n\n /**\n * get the plugin given its name\n * @method getPlugin\n * @param {String} name\n */\n getPlugin(name) {\n return this.plugins.filter(plugin => plugin.name === name)[0]\n }\n\n mouseEnter() {\n if (!this.options.chromeless || this.options.allowUserInteraction) {\n this.trigger(Events.CONTAINER_MOUSE_ENTER)\n }\n }\n\n mouseLeave() {\n if (!this.options.chromeless || this.options.allowUserInteraction) {\n this.trigger(Events.CONTAINER_MOUSE_LEAVE)\n }\n }\n\n settingsUpdate() {\n this.settings = this.playback.settings\n this.trigger(Events.CONTAINER_SETTINGSUPDATE)\n }\n\n highDefinitionUpdate(isHD) {\n this.trigger(Events.CONTAINER_HIGHDEFINITIONUPDATE, isHD)\n }\n\n isHighDefinitionInUse() {\n return this.playback.isHighDefinitionInUse()\n }\n\n disableMediaControl() {\n if (!this.mediaControlDisabled) {\n this.mediaControlDisabled = true\n this.trigger(Events.CONTAINER_MEDIACONTROL_DISABLE)\n }\n }\n\n enableMediaControl() {\n if (this.mediaControlDisabled) {\n this.mediaControlDisabled = false\n this.trigger(Events.CONTAINER_MEDIACONTROL_ENABLE)\n }\n }\n\n updateStyle() {\n if (!this.options.chromeless || this.options.allowUserInteraction) {\n this.$el.removeClass('chromeless')\n } else {\n this.$el.addClass('chromeless')\n }\n }\n\n /**\n * enables to configure the container after its creation\n * @method configure\n * @param {Object} options all the options to change in form of a javascript object\n */\n configure(options) {\n this._options = $.extend(this._options, options)\n this.updateStyle()\n this.trigger(Events.CONTAINER_OPTIONS_CHANGE)\n }\n\n render() {\n const s = Styler.getStyleFor(style)\n this.$el.append(s)\n this.$el.append(this.playback.render().el)\n this.updateStyle()\n return this\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/container/container.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/**\n * The ContainerFactory is responsible for manage playback bootstrap and create containers.\n */\n\nimport BaseObject from 'base/base_object'\nimport Events from 'base/events'\nimport Container from 'components/container'\nimport $ from 'clappr-zepto'\n\nimport isPlainObject from 'lodash.isplainobject'\n\nexport default class ContainerFactory extends BaseObject {\n get options() { return this._options }\n set options(options) { this._options = options }\n\n constructor(options, loader, i18n) {\n super(options)\n this._i18n = i18n\n this.loader = loader\n }\n\n createContainers() {\n return $.Deferred((promise) => {\n promise.resolve(this.options.sources.map((source) => {\n return this.createContainer(source)\n }))\n })\n }\n\n findPlaybackPlugin(source, mimeType) {\n return this.loader.playbackPlugins.filter(p => p.canPlay(source, mimeType))[0]\n }\n\n createContainer(source) {\n let resolvedSource = null,\n mimeType = this.options.mimeType\n if (isPlainObject(source)) {\n resolvedSource = source.source.toString()\n if (source.mimeType) {\n mimeType = source.mimeType\n }\n } else {\n resolvedSource = source.toString()\n }\n\n if (resolvedSource.match(/^\\/\\//)) resolvedSource = window.location.protocol + resolvedSource\n\n let options = $.extend({}, this.options, {\n src: resolvedSource,\n mimeType: mimeType\n })\n const playbackPlugin = this.findPlaybackPlugin(resolvedSource, mimeType)\n const playback = new playbackPlugin(options, this._i18n)\n\n options = $.extend({}, options, {playback: playback})\n\n const container = new Container(options, this._i18n)\n const defer = $.Deferred()\n defer.promise(container)\n this.addContainerPlugins(container)\n this.listenToOnce(container, Events.CONTAINER_READY, () => defer.resolve(container))\n return container\n }\n\n addContainerPlugins(container) {\n this.loader.containerPlugins.forEach((Plugin) => {\n container.addPlugin(new Plugin(container))\n })\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/container_factory/container_factory.js","module.exports = require('./container_factory')\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/container_factory/index.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {isNumber,Fullscreen} from 'base/utils'\n\nimport Events from 'base/events'\nimport Styler from 'base/styler'\nimport UIObject from 'base/ui_object'\nimport Browser from 'components/browser'\nimport ContainerFactory from 'components/container_factory'\nimport MediaControl from 'components/media_control'\nimport Mediator from 'components/mediator'\nimport PlayerInfo from 'components/player_info'\n\nimport $ from 'clappr-zepto'\n\nimport coreStyle from './public/style.scss'\n\n/**\n * The Core is responsible to manage Containers, the mediator, MediaControl\n * and the player state.\n * @class Core\n * @constructor\n * @extends UIObject\n * @module components\n */\nexport default class Core extends UIObject {\n get events() {\n return {\n 'webkitfullscreenchange': 'handleFullscreenChange',\n 'mousemove': 'showMediaControl',\n 'mouseleave': 'hideMediaControl'\n }\n }\n\n get attributes() {\n return {\n 'data-player': '',\n tabindex: 9999\n }\n }\n\n /**\n * checks if the core is ready.\n * @property isReady\n * @type {Boolean} `true` if the core is ready, otherwise `false`\n */\n get isReady() {\n return !!this.ready\n }\n\n /**\n * The internationalization plugin.\n * @property i18n\n * @type {Strings}\n */\n get i18n() {\n return this.getPlugin('strings') || { t: (key) => key }\n }\n\n constructor(options) {\n super(options)\n this.playerInfo = PlayerInfo.getInstance(options.playerId)\n this.firstResize = true\n this.plugins = []\n this.containers = []\n this.setupMediaControl(null)\n //FIXME fullscreen api sucks\n this._boundFullscreenHandler = () => this.handleFullscreenChange()\n $(document).bind('fullscreenchange', this._boundFullscreenHandler)\n $(document).bind('MSFullscreenChange', this._boundFullscreenHandler)\n $(document).bind('mozfullscreenchange', this._boundFullscreenHandler)\n }\n\n createContainers(options) {\n this.defer = $.Deferred()\n this.defer.promise(this)\n this.containerFactory = new ContainerFactory(options, options.loader, this.i18n)\n this.containerFactory\n .createContainers()\n .then((containers) => this.setupContainers(containers))\n .then((containers) => this.resolveOnContainersReady(containers))\n }\n\n updateSize() {\n if (Fullscreen.isFullscreen()) {\n this.setFullscreen()\n } else {\n this.setPlayerSize()\n }\n }\n\n setFullscreen() {\n if(!Browser.isiOS) {\n this.$el.addClass('fullscreen')\n this.$el.removeAttr('style')\n this.playerInfo.previousSize = { width: this.options.width, height: this.options.height }\n this.playerInfo.currentSize = { width: $(window).width(), height: $(window).height() }\n }\n }\n\n setPlayerSize() {\n this.$el.removeClass('fullscreen')\n this.playerInfo.currentSize = this.playerInfo.previousSize\n this.playerInfo.previousSize = { width: $(window).width(), height: $(window).height() }\n this.resize(this.playerInfo.currentSize)\n }\n\n resize(options) {\n if (!isNumber(options.height) && !isNumber(options.width)) {\n this.el.style.height = `${options.height}`\n this.el.style.width = `${options.width}`\n } else {\n this.el.style.height = `${options.height}px`\n this.el.style.width = `${options.width}px`\n }\n this.playerInfo.previousSize = { width: this.options.width, height: this.options.height }\n this.options.width = options.width\n this.options.height = options.height\n this.playerInfo.currentSize = options\n this.triggerResize(this.playerInfo.currentSize)\n }\n\n enableResizeObserver() {\n const checkSizeCallback = () => {\n if (this.playerInfo.computedSize.width != this.el.clientWidth ||\n this.playerInfo.computedSize.height != this.el.clientHeight) {\n this.playerInfo.computedSize = { width: this.el.clientWidth, height: this.el.clientHeight }\n this.triggerResize(this.playerInfo.computedSize)\n }\n }\n this.resizeObserverInterval = setInterval(checkSizeCallback, 500)\n }\n\n triggerResize(newSize) {\n const thereWasChange = this.firstResize || this.oldHeight !== newSize.height || this.oldWidth !== newSize.width\n if (thereWasChange) {\n Mediator.trigger(`${this.options.playerId}:${Events.PLAYER_RESIZE}`, newSize)\n this.oldHeight = newSize.height\n this.oldWidth = newSize.width\n this.firstResize = false\n }\n }\n\n disableResizeObserver() {\n if (this.resizeObserverInterval) clearInterval(this.resizeObserverInterval)\n }\n\n resolveOnContainersReady(containers) {\n $.when.apply($, containers).done(() => {\n this.defer.resolve(this)\n this.ready = true\n this.trigger(Events.CORE_READY)\n })\n }\n\n addPlugin(plugin) {\n this.plugins.push(plugin)\n }\n\n hasPlugin(name) {\n return !!this.getPlugin(name)\n }\n\n getPlugin(name) {\n return this.plugins.filter(plugin => plugin.name === name)[0]\n }\n\n load(sources, mimeType) {\n this.options.mimeType = mimeType\n sources = sources && sources.constructor === Array ? sources : [sources]\n this.containers.forEach((container) => container.destroy())\n this.mediaControl.container = null\n this.containerFactory.options = $.extend(this.options, {sources})\n this.containerFactory.createContainers().then((containers) => {\n this.setupContainers(containers)\n })\n }\n\n destroy() {\n this.disableResizeObserver()\n this.containers.forEach((container) => container.destroy())\n this.plugins.forEach((plugin) => plugin.destroy())\n this.$el.remove()\n this.mediaControl.destroy()\n $(document).unbind('fullscreenchange', this._boundFullscreenHandler)\n $(document).unbind('MSFullscreenChange', this._boundFullscreenHandler)\n $(document).unbind('mozfullscreenchange', this._boundFullscreenHandler)\n }\n\n handleFullscreenChange() {\n this.trigger(Events.CORE_FULLSCREEN, Fullscreen.isFullscreen())\n this.updateSize()\n this.mediaControl.show()\n }\n\n setMediaControlContainer(container) {\n this.mediaControl.setContainer(container)\n this.mediaControl.render()\n }\n\n disableMediaControl() {\n this.mediaControl.disable()\n this.$el.removeClass('nocursor')\n }\n\n enableMediaControl() {\n this.mediaControl.enable()\n }\n\n removeContainer(container) {\n this.stopListening(container)\n this.containers = this.containers.filter((c) => c !== container)\n }\n\n appendContainer(container) {\n this.listenTo(container, Events.CONTAINER_DESTROYED, this.removeContainer)\n this.containers.push(container)\n }\n\n setupContainers(containers) {\n containers.map(this.appendContainer.bind(this))\n this.trigger(Events.CORE_CONTAINERS_CREATED)\n this.renderContainers()\n this.setupMediaControl(this.getCurrentContainer())\n this.render()\n this.$el.appendTo(this.options.parentElement)\n return this.containers\n }\n\n renderContainers() {\n this.containers.map((container) => this.el.appendChild(container.render().el))\n }\n\n createContainer(source, options) {\n const container = this.containerFactory.createContainer(source, options)\n this.appendContainer(container)\n this.el.appendChild(container.render().el)\n return container\n }\n\n setupMediaControl(container) {\n if (this.mediaControl) {\n this.mediaControl.setContainer(container)\n } else {\n this.mediaControl = this.createMediaControl($.extend({container: container, focusElement: this.el}, this.options))\n this.listenTo(this.mediaControl, Events.MEDIACONTROL_FULLSCREEN, this.toggleFullscreen)\n this.listenTo(this.mediaControl, Events.MEDIACONTROL_SHOW, this.onMediaControlShow.bind(this, true))\n this.listenTo(this.mediaControl, Events.MEDIACONTROL_HIDE, this.onMediaControlShow.bind(this, false))\n }\n }\n\n createMediaControl(options) {\n if(options.mediacontrol && options.mediacontrol.external) {\n return new options.mediacontrol.external(options).render()\n } else {\n return new MediaControl(options).render()\n }\n }\n\n getCurrentContainer() {\n if (!this.mediaControl || !this.mediaControl.container) {\n return this.containers[0]\n }\n return this.mediaControl.container\n }\n\n getCurrentPlayback() {\n const container = this.getCurrentContainer()\n return container && container.playback\n }\n\n getPlaybackType() {\n const container = this.getCurrentContainer()\n return container && container.getPlaybackType()\n }\n\n toggleFullscreen() {\n if (!Fullscreen.isFullscreen()) {\n Fullscreen.requestFullscreen(this.el)\n if(!Browser.isiOS) {\n this.$el.addClass('fullscreen')\n }\n } else {\n Fullscreen.cancelFullscreen()\n if(!Browser.isiOS) {\n this.$el.removeClass('fullscreen nocursor')\n }\n }\n this.mediaControl.show()\n }\n\n showMediaControl(event) {\n this.mediaControl.show(event)\n }\n\n hideMediaControl() {\n this.mediaControl.hide(this.options.hideMediaControlDelay)\n }\n\n onMediaControlShow(showing) {\n this.getCurrentContainer().trigger(showing?Events.CONTAINER_MEDIACONTROL_SHOW:Events.CONTAINER_MEDIACONTROL_HIDE)\n\n if (showing)\n this.$el.removeClass('nocursor')\n else if (Fullscreen.isFullscreen())\n this.$el.addClass('nocursor')\n }\n\n /**\n * enables to configure the container after its creation\n * @method configure\n * @param {Object} options all the options to change in form of a javascript object\n */\n configure(options) {\n this._options = $.extend(this._options, options)\n const sources = options.source || options.sources\n\n if (sources) {\n this.load(sources, options.mimeType || this.options.mimeType)\n } else {\n this.trigger(Events.CORE_OPTIONS_CHANGE)\n\n this.containers.forEach((container) => {\n container.configure(this.options)\n })\n }\n }\n\n render() {\n const style = Styler.getStyleFor(coreStyle, {baseUrl: this.options.baseUrl})\n this.$el.append(style)\n this.$el.append(this.mediaControl.render().el)\n\n this.options.width = this.options.width || this.$el.width()\n this.options.height = this.options.height || this.$el.height()\n const size = {width: this.options.width, height: this.options.height}\n this.playerInfo.previousSize = this.playerInfo.currentSize = this.playerInfo.computedSize = size\n this.updateSize()\n\n this.previousSize = { width: this.$el.width(), height: this.$el.height() }\n\n this.enableResizeObserver()\n\n return this\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/core/core.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport BaseObject from 'base/base_object'\nimport Core from 'components/core'\n\n/**\n * The Core Factory is responsible for instantiate the core and it's plugins.\n * @class CoreFactory\n * @constructor\n * @extends BaseObject\n * @module components\n */\nexport default class CoreFactory extends BaseObject {\n\n get loader() { return this.player.loader }\n\n /**\n * it builds the core factory\n * @method constructor\n * @param {Player} player the player object\n */\n constructor(player) {\n super()\n this.player = player\n this._options = player.options\n }\n\n /**\n * creates a core and its plugins\n * @method create\n * @return {Core} created core\n */\n create() {\n this.options.loader = this.loader\n this.core = new Core(this.options)\n this.addCorePlugins()\n this.core.createContainers(this.options)\n return this.core\n }\n\n /**\n * given the core plugins (`loader.corePlugins`) it builds each one\n * @method addCorePlugins\n * @return {Core} the core with all plugins\n */\n addCorePlugins() {\n this.loader.corePlugins.forEach((Plugin) => {\n const plugin = new Plugin(this.core)\n this.core.addPlugin(plugin)\n this.setupExternalInterface(plugin)\n })\n return this.core\n }\n\n setupExternalInterface(plugin) {\n const externalFunctions = plugin.getExternalInterface()\n for (const key in externalFunctions) {\n this.player[key] = externalFunctions[key].bind(plugin)\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/core_factory/core_factory.js","module.exports = require('./core_factory')\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/core_factory/index.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport BaseObject from 'base/base_object'\nimport PlayerInfo from 'components/player_info'\nimport uniqBy from 'lodash.uniqby'\n\n/* Playback Plugins */\nimport HTML5VideoPlayback from 'playbacks/html5_video'\nimport FlashVideoPlayback from 'playbacks/flash'\nimport HTML5AudioPlayback from 'playbacks/html5_audio'\nimport FlasHLSVideoPlayback from 'playbacks/flashls'\nimport HLSVideoPlayback from 'playbacks/hls'\nimport HTMLImgPlayback from 'playbacks/html_img'\nimport NoOp from 'playbacks/no_op'\n\n/* Container Plugins */\nimport SpinnerThreeBouncePlugin from 'plugins/spinner_three_bounce'\nimport StatsPlugin from 'plugins/stats'\nimport WaterMarkPlugin from 'plugins/watermark'\nimport PosterPlugin from 'plugins/poster'\nimport GoogleAnalyticsPlugin from 'plugins/google_analytics'\nimport ClickToPausePlugin from 'plugins/click_to_pause'\n\n/* Core Plugins */\nimport DVRControls from 'plugins/dvr_controls'\nimport Favicon from 'plugins/favicon'\nimport SeekTime from 'plugins/seek_time'\nimport SourcesPlugin from 'plugins/sources'\nimport EndVideo from 'plugins/end_video'\nimport Strings from 'plugins/strings'\n\n/**\n * It keeps a list of the default plugins (playback, container, core) and it merges external plugins with its internals.\n * @class Loader\n * @constructor\n * @extends BaseObject\n * @module components\n */\nexport default class Loader extends BaseObject {\n /**\n * builds the loader\n * @method constructor\n * @param {Object} externalPlugins the external plugins\n * @param {Number} playerId you can embed multiple instances of clappr, therefore this is the unique id of each one.\n */\n constructor(externalPlugins, playerId) {\n super()\n this.playerId = playerId\n this.playbackPlugins = [HLSVideoPlayback, HTML5VideoPlayback, HTML5AudioPlayback, FlashVideoPlayback, FlasHLSVideoPlayback, HTMLImgPlayback, NoOp]\n this.containerPlugins = [SpinnerThreeBouncePlugin, WaterMarkPlugin, PosterPlugin, StatsPlugin, GoogleAnalyticsPlugin, ClickToPausePlugin]\n this.corePlugins = [DVRControls, Favicon, SeekTime, SourcesPlugin, EndVideo, Strings]\n if (externalPlugins) {\n if (!Array.isArray(externalPlugins)) {\n this.validateExternalPluginsType(externalPlugins)\n }\n this.addExternalPlugins(externalPlugins)\n }\n }\n\n /**\n * groups by type the external plugins that were passed through `options.plugins` it they're on a flat array\n * @method addExternalPlugins\n * @private\n * @param {Object} an config object or an array of plugins\n * @return {Object} plugins the config object with the plugins separated by type\n */\n groupPluginsByType(plugins) {\n if (Array.isArray(plugins)) {\n plugins = plugins.reduce(function(memo, plugin) {\n memo[plugin.type] || (memo[plugin.type] = [])\n memo[plugin.type].push(plugin)\n return memo\n }, {})\n }\n return plugins\n }\n\n /**\n * adds all the external plugins that were passed through `options.plugins`\n * @method addExternalPlugins\n * @private\n * @param {Object} plugins the config object with all plugins\n */\n addExternalPlugins(plugins) {\n plugins = this.groupPluginsByType(plugins)\n const pluginName = function(plugin) { return plugin.prototype.name }\n if (plugins.playback) { this.playbackPlugins = uniqBy(plugins.playback.concat(this.playbackPlugins), pluginName) }\n if (plugins.container) { this.containerPlugins = uniqBy(plugins.container.concat(this.containerPlugins), pluginName) }\n if (plugins.core) { this.corePlugins = uniqBy(plugins.core.concat(this.corePlugins), pluginName) }\n PlayerInfo.getInstance(this.playerId).playbackPlugins = this.playbackPlugins\n }\n\n /**\n * validate if the external plugins that were passed through `options.plugins` are associated to the correct type\n * @method validateExternalPluginsType\n * @private\n * @param {Object} plugins the config object with all plugins\n */\n validateExternalPluginsType(plugins) {\n const plugintypes = ['playback', 'container', 'core']\n plugintypes.forEach((type) => {\n (plugins[type] || []).forEach((el) => {\n const errorMessage = 'external ' + el.type + ' plugin on ' + type + ' array'\n if (el.type !== type) { throw new ReferenceError(errorMessage) }\n })\n })\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/loader/loader.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/**\n * The MediaControl is responsible for displaying the Player controls.\n */\n\nimport {Config, Fullscreen, formatTime, extend, removeArrayItem} from 'base/utils'\nimport {Kibo} from 'vendor'\n\nimport Events from 'base/events'\nimport Styler from 'base/styler'\nimport UIObject from 'base/ui_object'\nimport Browser from 'components/browser'\nimport Mediator from 'components/mediator'\nimport template from 'base/template'\nimport Playback from 'base/playback'\n\nimport $ from 'clappr-zepto'\nimport merge from 'lodash.merge'\n\nimport mediaControlStyle from './public/media-control.scss'\nimport mediaControlHTML from './public/media-control.html'\n\nimport playIcon from 'icons/01-play.svg'\nimport pauseIcon from 'icons/02-pause.svg'\nimport stopIcon from 'icons/03-stop.svg'\nimport volumeIcon from 'icons/04-volume.svg'\nimport volumeMuteIcon from 'icons/05-mute.svg'\nimport fullscreenIcon from 'icons/06-expand.svg'\nimport exitFullscreenIcon from 'icons/07-shrink.svg'\nimport hdIcon from 'icons/08-hd.svg'\n\nexport default class MediaControl extends UIObject {\n get name() { return 'MediaControl' }\n get disabled() { return this.userDisabled || (this.container && this.container.getPlaybackType() === Playback.NO_OP)}\n\n get attributes() {\n return {\n 'class': 'media-control',\n 'data-media-control': ''\n }\n }\n\n get events() {\n return {\n 'click [data-play]': 'play',\n 'click [data-pause]': 'pause',\n 'click [data-playpause]': 'togglePlayPause',\n 'click [data-stop]': 'stop',\n 'click [data-playstop]': 'togglePlayStop',\n 'click [data-fullscreen]': 'toggleFullscreen',\n 'click .bar-container[data-seekbar]': 'seek',\n 'click .bar-container[data-volume]': 'onVolumeClick',\n 'click .drawer-icon[data-volume]': 'toggleMute',\n 'mouseenter .drawer-container[data-volume]': 'showVolumeBar',\n 'mouseleave .drawer-container[data-volume]': 'hideVolumeBar',\n 'mousedown .bar-container[data-volume]': 'startVolumeDrag',\n 'mousemove .bar-container[data-volume]': 'mousemoveOnVolumeBar',\n 'mousedown .bar-scrubber[data-seekbar]': 'startSeekDrag',\n 'mousemove .bar-container[data-seekbar]': 'mousemoveOnSeekBar',\n 'mouseleave .bar-container[data-seekbar]': 'mouseleaveOnSeekBar',\n 'mouseenter .media-control-layer[data-controls]': 'setUserKeepVisible',\n 'mouseleave .media-control-layer[data-controls]': 'resetUserKeepVisible'\n }\n }\n\n get template() { return template(mediaControlHTML) }\n\n get stylesheet() { return Styler.getStyleFor(mediaControlStyle, {baseUrl: this.options.baseUrl}) }\n\n get volume() { return (this.container && this.container.isReady) ? this.container.volume : this.intendedVolume }\n get muted() { return this.volume === 0 }\n\n constructor(options) {\n super(options)\n this.persistConfig = this.options.persistConfig\n this.container = options.container\n this.currentPositionValue = null\n this.currentDurationValue = null\n const initialVolume = (this.persistConfig) ? Config.restore('volume') : 100\n this.setVolume(this.options.mute ? 0 : initialVolume)\n this.keepVisible = false\n this.fullScreenOnVideoTagSupported = null // unknown\n this.addEventListeners()\n this.settings = {\n left: ['play', 'stop', 'pause'],\n right: ['volume'],\n default: ['position', 'seekbar', 'duration']\n }\n\n if (this.container) {\n if (!$.isEmptyObject(this.container.settings)) {\n this.settings = $.extend({}, this.container.settings)\n }\n } else {\n this.settings = {}\n }\n\n this.userDisabled = false\n if ((this.container && this.container.mediaControlDisabled) || this.options.chromeless) {\n this.disable()\n }\n this.stopDragHandler = (event) => this.stopDrag(event)\n this.updateDragHandler = (event) => this.updateDrag(event)\n $(document).bind('mouseup', this.stopDragHandler)\n $(document).bind('mousemove', this.updateDragHandler)\n }\n\n addEventListeners() {\n if (this.container) {\n Mediator.on(`${this.options.playerId}:${Events.PLAYER_RESIZE}`, this.playerResize, this)\n this.listenTo(this.container, Events.CONTAINER_PLAY, this.changeTogglePlay)\n this.listenTo(this.container, Events.CONTAINER_PAUSE, this.changeTogglePlay)\n this.listenTo(this.container, Events.CONTAINER_DBLCLICK, this.toggleFullscreen)\n this.listenTo(this.container, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate)\n this.listenTo(this.container, Events.CONTAINER_PROGRESS, this.updateProgressBar)\n this.listenTo(this.container, Events.CONTAINER_SETTINGSUPDATE, this.settingsUpdate)\n this.listenTo(this.container, Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.settingsUpdate)\n this.listenTo(this.container, Events.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate)\n this.listenTo(this.container, Events.CONTAINER_MEDIACONTROL_DISABLE, this.disable)\n this.listenTo(this.container, Events.CONTAINER_MEDIACONTROL_ENABLE, this.enable)\n this.listenTo(this.container, Events.CONTAINER_ENDED, this.ended)\n this.listenTo(this.container, Events.CONTAINER_VOLUME, this.onVolumeChanged)\n if (this.container.playback.el.nodeName.toLowerCase() === 'video') {\n // wait until the metadata has loaded and then check if fullscreen on video tag is supported\n this.listenToOnce(this.container, Events.CONTAINER_LOADEDMETADATA, this.onLoadedMetadataOnVideoTag)\n }\n }\n }\n\n disable() {\n this.userDisabled = true\n this.hide()\n this.$el.hide()\n }\n\n enable() {\n if (this.options.chromeless) return\n this.userDisabled = false\n this.show()\n }\n\n play() {\n this.container.play()\n }\n\n pause() {\n this.container.pause()\n }\n\n stop() {\n this.container.stop()\n }\n\n onVolumeChanged() {\n this.updateVolumeUI()\n }\n\n onLoadedMetadataOnVideoTag() {\n let video = this.container.playback.el\n // video.webkitSupportsFullscreen is deprecated but iOS appears to only use this\n // see https://github.com/clappr/clappr/issues/1127\n if (!Fullscreen.fullscreenEnabled() && video.webkitSupportsFullscreen) {\n this.fullScreenOnVideoTagSupported = true\n this.settingsUpdate()\n }\n }\n\n updateVolumeUI() {\n if (!this.rendered) {\n // this will be called after a render\n return\n }\n // update volume bar scrubber/fill on bar mode\n this.$volumeBarContainer.find('.bar-fill-2').css({})\n const containerWidth = this.$volumeBarContainer.width()\n const barWidth = this.$volumeBarBackground.width()\n const offset = (containerWidth - barWidth) / 2.0\n const pos = barWidth * this.volume / 100.0 + offset\n this.$volumeBarFill.css({ width: `${this.volume}%` })\n this.$volumeBarScrubber.css({ left: pos })\n\n // update volume bar segments on segmented bar mode\n this.$volumeBarContainer.find('.segmented-bar-element').removeClass('fill')\n const item = Math.ceil(this.volume / 10.0)\n this.$volumeBarContainer.find('.segmented-bar-element').slice(0, item).addClass('fill')\n this.$volumeIcon.html('')\n this.$volumeIcon.removeClass('muted')\n if (!this.muted) {\n this.$volumeIcon.append(volumeIcon)\n } else {\n this.$volumeIcon.append(volumeMuteIcon)\n this.$volumeIcon.addClass('muted')\n }\n this.applyButtonStyle(this.$volumeIcon)\n }\n\n changeTogglePlay() {\n this.$playPauseToggle.html('')\n this.$playStopToggle.html('')\n if (this.container && this.container.isPlaying()) {\n this.$playPauseToggle.append(pauseIcon)\n this.$playStopToggle.append(stopIcon)\n this.trigger(Events.MEDIACONTROL_PLAYING)\n } else {\n this.$playPauseToggle.append(playIcon)\n this.$playStopToggle.append(playIcon)\n this.trigger(Events.MEDIACONTROL_NOTPLAYING)\n if (Browser.isMobile) {\n this.show()\n }\n }\n this.applyButtonStyle(this.$playPauseToggle)\n this.applyButtonStyle(this.$playStopToggle)\n }\n\n mousemoveOnSeekBar(event) {\n if (this.settings.seekEnabled) {\n const offsetX = event.pageX - this.$seekBarContainer.offset().left - (this.$seekBarHover.width() / 2)\n this.$seekBarHover.css({left: offsetX})\n }\n this.trigger(Events.MEDIACONTROL_MOUSEMOVE_SEEKBAR, event)\n }\n\n mouseleaveOnSeekBar(event) {\n this.trigger(Events.MEDIACONTROL_MOUSELEAVE_SEEKBAR, event)\n }\n\n onVolumeClick(event) {\n this.setVolume(this.getVolumeFromUIEvent(event))\n }\n\n mousemoveOnVolumeBar(event) {\n if(this.draggingVolumeBar) {\n this.setVolume(this.getVolumeFromUIEvent(event))\n }\n }\n\n playerResize(size) {\n this.$fullscreenToggle.html('')\n if (Fullscreen.isFullscreen()) {\n this.$fullscreenToggle.append(exitFullscreenIcon)\n } else {\n this.$fullscreenToggle.append(fullscreenIcon)\n }\n this.applyButtonStyle(this.$fullscreenToggle)\n this.$el.removeClass('w320')\n if (size.width <= 320 || this.options.hideVolumeBar) {\n this.$el.addClass('w320')\n }\n }\n\n togglePlayPause() {\n if (this.container.isPlaying()) {\n this.container.pause()\n } else {\n this.container.play()\n }\n return false\n }\n\n togglePlayStop() {\n if (this.container.isPlaying()) {\n this.container.stop()\n } else {\n this.container.play()\n }\n }\n\n startSeekDrag(event) {\n if (!this.settings.seekEnabled) return\n this.draggingSeekBar = true\n this.$el.addClass('dragging')\n this.$seekBarLoaded.addClass('media-control-notransition')\n this.$seekBarPosition.addClass('media-control-notransition')\n this.$seekBarScrubber.addClass('media-control-notransition')\n if (event) {\n event.preventDefault()\n }\n }\n\n startVolumeDrag(event) {\n this.draggingVolumeBar = true\n this.$el.addClass('dragging')\n if (event) {\n event.preventDefault()\n }\n }\n\n stopDrag(event) {\n if (this.draggingSeekBar) {\n this.seek(event)\n }\n this.$el.removeClass('dragging')\n this.$seekBarLoaded.removeClass('media-control-notransition')\n this.$seekBarPosition.removeClass('media-control-notransition')\n this.$seekBarScrubber.removeClass('media-control-notransition dragging')\n this.draggingSeekBar = false\n this.draggingVolumeBar = false\n }\n\n updateDrag(event) {\n if (this.draggingSeekBar) {\n event.preventDefault()\n const offsetX = event.pageX - this.$seekBarContainer.offset().left\n let pos = offsetX / this.$seekBarContainer.width() * 100\n pos = Math.min(100, Math.max(pos, 0))\n this.setSeekPercentage(pos)\n } else if (this.draggingVolumeBar) {\n event.preventDefault()\n this.setVolume(this.getVolumeFromUIEvent(event))\n }\n }\n\n getVolumeFromUIEvent(event) {\n const offsetY = event.pageX - this.$volumeBarContainer.offset().left\n const volumeFromUI = (offsetY / this.$volumeBarContainer.width()) * 100\n return volumeFromUI\n }\n\n toggleMute() {\n this.setVolume(this.muted ? 100 : 0)\n }\n\n setVolume(value) {\n value = Math.min(100, Math.max(value, 0))\n // this will hold the intended volume\n // it may not actually get set to this straight away\n // if the container is not ready etc\n this.intendedVolume = value\n this.persistConfig && Config.persist('volume', value)\n const setWhenContainerReady = () => {\n if (this.container.isReady) {\n this.container.setVolume(value)\n } else {\n this.listenToOnce(this.container, Events.CONTAINER_READY, () => {\n this.container.setVolume(value)\n })\n }\n }\n\n if (!this.container) {\n this.listenToOnce(this, Events.MEDIACONTROL_CONTAINERCHANGED, () => {\n setWhenContainerReady()\n })\n } else {\n setWhenContainerReady()\n }\n }\n\n toggleFullscreen() {\n this.trigger(Events.MEDIACONTROL_FULLSCREEN, this.name)\n this.container.fullscreen()\n this.resetUserKeepVisible()\n }\n\n setContainer(container) {\n if (this.container) {\n this.stopListening(this.container)\n this.fullScreenOnVideoTagSupported = null\n }\n Mediator.off(`${this.options.playerId}:${Events.PLAYER_RESIZE}`, this.playerResize, this)\n this.container = container\n // set the new container to match the volume of the last one\n this.setVolume(this.intendedVolume)\n this.changeTogglePlay()\n this.addEventListeners()\n this.settingsUpdate()\n this.container.trigger(Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.container.isDvrInUse())\n if (this.container.mediaControlDisabled) {\n this.disable()\n }\n this.trigger(Events.MEDIACONTROL_CONTAINERCHANGED)\n }\n\n showVolumeBar() {\n if (this.hideVolumeId) {\n clearTimeout(this.hideVolumeId)\n }\n this.$volumeBarContainer.removeClass('volume-bar-hide')\n }\n\n hideVolumeBar(timeout = 400) {\n if (!this.$volumeBarContainer) return\n if (this.draggingVolumeBar) {\n this.hideVolumeId = setTimeout(() => this.hideVolumeBar(), timeout)\n } else {\n if (this.hideVolumeId) {\n clearTimeout(this.hideVolumeId)\n }\n this.hideVolumeId = setTimeout(() => this.$volumeBarContainer.addClass('volume-bar-hide'), timeout)\n }\n }\n\n ended() {\n this.changeTogglePlay()\n }\n\n updateProgressBar(progress) {\n const loadedStart = progress.start / progress.total * 100\n const loadedEnd = progress.current / progress.total * 100\n this.$seekBarLoaded.css({ left: `${loadedStart}%`, width: `${loadedEnd - loadedStart}%` })\n }\n\n onTimeUpdate(timeProgress) {\n if (this.draggingSeekBar) return\n // TODO why should current time ever be negative?\n const position = (timeProgress.current < 0) ? timeProgress.total : timeProgress.current\n\n this.currentPositionValue = position\n this.currentDurationValue = timeProgress.total\n this.renderSeekBar()\n }\n\n renderSeekBar() {\n if (this.currentPositionValue === null || this.currentDurationValue === null) {\n // this will be triggered as soon as these beocome available\n return\n }\n\n // default to 100%\n this.currentSeekBarPercentage = 100\n if (this.container.getPlaybackType() !== Playback.LIVE || this.container.isDvrInUse()) {\n this.currentSeekBarPercentage = (this.currentPositionValue / this.currentDurationValue) * 100\n }\n this.setSeekPercentage(this.currentSeekBarPercentage)\n\n const newPosition = formatTime(this.currentPositionValue)\n const newDuration = formatTime(this.currentDurationValue)\n if (newPosition !== this.displayedPosition) {\n this.$position.text(newPosition)\n this.displayedPosition = newPosition\n }\n if (newDuration !== this.displayedDuration) {\n this.$duration.text(newDuration)\n this.displayedDuration = newDuration\n }\n }\n\n seek(event) {\n if (!this.settings.seekEnabled) return\n const offsetX = event.pageX - this.$seekBarContainer.offset().left\n let pos = offsetX / this.$seekBarContainer.width() * 100\n pos = Math.min(100, Math.max(pos, 0))\n this.container.seekPercentage(pos)\n this.setSeekPercentage(pos)\n return false\n }\n\n setKeepVisible() {\n this.keepVisible = true\n }\n\n resetKeepVisible() {\n this.keepVisible = false\n }\n\n setUserKeepVisible() {\n this.userKeepVisible = true\n }\n\n resetUserKeepVisible() {\n this.userKeepVisible = false\n }\n\n isVisible() {\n return !this.$el.hasClass('media-control-hide')\n }\n\n show(event) {\n if (this.disabled) {\n return\n }\n const timeout = 2000\n if (!event || (event.clientX !== this.lastMouseX && event.clientY !== this.lastMouseY) || navigator.userAgent.match(/firefox/i)) {\n clearTimeout(this.hideId)\n this.$el.show()\n this.trigger(Events.MEDIACONTROL_SHOW, this.name)\n this.$el.removeClass('media-control-hide')\n this.hideId = setTimeout(() => this.hide(), timeout)\n if (event) {\n this.lastMouseX = event.clientX\n this.lastMouseY = event.clientY\n }\n }\n }\n\n hide(delay = 0) {\n if (!this.isVisible() || (Browser.isMobile && !this.container.isPlaying())) {\n return\n }\n const timeout = delay || 2000\n clearTimeout(this.hideId)\n if (!this.disabled && this.options.hideMediaControl === false) {\n return\n }\n if (!this.disabled && (delay || this.userKeepVisible || this.keepVisible || this.draggingSeekBar || this.draggingVolumeBar)) {\n this.hideId = setTimeout(() => this.hide(), timeout)\n } else {\n this.trigger(Events.MEDIACONTROL_HIDE, this.name)\n this.$el.addClass('media-control-hide')\n this.hideVolumeBar(0)\n }\n }\n\n settingsUpdate() {\n const newSettings = this.getSettings()\n if (newSettings && !this.fullScreenOnVideoTagSupported && !Fullscreen.fullscreenEnabled()) {\n // remove fullscreen from settings if it is present\n newSettings.default && removeArrayItem(newSettings.default, 'fullscreen')\n newSettings.left && removeArrayItem(newSettings.left, 'fullscreen')\n newSettings.right && removeArrayItem(newSettings.right, 'fullscreen')\n }\n const settingsChanged = JSON.stringify(this.settings) !== JSON.stringify(newSettings)\n if (settingsChanged) {\n this.settings = newSettings\n this.render()\n }\n }\n\n getSettings() {\n return merge({}, this.container.settings)\n }\n\n highDefinitionUpdate(isHD) {\n const method = isHD ? 'addClass' : 'removeClass'\n this.$hdIndicator[method]('enabled')\n }\n\n createCachedElements() {\n const $layer = this.$el.find('.media-control-layer')\n this.$duration = $layer.find('.media-control-indicator[data-duration]')\n this.$fullscreenToggle = $layer.find('button.media-control-button[data-fullscreen]')\n this.$playPauseToggle = $layer.find('button.media-control-button[data-playpause]')\n this.$playStopToggle = $layer.find('button.media-control-button[data-playstop]')\n this.$position = $layer.find('.media-control-indicator[data-position]')\n this.$seekBarContainer = $layer.find('.bar-container[data-seekbar]')\n this.$seekBarHover = $layer.find('.bar-hover[data-seekbar]')\n this.$seekBarLoaded = $layer.find('.bar-fill-1[data-seekbar]')\n this.$seekBarPosition = $layer.find('.bar-fill-2[data-seekbar]')\n this.$seekBarScrubber = $layer.find('.bar-scrubber[data-seekbar]')\n this.$volumeBarContainer = $layer.find('.bar-container[data-volume]')\n this.$volumeContainer = $layer.find('.drawer-container[data-volume]')\n this.$volumeIcon = $layer.find('.drawer-icon[data-volume]')\n this.$volumeBarBackground = this.$el.find('.bar-background[data-volume]')\n this.$volumeBarFill = this.$el.find('.bar-fill-1[data-volume]')\n this.$volumeBarScrubber = this.$el.find('.bar-scrubber[data-volume]')\n this.$hdIndicator = this.$el.find('button.media-control-button[data-hd-indicator]')\n this.resetIndicators()\n this.initializeIcons()\n }\n\n resetIndicators() {\n this.displayedPosition = this.$position.text()\n this.displayedDuration = this.$duration.text()\n }\n\n initializeIcons() {\n const $layer = this.$el.find('.media-control-layer')\n $layer.find('button.media-control-button[data-play]').append(playIcon)\n $layer.find('button.media-control-button[data-pause]').append(pauseIcon)\n $layer.find('button.media-control-button[data-stop]').append(stopIcon)\n this.$playPauseToggle.append(playIcon)\n this.$playStopToggle.append(playIcon)\n this.$volumeIcon.append(volumeIcon)\n this.$fullscreenToggle.append(fullscreenIcon)\n this.$hdIndicator.append(hdIcon)\n }\n\n setSeekPercentage(value) {\n value = Math.max(Math.min(value, 100.0), 0)\n if (this.displayedSeekBarPercentage === value) {\n // not changed since last update\n return\n }\n this.displayedSeekBarPercentage = value\n\n this.$seekBarPosition.removeClass('media-control-notransition')\n this.$seekBarScrubber.removeClass('media-control-notransition')\n this.$seekBarPosition.css({ width: `${value}%` })\n this.$seekBarScrubber.css({ left: `${value}%` })\n }\n\n seekRelative(delta) {\n if (!this.settings.seekEnabled) return\n const currentTime = this.container.getCurrentTime()\n const duration = this.container.getDuration()\n let position = Math.min(Math.max(currentTime + delta, 0), duration)\n position = Math.min(position * 100 / duration, 100)\n this.container.seekPercentage(position)\n }\n\n bindKeyEvents() {\n this.unbindKeyEvents()\n this.kibo = new Kibo(this.options.focusElement)\n this.kibo.down(['space'], () => this.togglePlayPause())\n this.kibo.down(['left'], () => this.seekRelative(-15))\n this.kibo.down(['right'], () => this.seekRelative(15))\n const keys = [1,2,3,4,5,6,7,8,9,0]\n keys.forEach((i) => { this.kibo.down(i.toString(), () => this.settings.seekEnabled && this.container.seekPercentage(i * 10)) })\n }\n\n unbindKeyEvents() {\n if (this.kibo) {\n this.kibo.off('space')\n this.kibo.off('left')\n this.kibo.off('right')\n this.kibo.off([1,2,3,4,5,6,7,8,9,0])\n }\n }\n\n parseColors() {\n if (this.options.mediacontrol) {\n this.buttonsColor = this.options.mediacontrol.buttons\n const seekbarColor = this.options.mediacontrol.seekbar\n this.$el.find('.bar-fill-2[data-seekbar]').css('background-color', seekbarColor)\n this.$el.find('.media-control-icon svg path').css('fill', this.buttonsColor)\n this.$el.find('.segmented-bar-element[data-volume]').css('boxShadow', 'inset 2px 0 0 ' + this.buttonsColor)\n }\n }\n\n applyButtonStyle(element) {\n if (this.buttonsColor && element) {\n $(element).find('svg path').css('fill', this.buttonsColor)\n }\n }\n\n destroy() {\n this.remove()\n $(document).unbind('mouseup', this.stopDragHandler)\n $(document).unbind('mousemove', this.updateDragHandler)\n this.unbindKeyEvents()\n }\n\n render() {\n const timeout = 1000\n this.$el.html(this.template({ settings: this.settings }))\n this.$el.append(this.stylesheet)\n this.createCachedElements()\n this.$playPauseToggle.addClass('paused')\n this.$playStopToggle.addClass('stopped')\n\n this.changeTogglePlay()\n this.hideId = setTimeout(() => this.hide(), timeout)\n if (this.disabled) {\n this.hide()\n }\n\n if(Browser.isSafari && Browser.isMobile) {\n this.$volumeContainer.css('display','none')\n }\n\n this.$seekBarPosition.addClass('media-control-notransition')\n this.$seekBarScrubber.addClass('media-control-notransition')\n\n let previousSeekPercentage = 0\n if (this.displayedSeekBarPercentage) {\n previousSeekPercentage = this.displayedSeekBarPercentage\n }\n this.displayedSeekBarPercentage = null\n this.setSeekPercentage(previousSeekPercentage)\n\n process.nextTick(() => {\n if (!this.settings.seekEnabled) {\n this.$seekBarContainer.addClass('seek-disabled')\n }\n if (!this.options.disableKeyboardShortcuts) {\n this.bindKeyEvents()\n }\n this.playerResize({width: this.options.width, height: this.options.height})\n this.hideVolumeBar(0)\n })\n\n this.parseColors()\n this.highDefinitionUpdate()\n\n this.rendered = true\n this.updateVolumeUI()\n this.trigger(Events.MEDIACONTROL_RENDERED)\n return this\n }\n}\n\nMediaControl.extend = function(properties) {\n return extend(MediaControl, properties)\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/media_control/media_control.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {uniqueId, currentScriptUrl} from 'base/utils'\n\nimport BaseObject from 'base/base_object'\nimport Events from 'base/events'\nimport Browser from 'components/browser'\nimport CoreFactory from 'components/core_factory'\nimport Loader from 'components/loader'\nimport PlayerInfo from 'components/player_info'\nimport $ from 'clappr-zepto'\n\nconst baseUrl = currentScriptUrl().replace(/\\/[^\\/]+$/, '')\n\n/**\n * @class Player\n * @constructor\n * @extends BaseObject\n * @module components\n * @example\n * ### Using the Player\n *\n * Add the following script on your HTML:\n * ```html\n * <head>\n * <script type=\"text/javascript\" src=\"http://cdn.clappr.io/latest/clappr.min.js\"></script>\n * </head>\n * ```\n * Now, create the player:\n * ```html\n * <body>\n * <div id=\"player\"></div>\n * <script>\n * var player = new Clappr.Player({source: \"http://your.video/here.mp4\", parentId: \"#player\"});\n * </script>\n * </body>\n * ```\n */\nexport default class Player extends BaseObject {\n\n set loader(loader) { this._loader = loader }\n get loader() {\n if (!this._loader) {\n this._loader = new Loader(this.options.plugins || {}, this.options.playerId)\n }\n return this._loader\n }\n\n /**\n * Determine if the playback has ended.\n * @property ended\n * @type Boolean\n */\n get ended() {\n return this.core.mediaControl.container.ended\n }\n\n /**\n * Determine if the playback is having to buffer in order for\n * playback to be smooth.\n * (i.e if a live stream is playing smoothly, this will be false)\n * @property buffering\n * @type Boolean\n */\n get buffering() {\n return this.core.mediaControl.container.buffering\n }\n\n /*\n * determine if the player is ready.\n * @property isReady\n * @type {Boolean} `true` if the player is ready. ie PLAYER_READY event has fired\n */\n get isReady() {\n return !!this._ready\n }\n\n /**\n * An events map that allows the user to add custom callbacks in player's options.\n * @property eventsMapping\n * @type {Object}\n */\n get eventsMapping() {\n return {\n onReady: Events.PLAYER_READY,\n onResize: Events.PLAYER_RESIZE,\n onPlay: Events.PLAYER_PLAY,\n onPause: Events.PLAYER_PAUSE,\n onStop: Events.PLAYER_STOP,\n onEnded: Events.PLAYER_ENDED,\n onSeek: Events.PLAYER_SEEK,\n onError: Events.PLAYER_ERROR,\n onTimeUpdate: Events.PLAYER_TIMEUPDATE,\n onVolumeUpdate: Events.PLAYER_VOLUMEUPDATE\n }\n }\n\n /**\n * ## Player's constructor\n *\n * You might pass the options object to build the player.\n * ```javascript\n * var options = {source: \"http://example.com/video.mp4\", param1: \"val1\"};\n * var player = new Clappr.Player(options);\n * ```\n *\n * @method constructor\n * @param {Object} options Data\n * options to build a player instance\n * @param {Number} [options.width]\n * player's width **default**: `640`\n * @param {Number} [options.height]\n * player's height **default**: `360`\n * @param {String} [options.parentId]\n * the id of the element on the page that the player should be inserted into\n * @param {Object} [options.parent]\n * a reference to a dom element that the player should be inserted into\n * @param {String} [options.source]\n * The media source URL, or {source: <<source URL>>, mimeType: <<source mime type>>}\n * @param {Object} [options.sources]\n * An array of media source URL's, or an array of {source: <<source URL>>, mimeType: <<source mime type>>}\n * @param {Boolean} [options.autoPlay]\n * automatically play after page load **default**: `false`\n * @param {Boolean} [options.loop]\n * automatically replay after it ends **default**: `false`\n * @param {Boolean} [options.chromeless]\n * player acts in chromeless mode **default**: `false`\n * @param {Boolean} [options.allowUserInteraction]\n * whether or not the player should handle click events when in chromeless mode **default**: `false` on desktops browsers, `true` on mobile.\n * @param {Boolean} [options.disableKeyboardShortcuts]\n * disable keyboard shortcuts. **default**: `false`. `true` if `allowUserInteraction` is `false`.\n * @param {Boolean} [options.muted]\n * start the video muted **default**: `false`\n * @param {String} [options.mimeType]\n * add `mimeType: \"application/vnd.apple.mpegurl\"` if you need to use a url without extension.\n * @param {String} [options.actualLiveTime]\n * show duration and seek time relative to actual time.\n * @param {String} [options.actualLiveServerTime]\n * specify server time as a string, format: \"2015/11/26 06:01:03\". This option is meant to be used with actualLiveTime.\n * @param {Boolean} [options.persistConfig]\n * persist player's settings (volume) through the same domain **default**: `true`\n * @param {String} [options.preload]\n * video will be preloaded according to `preload` attribute options **default**: `'metadata'`\n * @param {Number} [options.maxBufferLength]\n * the default behavior for the **HLS playback** is to keep buffering indefinitely, even on VoD.\n * This replicates the behavior for progressive download, which continues buffering when pausing the video, thus making the video available for playback even on slow networks.\n * To change this behavior use `maxBufferLength` where **value is in seconds**.\n * @param {String} [options.gaAccount]\n * enable Google Analytics events dispatch **(play/pause/stop/buffering/etc)** by adding your `gaAccount`\n * @param {String} [options.gaTrackerName]\n * besides `gaAccount` you can optionally, pass your favorite trackerName as `gaTrackerName`\n * @param {Object} [options.mediacontrol]\n * customize control bar colors, example: `mediacontrol: {seekbar: \"#E113D3\", buttons: \"#66B2FF\"}`\n * @param {Boolean} [options.hideMediaControl]\n * control media control auto hide **default**: `true`\n * @param {Boolean} [options.hideVolumeBar]\n * when embedded with width less than 320, volume bar will hide. You can force this behavior for all sizes by adding `true` **default**: `false`\n * @param {String} [options.watermark]\n * put `watermark: 'http://url/img.png'` on your embed parameters to automatically add watermark on your video.\n * You can customize corner position by defining position parameter. Positions can be `bottom-left`, `bottom-right`, `top-left` and `top-right`.\n * @param {String} [options.watermarkLink]\n * `watermarkLink: 'http://example.net/'` - define URL to open when the watermark is clicked. If not provided watermark will not be clickable.\n * @param {Boolean} [options.disableVideoTagContextMenu]\n * disables the context menu (right click) on the video element if a HTML5Video playback is used.\n * @param {Boolean} [options.autoSeekFromUrl]\n * Automatically seek to the seconds provided in the url (e.g example.com?t=100) **default**: `true`\n * @param {Boolean} [options.exitFullscreenOnEnd]\n * Automatically exit full screen when the media finishes. **default**: `true`\n * @param {String} [options.poster]\n * define a poster by adding its address `poster: 'http://url/img.png'`. It will appear after video embed, disappear on play and go back when user stops the video.\n * @param {String} [options.playbackNotSupportedMessage]\n * define a custom message to be displayed when a playback is not supported.\n * @param {Object} [options.events]\n * Specify listeners which will be registered with their corresponding player events.\n * E.g. onReady -> \"PLAYER_READY\", onTimeUpdate -> \"PLAYER_TIMEUPDATE\"\n */\n constructor(options) {\n super(options)\n const defaultOptions = {playerId: uniqueId(''), persistConfig: true, width: 640, height: 360, baseUrl: baseUrl, allowUserInteraction: Browser.isMobile}\n this._options = $.extend(defaultOptions, options)\n this.options.sources = this._normalizeSources(options)\n if (!this.options.chromeless) {\n // \"allowUserInteraction\" cannot be false if not in chromeless mode.\n this.options.allowUserInteraction = true\n }\n if (!this.options.allowUserInteraction) {\n // if user iteraction is not allowed ensure keyboard shortcuts are disabled\n this.options.disableKeyboardShortcuts = true\n }\n this._registerOptionEventListeners()\n this._coreFactory = new CoreFactory(this)\n this.playerInfo = PlayerInfo.getInstance(this.options.playerId)\n this.playerInfo.currentSize = {width: options.width, height: options.height}\n this.playerInfo.options = this.options\n if (this.options.parentId) {\n this.setParentId(this.options.parentId)\n }\n else if (this.options.parent) {\n this.attachTo(this.options.parent)\n }\n }\n\n /**\n * Specify a `parentId` to the player.\n * @method setParentId\n * @param {String} parentId the element parent id.\n * @return {Player} itself\n */\n setParentId(parentId) {\n const el = document.querySelector(parentId)\n if (el) {\n this.attachTo(el)\n }\n return this\n }\n\n /**\n * You can use this method to attach the player to a given element. You don't need to do this when you specify it during the player instantiation passing the `parentId` param.\n * @method attachTo\n * @param {Object} element a given element.\n * @return {Player} itself\n */\n attachTo(element) {\n this.options.parentElement = element\n this.core = this._coreFactory.create()\n this._addEventListeners()\n return this\n }\n\n _addEventListeners() {\n if (!this.core.isReady) {\n this.listenToOnce(this.core, Events.CORE_READY, this._onReady)\n } else {\n this._onReady()\n }\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this._containerChanged)\n this.listenTo(this.core, Events.CORE_FULLSCREEN, this._onFullscreenChange)\n return this\n }\n\n _addContainerEventListeners() {\n const container = this.core.mediaControl.container\n if (container) {\n this.listenTo(container, Events.CONTAINER_PLAY, this._onPlay)\n this.listenTo(container, Events.CONTAINER_PAUSE, this._onPause)\n this.listenTo(container, Events.CONTAINER_STOP, this._onStop)\n this.listenTo(container, Events.CONTAINER_ENDED, this._onEnded)\n this.listenTo(container, Events.CONTAINER_SEEK, this._onSeek)\n this.listenTo(container, Events.CONTAINER_ERROR, this._onError)\n this.listenTo(container, Events.CONTAINER_TIMEUPDATE, this._onTimeUpdate)\n this.listenTo(container, Events.CONTAINER_VOLUME, this._onVolumeUpdate)\n }\n return this\n }\n\n _registerOptionEventListeners() {\n const userEvents = this.options.events || {}\n Object.keys(userEvents).forEach((userEvent) => {\n const eventType = this.eventsMapping[userEvent]\n if (eventType) {\n let eventFunction = userEvents[userEvent]\n eventFunction = typeof eventFunction === 'function' && eventFunction\n eventFunction && this.on(eventType, eventFunction)\n }\n })\n return this\n }\n\n _containerChanged() {\n this.stopListening()\n this._addEventListeners()\n }\n\n _onReady() {\n this._ready = true\n this._addContainerEventListeners()\n this.trigger(Events.PLAYER_READY)\n }\n\n _onFullscreenChange(fullscreen) {\n this.trigger(Events.PLAYER_FULLSCREEN, fullscreen)\n }\n\n _onVolumeUpdate(volume) {\n this.trigger(Events.PLAYER_VOLUMEUPDATE, volume)\n }\n\n _onPlay() {\n this.trigger(Events.PLAYER_PLAY)\n }\n\n _onPause() {\n this.trigger(Events.PLAYER_PAUSE)\n }\n\n _onStop() {\n this.trigger(Events.PLAYER_STOP, this.getCurrentTime())\n }\n\n _onEnded() {\n this.trigger(Events.PLAYER_ENDED)\n }\n\n _onSeek(time) {\n this.trigger(Events.PLAYER_SEEK, time)\n }\n\n _onTimeUpdate(timeProgress) {\n this.trigger(Events.PLAYER_TIMEUPDATE, timeProgress)\n }\n\n _onError(error) {\n this.trigger(Events.PLAYER_ERROR, error)\n }\n\n _normalizeSources(options) {\n const sources = options.sources || (options.source !== undefined? [options.source] : [])\n return sources.length === 0 ? [{source:'', mimeType:''}] : sources\n }\n\n /**\n * resizes the current player canvas.\n * @method resize\n * @param {Object} size should be a literal object with `height` and `width`.\n * @return {Player} itself\n * @example\n * ```javascript\n * player.resize({height: 360, width: 640})\n * ```\n */\n resize(size) {\n this.core.resize(size)\n return this\n }\n\n /**\n * loads a new source.\n * @method load\n * @param {Array|String} sources source or sources of video.\n * An array item can be a string or {source: <<source URL>>, mimeType: <<source mime type>>}\n * @param {String} mimeType a mime type, example: `'application/vnd.apple.mpegurl'`\n * @param {Boolean} [autoPlay=false] whether playing should be started immediately\n * @return {Player} itself\n */\n load(sources, mimeType, autoPlay) {\n if (autoPlay !== undefined) {\n this.configure({autoPlay: !!autoPlay})\n }\n this.core.load(sources, mimeType)\n return this\n }\n\n /**\n * destroys the current player and removes it from the DOM.\n * @method destroy\n * @return {Player} itself\n */\n destroy() {\n this.core.destroy()\n return this\n }\n\n /**\n * plays the current video (`source`).\n * @method play\n * @return {Player} itself\n */\n play() {\n this.core.mediaControl.container.play()\n return this\n }\n\n /**\n * pauses the current video (`source`).\n * @method pause\n * @return {Player} itself\n */\n pause() {\n this.core.mediaControl.container.pause()\n return this\n }\n\n /**\n * stops the current video (`source`).\n * @method stop\n * @return {Player} itself\n */\n stop() {\n this.core.mediaControl.container.stop()\n return this\n }\n\n\n /**\n * seeks the current video (`source`). For example, `player.seek(120)` will seek to second 120 (2minutes) of the current video.\n * @method seek\n * @param {Number} time should be a number between 0 and the video duration.\n * @return {Player} itself\n */\n seek(time) {\n this.core.mediaControl.container.seek(time)\n return this\n }\n\n /**\n * seeks the current video (`source`). For example, `player.seek(50)` will seek to the middle of the current video.\n * @method seekPercentage\n * @param {Number} time should be a number between 0 and 100.\n * @return {Player} itself\n */\n seekPercentage(percentage) {\n this.core.mediaControl.container.seekPercentage(percentage)\n return this\n }\n\n /**\n * Set the volume for the current video (`source`).\n * @method setVolume\n * @param {Number} volume should be a number between 0 and 100, 0 being mute and 100 the max volume.\n * @return {Player} itself\n */\n setVolume(volume) {\n if (this.core && this.core.mediaControl) {\n this.core.mediaControl.setVolume(volume)\n }\n return this\n }\n\n /**\n * Get the volume for the current video\n * @method getVolume\n * @return {Number} volume should be a number between 0 and 100, 0 being mute and 100 the max volume.\n */\n getVolume() {\n return this.core && this.core.mediaControl ? this.core.mediaControl.volume : 0\n }\n\n /**\n * mutes the current video (`source`).\n * @method mute\n * @return {Player} itself\n */\n mute() {\n this._mutedVolume = this.getVolume()\n this.setVolume(0)\n return this\n }\n\n /**\n * unmutes the current video (`source`).\n * @method unmute\n * @return {Player} itself\n */\n unmute() {\n this.setVolume(typeof this._mutedVolume === 'number' ? this._mutedVolume : 100)\n this._mutedVolume = null\n return this\n }\n\n /**\n * checks if the player is playing.\n * @method isPlaying\n * @return {Boolean} `true` if the current source is playing, otherwise `false`\n */\n isPlaying() {\n return this.core.mediaControl.container.isPlaying()\n }\n\n /**\n * returns `true` if DVR is enable otherwise `false`.\n * @method isDvrEnabled\n * @return {Boolean}\n */\n isDvrEnabled() {\n return this.core.mediaControl.container.isDvrEnabled()\n }\n\n /**\n * returns `true` if DVR is in use otherwise `false`.\n * @method isDvrInUse\n * @return {Boolean}\n */\n isDvrInUse() {\n return this.core.mediaControl.container.isDvrInUse()\n }\n\n /**\n * enables to configure a player after its creation\n * @method configure\n * @param {Object} options all the options to change in form of a javascript object\n * @return {Player} itself\n */\n configure(options) {\n this.core.configure(options)\n return this\n }\n\n /**\n * get a plugin by its name.\n * @method getPlugin\n * @param {String} name of the plugin.\n * @return {Object} the plugin instance\n * @example\n * ```javascript\n * var poster = player.getPlugin('poster');\n * poster.hidePlayButton();\n * ```\n */\n getPlugin(name) {\n const plugins = this.core.plugins.concat(this.core.mediaControl.container.plugins)\n return plugins.filter(plugin => plugin.name === name)[0]\n }\n\n /**\n * the current time in seconds.\n * @method getCurrentTime\n * @return {Number} current time (in seconds) of the current source\n */\n getCurrentTime() {\n return this.core.mediaControl.container.getCurrentTime()\n }\n\n /**\n * The time that \"0\" now represents relative to when playback started.\n * For a stream with a sliding window this will increase as content is\n * removed from the beginning.\n * @method getStartTimeOffset\n * @return {Number} time (in seconds) that time \"0\" represents.\n */\n getStartTimeOffset() {\n return this.core.mediaControl.container.getStartTimeOffset()\n }\n\n /**\n * the duration time in seconds.\n * @method getDuration\n * @return {Number} duration time (in seconds) of the current source\n */\n getDuration() {\n return this.core.mediaControl.container.getDuration()\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/player.js","// Copyright 2015 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport Playback from 'base/playback'\nimport Styler from 'base/styler'\nimport template from 'base/template'\nimport Browser from 'components/browser'\n\nimport flashHTML from './public/flash.html'\nimport flashStyle from './public/flash.scss'\n\nconst IE_CLASSID = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'\n\nexport default class BaseFlashPlayback extends Playback {\n get tagName() { return 'object' }\n get swfPath() { return '' }\n get wmode() { return 'transparent' }\n get template() { return template(flashHTML) }\n get attributes() {\n let type = 'application/x-shockwave-flash'\n\n if (Browser.isLegacyIE) {\n type = ''\n }\n\n return {\n class: 'clappr-flash-playback',\n type: type,\n width: '100%',\n height: '100%',\n 'data-flash-playback': this.name\n }\n }\n\n setElement(element) {\n this.$el = element\n this.el = element[0]\n }\n\n _setupFirefox() {\n const $el = this.$('embed')\n $el.attr('data-flash-playback', this.name)\n $el.addClass(this.attributes.class)\n this.setElement($el)\n }\n\n render() {\n this.$el.html(this.template({\n cid: this.cid,\n swfPath: this.swfPath,\n baseUrl: this.baseUrl,\n playbackId: this.uniqueId,\n wmode: this.wmode,\n callbackName: `window.Clappr.flashlsCallbacks.${this.cid}`})\n )\n\n if (Browser.isIE) {\n this.$('embed').remove()\n\n if (Browser.isLegacyIE) {\n this.$el.attr('classid', IE_CLASSID)\n }\n }\n\n if (Browser.isFirefox) {\n this._setupFirefox()\n }\n\n this.el.id = this.cid\n this.$el.append(Styler.getStyleFor(flashStyle))\n\n return this\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/base_flash_playback/base_flash_playback.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {seekStringToSeconds} from 'base/utils'\n\nimport BaseFlashPlayback from 'playbacks/base_flash_playback'\nimport Browser from 'components/browser'\nimport Mediator from 'components/mediator'\nimport template from 'base/template'\nimport $ from 'clappr-zepto'\nimport Events from 'base/events'\nimport Playback from 'base/playback'\nimport flashSwf from './public/Player.swf'\n\nconst MAX_ATTEMPTS = 60\n\nexport default class Flash extends BaseFlashPlayback {\n get name() { return 'flash' }\n get swfPath() { return template(flashSwf)({baseUrl: this._baseUrl}) }\n\n /**\n * Determine if the playback has ended.\n * @property ended\n * @type Boolean\n */\n get ended() {\n return this._currentState === 'ENDED'\n }\n\n /**\n * Determine if the playback is buffering.\n * This is related to the PLAYBACK_BUFFERING and PLAYBACK_BUFFERFULL events\n * @property buffering\n * @type Boolean\n */\n get buffering() {\n return !!this._bufferingState && this._currentState !== 'ENDED'\n }\n\n constructor(...args) {\n super(...args)\n this._src = this.options.src\n this._baseUrl = this.options.baseUrl\n this._autoPlay = this.options.autoPlay\n this.settings = {default: ['seekbar']}\n this.settings.left = ['playpause', 'position', 'duration']\n this.settings.right = ['fullscreen', 'volume']\n this.settings.seekEnabled = true\n this._isReadyState = false\n this._addListeners()\n }\n\n\n _bootstrap() {\n if (this.el.playerPlay) {\n this.el.width = '100%'\n this.el.height = '100%'\n if (this._currentState === 'PLAYING') {\n this._firstPlay()\n } else {\n this._currentState = 'IDLE'\n this._autoPlay && this.play()\n }\n $('<div style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%\" />').insertAfter(this.$el)\n if (this.getDuration() > 0) {\n this._metadataLoaded()\n } else {\n Mediator.once(this.uniqueId + ':timeupdate', this._metadataLoaded, this)\n }\n } else {\n this._attempts = this._attempts || 0\n if (++this._attempts <= MAX_ATTEMPTS) {\n setTimeout(() => this._bootstrap(), 50)\n } else {\n this.trigger(Events.PLAYBACK_ERROR, {message: 'Max number of attempts reached'}, this.name)\n }\n }\n }\n\n _metadataLoaded() {\n this._isReadyState = true\n this.trigger(Events.PLAYBACK_READY, this.name)\n this.trigger(Events.PLAYBACK_SETTINGSUPDATE, this.name)\n }\n\n getPlaybackType() {\n return Playback.VOD\n }\n\n isHighDefinitionInUse() {\n return false\n }\n\n _updateTime() {\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: this.el.getPosition(), total: this.el.getDuration()}, this.name)\n }\n\n _addListeners() {\n Mediator.on(this.uniqueId + ':progress', this._progress, this)\n Mediator.on(this.uniqueId + ':timeupdate', this._updateTime, this)\n Mediator.on(this.uniqueId + ':statechanged', this._checkState, this)\n Mediator.on(this.uniqueId + ':flashready', this._bootstrap, this)\n }\n\n stopListening() {\n super.stopListening()\n Mediator.off(this.uniqueId + ':progress')\n Mediator.off(this.uniqueId + ':timeupdate')\n Mediator.off(this.uniqueId + ':statechanged')\n Mediator.off(this.uniqueId + ':flashready')\n }\n\n _checkState() {\n if (this._isIdle || this._currentState === 'PAUSED') {\n return\n } else if (this._currentState !== 'PLAYING_BUFFERING' && this.el.getState() === 'PLAYING_BUFFERING') {\n this._bufferingState = true\n this.trigger(Events.PLAYBACK_BUFFERING, this.name)\n this._currentState = 'PLAYING_BUFFERING'\n } else if (this.el.getState() === 'PLAYING') {\n this._bufferingState = false\n this.trigger(Events.PLAYBACK_BUFFERFULL, this.name)\n this._currentState = 'PLAYING'\n } else if (this.el.getState() === 'IDLE') {\n this._currentState = 'IDLE'\n } else if (this.el.getState() === 'ENDED') {\n this.trigger(Events.PLAYBACK_ENDED, this.name)\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: 0, total: this.el.getDuration()}, this.name)\n this._currentState = 'ENDED'\n this._isIdle = true\n }\n }\n\n _progress() {\n if (this._currentState !== 'IDLE' && this._currentState !== 'ENDED') {\n this.trigger(Events.PLAYBACK_PROGRESS,{\n start: 0,\n current: this.el.getBytesLoaded(),\n total: this.el.getBytesTotal()\n })\n }\n }\n\n _firstPlay() {\n if (this.el.playerPlay) {\n this._isIdle = false\n this.el.playerPlay(this._src)\n this.listenToOnce(this, Events.PLAYBACK_BUFFERFULL, () => this._checkInitialSeek())\n this._currentState = 'PLAYING'\n } else {\n this.listenToOnce(this, Events.PLAYBACK_READY, this._firstPlay)\n }\n }\n\n _checkInitialSeek() {\n let seekTime = seekStringToSeconds(window.location.href)\n if (seekTime !== 0) {\n this.seekSeconds(seekTime)\n }\n }\n\n play() {\n this.trigger(Events.PLAYBACK_PLAY_INTENT)\n if (this._currentState === 'PAUSED' || this._currentState === 'PLAYING_BUFFERING') {\n this._currentState = 'PLAYING'\n this.el.playerResume()\n this.trigger(Events.PLAYBACK_PLAY, this.name)\n } else if (this._currentState !== 'PLAYING') {\n this._firstPlay()\n this.trigger(Events.PLAYBACK_PLAY, this.name)\n }\n }\n\n volume(value) {\n if (this.isReady) {\n this.el.playerVolume(value)\n } else {\n this.listenToOnce(this, Events.PLAYBACK_BUFFERFULL, () => this.volume(value))\n }\n }\n\n pause() {\n this._currentState = 'PAUSED'\n this.el.playerPause()\n this.trigger(Events.PLAYBACK_PAUSE, this.name)\n }\n\n stop() {\n this.el.playerStop()\n this.trigger(Events.PLAYBACK_STOP)\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: 0, total: 0}, this.name)\n }\n\n isPlaying() {\n return !!(this.isReady && this._currentState.indexOf('PLAYING') > -1)\n }\n\n get isReady(){\n return this._isReadyState\n }\n\n getDuration() {\n return this.el.getDuration()\n }\n\n seekPercentage(percentage) {\n if (this.el.getDuration() > 0) {\n let seekSeconds = this.el.getDuration() * (percentage / 100)\n this.seek(seekSeconds)\n } else {\n this.listenToOnce(this, Events.PLAYBACK_BUFFERFULL, () => this.seekPercentage(percentage))\n }\n }\n\n seek(time) {\n if (this.isReady && this.el.playerSeek) {\n this.el.playerSeek(time)\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: time, total: this.el.getDuration()}, this.name)\n if (this._currentState === 'PAUSED') {\n this.el.playerPause()\n }\n } else {\n this.listenToOnce(this, Events.PLAYBACK_BUFFERFULL, () => this.seek(time))\n }\n }\n\n destroy() {\n clearInterval(this.bootstrapId)\n super.stopListening()\n this.$el.remove()\n }\n}\n\nFlash.canPlay = function(resource) {\n if (!Browser.hasFlash || !resource || resource.constructor !== String) {\n return false\n } else {\n const resourceParts = resource.split('?')[0].match(/.*\\.(.*)$/) || []\n return resourceParts.length > 1 && !Browser.isMobile && resourceParts[1].toLowerCase().match(/^(mp4|mov|f4v|3gpp|3gp)$/)\n\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/flash/flash.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport BaseFlashPlayback from 'playbacks/base_flash_playback'\nimport Events from 'base/events'\nimport template from 'base/template'\nimport Playback from 'base/playback'\nimport Mediator from 'components/mediator'\nimport Browser from 'components/browser'\nimport HLSEvents from './flashls_events'\nimport hlsSwf from './public/HLSPlayer.swf'\nimport $ from 'clappr-zepto'\n\n\nconst MAX_ATTEMPTS = 60\nconst AUTO = -1\n\nexport default class FlasHLS extends BaseFlashPlayback {\n get name() { return 'flashls' }\n get swfPath() { return template(hlsSwf)({baseUrl: this._baseUrl}) }\n\n get levels() { return this._levels || [] }\n get currentLevel() {\n if (this._currentLevel === null || this._currentLevel === undefined) {\n return AUTO\n } else {\n return this._currentLevel //0 is a valid level ID\n }\n }\n set currentLevel(id) {\n this._currentLevel = id\n this.trigger(Events.PLAYBACK_LEVEL_SWITCH_START)\n this.el.playerSetCurrentLevel(id)\n }\n\n /**\n * Determine if the playback has ended.\n * @property ended\n * @type Boolean\n */\n get ended() {\n return this._hasEnded\n }\n\n /**\n * Determine if the playback is buffering.\n * This is related to the PLAYBACK_BUFFERING and PLAYBACK_BUFFERFULL events\n * @property buffering\n * @type Boolean\n */\n get buffering() {\n return !!this._bufferingState && !this._hasEnded\n }\n\n constructor(...args) {\n super(...args)\n this._src = this.options.src\n this._baseUrl = this.options.baseUrl\n this._initHlsParameters(this.options)\n // TODO can this be private?\n this.highDefinition = false\n this._autoPlay = this.options.autoPlay\n this._loop = this.options.loop\n this._defaultSettings = {\n left: ['playstop'],\n default: ['seekbar'],\n right: ['fullscreen', 'volume', 'hd-indicator'],\n seekEnabled: false\n }\n this.settings = $.extend({}, this._defaultSettings)\n this._playbackType = Playback.LIVE\n this._hasEnded = false\n this._addListeners()\n }\n\n _initHlsParameters(options) {\n this._autoStartLoad = (options.autoStartLoad === undefined) ? true : options.autoStartLoad\n this._capLevelToStage = (options.capLevelToStage === undefined) ? false : options.capLevelToStage\n this._maxLevelCappingMode = (options.maxLevelCappingMode === undefined) ? 'downscale' : options.maxLevelCappingMode\n this._minBufferLength = (options.minBufferLength === undefined) ? -1 : options.minBufferLength\n this._minBufferLengthCapping = (options.minBufferLengthCapping === undefined) ? -1 : options.minBufferLengthCapping\n this._maxBufferLength = (options.maxBufferLength === undefined) ? 120 : options.maxBufferLength\n this._maxBackBufferLength = (options.maxBackBufferLength === undefined) ? 30 : options.maxBackBufferLength\n this._lowBufferLength = (options.lowBufferLength === undefined) ? 3 : options.lowBufferLength\n this._mediaTimePeriod = (options.mediaTimePeriod === undefined) ? 100 : options.mediaTimePeriod\n this._fpsDroppedMonitoringPeriod = (options.fpsDroppedMonitoringPeriod === undefined) ? 5000 : options.fpsDroppedMonitoringPeriod\n this._fpsDroppedMonitoringThreshold = (options.fpsDroppedMonitoringThreshold === undefined) ? 0.2 : options.fpsDroppedMonitoringThreshold\n this._capLevelonFPSDrop = (options.capLevelonFPSDrop === undefined) ? false : options.capLevelonFPSDrop\n this._smoothAutoSwitchonFPSDrop = (options.smoothAutoSwitchonFPSDrop === undefined) ? this.capLevelonFPSDrop : options.smoothAutoSwitchonFPSDrop\n this._switchDownOnLevelError = (options.switchDownOnLevelError === undefined) ? true : options.switchDownOnLevelError\n this._seekMode = (options.seekMode === undefined) ? 'ACCURATE' : options.seekMode\n this._keyLoadMaxRetry = (options.keyLoadMaxRetry === undefined) ? 3 : options.keyLoadMaxRetry\n this._keyLoadMaxRetryTimeout = (options.keyLoadMaxRetryTimeout === undefined) ? 64000 : options.keyLoadMaxRetryTimeout\n this._fragmentLoadMaxRetry = (options.fragmentLoadMaxRetry === undefined) ? 3 : options.fragmentLoadMaxRetry\n this._fragmentLoadMaxRetryTimeout = (options.fragmentLoadMaxRetryTimeout === undefined) ? 4000 : options.fragmentLoadMaxRetryTimeout\n this._fragmentLoadSkipAfterMaxRetry = (options.fragmentLoadSkipAfterMaxRetry === undefined) ? true : options.fragmentLoadSkipAfterMaxRetry\n this._maxSkippedFragments = (options.maxSkippedFragments === undefined) ? 5 : options.maxSkippedFragments\n this._flushLiveURLCache = (options.flushLiveURLCache === undefined) ? false : options.flushLiveURLCache\n this._initialLiveManifestSize = (options.initialLiveManifestSize === undefined) ? 1 : options.initialLiveManifestSize\n this._manifestLoadMaxRetry = (options.manifestLoadMaxRetry === undefined) ? 3 : options.manifestLoadMaxRetry\n this._manifestLoadMaxRetryTimeout = (options.manifestLoadMaxRetryTimeout === undefined) ? 64000 : options.manifestLoadMaxRetryTimeout\n this._manifestRedundantLoadmaxRetry = (options.manifestRedundantLoadmaxRetry === undefined) ? 3 : options.manifestRedundantLoadmaxRetry\n this._startFromBitrate = (options.startFromBitrate === undefined) ? -1 : options.startFromBitrate\n this._startFromLevel = (options.startFromLevel === undefined) ? -1 : options.startFromLevel\n this._autoStartMaxDuration = (options.autoStartMaxDuration === undefined) ? -1 : options.autoStartMaxDuration\n this._seekFromLevel = (options.seekFromLevel === undefined) ? -1 : options.seekFromLevel\n this._useHardwareVideoDecoder = (options.useHardwareVideoDecoder === undefined) ? false : options.useHardwareVideoDecoder\n this._hlsLogEnabled = (options.hlsLogEnabled === undefined) ? true : options.hlsLogEnabled\n this._logDebug = (options.logDebug === undefined) ? false : options.logDebug\n this._logDebug2 = (options.logDebug2 === undefined) ? false : options.logDebug2\n this._logWarn = (options.logWarn === undefined) ? true : options.logWarn\n this._logError = (options.logError === undefined) ? true : options.logError\n this._hlsMinimumDvrSize = (options.hlsMinimumDvrSize === undefined) ? 60 : options.hlsMinimumDvrSize\n }\n\n _addListeners() {\n Mediator.on(this.cid + ':flashready', () => this._bootstrap())\n Mediator.on(this.cid + ':timeupdate', (timeMetrics) => this._updateTime(timeMetrics))\n Mediator.on(this.cid + ':playbackstate', (state) => this._setPlaybackState(state))\n Mediator.on(this.cid + ':levelchanged', (level) => this._levelChanged(level))\n Mediator.on(this.cid + ':error', (code, url, message) => this._flashPlaybackError(code, url, message))\n Mediator.on(this.cid + ':fragmentloaded',(loadmetrics) => this._onFragmentLoaded(loadmetrics))\n Mediator.on(this.cid + ':levelendlist', (level) => this._onLevelEndlist(level))\n }\n\n stopListening() {\n super.stopListening()\n Mediator.off(this.cid + ':flashready')\n Mediator.off(this.cid + ':timeupdate')\n Mediator.off(this.cid + ':playbackstate')\n Mediator.off(this.cid + ':levelchanged')\n Mediator.off(this.cid + ':playbackerror')\n Mediator.off(this.cid + ':fragmentloaded')\n Mediator.off(this.cid + ':manifestloaded')\n Mediator.off(this.cid + ':levelendlist')\n }\n\n _bootstrap() {\n if (this.el.playerLoad) {\n this.el.width = '100%'\n this.el.height = '100%'\n this._isReadyState = true\n this._srcLoaded = false\n this._currentState = 'IDLE'\n this._setFlashSettings()\n this._updatePlaybackType()\n if (this._autoPlay || this._shouldPlayOnManifestLoaded) {\n this.play()\n }\n this.trigger(Events.PLAYBACK_READY, this.name)\n } else {\n this._bootstrapAttempts = this._bootstrapAttempts || 0\n if (++this._bootstrapAttempts <= MAX_ATTEMPTS) {\n setTimeout(() => this._bootstrap(), 50)\n } else {\n this.trigger(Events.PLAYBACK_ERROR, {message: 'Max number of attempts reached'}, this.name)\n }\n }\n }\n\n _setFlashSettings() {\n this.el.playerSetAutoStartLoad(this._autoStartLoad)\n this.el.playerSetCapLevelToStage(this._capLevelToStage)\n this.el.playerSetMaxLevelCappingMode(this._maxLevelCappingMode)\n this.el.playerSetMinBufferLength(this._minBufferLength)\n this.el.playerSetMinBufferLengthCapping(this._minBufferLengthCapping)\n this.el.playerSetMaxBufferLength(this._maxBufferLength)\n this.el.playerSetMaxBackBufferLength(this._maxBackBufferLength)\n this.el.playerSetLowBufferLength(this._lowBufferLength)\n this.el.playerSetMediaTimePeriod(this._mediaTimePeriod)\n this.el.playerSetFpsDroppedMonitoringPeriod(this._fpsDroppedMonitoringPeriod)\n this.el.playerSetFpsDroppedMonitoringThreshold(this._fpsDroppedMonitoringThreshold)\n this.el.playerSetCapLevelonFPSDrop(this._capLevelonFPSDrop)\n this.el.playerSetSmoothAutoSwitchonFPSDrop(this._smoothAutoSwitchonFPSDrop)\n this.el.playerSetSwitchDownOnLevelError(this._switchDownOnLevelError)\n this.el.playerSetSeekMode(this._seekMode)\n this.el.playerSetKeyLoadMaxRetry(this._keyLoadMaxRetry)\n this.el.playerSetKeyLoadMaxRetryTimeout(this._keyLoadMaxRetryTimeout)\n this.el.playerSetFragmentLoadMaxRetry(this._fragmentLoadMaxRetry)\n this.el.playerSetFragmentLoadMaxRetryTimeout(this._fragmentLoadMaxRetryTimeout)\n this.el.playerSetFragmentLoadSkipAfterMaxRetry(this._fragmentLoadSkipAfterMaxRetry)\n this.el.playerSetMaxSkippedFragments(this._maxSkippedFragments)\n this.el.playerSetFlushLiveURLCache(this._flushLiveURLCache)\n this.el.playerSetInitialLiveManifestSize(this._initialLiveManifestSize)\n this.el.playerSetManifestLoadMaxRetry(this._manifestLoadMaxRetry)\n this.el.playerSetManifestLoadMaxRetryTimeout(this._manifestLoadMaxRetryTimeout)\n this.el.playerSetManifestRedundantLoadmaxRetry(this._manifestRedundantLoadmaxRetry)\n this.el.playerSetStartFromBitrate(this._startFromBitrate)\n this.el.playerSetStartFromLevel(this._startFromLevel)\n this.el.playerSetAutoStartMaxDuration(this._autoStartMaxDuration)\n this.el.playerSetSeekFromLevel(this._seekFromLevel)\n this.el.playerSetUseHardwareVideoDecoder(this._useHardwareVideoDecoder)\n this.el.playerSetLogInfo(this._hlsLogEnabled)\n this.el.playerSetLogDebug(this._logDebug)\n this.el.playerSetLogDebug2(this._logDebug2)\n this.el.playerSetLogWarn(this._logWarn)\n this.el.playerSetLogError(this._logError)\n }\n\n setAutoStartLoad(autoStartLoad) {\n this._autoStartLoad = autoStartLoad\n this.el.playerSetAutoStartLoad(this._autoStartLoad)\n }\n\n setCapLevelToStage(capLevelToStage) {\n this._capLevelToStage = capLevelToStage\n this.el.playerSetCapLevelToStage(this._capLevelToStage)\n }\n\n setMaxLevelCappingMode(maxLevelCappingMode) {\n this._maxLevelCappingMode = maxLevelCappingMode\n this.el.playerSetMaxLevelCappingMode(this._maxLevelCappingMode)\n }\n\n setSetMinBufferLength(minBufferLength) {\n this._minBufferLength = minBufferLength\n this.el.playerSetMinBufferLength(this._minBufferLength)\n }\n\n setMinBufferLengthCapping(minBufferLengthCapping) {\n this._minBufferLengthCapping = minBufferLengthCapping\n this.el.playerSetMinBufferLengthCapping(this._minBufferLengthCapping)\n }\n\n setMaxBufferLength(maxBufferLength) {\n this._maxBufferLength = maxBufferLength\n this.el.playerSetMaxBufferLength(this._maxBufferLength)\n }\n\n setMaxBackBufferLength(maxBackBufferLength) {\n this._maxBackBufferLength = maxBackBufferLength\n this.el.playerSetMaxBackBufferLength(this._maxBackBufferLength)\n }\n\n setLowBufferLength(lowBufferLength) {\n this._lowBufferLength = lowBufferLength\n this.el.playerSetLowBufferLength(this._lowBufferLength)\n }\n\n setMediaTimePeriod(mediaTimePeriod) {\n this._mediaTimePeriod = mediaTimePeriod\n this.el.playerSetMediaTimePeriod(this._mediaTimePeriod)\n }\n\n setFpsDroppedMonitoringPeriod(fpsDroppedMonitoringPeriod) {\n this._fpsDroppedMonitoringPeriod = fpsDroppedMonitoringPeriod\n this.el.playerSetFpsDroppedMonitoringPeriod(this._fpsDroppedMonitoringPeriod)\n }\n\n setFpsDroppedMonitoringThreshold(fpsDroppedMonitoringThreshold) {\n this._fpsDroppedMonitoringThreshold = fpsDroppedMonitoringThreshold\n this.el.playerSetFpsDroppedMonitoringThreshold(this._fpsDroppedMonitoringThreshold)\n }\n\n setCapLevelonFPSDrop(capLevelonFPSDrop) {\n this._capLevelonFPSDrop = capLevelonFPSDrop\n this.el.playerSetCapLevelonFPSDrop(this._capLevelonFPSDrop)\n }\n\n setSmoothAutoSwitchonFPSDrop(smoothAutoSwitchonFPSDrop) {\n this._smoothAutoSwitchonFPSDrop = smoothAutoSwitchonFPSDrop\n this.el.playerSetSmoothAutoSwitchonFPSDrop(this._smoothAutoSwitchonFPSDrop)\n }\n\n setSwitchDownOnLevelError(switchDownOnLevelError) {\n this._switchDownOnLevelError = switchDownOnLevelError\n this.el.playerSetSwitchDownOnLevelError(this._switchDownOnLevelError)\n }\n\n setSeekMode(seekMode) {\n this._seekMode = seekMode\n this.el.playerSetSeekMode(this._seekMode)\n }\n\n setKeyLoadMaxRetry(keyLoadMaxRetry) {\n this._keyLoadMaxRetry = keyLoadMaxRetry\n this.el.playerSetKeyLoadMaxRetry(this._keyLoadMaxRetry)\n }\n\n setKeyLoadMaxRetryTimeout(keyLoadMaxRetryTimeout) {\n this._keyLoadMaxRetryTimeout = keyLoadMaxRetryTimeout\n this.el.playerSetKeyLoadMaxRetryTimeout(this._keyLoadMaxRetryTimeout)\n }\n\n setFragmentLoadMaxRetry(fragmentLoadMaxRetry) {\n this._fragmentLoadMaxRetry = fragmentLoadMaxRetry\n this.el.playerSetFragmentLoadMaxRetry(this._fragmentLoadMaxRetry)\n }\n\n setFragmentLoadMaxRetryTimeout(fragmentLoadMaxRetryTimeout) {\n this._fragmentLoadMaxRetryTimeout = fragmentLoadMaxRetryTimeout\n this.el.playerSetFragmentLoadMaxRetryTimeout(this._fragmentLoadMaxRetryTimeout)\n }\n\n setFragmentLoadSkipAfterMaxRetry(fragmentLoadSkipAfterMaxRetry) {\n this._fragmentLoadSkipAfterMaxRetry = fragmentLoadSkipAfterMaxRetry\n this.el.playerSetFragmentLoadSkipAfterMaxRetry(this._fragmentLoadSkipAfterMaxRetry)\n }\n\n setMaxSkippedFragments(maxSkippedFragments) {\n this._maxSkippedFragments = maxSkippedFragments\n this.el.playerSetMaxSkippedFragments(this._maxSkippedFragments)\n }\n\n setFlushLiveURLCache(flushLiveURLCache) {\n this._flushLiveURLCache = flushLiveURLCache\n this.el.playerSetFlushLiveURLCache(this._flushLiveURLCache)\n }\n\n setInitialLiveManifestSize(initialLiveManifestSize) {\n this._initialLiveManifestSize = initialLiveManifestSize\n this.el.playerSetInitialLiveManifestSize(this._initialLiveManifestSize)\n }\n\n setManifestLoadMaxRetry(manifestLoadMaxRetry) {\n this._manifestLoadMaxRetry = manifestLoadMaxRetry\n this.el.playerSetManifestLoadMaxRetry(this._manifestLoadMaxRetry)\n }\n\n setManifestLoadMaxRetryTimeout(manifestLoadMaxRetryTimeout) {\n this._manifestLoadMaxRetryTimeout = manifestLoadMaxRetryTimeout\n this.el.playerSetManifestLoadMaxRetryTimeout(this._manifestLoadMaxRetryTimeout)\n }\n\n setManifestRedundantLoadmaxRetry(manifestRedundantLoadmaxRetry) {\n this._manifestRedundantLoadmaxRetry = manifestRedundantLoadmaxRetry\n this.el.playerSetManifestRedundantLoadmaxRetry(this._manifestRedundantLoadmaxRetry)\n }\n\n setStartFromBitrate(startFromBitrate) {\n this._startFromBitrate = startFromBitrate\n this.el.playerSetStartFromBitrate(this._startFromBitrate)\n }\n\n setStartFromLevel(startFromLevel) {\n this._startFromLevel = startFromLevel\n this.el.playerSetStartFromLevel(this._startFromLevel)\n }\n\n setAutoStartMaxDuration(autoStartMaxDuration) {\n this._autoStartMaxDuration = autoStartMaxDuration\n this.el.playerSetAutoStartMaxDuration(this._autoStartMaxDuration)\n }\n\n setSeekFromLevel(seekFromLevel) {\n this._seekFromLevel = seekFromLevel\n this.el.playerSetSeekFromLevel(this._seekFromLevel)\n }\n\n setUseHardwareVideoDecoder(useHardwareVideoDecoder) {\n this._useHardwareVideoDecoder = useHardwareVideoDecoder\n this.el.playerSetUseHardwareVideoDecoder(this._useHardwareVideoDecoder)\n }\n\n setSetLogInfo(hlsLogEnabled) {\n this._hlsLogEnabled = hlsLogEnabled\n this.el.playerSetLogInfo(this._hlsLogEnabled)\n }\n\n setLogDebug(logDebug) {\n this._logDebug = logDebug\n this.el.playerSetLogDebug(this._logDebug)\n }\n\n setLogDebug2(logDebug2) {\n this._logDebug2 = logDebug2\n this.el.playerSetLogDebug2(this._logDebug2)\n }\n\n setLogWarn(logWarn) {\n this._logWarn = logWarn\n this.el.playerSetLogWarn(this._logWarn)\n }\n\n setLogError(logError) {\n this._logError = logError\n this.el.playerSetLogError(this._logError)\n }\n\n _levelChanged(level) {\n const currentLevel = this.el.getLevels()[level]\n if (currentLevel) {\n this.highDefinition = (currentLevel.height >= 720 || (currentLevel.bitrate / 1000) >= 2000)\n this.trigger(Events.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinition)\n\n if (!this._levels || this._levels.length === 0) this._fillLevels()\n\n this.trigger(Events.PLAYBACK_BITRATE, {\n height: currentLevel.height,\n width: currentLevel.width,\n bandwidth: currentLevel.bitrate,\n bitrate: currentLevel.bitrate,\n level: level\n })\n this.trigger(Events.PLAYBACK_LEVEL_SWITCH_END)\n }\n }\n\n _updateTime(timeMetrics) {\n if (this._currentState === 'IDLE') {\n return\n }\n\n const duration = this._normalizeDuration(timeMetrics.duration)\n let position = Math.min(Math.max(timeMetrics.position, 0), duration)\n const previousDVRStatus = this._dvrEnabled\n const livePlayback = (this._playbackType === Playback.LIVE)\n this._dvrEnabled = (livePlayback && duration > this._hlsMinimumDvrSize)\n\n if (duration === 100 || livePlayback === undefined) {\n return\n }\n\n if (this._dvrEnabled !== previousDVRStatus) {\n this._updateSettings()\n this.trigger(Events.PLAYBACK_SETTINGSUPDATE, this.name)\n }\n\n if (livePlayback && (!this._dvrEnabled || !this._dvrInUse)) {\n position = duration\n }\n\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: position, total: duration}, this.name)\n }\n\n play() {\n this.trigger(Events.PLAYBACK_PLAY_INTENT)\n if(this._currentState === 'PAUSED') {\n this.el.playerResume()\n } else if (!this._srcLoaded && this._currentState !== 'PLAYING') {\n this._firstPlay()\n } else {\n this.el.playerPlay()\n }\n }\n\n getPlaybackType() {\n return this._playbackType? this._playbackType: null\n }\n\n getCurrentLevelIndex() {\n return this._currentLevel\n }\n\n getCurrentLevel() {\n return this.levels[this.currentLevel]\n }\n\n getCurrentBitrate() {\n return this.levels[this.currentLevel].bitrate\n }\n\n setCurrentLevel(level) {\n this.currentLevel = level\n }\n\n isHighDefinitionInUse() {\n return this.highDefinition\n }\n\n getLevels() {\n return this.levels\n }\n\n _setPlaybackState(state) {\n if (['PLAYING_BUFFERING', 'PAUSED_BUFFERING'].indexOf(state) >= 0) {\n this._bufferingState = true\n this.trigger(Events.PLAYBACK_BUFFERING, this.name)\n this._updateCurrentState(state)\n } else if (['PLAYING', 'PAUSED'].indexOf(state) >= 0) {\n if (['PLAYING_BUFFERING', 'PAUSED_BUFFERING', 'IDLE'].indexOf(this._currentState) >= 0) {\n this._bufferingState = false\n this.trigger(Events.PLAYBACK_BUFFERFULL, this.name)\n }\n this._updateCurrentState(state)\n } else if (state === 'IDLE') {\n this._srcLoaded = false\n if (this._loop && ['PLAYING_BUFFERING', 'PLAYING'].indexOf(this._currentState) >= 0) {\n this.play()\n this.seek(0)\n } else {\n this._updateCurrentState(state)\n this._hasEnded = true\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: 0, total: this.getDuration()}, this.name)\n this.trigger(Events.PLAYBACK_ENDED, this.name)\n }\n }\n }\n\n _updateCurrentState(state) {\n this._currentState = state\n if (state !== 'IDLE') {\n this._hasEnded = false\n }\n this._updatePlaybackType()\n if (state === 'PLAYING') {\n this.trigger(Events.PLAYBACK_PLAY, this.name)\n } else if (state === 'PAUSED') {\n this.trigger(Events.PLAYBACK_PAUSE, this.name)\n }\n }\n\n _updatePlaybackType() {\n this._playbackType = this.el.getType()\n if (this._playbackType) {\n this._playbackType = this._playbackType.toLowerCase()\n if (this._playbackType === Playback.VOD) {\n this._startReportingProgress()\n } else {\n this._stopReportingProgress()\n }\n }\n this.trigger(Events.PLAYBACK_PLAYBACKSTATE, {type: this._playbackType})\n }\n\n _startReportingProgress() {\n if (!this._reportingProgress) {\n this._reportingProgress = true\n }\n }\n\n _stopReportingProgress() {\n this._reportingProgress = false\n }\n\n _onFragmentLoaded(loadmetrics) {\n this.trigger(Events.PLAYBACK_FRAGMENT_LOADED, loadmetrics)\n if (this._reportingProgress && this.el.getPosition) {\n const buffered = this.el.getPosition() + this.el.getbufferLength()\n this.trigger(Events.PLAYBACK_PROGRESS, {\n start: this.el.getPosition(),\n current: buffered,\n total: this.el.getDuration()\n })\n }\n }\n\n _onLevelEndlist() {\n this._updatePlaybackType()\n }\n\n _firstPlay() {\n this._shouldPlayOnManifestLoaded = true\n if (this.el.playerLoad) {\n Mediator.once(this.cid + ':manifestloaded', (duration, loadmetrics) => this._manifestLoaded(duration, loadmetrics))\n this._setFlashSettings() //ensure flushLiveURLCache will work (#327)\n this.el.playerLoad(this._src)\n this._srcLoaded = true\n }\n }\n\n volume(value) {\n if (this.isReady) {\n this.el.playerVolume(value)\n } else {\n this.listenToOnce(this, Events.PLAYBACK_BUFFERFULL, () => this.volume(value))\n }\n }\n\n pause() {\n if (this._playbackType !== Playback.LIVE || this._dvrEnabled) {\n this.el.playerPause()\n if (this._playbackType === Playback.LIVE && this._dvrEnabled) {\n this._updateDvr(true)\n }\n }\n }\n\n stop() {\n this._srcLoaded = false\n this.el.playerStop()\n this.trigger(Events.PLAYBACK_STOP)\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: 0, total: 0}, this.name)\n }\n\n isPlaying() {\n if (this._currentState) {\n return !!(this._currentState.match(/playing/i))\n }\n return false\n }\n\n get isReady() {\n return this._isReadyState\n }\n\n getDuration() {\n return this._normalizeDuration(this.el.getDuration())\n }\n\n _normalizeDuration(duration) {\n if (this._playbackType === Playback.LIVE) {\n // estimate 10 seconds of buffer time for live streams for seek positions\n duration = Math.max(0, duration - 10)\n }\n return duration\n }\n\n seekPercentage(percentage) {\n const duration = this.el.getDuration()\n let time = 0\n if (percentage > 0) {\n time = duration * percentage / 100\n }\n this.seek(time)\n }\n\n seek(time) {\n const duration = this.getDuration()\n if (this._playbackType === Playback.LIVE) {\n // seek operations to a time within 3 seconds from live stream will position playhead back to live\n const dvrInUse = duration - time > 3\n this._updateDvr(dvrInUse)\n }\n this.el.playerSeek(time)\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: time, total: duration}, this.name)\n }\n\n _updateDvr(dvrInUse) {\n const previousDvrInUse = !!this._dvrInUse\n this._dvrInUse = dvrInUse\n if (this._dvrInUse !== previousDvrInUse) {\n this._updateSettings()\n this.trigger(Events.PLAYBACK_DVR, this._dvrInUse)\n this.trigger(Events.PLAYBACK_STATS_ADD, {'dvr': this._dvrInUse})\n }\n }\n\n _flashPlaybackError(code, url, message) {\n this.trigger(Events.PLAYBACK_ERROR, {code: code, url: url, message: message})\n this.trigger(Events.PLAYBACK_STOP)\n }\n\n _manifestLoaded(duration, loadmetrics) {\n if (this._shouldPlayOnManifestLoaded) {\n this._shouldPlayOnManifestLoaded = false\n // this method initialises the player (and starts playback)\n // this needs to happen before PLAYBACK_LOADEDMETADATA is fired\n // as the user may call seek() in a LOADEDMETADATA listener.\n /// when playerPlay() is called the player seeks to 0\n this.el.playerPlay()\n }\n\n this._fillLevels()\n this.trigger(Events.PLAYBACK_LOADEDMETADATA, {duration: duration, data: loadmetrics})\n }\n\n _fillLevels() {\n const levels = this.el.getLevels()\n const levelsLength = levels.length\n this._levels = []\n\n for (let index = 0 ; index < levelsLength ; index++) {\n this._levels.push({id: index, label: `${levels[index].height}p`, level: levels[index]})\n }\n this.trigger(Events.PLAYBACK_LEVELS_AVAILABLE, this._levels)\n }\n\n destroy() {\n this.stopListening()\n this.$el.remove()\n }\n\n _updateSettings() {\n this.settings = $.extend({}, this._defaultSettings)\n if (this._playbackType === Playback.VOD || this._dvrInUse) {\n this.settings.left = ['playpause', 'position', 'duration']\n this.settings.seekEnabled = true\n } else if (this._dvrEnabled) {\n this.settings.left = ['playpause']\n this.settings.seekEnabled = true\n } else {\n this.settings.seekEnabled = false\n }\n }\n\n get dvrEnabled() {\n return !!this._dvrEnabled\n }\n\n _createCallbacks() {\n if (!window.Clappr) {\n window.Clappr = {}\n }\n if (!window.Clappr.flashlsCallbacks) {\n window.Clappr.flashlsCallbacks = {}\n }\n this.flashlsEvents = new HLSEvents(this.cid)\n window.Clappr.flashlsCallbacks[this.cid] = (eventName, args) => {\n this.flashlsEvents[eventName].apply(this.flashlsEvents, args)\n }\n }\n\n render() {\n super.render()\n this._createCallbacks()\n return this\n }\n}\n\nFlasHLS.canPlay = function(resource, mimeType) {\n const resourceParts = resource.split('?')[0].match(/.*\\.(.*)$/) || []\n return Browser.hasFlash &&\n ((resourceParts.length > 1 && resourceParts[1].toLowerCase() === 'm3u8') ||\n mimeType === 'application/x-mpegURL' || mimeType === 'application/vnd.apple.mpegurl')\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/flashls/flashls.js","import Mediator from '../../components/mediator'\n\nexport default class HLSEvents {\n constructor(instanceId) {\n this.instanceId = instanceId\n }\n ready() {\n Mediator.trigger(`${this.instanceId}:flashready`)\n }\n videoSize(width, height) {\n Mediator.trigger(`${this.instanceId}:videosizechanged`, width, height)\n }\n complete() {\n Mediator.trigger(`${this.instanceId}:complete`)\n }\n error(code, url, message) {\n Mediator.trigger(`${this.instanceId}:error`, code, url, message)\n }\n manifest(duration, loadmetrics) {\n Mediator.trigger(`${this.instanceId}:manifestloaded`, duration, loadmetrics)\n }\n audioLevelLoaded(loadmetrics) {\n Mediator.trigger(`${this.instanceId}:audiolevelloaded`, loadmetrics)\n }\n levelLoaded(loadmetrics) {\n Mediator.trigger(`${this.instanceId}:levelloaded`, loadmetrics)\n }\n levelEndlist(level) {\n Mediator.trigger(`${this.instanceId}:levelendlist`, level)\n }\n fragmentLoaded(loadmetrics) {\n Mediator.trigger(`${this.instanceId}:fragmentloaded`, loadmetrics)\n }\n fragmentPlaying(playmetrics) {\n Mediator.trigger(`${this.instanceId}:fragmentplaying`, playmetrics)\n }\n position(timemetrics) {\n Mediator.trigger(`${this.instanceId}:timeupdate`, timemetrics)\n }\n state(newState) {\n Mediator.trigger(`${this.instanceId}:playbackstate`, newState)\n }\n seekState(newState) {\n Mediator.trigger(`${this.instanceId}:seekstate`, newState)\n }\n switch(newLevel) {\n Mediator.trigger(`${this.instanceId}:levelchanged`, newLevel)\n }\n audioTracksListChange(trackList) {\n Mediator.trigger(`${this.instanceId}:audiotracklistchanged`, trackList)\n }\n audioTrackChange(trackId) {\n Mediator.trigger(`${this.instanceId}:audiotrackchanged`, trackId)\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/flashls/flashls_events.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport HTML5VideoPlayback from 'playbacks/html5_video'\nimport HLSJS from 'hls.js'\nimport isEqual from 'lodash.isequal'\nimport Events from 'base/events'\nimport Playback from 'base/playback'\nimport Browser from 'components/browser'\nimport {now} from 'base/utils'\nimport Log from 'plugins/log'\n\nconst AUTO = -1\n\nexport default class HLS extends HTML5VideoPlayback {\n get name() { return 'hls' }\n\n get levels() { return this._levels || [] }\n get currentLevel() {\n if (this._currentLevel === null || this._currentLevel === undefined) {\n return AUTO\n } else {\n return this._currentLevel //0 is a valid level ID\n }\n }\n set currentLevel(id) {\n this._currentLevel = id\n this.trigger(Events.PLAYBACK_LEVEL_SWITCH_START)\n this._hls.currentLevel = this._currentLevel\n }\n\n get _startTime() {\n if (this._playbackType === Playback.LIVE && this._playlistType !== 'EVENT') {\n return this._extrapolatedStartTime\n }\n return this._playableRegionStartTime\n }\n\n get _now() {\n return now()\n }\n\n // the time in the video element which should represent the start of the sliding window\n // extrapolated to increase in real time (instead of jumping as the early segments are removed)\n get _extrapolatedStartTime() {\n if (!this._localStartTimeCorrelation) {\n return this._playableRegionStartTime\n }\n let corr = this._localStartTimeCorrelation\n let timePassed = this._now - corr.local\n let extrapolatedWindowStartTime = (corr.remote + timePassed) / 1000\n // cap at the end of the extrapolated window duration\n return Math.min(extrapolatedWindowStartTime, this._playableRegionStartTime + this._extrapolatedWindowDuration)\n }\n\n // the time in the video element which should represent the end of the content\n // extrapolated to increase in real time (instead of jumping as segments are added)\n get _extrapolatedEndTime() {\n let actualEndTime = this._playableRegionStartTime + this._playableRegionDuration\n if (!this._localEndTimeCorrelation) {\n return actualEndTime\n }\n let corr = this._localEndTimeCorrelation\n let timePassed = this._now - corr.local\n let extrapolatedEndTime = (corr.remote + timePassed) / 1000\n return Math.max(actualEndTime - this._extrapolatedWindowDuration, Math.min(extrapolatedEndTime, actualEndTime))\n }\n\n get _duration() {\n return this._extrapolatedEndTime - this._startTime\n }\n\n // Returns the duration (seconds) of the window that the extrapolated start time is allowed\n // to move in before being capped.\n // The extrapolated start time should never reach the cap at the end of the window as the\n // window should slide as chunks are removed from the start.\n // This also applies to the extrapolated end time in the same way.\n //\n // If chunks aren't being removed for some reason that the start time will reach and remain fixed at\n // playableRegionStartTime + extrapolatedWindowDuration\n //\n // <-- window duration -->\n // I.e playableRegionStartTime |-----------------------|\n // | --> . . .\n // . --> | --> . .\n // . . --> | --> .\n // . . . --> |\n // . . . .\n // extrapolatedStartTime\n get _extrapolatedWindowDuration() {\n if (this._segmentTargetDuration === null) {\n return 0\n }\n return this._extrapolatedWindowNumSegments * this._segmentTargetDuration\n }\n\n constructor(...args) {\n super(...args)\n // backwards compatibility (TODO: remove on 0.3.0)\n this.options.playback || (this.options.playback = this.options)\n this._minDvrSize = typeof(this.options.hlsMinimumDvrSize) === 'undefined' ? 60 : this.options.hlsMinimumDvrSize\n // The size of the start time extrapolation window measured as a multiple of segments.\n // Should be 2 or higher, or 0 to disable. Should only need to be increased above 2 if more than one segment is\n // removed from the start of the playlist at a time. E.g if the playlist is cached for 10 seconds and new chunks are\n // added/removed every 5.\n this._extrapolatedWindowNumSegments = !this.options.playback || typeof(this.options.playback.extrapolatedWindowNumSegments) === 'undefined' ? 2 : this.options.playback.extrapolatedWindowNumSegments\n\n this._playbackType = Playback.VOD\n this._lastTimeUpdate = null\n this._lastDuration = null\n // for hls streams which have dvr with a sliding window,\n // the content at the start of the playlist is removed as new\n // content is appended at the end.\n // this means the actual playable start time will increase as the\n // start content is deleted\n // For streams with dvr where the entire recording is kept from the\n // beginning this should stay as 0\n this._playableRegionStartTime = 0\n // {local, remote} remote is the time in the video element that should represent 0\n // local is the system time when the 'remote' measurment took place\n this._localStartTimeCorrelation = null\n // {local, remote} remote is the time in the video element that should represents the end\n // local is the system time when the 'remote' measurment took place\n this._localEndTimeCorrelation = null\n // if content is removed from the beginning then this empty area should\n // be ignored. \"playableRegionDuration\" excludes the empty area\n this._playableRegionDuration = 0\n // true when the actual duration is longer than hlsjs's live sync point\n // when this is false playableRegionDuration will be the actual duration\n // when this is true playableRegionDuration will exclude the time after the sync point\n this._durationExcludesAfterLiveSyncPoint = false\n // #EXT-X-TARGETDURATION\n this._segmentTargetDuration = null\n // #EXT-X-PLAYLIST-TYPE\n this._playlistType = null\n this._recoverAttemptsRemaining = this.options.hlsRecoverAttempts || 16\n this._startTimeUpdateTimer()\n }\n\n _setupHls() {\n this._hls = new HLSJS(this.options.playback.hlsjsConfig || {})\n this._hls.on(HLSJS.Events.MEDIA_ATTACHED, () => this._hls.loadSource(this.options.src))\n this._hls.on(HLSJS.Events.LEVEL_LOADED, (evt, data) => this._updatePlaybackType(evt, data))\n this._hls.on(HLSJS.Events.LEVEL_UPDATED, (evt, data) => this._onLevelUpdated(evt, data))\n this._hls.on(HLSJS.Events.LEVEL_SWITCH, (evt,data) => this._onLevelSwitch(evt, data))\n this._hls.on(HLSJS.Events.FRAG_LOADED, (evt, data) => this._onFragmentLoaded(evt, data))\n this._hls.on(HLSJS.Events.ERROR, (evt, data) => this._onHLSJSError(evt, data))\n this._hls.attachMedia(this.el)\n }\n\n _recover(evt, data) {\n if (!this._recoveredDecodingError) {\n this._recoveredDecodingError = true\n this._hls.recoverMediaError()\n } else if (!this._recoveredAudioCodecError) {\n this._recoveredAudioCodecError = true\n this._hls.swapAudioCodec()\n this._hls.recoverMediaError()\n } else {\n Log.error('hlsjs: failed to recover')\n this.trigger(Events.PLAYBACK_ERROR, `hlsjs: could not recover from error, evt ${evt}, data ${data} `, this.name)\n }\n }\n\n // override\n _setupSrc(srcUrl) { // eslint-disable-line no-unused-vars\n // this playback manages the src on the video element itself\n }\n\n _startTimeUpdateTimer() {\n this._timeUpdateTimer = setInterval(() => {\n this._onDurationChange()\n this._onTimeUpdate()\n }, 100)\n }\n\n _stopTimeUpdateTimer() {\n clearInterval(this._timeUpdateTimer)\n }\n\n // the duration on the video element itself should not be used\n // as this does not necesarily represent the duration of the stream\n // https://github.com/clappr/clappr/issues/668#issuecomment-157036678\n getDuration() {\n return this._duration\n }\n\n getCurrentTime() {\n // e.g. can be < 0 if user pauses near the start\n // eventually they will then be kicked to the end by hlsjs if they run out of buffer\n // before the official start time\n return Math.max(0, this.el.currentTime - this._startTime)\n }\n\n // the time that \"0\" now represents relative to when playback started\n // for a stream with a sliding window this will increase as content is\n // removed from the beginning\n getStartTimeOffset() {\n return this._startTime\n }\n\n seekPercentage(percentage) {\n let seekTo = this._duration\n if (percentage > 0) {\n seekTo = this._duration * (percentage / 100)\n }\n this.seek(seekTo)\n }\n\n seek(time) {\n if (time < 0) {\n Log.warn('Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point.')\n time = this.getDuration()\n }\n // assume live if time within 3 seconds of end of stream\n this.dvrEnabled && this._updateDvr(time < this.getDuration()-3)\n time += this._startTime\n super.seek(time)\n }\n\n seekToLivePoint() {\n this.seek(this.getDuration())\n }\n\n _updateDvr(status) {\n this.trigger(Events.PLAYBACK_DVR, status)\n this.trigger(Events.PLAYBACK_STATS_ADD, {'dvr': status})\n }\n\n _updateSettings() {\n if (this._playbackType === Playback.VOD) {\n this.settings.left = ['playpause', 'position', 'duration']\n } else if (this.dvrEnabled) {\n this.settings.left = ['playpause']\n } else {\n this.settings.left = ['playstop']\n }\n this.settings.seekEnabled = this.isSeekEnabled()\n this.trigger(Events.PLAYBACK_SETTINGSUPDATE)\n }\n\n _onHLSJSError(evt, data) {\n // only report/handle errors if they are fatal\n // hlsjs should automatically handle non fatal errors\n if (data.fatal) {\n if (this._recoverAttemptsRemaining > 0) {\n this._recoverAttemptsRemaining -= 1\n switch (data.type) {\n case HLSJS.ErrorTypes.NETWORK_ERROR:\n Log.warn(`hlsjs: trying to recover from network error, evt ${evt}, data ${data} `)\n this._hls.startLoad()\n break\n case HLSJS.ErrorTypes.MEDIA_ERROR:\n Log.warn(`hlsjs: trying to recover from media error, evt ${evt}, data ${data} `)\n this._recover(evt, data)\n break\n default:\n Log.error(`hlsjs: trying to recover from error, evt ${evt}, data ${data} `)\n this.trigger(Events.PLAYBACK_ERROR, `hlsjs: could not recover from error, evt ${evt}, data ${data} `, this.name)\n break\n }\n } else {\n Log.error(`hlsjs: could not recover from error after maximum number of attempts, evt ${evt}, data ${data} `)\n this.trigger(Events.PLAYBACK_ERROR, {evt, data}, this.name)\n }\n }\n else {\n Log.warn(`hlsjs: non-fatal error occurred, evt ${evt}, data ${data} `)\n }\n }\n\n _onTimeUpdate() {\n let update = {current: this.getCurrentTime(), total: this.getDuration()}\n if (isEqual(update, this._lastTimeUpdate)) {\n return\n }\n this._lastTimeUpdate = update\n this.trigger(Events.PLAYBACK_TIMEUPDATE, update, this.name)\n }\n\n _onDurationChange() {\n let duration = this.getDuration()\n if (this._lastDuration === duration) {\n return\n }\n this._lastDuration = duration\n super._onDurationChange()\n }\n\n _onProgress() {\n if (!this.el.buffered.length) {\n return\n }\n let buffered = []\n let bufferedPos = 0\n for (let i = 0; i < this.el.buffered.length; i++) {\n buffered = [...buffered, {\n // for a stream with sliding window dvr something that is buffered my slide off the start of the timeline\n start: Math.max(0, this.el.buffered.start(i) - this._playableRegionStartTime),\n end: Math.max(0, this.el.buffered.end(i) - this._playableRegionStartTime)\n }]\n if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) {\n bufferedPos = i\n }\n }\n const progress = {\n start: buffered[bufferedPos].start,\n current: buffered[bufferedPos].end,\n total: this.getDuration()\n }\n this.trigger(Events.PLAYBACK_PROGRESS, progress, buffered)\n }\n\n play() {\n if (!this._hls) {\n this._setupHls()\n }\n super.play()\n }\n\n pause() {\n if (!this._hls) {\n return\n }\n super.pause()\n if (this.dvrEnabled) {\n this._updateDvr(true)\n }\n }\n\n stop() {\n if (this._hls) {\n super.stop()\n this._hls.destroy()\n delete this._hls\n }\n }\n\n destroy() {\n this._stopTimeUpdateTimer()\n if (this._hls) {\n this._hls.destroy()\n delete this._hls\n }\n super.destroy()\n }\n\n _updatePlaybackType(evt, data) {\n this._playbackType = data.details.live ? Playback.LIVE : Playback.VOD\n this._fillLevels()\n this._onLevelUpdated(evt, data)\n }\n\n _fillLevels() {\n this._levels = this._hls.levels.map((level, index) => {\n return {id: index, level: level, label: `${level.bitrate/1000}Kbps`}\n })\n this.trigger(Events.PLAYBACK_LEVELS_AVAILABLE, this._levels)\n }\n\n _onLevelUpdated(evt, data) {\n this._segmentTargetDuration = data.details.targetduration\n this._playlistType = data.details.type || null\n\n let startTimeChanged = false\n let durationChanged = false\n let fragments = data.details.fragments\n let previousPlayableRegionStartTime = this._playableRegionStartTime\n let previousPlayableRegionDuration = this._playableRegionDuration\n\n if (fragments.length === 0) {\n return\n }\n\n if (this._playableRegionStartTime !== fragments[0].start) {\n startTimeChanged = true\n this._playableRegionStartTime = fragments[0].start\n }\n\n if (startTimeChanged) {\n if (!this._localStartTimeCorrelation) {\n // set the correlation to map to middle of the extrapolation window\n this._localStartTimeCorrelation = {\n local: this._now,\n remote: (fragments[0].start + (this._extrapolatedWindowDuration/2)) * 1000\n }\n }\n else {\n // check if the correlation still works\n let corr = this._localStartTimeCorrelation\n let timePassed = this._now - corr.local\n // this should point to a time within the extrapolation window\n let startTime = (corr.remote + timePassed) / 1000\n if (startTime < fragments[0].start) {\n // our start time is now earlier than the first chunk\n // (maybe the chunk was removed early)\n // reset correlation so that it sits at the beginning of the first available chunk\n this._localStartTimeCorrelation = {\n local: this._now,\n remote: fragments[0].start * 1000\n }\n }\n else if (startTime > previousPlayableRegionStartTime + this._extrapolatedWindowDuration) {\n // start time was past the end of the old extrapolation window (so would have been capped)\n // see if now that time would be inside the window, and if it would be set the correlation\n // so that it resumes from the time it was at at the end of the old window\n // update the correlation so that the time starts counting again from the value it's on now\n this._localStartTimeCorrelation = {\n local: this._now,\n remote: Math.max(fragments[0].start, previousPlayableRegionStartTime + this._extrapolatedWindowDuration) * 1000\n }\n }\n }\n }\n\n let newDuration = data.details.totalduration\n // if it's a live stream then shorten the duration to remove access\n // to the area after hlsjs's live sync point\n // seeks to areas after this point sometimes have issues\n if (this._playbackType === Playback.LIVE) {\n let fragmentTargetDuration = data.details.targetduration\n let hlsjsConfig = this.options.playback || {}\n let liveSyncDurationCount = hlsjsConfig.liveSyncDurationCount || HLSJS.DefaultConfig.liveSyncDurationCount\n let hiddenAreaDuration = fragmentTargetDuration * liveSyncDurationCount\n if (hiddenAreaDuration <= newDuration) {\n newDuration -= hiddenAreaDuration\n this._durationExcludesAfterLiveSyncPoint = true\n }\n else {\n this._durationExcludesAfterLiveSyncPoint = false\n }\n }\n\n if (newDuration !== this._playableRegionDuration) {\n durationChanged = true\n this._playableRegionDuration = newDuration\n }\n\n // Note the end time is not the playableRegionDuration\n // The end time will always increase even if content is removed from the beginning\n let endTime = fragments[0].start + newDuration\n let previousEndTime = previousPlayableRegionStartTime + previousPlayableRegionDuration\n let endTimeChanged = endTime !== previousEndTime\n if (endTimeChanged) {\n if (!this._localEndTimeCorrelation) {\n // set the correlation to map to the end\n this._localEndTimeCorrelation = {\n local: this._now,\n remote: endTime * 1000\n }\n }\n else {\n // check if the correlation still works\n let corr = this._localEndTimeCorrelation\n let timePassed = this._now - corr.local\n // this should point to a time within the extrapolation window from the end\n let extrapolatedEndTime = (corr.remote + timePassed) / 1000\n if (extrapolatedEndTime > endTime) {\n this._localEndTimeCorrelation = {\n local: this._now,\n remote: endTime * 1000\n }\n }\n else if (extrapolatedEndTime < endTime - this._extrapolatedWindowDuration) {\n // our extrapolated end time is now earlier than the extrapolation window from the actual end time\n // (maybe a chunk became available early)\n // reset correlation so that it sits at the beginning of the extrapolation window from the end time\n this._localEndTimeCorrelation = {\n local: this._now,\n remote: (endTime - this._extrapolatedWindowDuration) * 1000\n }\n }\n else if (extrapolatedEndTime > previousEndTime) {\n // end time was past the old end time (so would have been capped)\n // set the correlation so that it resumes from the time it was at at the end of the old window\n this._localEndTimeCorrelation = {\n local: this._now,\n remote: previousEndTime * 1000\n }\n }\n }\n }\n\n // now that the values have been updated call any methods that use on them so they get the updated values\n // immediately\n durationChanged && this._onDurationChange()\n startTimeChanged && this._onProgress()\n }\n\n _onFragmentLoaded(evt, data) {\n this.trigger(Events.PLAYBACK_FRAGMENT_LOADED, data)\n }\n\n _onLevelSwitch(evt, data) {\n if (!this.levels.length) {\n this._fillLevels()\n }\n this.trigger(Events.PLAYBACK_LEVEL_SWITCH_END)\n this.trigger(Events.PLAYBACK_LEVEL_SWITCH, data)\n let currentLevel = this._hls.levels[data.level]\n if (currentLevel) {\n // TODO should highDefinition be private and maybe have a read only accessor if it's used somewhere\n this.highDefinition = (currentLevel.height >= 720 || (currentLevel.bitrate / 1000) >= 2000)\n this.trigger(Events.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinition)\n this.trigger(Events.PLAYBACK_BITRATE, {\n height: currentLevel.height,\n width: currentLevel.width,\n bandwidth: currentLevel.bitrate,\n bitrate: currentLevel.bitrate,\n level: data.level\n })\n }\n }\n\n get dvrEnabled() {\n // enabled when:\n // - the duration does not include content after hlsjs's live sync point\n // - the playable region duration is longer than the configured duration to enable dvr after\n // - the playback type is LIVE.\n return (this._durationExcludesAfterLiveSyncPoint && this._duration >= this._minDvrSize && this.getPlaybackType() === Playback.LIVE)\n }\n\n getPlaybackType() {\n return this._playbackType\n }\n\n isSeekEnabled() {\n return (this._playbackType === Playback.VOD || this.dvrEnabled)\n }\n}\n\nHLS.canPlay = function(resource, mimeType) {\n const resourceParts = resource.split('?')[0].match(/.*\\.(.*)$/) || []\n const isHls = ((resourceParts.length > 1 && resourceParts[1].toLowerCase() === 'm3u8') ||\n mimeType === 'application/x-mpegURL' || mimeType === 'application/vnd.apple.mpegurl')\n\n return !!(HLSJS.isSupported() && isHls && !Browser.isSafari)\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/hls/hls.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport Events from 'base/events'\nimport Playback from 'base/playback'\nimport HTML5Video from 'playbacks/html5_video'\n\n// TODO: remove this playback and change HTML5Video to HTML5Playback (breaking change, only after 0.3.0)\nexport default class HTML5Audio extends HTML5Video {\n get name() { return 'html5_audio' }\n get tagName() { return 'audio' }\n \n get isAudioOnly() {\n return true\n }\n\n updateSettings() {\n this.settings.left = ['playpause', 'position', 'duration']\n this.settings.seekEnabled = this.isSeekEnabled()\n this.trigger(Events.PLAYBACK_SETTINGSUPDATE)\n }\n\n getPlaybackType() {\n return Playback.AOD\n }\n}\n\nHTML5Audio.canPlay = function(resourceUrl, mimeType) {\n const mimetypes = {\n 'wav': ['audio/wav'],\n 'mp3': ['audio/mp3', 'audio/mpeg;codecs=\"mp3\"'],\n 'aac': ['audio/mp4;codecs=\"mp4a.40.5\"'],\n 'oga': ['audio/ogg']\n }\n return HTML5Video._canPlay('audio', mimetypes, resourceUrl, mimeType)\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/html5_audio/html5_audio.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {seekStringToSeconds} from 'base/utils'\n\nimport Playback from 'base/playback'\nimport Styler from 'base/styler'\nimport Browser from 'components/browser'\nimport Events from 'base/events'\nimport tagStyle from './public/style.scss'\nimport $ from 'clappr-zepto'\n\nconst MIMETYPES = {\n 'mp4': ['avc1.42E01E', 'avc1.58A01E', 'avc1.4D401E', 'avc1.64001E', 'mp4v.20.8', 'mp4v.20.240', 'mp4a.40.2'].map(\n (codec) => { return 'video/mp4; codecs=\"' + codec + ', mp4a.40.2\"'}),\n 'ogg': ['video/ogg; codecs=\"theora, vorbis\"', 'video/ogg; codecs=\"dirac\"', 'video/ogg; codecs=\"theora, speex\"'],\n '3gpp': ['video/3gpp; codecs=\"mp4v.20.8, samr\"'],\n 'webm': ['video/webm; codecs=\"vp8, vorbis\"'],\n 'mkv': ['video/x-matroska; codecs=\"theora, vorbis\"'],\n 'm3u8': ['application/x-mpegurl']\n}\nMIMETYPES['ogv'] = MIMETYPES['ogg']\nMIMETYPES['3gp'] = MIMETYPES['3gpp']\n\nconst AUDIO_MIMETYPES = {\n 'wav': ['audio/wav'],\n 'mp3': ['audio/mp3', 'audio/mpeg;codecs=\"mp3\"'],\n 'aac': ['audio/mp4;codecs=\"mp4a.40.5\"'],\n 'oga': ['audio/ogg']\n}\n\nconst KNOWN_AUDIO_MIMETYPES = Object.keys(AUDIO_MIMETYPES).reduce((acc, k) => [...acc, ...AUDIO_MIMETYPES[k]], [])\n\n// TODO: rename this Playback to HTML5Playback (breaking change, only after 0.3.0)\nexport default class HTML5Video extends Playback {\n get name() { return 'html5_video' }\n get tagName() { return this.isAudioOnly ? 'audio' : 'video' }\n\n get isAudioOnly() {\n const resourceUrl = this.options.src\n let mimeTypes = HTML5Video._mimeTypesForUrl(resourceUrl, AUDIO_MIMETYPES, this.options.mimeType)\n return this.options.playback && this.options.playback.audioOnly || this.options.audioOnly || KNOWN_AUDIO_MIMETYPES.indexOf(mimeTypes[0]) >= 0\n }\n\n get attributes() {\n return {\n 'data-html5-video': ''\n }\n }\n\n get events() {\n return {\n 'canplay': '_onCanPlay',\n 'canplaythrough': '_handleBufferingEvents',\n 'durationchange': '_onDurationChange',\n 'ended': '_onEnded',\n 'error': '_onError',\n 'loadeddata': '_onLoadedData',\n 'loadedmetadata': '_onLoadedMetadata',\n 'pause': '_onPause',\n 'playing': '_onPlaying',\n 'progress': '_onProgress',\n 'seeked': '_handleBufferingEvents',\n 'seeking': '_handleBufferingEvents',\n 'stalled': '_handleBufferingEvents',\n 'timeupdate': '_onTimeUpdate',\n 'waiting': '_onWaiting'\n }\n }\n\n /**\n * Determine if the playback has ended.\n * @property ended\n * @type Boolean\n */\n get ended() {\n return this.el.ended\n }\n\n /**\n * Determine if the playback is having to buffer in order for\n * playback to be smooth.\n * This is related to the PLAYBACK_BUFFERING and PLAYBACK_BUFFERFULL events\n * @property buffering\n * @type Boolean\n */\n get buffering() {\n return !!this._bufferingState\n }\n\n constructor(...args) {\n super(...args)\n this._loadStarted = false\n this._playheadMoving = false\n this._playheadMovingTimer = null\n this._stopped = false\n this._setupSrc(this.options.src)\n // backwards compatibility (TODO: remove on 0.3.0)\n this.options.playback || (this.options.playback = this.options || {})\n this.options.playback.disableContextMenu = this.options.playback.disableContextMenu || this.options.disableVideoTagContextMenu\n\n const playbackConfig = this.options.playback\n const preload = playbackConfig.preload || (Browser.isSafari ? 'auto' : this.options.preload)\n\n $.extend(this.el, {\n loop: this.options.loop,\n poster: this.options.poster,\n preload: preload || 'metadata',\n controls: (playbackConfig.controls || this.options.useVideoTagDefaultControls) && 'controls',\n crossOrigin: playbackConfig.crossOrigin,\n 'x-webkit-playsinline': playbackConfig.playInline\n })\n\n // TODO should settings be private?\n this.settings = {default: ['seekbar']}\n this.settings.left = ['playpause', 'position', 'duration']\n this.settings.right = ['fullscreen', 'volume', 'hd-indicator']\n\n // https://github.com/clappr/clappr/issues/1076\n this.options.autoPlay && process.nextTick(() => this.play())\n }\n\n /**\n * Sets the source url on the <video> element, and also the 'src' property.\n * @method setupSrc\n * @private\n * @param {String} srcUrl The source URL.\n */\n _setupSrc(srcUrl) {\n if (this.el.src === srcUrl) {\n return\n }\n this._src = srcUrl\n this.el.src = srcUrl\n }\n\n _onLoadedMetadata(e) {\n this._handleBufferingEvents()\n this.trigger(Events.PLAYBACK_LOADEDMETADATA, {duration: e.target.duration, data: e})\n this._updateSettings()\n const autoSeekFromUrl = typeof(this._options.autoSeekFromUrl) === 'undefined' || this._options.autoSeekFromUrl\n if (this.getPlaybackType() !== Playback.LIVE && autoSeekFromUrl) {\n this._checkInitialSeek()\n }\n }\n\n _onDurationChange() {\n this._updateSettings()\n this._onTimeUpdate()\n // onProgress uses the duration\n this._onProgress()\n }\n\n _updateSettings() {\n // we can't figure out if hls resource is VoD or not until it is being loaded or duration has changed.\n // that's why we check it again and update media control accordingly.\n if (this.getPlaybackType() === Playback.VOD || this.getPlaybackType() === Playback.AOD) {\n this.settings.left = ['playpause', 'position', 'duration']\n } else {\n this.settings.left = ['playstop']\n }\n this.settings.seekEnabled = this.isSeekEnabled()\n this.trigger(Events.PLAYBACK_SETTINGSUPDATE)\n }\n\n isSeekEnabled() {\n return isFinite(this.getDuration())\n }\n\n getPlaybackType() {\n const onDemandType = this.tagName === 'audio' ? Playback.AOD : Playback.VOD\n return [0, undefined, Infinity].indexOf(this.el.duration) >= 0 ? Playback.LIVE : onDemandType\n }\n\n isHighDefinitionInUse() {\n return false\n }\n\n play() {\n this.trigger(Events.PLAYBACK_PLAY_INTENT)\n this._stopped = false\n this._setupSrc(this._src)\n this._handleBufferingEvents()\n this.el.play()\n }\n\n pause() {\n this.el.pause()\n }\n\n stop() {\n this.pause()\n this._stopped = true\n // src will be added again in play()\n this.el.removeAttribute('src')\n this._stopPlayheadMovingChecks()\n this._handleBufferingEvents()\n this.trigger(Events.PLAYBACK_STOP)\n }\n\n volume(value) {\n this.el.volume = value / 100\n }\n\n mute() {\n this.el.volume = 0\n }\n\n unmute() {\n this.el.volume = 1\n }\n\n isMuted() {\n return !!this.el.volume\n }\n\n isPlaying() {\n return !this.el.paused && !this.el.ended\n }\n\n get isReady() {\n return this._isReadyState\n }\n\n _startPlayheadMovingChecks() {\n if (this._playheadMovingTimer !== null) {\n return\n }\n this._playheadMovingTimeOnCheck = null\n this._determineIfPlayheadMoving()\n this._playheadMovingTimer = setInterval(this._determineIfPlayheadMoving.bind(this), 500)\n }\n\n _stopPlayheadMovingChecks() {\n if (this._playheadMovingTimer === null) {\n return\n }\n clearInterval(this._playheadMovingTimer)\n this._playheadMovingTimer = null\n this._playheadMoving = false\n }\n\n _determineIfPlayheadMoving() {\n const before = this._playheadMovingTimeOnCheck\n const now = this.el.currentTime\n this._playheadMoving = before !== now\n this._playheadMovingTimeOnCheck = now\n this._handleBufferingEvents()\n }\n\n // this seems to happen when the user is having to wait\n // for something to happen AFTER A USER INTERACTION\n // e.g the player might be buffering, but when `play()` is called\n // only at this point will this be called.\n // Or the user may seek somewhere but the new area requires buffering,\n // so it will fire then as well.\n // On devices where playing is blocked until requested with a user action,\n // buffering may start, but never finish until the user initiates a play,\n // but this only happens when play is actually requested\n _onWaiting() {\n this._loadStarted = true\n this._handleBufferingEvents()\n }\n\n // called after the first frame has loaded\n // note this doesn't fire on ios before the user has requested play\n // ideally the \"loadstart\" event would be used instead, but this fires\n // before a user has requested play on iOS, and also this is always fired\n // even if the preload setting is \"none\". In both these cases this causes\n // infinite buffering until the user does something which isn't great.\n _onLoadedData() {\n this._loadStarted = true\n this._handleBufferingEvents()\n }\n\n // note this doesn't fire on ios before user has requested play\n _onCanPlay() {\n this._handleBufferingEvents()\n }\n\n _onPlaying() {\n this._startPlayheadMovingChecks()\n this._handleBufferingEvents()\n this.trigger(Events.PLAYBACK_PLAY)\n }\n\n _onPause() {\n this._stopPlayheadMovingChecks()\n this._handleBufferingEvents()\n this.trigger(Events.PLAYBACK_PAUSE)\n }\n\n _onEnded() {\n this._handleBufferingEvents()\n this.trigger(Events.PLAYBACK_ENDED, this.name)\n }\n\n // The playback should be classed as buffering if the following are true:\n // - the ready state is less then HAVE_FUTURE_DATA or the playhead isn't moving and it should be\n // - the media hasn't \"ended\",\n // - the media hasn't been stopped\n // - loading has started\n _handleBufferingEvents() {\n const playheadShouldBeMoving = !this.el.ended && !this.el.paused\n const buffering = this._loadStarted && !this.el.ended && !this._stopped && ((playheadShouldBeMoving && !this._playheadMoving) || this.el.readyState < this.el.HAVE_FUTURE_DATA)\n if (this._bufferingState !== buffering) {\n this._bufferingState = buffering\n if (buffering) {\n this.trigger(Events.PLAYBACK_BUFFERING, this.name)\n }\n else {\n this.trigger(Events.PLAYBACK_BUFFERFULL, this.name)\n }\n }\n }\n\n _onError() {\n this.trigger(Events.PLAYBACK_ERROR, this.el.error, this.name)\n }\n\n destroy() {\n this.$el.remove()\n this.el.src = ''\n this._src = null\n }\n\n seek(time) {\n this.el.currentTime = time\n }\n\n seekPercentage(percentage) {\n const time = this.el.duration * (percentage / 100)\n this.seek(time)\n }\n\n _checkInitialSeek() {\n const seekTime = seekStringToSeconds(window.location.href)\n if (seekTime !== 0) {\n this.seek(seekTime)\n }\n }\n\n getCurrentTime() {\n return this.el.currentTime\n }\n\n getDuration() {\n return this.el.duration\n }\n\n _onTimeUpdate() {\n this._handleBufferingEvents()\n if (this.getPlaybackType() === Playback.LIVE) {\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: 1, total: 1}, this.name)\n } else {\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: this.el.currentTime, total: this.el.duration}, this.name)\n }\n }\n\n _onProgress() {\n if (!this.el.buffered.length) {\n return\n }\n let buffered = []\n let bufferedPos = 0\n for (let i = 0; i < this.el.buffered.length; i++) {\n buffered = [...buffered, {start: this.el.buffered.start(i), end: this.el.buffered.end(i)}]\n if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) {\n bufferedPos = i\n }\n }\n const progress = {\n start: buffered[bufferedPos].start,\n current: buffered[bufferedPos].end,\n total: this.el.duration\n }\n this.trigger(Events.PLAYBACK_PROGRESS, progress, buffered)\n }\n\n _typeFor(src) {\n let mimeTypes = HTML5Video._mimeTypesForUrl(src, MIMETYPES, this.options.mimeType)\n if (mimeTypes.length == 0) {\n mimeTypes = HTML5Video._mimeTypesForUrl(src, AUDIO_MIMETYPES, this.options.mimeType)\n }\n const mimeType = mimeTypes[0] || ''\n return mimeType.split(';')[0]\n }\n\n _ready() {\n if (this._isReadyState) {\n return\n }\n this._isReadyState = true\n this.trigger(Events.PLAYBACK_READY, this.name)\n }\n\n render() {\n const style = Styler.getStyleFor(tagStyle)\n\n if (this.options.playback.disableContextMenu) {\n this.$el.on('contextmenu', () => {\n return false\n })\n }\n\n this.$el.append(style)\n this._ready()\n return this\n }\n}\n\nHTML5Video._mimeTypesForUrl = function(resourceUrl, mimeTypesByExtension, mimeType) {\n const extension = (resourceUrl.split('?')[0].match(/.*\\.(.*)$/) || [])[1]\n let mimeTypes = mimeType || (extension && mimeTypesByExtension[extension.toLowerCase()]) || []\n return (mimeTypes.constructor === Array) ? mimeTypes : [mimeTypes]\n}\n\nHTML5Video._canPlay = function(type, mimeTypesByExtension, resourceUrl, mimeType) {\n let mimeTypes = HTML5Video._mimeTypesForUrl(resourceUrl, mimeTypesByExtension, mimeType)\n const media = document.createElement(type)\n return !!(mimeTypes.filter(mediaType => !!media.canPlayType(mediaType).replace(/no/, ''))[0])\n}\n\nHTML5Video.canPlay = function(resourceUrl, mimeType) {\n return HTML5Video._canPlay('audio', AUDIO_MIMETYPES, resourceUrl, mimeType) ||\n HTML5Video._canPlay('video', MIMETYPES, resourceUrl, mimeType)\n}\n\nmodule.exports = HTML5Video\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/html5_video/html5_video.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport Playback from 'base/playback'\nimport Styler from 'base/styler'\nimport imgStyle from './public/style.scss'\nimport Events from 'base/events'\n\nexport default class HTMLImg extends Playback {\n get name() { return 'html_img' }\n get tagName() { return 'img' }\n get attributes() {\n return {\n 'data-html-img': ''\n }\n }\n\n get events() {\n return {\n 'load': '_onLoad',\n 'abort': '_onError',\n 'error': '_onError'\n }\n }\n\n getPlaybackType() {\n return Playback.NO_OP\n }\n\n constructor(params) {\n super(params)\n this.el.src = params.src\n }\n\n render() {\n const style = Styler.getStyleFor(imgStyle)\n this.$el.append(style)\n this.trigger(Events.PLAYBACK_READY, this.name)\n return this\n }\n\n _onLoad() {\n this.trigger(Events.PLAYBACK_ENDED, this.name)\n }\n\n _onError(evt) {\n const m = (evt.type === 'error') ? 'load error' : 'loading aborted'\n this.trigger(Events.PLAYBACK_ERROR, {message: m}, this.name)\n }\n}\n\nHTMLImg.canPlay = function(resource) {\n return /\\.(png|jpg|jpeg|gif|bmp|tiff|pgm|pnm|webp)(|\\?.*)$/i.test(resource)\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/html_img/html_img.js","import {requestAnimationFrame, cancelAnimationFrame} from 'base/utils'\nimport Playback from 'base/playback'\nimport template from 'base/template'\nimport Styler from 'base/styler'\nimport Events from 'base/events'\nimport noOpStyle from './public/style.scss'\nimport noOpHTML from './public/error.html'\n\nexport default class NoOp extends Playback {\n get name() { return 'no_op' }\n get template() { return template(noOpHTML) }\n get attributes() {\n return {'data-no-op': ''}\n }\n\n constructor(...args) {\n super(...args)\n this._noiseFrameNum = -1\n this._started = false\n }\n\n render() {\n const style = Styler.getStyleFor(noOpStyle)\n const playbackNotSupported = this.options.playbackNotSupportedMessage || this.i18n.t('playback_not_supported')\n this.$el.html(this.template({message: playbackNotSupported}))\n this.$el.append(style)\n this.trigger(Events.PLAYBACK_READY, this.name)\n const showForNoOp = !!(this.options.poster && this.options.poster.showForNoOp)\n if (this.options.autoPlay || !showForNoOp) {\n this.play()\n }\n return this\n }\n\n play() {\n if (!this._started) {\n this._started = true\n this.trigger(Events.PLAYBACK_PLAY)\n this._animate()\n }\n }\n\n _noise() {\n this._noiseFrameNum = (this._noiseFrameNum+1)%5\n if (this._noiseFrameNum) {\n // only update noise every 5 frames to save cpu\n return\n }\n\n const idata = this.context.createImageData(this.context.canvas.width, this.context.canvas.height)\n let buffer32\n try {\n buffer32 = new Uint32Array(idata.data.buffer)\n } catch (err) {\n buffer32 = new Uint32Array(this.context.canvas.width * this.context.canvas.height * 4)\n const data=idata.data\n for(let i = 0; i < data.length; i++){\n buffer32[i]=data[i]\n }\n }\n\n const len = buffer32.length,\n m = Math.random() * 6 + 4\n let run = 0,\n color = 0\n for (let i = 0; i < len;) {\n if (run < 0) {\n run = m * Math.random()\n const p = Math.pow(Math.random(), 0.4)\n color = (255 * p) << 24\n }\n run -= 1\n buffer32[i++] = color\n }\n this.context.putImageData(idata, 0, 0)\n }\n\n _loop() {\n if (this._stop) {\n return\n }\n this._noise()\n this._animationHandle = requestAnimationFrame(() => this._loop())\n }\n\n destroy() {\n if (this._animationHandle) {\n cancelAnimationFrame(this._animationHandle)\n this._stop = true\n }\n }\n\n _animate() {\n this.canvas = this.$el.find('canvas[data-no-op-canvas]')[0]\n this.context = this.canvas.getContext('2d')\n this._loop()\n }\n}\n\nNoOp.canPlay = (source) => { // eslint-disable-line no-unused-vars\n return true\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/playbacks/no_op/no_op.js","//Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport ContainerPlugin from 'base/container_plugin'\nimport Events from 'base/events'\nimport Playback from 'base/playback'\n\nexport default class ClickToPausePlugin extends ContainerPlugin {\n get name() { return 'click_to_pause' }\n\n constructor(container) {\n super(container)\n }\n\n bindEvents() {\n this.listenTo(this.container, Events.CONTAINER_CLICK, this.click)\n this.listenTo(this.container, Events.CONTAINER_SETTINGSUPDATE, this.settingsUpdate)\n }\n\n click() {\n if (this.container.getPlaybackType() !== Playback.LIVE || this.container.isDvrEnabled()) {\n if (this.container.isPlaying()) {\n this.container.pause()\n } else {\n this.container.play()\n }\n }\n }\n\n settingsUpdate() {\n this.container.$el.removeClass('pointer-enabled')\n if (this.container.getPlaybackType() !== Playback.LIVE || this.container.isDvrEnabled()) {\n this.container.$el.addClass('pointer-enabled')\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/click_to_pause/click_to_pause.js","module.exports = require('./click_to_pause')\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/click_to_pause/index.js","import UICorePlugin from 'base/ui_core_plugin'\nimport template from 'base/template'\nimport Playback from 'base/playback'\nimport Styler from 'base/styler'\nimport Events from 'base/events'\nimport dvrStyle from './public/dvr_controls.scss'\nimport dvrHTML from './public/index.html'\n\nexport default class DVRControls extends UICorePlugin {\n get template() { return template(dvrHTML) }\n get name() { return 'dvr_controls' }\n get events() {\n return {\n 'click .live-button': 'click'\n }\n }\n get attributes() {\n return {\n 'class': 'dvr-controls',\n 'data-dvr-controls': ''\n }\n }\n\n constructor(core) {\n super(core)\n this.settingsUpdate()\n }\n\n bindEvents() {\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged)\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.settingsUpdate)\n this.listenTo(this.core, Events.CORE_OPTIONS_CHANGE, this.render)\n if (this.core.getCurrentContainer()) {\n this.listenToOnce(this.core.getCurrentContainer(), Events.CONTAINER_TIMEUPDATE, this.render)\n this.listenTo(this.core.getCurrentContainer(), Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.dvrChanged)\n }\n }\n\n containerChanged() {\n this.stopListening()\n this.bindEvents()\n }\n\n dvrChanged(dvrEnabled) {\n this.settingsUpdate()\n this.core.mediaControl.$el.addClass('live')\n if (dvrEnabled) {\n this.core.mediaControl.$el.addClass('dvr')\n this.core.mediaControl.$el.find('.media-control-indicator[data-position], .media-control-indicator[data-duration]').hide()\n } else {\n this.core.mediaControl.$el.removeClass('dvr')\n }\n }\n\n click() {\n const mediaControl = this.core.mediaControl\n const container = mediaControl.container\n if (!container.isPlaying()) {\n container.play()\n }\n if (mediaControl.$el.hasClass('dvr')) {\n container.seek(container.getDuration())\n }\n }\n\n settingsUpdate() {\n this.stopListening()\n if(this.shouldRender()) {\n this.render()\n this.$el.click(() => this.click())\n }\n this.bindEvents()\n }\n\n shouldRender() {\n const useDvrControls = this.core.options.useDvrControls === undefined || !!this.core.options.useDvrControls\n return useDvrControls && this.core.getPlaybackType() === Playback.LIVE\n }\n\n render() {\n this.style = this.style || Styler.getStyleFor(dvrStyle, { baseUrl: this.core.options.baseUrl })\n this.$el.html(this.template({\n live: this.core.i18n.t('live'),\n backToLive: this.core.i18n.t('back_to_live')\n }))\n this.$el.append(this.style)\n if (this.shouldRender()) {\n this.core.mediaControl.$el.addClass('live')\n this.core.mediaControl.$('.media-control-left-panel[data-media-control]').append(this.$el)\n }\n return this\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/dvr_controls/dvr_controls.js","module.exports = require('./dvr_controls')\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/dvr_controls/index.js","import Events from 'base/events'\nimport CorePlugin from 'base/core_plugin'\nimport {Fullscreen} from 'base/utils'\n\nexport default class EndVideo extends CorePlugin {\n get name() { return 'end_video' }\n bindEvents() {\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged)\n const container = this.core.getCurrentContainer()\n if (container) {\n this.listenTo(container, Events.CONTAINER_ENDED, this.ended)\n this.listenTo(container, Events.CONTAINER_STOP, this.ended)\n }\n }\n\n containerChanged() {\n this.stopListening()\n this.bindEvents()\n }\n\n ended() {\n const exitOnEnd = typeof(this.core.options.exitFullscreenOnEnd) === 'undefined' || this.core.options.exitFullscreenOnEnd\n if (exitOnEnd && Fullscreen.isFullscreen()) {\n this.core.toggleFullscreen()\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/end_video.js","import CorePlugin from 'base/core_plugin'\nimport Events from 'base/events'\nimport $ from 'clappr-zepto'\n\nimport playIcon from 'icons/01-play.svg'\nimport pauseIcon from 'icons/02-pause.svg'\n\nconst oldIcon = $('link[rel=\"shortcut icon\"]')\n\nexport default class Favicon extends CorePlugin {\n get name() { return 'favicon' }\n get oldIcon() { return oldIcon }\n\n constructor(core) {\n super(core)\n this._container = null\n this.configure()\n }\n\n configure() {\n if (this.core.options.changeFavicon) {\n if (!this.enabled) {\n this.stopListening(this.core, Events.CORE_OPTIONS_CHANGE)\n this.enable()\n }\n } else if (this.enabled) {\n this.disable()\n this.listenTo(this.core, Events.CORE_OPTIONS_CHANGE, this.configure)\n }\n }\n\n bindEvents() {\n this.listenTo(this.core, Events.CORE_OPTIONS_CHANGE, this.configure)\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged)\n if (this.core.mediaControl.container) {\n this.containerChanged()\n }\n }\n\n containerChanged() {\n this._container && this.stopListening(this._container)\n this._container = this.core.mediaControl.container\n this.listenTo(this._container, Events.CONTAINER_PLAY, this.setPlayIcon)\n this.listenTo(this._container, Events.CONTAINER_PAUSE, this.setPauseIcon)\n this.listenTo(this._container, Events.CONTAINER_STOP, this.resetIcon)\n this.listenTo(this._container, Events.CONTAINER_ENDED, this.resetIcon)\n this.listenTo(this._container, Events.CONTAINER_ERROR, this.resetIcon)\n this.resetIcon()\n }\n\n disable() {\n super.disable()\n this.resetIcon()\n }\n\n destroy() {\n super.destroy()\n this.resetIcon()\n }\n\n createIcon(svg) {\n const canvas = $('<canvas/>')\n canvas[0].width = 16\n canvas[0].height = 16\n const ctx = canvas[0].getContext('2d')\n ctx.fillStyle = '#000'\n const d = $(svg).find('path').attr('d')\n const path = new Path2D(d)\n ctx.fill(path)\n const icon = $('<link rel=\"shortcut icon\" type=\"image/png\"/>')\n icon.attr('href', canvas[0].toDataURL('image/png'))\n return icon\n }\n\n setPlayIcon() {\n if (!this.playIcon) {\n this.playIcon = this.createIcon(playIcon)\n }\n this.changeIcon(this.playIcon)\n }\n\n setPauseIcon() {\n if (!this.pauseIcon) {\n this.pauseIcon = this.createIcon(pauseIcon)\n }\n this.changeIcon(this.pauseIcon)\n }\n\n resetIcon() {\n $('link[rel=\"shortcut icon\"]').remove()\n $('head').append(this.oldIcon)\n }\n\n changeIcon(icon) {\n if (icon) {\n $('link[rel=\"shortcut icon\"]').remove()\n $('head').append(icon)\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/favicon/favicon.js","module.exports = require('./favicon.js')\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/favicon/index.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport ContainerPlugin from 'base/container_plugin'\nimport Events from 'base/events'\n\nexport default class GoogleAnalytics extends ContainerPlugin {\n get name() { return 'google_analytics' }\n constructor(container) {\n super(container)\n if (this.container.options.gaAccount) {\n this.account = this.container.options.gaAccount\n this.trackerName = (this.container.options.gaTrackerName) ? this.container.options.gaTrackerName + '.' : 'Clappr.'\n this.domainName = this.container.options.gaDomainName\n this.currentHDState = undefined\n this.embedScript()\n }\n }\n\n embedScript() {\n if (!window._gat) {\n const script = document.createElement('script')\n script.setAttribute('type', 'text/javascript')\n script.setAttribute('async', 'async')\n script.setAttribute('src', '//www.google-analytics.com/ga.js')\n script.onload = () => this.addEventListeners()\n document.body.appendChild(script)\n } else {\n this.addEventListeners()\n }\n }\n\n addEventListeners() {\n if (this.container) {\n this.listenTo(this.container, Events.CONTAINER_READY, this.onReady)\n this.listenTo(this.container, Events.CONTAINER_PLAY, this.onPlay)\n this.listenTo(this.container, Events.CONTAINER_STOP, this.onStop)\n this.listenTo(this.container, Events.CONTAINER_PAUSE, this.onPause)\n this.listenTo(this.container, Events.CONTAINER_ENDED, this.onEnded)\n this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERING, this.onBuffering)\n this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERFULL, this.onBufferFull)\n this.listenTo(this.container, Events.CONTAINER_ERROR, this.onError)\n this.listenTo(this.container, Events.CONTAINER_PLAYBACKSTATE, this.onPlaybackChanged)\n this.listenTo(this.container, Events.CONTAINER_VOLUME, (event) => this.onVolumeChanged(event))\n this.listenTo(this.container, Events.CONTAINER_SEEK, (event) => this.onSeek(event))\n this.listenTo(this.container, Events.CONTAINER_FULL_SCREEN, this.onFullscreen)\n this.listenTo(this.container, Events.CONTAINER_HIGHDEFINITIONUPDATE, this.onHD)\n this.listenTo(this.container, Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.onDVR)\n }\n _gaq.push([this.trackerName + '_setAccount', this.account])\n if (this.domainName)\n _gaq.push([this.trackerName + '_setDomainName', this.domainName])\n }\n\n onReady(){\n this.push(['Video', 'Playback', this.container.playback.name])\n }\n\n onPlay() {\n this.push(['Video', 'Play', this.container.playback.src])\n }\n\n onStop() {\n this.push(['Video', 'Stop', this.container.playback.src])\n }\n\n onEnded() {\n this.push(['Video', 'Ended', this.container.playback.src])\n }\n\n onBuffering() {\n this.push(['Video', 'Buffering', this.container.playback.src])\n }\n\n onBufferFull() {\n this.push(['Video', 'Bufferfull', this.container.playback.src])\n }\n\n onError() {\n this.push(['Video', 'Error', this.container.playback.src])\n }\n\n onHD(isHD) {\n const status = isHD ? 'ON': 'OFF'\n if (status !== this.currentHDState) {\n this.currentHDState = status\n this.push(['Video', 'HD - ' + status, this.container.playback.src])\n }\n }\n\n onPlaybackChanged(playbackState) {\n if (playbackState.type !== null) {\n this.push(['Video', 'Playback Type - ' + playbackState.type, this.container.playback.src])\n }\n }\n\n onDVR(dvrInUse) {\n const status = dvrInUse? 'ON': 'OFF'\n this.push(['Interaction', 'DVR - ' + status, this.container.playback.src])\n }\n\n onPause() {\n this.push(['Video', 'Pause', this.container.playback.src])\n }\n\n onSeek() {\n this.push(['Video', 'Seek', this.container.playback.src])\n }\n\n onVolumeChanged() {\n this.push(['Interaction', 'Volume', this.container.playback.src])\n }\n\n onFullscreen() {\n this.push(['Interaction', 'Fullscreen', this.container.playback.src])\n }\n\n\n push(array) {\n const res = [this.trackerName + '_trackEvent'].concat(array)\n _gaq.push(res)\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/google_analytics/google_analytics.js","module.exports = require('./google_analytics')\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/google_analytics/index.js","\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Kibo} from 'vendor'\n\nconst BOLD = 'font-weight: bold; font-size: 13px;'\nconst INFO = 'color: #006600;' + BOLD\nconst DEBUG = 'color: #0000ff;' + BOLD\nconst WARN = 'color: #ff8000;' + BOLD\nconst ERROR = 'color: #ff0000;' + BOLD\n\nconst LEVEL_DEBUG = 0\nconst LEVEL_INFO = 1\nconst LEVEL_WARN = 2\nconst LEVEL_ERROR = 3\nconst LEVEL_DISABLED = LEVEL_ERROR\n\nconst COLORS = [DEBUG, INFO, WARN, ERROR, ERROR]\nconst DESCRIPTIONS = ['debug', 'info', 'warn', 'error', 'disabled']\n\nexport default class Log {\n constructor(level = LEVEL_INFO, offLevel = LEVEL_DISABLED) {\n this.kibo = new Kibo()\n this.kibo.down(['ctrl shift d'], () => this.onOff())\n this.BLACKLIST = ['timeupdate', 'playback:timeupdate', 'playback:progress', 'container:hover', 'container:timeupdate', 'container:progress']\n this.level = level\n this.offLevel = offLevel\n }\n\n debug(klass) {this.log(klass, LEVEL_DEBUG, Array.prototype.slice.call(arguments, 1))}\n info(klass) {this.log(klass, LEVEL_INFO, Array.prototype.slice.call(arguments, 1))}\n warn(klass) {this.log(klass, LEVEL_WARN, Array.prototype.slice.call(arguments, 1))}\n error(klass) {this.log(klass, LEVEL_ERROR, Array.prototype.slice.call(arguments, 1))}\n\n onOff() {\n if (this.level === this.offLevel) {\n this.level = this.previousLevel\n } else {\n this.previousLevel = this.level\n this.level = this.offLevel\n }\n // handle instances where console.log is unavailable\n if (window.console && window.console.log) {\n window.console.log('%c[Clappr.Log] set log level to ' + DESCRIPTIONS[this.level], WARN)\n }\n }\n\n level(newLevel) {\n this.level = newLevel\n }\n\n log(klass, level, message) {\n if (this.BLACKLIST.indexOf(message[0]) >= 0) return\n if (level < this.level) return\n\n if (!message) {\n message = klass\n klass = null\n }\n const color = COLORS[level]\n let klassDescription = ''\n if (klass) {\n klassDescription = '[' + klass + ']'\n }\n if (window.console && window.console.log) {\n window.console.log.apply(console, ['%c[' + DESCRIPTIONS[level] + ']' + klassDescription, color].concat(message))\n }\n }\n}\n\nLog.LEVEL_DEBUG = LEVEL_DEBUG\nLog.LEVEL_INFO = LEVEL_INFO\nLog.LEVEL_WARN = LEVEL_WARN\nLog.LEVEL_ERROR = LEVEL_ERROR\n\nLog.getInstance = function() {\n if (this._instance === undefined) {\n this._instance = new this()\n this._instance.previousLevel = this._instance.level\n this._instance.level = this._instance.offLevel\n }\n return this._instance\n}\n\nLog.setLevel = function(level) { this.getInstance().level = level }\n\nLog.debug = function() { this.getInstance().debug.apply(this.getInstance(), arguments) }\nLog.info = function() { this.getInstance().info.apply(this.getInstance(), arguments) }\nLog.warn = function() { this.getInstance().warn.apply(this.getInstance(), arguments) }\nLog.error = function() { this.getInstance().error.apply(this.getInstance(), arguments) }\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/log/log.js","//Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport UIContainerPlugin from 'base/ui_container_plugin'\nimport Events from 'base/events'\nimport Styler from 'base/styler'\nimport template from 'base/template'\nimport Playback from 'base/playback'\nimport posterStyle from './public/poster.scss'\nimport posterHTML from './public/poster.html'\nimport playIcon from 'icons/01-play.svg'\n\nexport default class PosterPlugin extends UIContainerPlugin {\n get name() { return 'poster' }\n get template() { return template(posterHTML) }\n get shouldRender() {\n const showForNoOp = !!(this.options.poster && this.options.poster.showForNoOp)\n return this.container.playback.name !== 'html_img' && (this.container.playback.getPlaybackType() !== Playback.NO_OP || showForNoOp)\n }\n\n get attributes() {\n return {\n 'class': 'player-poster',\n 'data-poster': ''\n }\n }\n\n get events() {\n return {\n 'click': 'clicked'\n }\n }\n\n get showOnVideoEnd() {\n return !this.options.poster || this.options.poster.showOnVideoEnd || this.options.poster.showOnVideoEnd === undefined\n }\n\n constructor(container) {\n super(container)\n this.hasStartedPlaying = false\n this.playRequested = false\n this.render()\n process.nextTick(() => this.update())\n }\n\n bindEvents() {\n this.listenTo(this.container, Events.CONTAINER_STOP, this.onStop)\n this.listenTo(this.container, Events.CONTAINER_PLAY, this.onPlay)\n this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERING, this.update)\n this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERFULL, this.update)\n this.listenTo(this.container, Events.CONTAINER_OPTIONS_CHANGE, this.render)\n this.showOnVideoEnd && this.listenTo(this.container, Events.CONTAINER_ENDED, this.onStop)\n }\n\n stopListening() {\n super.stopListening()\n }\n\n onPlay() {\n this.hasStartedPlaying = true\n this.update()\n }\n\n onStop() {\n this.hasStartedPlaying = false\n this.playRequested = false\n this.update()\n }\n\n showPlayButton(show) {\n if (show && (!this.options.chromeless || this.options.allowUserInteraction)) {\n this.$playButton.show()\n this.$el.addClass('clickable')\n } else {\n this.$playButton.hide()\n this.$el.removeClass('clickable')\n }\n }\n\n clicked() {\n if (!this.options.chromeless || this.options.allowUserInteraction) {\n this.playRequested = true\n this.update()\n this.container.play()\n }\n return false\n }\n\n shouldHideOnPlay() {\n // Audio broadcasts should keep the poster up; video should hide poster while playing.\n return !this.container.playback.isAudioOnly\n }\n\n update() {\n if (!this.shouldRender) {\n return\n }\n let showPlayButton = !this.playRequested && !this.hasStartedPlaying && !this.container.buffering\n this.showPlayButton(showPlayButton)\n if (!this.hasStartedPlaying) {\n this.container.disableMediaControl()\n this.$el.show()\n } else {\n this.container.enableMediaControl()\n if (this.shouldHideOnPlay()) {\n this.$el.hide()\n }\n }\n }\n\n render() {\n if (!this.shouldRender) {\n return\n }\n let style = Styler.getStyleFor(posterStyle, {baseUrl: this.options.baseUrl})\n this.$el.html(this.template())\n this.$el.append(style)\n if (this.options.poster) {\n const posterUrl = this.options.poster.url || this.options.poster\n this.$el.css({'background-image': 'url(' + posterUrl + ')'})\n }\n this.container.$el.append(this.el)\n this.$playWrapper = this.$el.find('.play-wrapper')\n this.$playWrapper.append(playIcon)\n this.$playButton = this.$playWrapper.find('svg')\n this.$playButton.addClass('poster-icon')\n this.$playButton.attr('data-poster', '')\n\n let buttonsColor = this.options.mediacontrol && this.options.mediacontrol.buttons\n if (buttonsColor) {\n this.$el.find('svg path').css('fill', buttonsColor)\n }\n\n if (this.options.mediacontrol && this.options.mediacontrol.buttons) {\n buttonsColor = this.options.mediacontrol.buttons\n this.$playButton.css('color', buttonsColor)\n }\n this.update()\n return this\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/poster/poster.js","module.exports = require('./seek_time')\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/seek_time/index.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {formatTime} from 'base/utils'\n\nimport UICorePlugin from 'base/ui_core_plugin'\nimport Styler from 'base/styler'\nimport template from 'base/template'\nimport Events from 'base/events'\nimport Playback from 'base/playback'\nimport seekTimeStyle from './public/seek_time.scss'\nimport seekTimeHTML from './public/seek_time.html'\n\nexport default class SeekTime extends UICorePlugin {\n get name() { return 'seek_time' }\n get template() {\n return template(seekTimeHTML)\n }\n get attributes() {\n return {\n 'class': 'seek-time',\n 'data-seek-time': ''\n }\n }\n get mediaControl() { return this.core.mediaControl }\n get mediaControlContainer() { return this.mediaControl.container }\n get isLiveStreamWithDvr() { return this.mediaControlContainer && this.mediaControlContainer.getPlaybackType() === Playback.LIVE && this.mediaControlContainer.isDvrEnabled() }\n get durationShown() { return this.isLiveStreamWithDvr && !this.useActualLiveTime }\n get useActualLiveTime() { return this.actualLiveTime && this.isLiveStreamWithDvr }\n constructor(core) {\n super(core)\n this.hoveringOverSeekBar = false\n this.hoverPosition = null\n this.duration = null\n this.actualLiveTime = !!this.mediaControl.options.actualLiveTime\n if (this.actualLiveTime) {\n if (this.mediaControl.options.actualLiveServerTime) {\n this.actualLiveServerTimeDiff = new Date().getTime() - new Date(this.mediaControl.options.actualLiveServerTime).getTime()\n } else {\n this.actualLiveServerTimeDiff = 0\n }\n }\n }\n\n bindEvents() {\n this.listenTo(this.mediaControl, Events.MEDIACONTROL_RENDERED, this.render)\n this.listenTo(this.mediaControl, Events.MEDIACONTROL_MOUSEMOVE_SEEKBAR, this.showTime)\n this.listenTo(this.mediaControl, Events.MEDIACONTROL_MOUSELEAVE_SEEKBAR, this.hideTime)\n this.listenTo(this.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.onContainerChanged)\n if (this.mediaControlContainer) {\n this.listenTo(this.mediaControlContainer, Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.update)\n this.listenTo(this.mediaControlContainer, Events.CONTAINER_TIMEUPDATE, this.updateDuration)\n }\n }\n\n onContainerChanged() {\n this.stopListening()\n this.bindEvents()\n }\n\n updateDuration(timeProgress) {\n this.duration = timeProgress.total\n this.update()\n }\n\n showTime(event) {\n this.hoveringOverSeekBar = true\n this.calculateHoverPosition(event)\n this.update()\n }\n\n hideTime() {\n this.hoveringOverSeekBar = false\n this.update()\n }\n\n calculateHoverPosition(event) {\n const offset = event.pageX - this.mediaControl.$seekBarContainer.offset().left\n // proportion into the seek bar that the mouse is hovered over 0-1\n this.hoverPosition = Math.min(1, Math.max(offset/this.mediaControl.$seekBarContainer.width(), 0))\n }\n\n getSeekTime() {\n let seekTime, secondsSinceMidnight\n if (this.useActualLiveTime) {\n const d = new Date(new Date().getTime() - this.actualLiveServerTimeDiff), e = new Date(d)\n secondsSinceMidnight = (e - d.setHours(0,0,0,0)) / 1000\n seekTime = (secondsSinceMidnight - this.duration) + (this.hoverPosition * this.duration)\n if (seekTime < 0) {\n seekTime += 86400\n }\n } else {\n seekTime = this.hoverPosition * this.duration\n }\n return {seekTime, secondsSinceMidnight}\n }\n\n update() {\n if (!this.rendered) {\n // update() is always called after a render\n return\n }\n if (!this.shouldBeVisible()) {\n this.$el.hide()\n this.$el.css('left', '-100%')\n } else {\n const seekTime = this.getSeekTime()\n const currentSeekTime = formatTime(seekTime.seekTime, this.useActualLiveTime)\n // only update dom if necessary, ie time actually changed\n if (currentSeekTime !== this.displayedSeekTime) {\n this.$seekTimeEl.text(currentSeekTime)\n this.displayedSeekTime = currentSeekTime\n }\n\n if (this.durationShown) {\n this.$durationEl.show()\n const currentDuration = formatTime(this.actualLiveTime ? seekTime.secondsSinceMidnight : this.duration, this.actualLiveTime)\n if (currentDuration !== this.displayedDuration) {\n this.$durationEl.text(currentDuration)\n this.displayedDuration = currentDuration\n }\n } else {\n this.$durationEl.hide()\n }\n\n // the element must be unhidden before its width is requested, otherwise it's width will be reported as 0\n this.$el.show()\n const containerWidth = this.mediaControl.$seekBarContainer.width()\n const elWidth = this.$el.width()\n let elLeftPos = this.hoverPosition * containerWidth\n elLeftPos -= elWidth / 2\n elLeftPos = Math.max(0, Math.min(elLeftPos, containerWidth - elWidth))\n this.$el.css('left', elLeftPos)\n }\n }\n\n shouldBeVisible() {\n return this.mediaControlContainer && this.mediaControlContainer.settings.seekEnabled && this.hoveringOverSeekBar && this.hoverPosition !== null && this.duration !== null\n }\n\n render() {\n this.rendered = true\n this.displayedDuration = null\n this.displayedSeekTime = null\n const style = Styler.getStyleFor(seekTimeStyle)\n this.$el.html(this.template())\n this.$el.append(style)\n this.$el.hide()\n this.mediaControl.$el.append(this.el)\n this.$seekTimeEl = this.$el.find('[data-seek-time]')\n this.$durationEl = this.$el.find('[data-duration]')\n this.$durationEl.hide()\n this.update()\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/seek_time/seek_time.js","import CorePlugin from 'base/core_plugin'\n\nimport Events from 'base/events'\n\nexport default class SourcesPlugin extends CorePlugin {\n get name() { return 'sources' }\n\n bindEvents() {\n this.listenTo(this.core, Events.CORE_CONTAINERS_CREATED, this.onContainersCreated)\n }\n\n onContainersCreated() {\n const firstValidSource = this.core.containers.filter(container => container.playback.name !== 'no_op')[0] || this.core.containers[0]\n if (firstValidSource) {\n this.core.containers.forEach((container) => {\n if (container !== firstValidSource) {\n container.destroy()\n }\n })\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/sources.js","module.exports = require('./spinner_three_bounce')\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/spinner_three_bounce/index.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport UIContainerPlugin from 'base/ui_container_plugin'\nimport Events from 'base/events'\nimport Styler from 'base/styler'\nimport template from 'base/template'\nimport spinnerHTML from './public/spinner.html'\nimport spinnerStyle from './public/spinner.scss'\n\nexport default class SpinnerThreeBouncePlugin extends UIContainerPlugin {\n get name() { return 'spinner' }\n get attributes() {\n return {\n 'data-spinner':'',\n 'class': 'spinner-three-bounce'\n }\n }\n\n constructor(container) {\n super(container)\n this.template = template(spinnerHTML)\n this.showTimeout = null\n this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERING, this.onBuffering)\n this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERFULL, this.onBufferFull)\n this.listenTo(this.container, Events.CONTAINER_STOP, this.onStop)\n this.listenTo(this.container, Events.CONTAINER_ENDED, this.onStop)\n this.listenTo(this.container, Events.CONTAINER_ERROR, this.onStop)\n this.render()\n }\n\n onBuffering() {\n this.show()\n }\n\n onBufferFull() {\n this.hide()\n }\n\n onStop() {\n this.hide()\n }\n\n show() {\n if (this.showTimeout === null) {\n this.showTimeout = setTimeout(() => this.$el.show(), 300)\n }\n }\n\n hide() {\n if (this.showTimeout !== null) {\n clearTimeout(this.showTimeout)\n this.showTimeout = null\n }\n this.$el.hide()\n }\n\n render() {\n this.$el.html(this.template())\n const style = Styler.getStyleFor(spinnerStyle)\n this.container.$el.append(style)\n this.container.$el.append(this.$el)\n this.$el.hide()\n if (this.container.buffering) {\n this.onBuffering()\n }\n return this\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/spinner_three_bounce/spinner_three_bounce.js","module.exports = require('./stats')\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/stats/index.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport ContainerPlugin from 'base/container_plugin'\nimport Events from 'base/events'\nimport $ from 'clappr-zepto'\n\nexport default class StatsPlugin extends ContainerPlugin {\n get name() { return 'stats' }\n\n constructor(container) {\n super(container)\n this.setInitialAttrs()\n this.reportInterval = this.options.reportInterval || 5000\n this.state = 'IDLE'\n }\n\n bindEvents() {\n this.listenTo(this.container.playback, Events.PLAYBACK_PLAY, this.onPlay)\n this.listenTo(this.container, Events.CONTAINER_STOP, this.onStop)\n this.listenTo(this.container, Events.CONTAINER_ENDED, this.onStop)\n this.listenTo(this.container, Events.CONTAINER_DESTROYED, this.onStop)\n this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERING, this.onBuffering)\n this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERFULL, this.onBufferFull)\n this.listenTo(this.container, Events.CONTAINER_STATS_ADD, this.onStatsAdd)\n this.listenTo(this.container, Events.CONTAINER_BITRATE, this.onStatsAdd)\n this.listenTo(this.container.playback, Events.PLAYBACK_STATS_ADD, this.onStatsAdd)\n }\n\n setInitialAttrs() {\n this.firstPlay = true\n this.startupTime = 0\n this.rebufferingTime = 0\n this.watchingTime = 0\n this.rebuffers = 0\n this.externalMetrics = {}\n }\n\n onPlay() {\n this.state = 'PLAYING'\n this.watchingTimeInit = Date.now()\n if (!this.intervalId) {\n this.intervalId = setInterval(this.report.bind(this), this.reportInterval)\n }\n }\n\n onStop() {\n clearInterval(this.intervalId)\n this.report()\n this.intervalId = undefined\n this.state = 'STOPPED'\n }\n\n onBuffering() {\n if (this.firstPlay) {\n this.startupTimeInit = Date.now()\n } else {\n this.rebufferingTimeInit = Date.now()\n }\n this.state = 'BUFFERING'\n this.rebuffers++\n }\n\n onBufferFull() {\n if (this.firstPlay && this.startupTimeInit) {\n this.firstPlay = false\n this.startupTime = Date.now() - this.startupTimeInit\n this.watchingTimeInit = Date.now()\n } else if (this.rebufferingTimeInit) {\n this.rebufferingTime += this.getRebufferingTime()\n }\n this.rebufferingTimeInit = undefined\n this.state = 'PLAYING'\n }\n\n getRebufferingTime() {\n return Date.now() - this.rebufferingTimeInit\n }\n\n getWatchingTime() {\n const totalTime = (Date.now() - this.watchingTimeInit)\n return totalTime - this.rebufferingTime\n }\n\n isRebuffering() {\n return !!this.rebufferingTimeInit\n }\n\n onStatsAdd(metric) {\n $.extend(this.externalMetrics, metric)\n }\n\n getStats() {\n const metrics = {\n startupTime: this.startupTime,\n rebuffers: this.rebuffers,\n rebufferingTime: this.isRebuffering()? this.rebufferingTime + this.getRebufferingTime(): this.rebufferingTime,\n watchingTime: this.isRebuffering()? this.getWatchingTime() - this.getRebufferingTime(): this.getWatchingTime()\n }\n $.extend(metrics, this.externalMetrics)\n return metrics\n }\n\n report() {\n this.container.statsReport(this.getStats())\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/stats/stats.js","import {getBrowserLanguage} from 'base/utils'\n\nimport CorePlugin from 'base/core_plugin'\nimport merge from 'lodash.merge'\n\n/**\n * The internationalization (i18n) plugin\n * @class Strings\n * @constructor\n * @extends CorePlugin\n * @module plugins\n */\nexport default class Strings extends CorePlugin {\n get name() {return 'strings'}\n\n constructor(core) {\n super(core)\n this._initializeMessages()\n }\n /**\n * Gets a translated string for the given key.\n * @method t\n * @param {String} key the key to all messages\n * @return {String} translated label\n */\n t(key) {\n const lang = this._language()\n const i18n = lang && this._messages[lang] || this._messages['en']\n return i18n[key] || key\n }\n\n _language() {return this.core.options.language || getBrowserLanguage()}\n\n _initializeMessages() {\n this._messages = merge({\n 'en': {\n 'live': 'live',\n 'back_to_live': 'back to live',\n 'playback_not_supported': 'Your browser does not support the playback of this video. Please try using a different browser.'\n },\n 'pt': {\n 'live': 'ao vivo',\n 'back_to_live': 'voltar para o ao vivo',\n 'playback_not_supported': 'Seu navegador não supporta a reprodução deste video. Por favor, tente usar um navegador diferente.'\n },\n 'es': {\n 'live': 'vivo',\n 'back_to_live': 'volver en vivo',\n 'playback_not_supported': 'Su navegador no soporta la reproducción de un video. Por favor, trate de usar un navegador diferente.'\n },\n 'ru': {\n 'live': 'прямой эфир',\n 'back_to_live': 'к прямому эфиру',\n 'playback_not_supported': 'Ваш браузер не поддерживает воспроизведение этого видео. Пожалуйста, попробуйте другой браузер.'\n }\n }, this.core.options.strings || {})\n\n this._messages['pt-BR'] = this._messages['pt']\n this._messages['en-US'] = this._messages['en']\n this._messages['es-419'] = this._messages['es']\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/strings.js","module.exports = require('./watermark')\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/watermark/index.js","// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport UIContainerPlugin from 'base/ui_container_plugin'\nimport Events from 'base/events'\nimport Styler from 'base/styler'\nimport template from 'base/template'\nimport watermarkStyle from './public/watermark.scss'\nimport watermarkHTML from './public/watermark.html'\n\nexport default class WaterMarkPlugin extends UIContainerPlugin {\n get name() { return 'watermark' }\n\n get template() { return template(watermarkHTML) }\n\n constructor(container) {\n super(container)\n this.configure()\n }\n\n bindEvents() {\n this.listenTo(this.container, Events.CONTAINER_PLAY, this.onPlay)\n this.listenTo(this.container, Events.CONTAINER_STOP, this.onStop)\n this.listenTo(this.container, Events.CONTAINER_OPTIONS_CHANGE, this.configure)\n }\n\n configure() {\n this.position = this.options.position || 'bottom-right'\n if (this.options.watermark) {\n this.imageUrl = this.options.watermark\n this.imageLink = this.options.watermarkLink\n this.render()\n } else {\n this.$el.remove()\n }\n }\n\n onPlay() {\n if (!this.hidden)\n this.$el.show()\n }\n\n onStop() {\n this.$el.hide()\n }\n\n render() {\n this.$el.hide()\n const templateOptions = {position: this.position, imageUrl: this.imageUrl, imageLink: this.imageLink}\n this.$el.html(this.template(templateOptions))\n const style = Styler.getStyleFor(watermarkStyle)\n this.container.$el.append(style)\n this.container.$el.append(this.$el)\n return this\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/watermark/watermark.js","/* eslint-disable */\n// Kibo is released under the MIT License. Copyright (c) 2013 marquete.\n// see https://github.com/marquete/kibo\n\nvar Kibo = function(element) {\n this.element = element || window.document;\n this.initialize();\n};\n\nKibo.KEY_NAMES_BY_CODE = {\n 8: 'backspace', 9: 'tab', 13: 'enter',\n 16: 'shift', 17: 'ctrl', 18: 'alt',\n 20: 'caps_lock',\n 27: 'esc',\n 32: 'space',\n 37: 'left', 38: 'up', 39: 'right', 40: 'down',\n 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', 54: '6', 55: '7', 56: '8', 57: '9',\n 65: 'a', 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h', 73: 'i', 74: 'j',\n 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't',\n 85: 'u', 86: 'v', 87: 'w', 88: 'x', 89: 'y', 90: 'z', 112: 'f1', 113: 'f2', 114: 'f3',\n 115: 'f4', 116: 'f5', 117: 'f6', 118: 'f7', 119: 'f8', 120: 'f9', 121: 'f10', 122: 'f11', 123: 'f12'\n};\n\nKibo.KEY_CODES_BY_NAME = {};\n(function() {\n for(var key in Kibo.KEY_NAMES_BY_CODE) {\n if(Object.prototype.hasOwnProperty.call(Kibo.KEY_NAMES_BY_CODE, key)) {\n Kibo.KEY_CODES_BY_NAME[Kibo.KEY_NAMES_BY_CODE[key]] = +key;\n }\n }\n})();\n\nKibo.MODIFIERS = ['shift', 'ctrl', 'alt'];\n\nKibo.registerEvent = (function() {\n if(document.addEventListener) {\n return function(element, eventName, func) {\n element.addEventListener(eventName, func, false);\n };\n }\n else if(document.attachEvent) {\n return function(element, eventName, func) {\n element.attachEvent('on' + eventName, func);\n };\n }\n})();\n\nKibo.unregisterEvent = (function() {\n if(document.removeEventListener) {\n return function(element, eventName, func) {\n element.removeEventListener(eventName, func, false);\n };\n }\n else if(document.detachEvent) {\n return function(element, eventName, func) {\n element.detachEvent('on' + eventName, func);\n };\n }\n})();\n\nKibo.stringContains = function(string, substring) {\n return string.indexOf(substring) !== -1;\n};\n\nKibo.neatString = function(string) {\n return string.replace(/^\\s+|\\s+$/g, '').replace(/\\s+/g, ' ');\n};\n\nKibo.capitalize = function(string) {\n return string.toLowerCase().replace(/^./, function(match) { return match.toUpperCase(); });\n};\n\nKibo.isString = function(what) {\n return Kibo.stringContains(Object.prototype.toString.call(what), 'String');\n};\n\nKibo.arrayIncludes = (function() {\n if(Array.prototype.indexOf) {\n return function(haystack, needle) {\n return haystack.indexOf(needle) !== -1;\n };\n }\n else {\n return function(haystack, needle) {\n for(var i = 0; i < haystack.length; i++) {\n if(haystack[i] === needle) {\n return true;\n }\n }\n return false;\n };\n }\n})();\n\nKibo.extractModifiers = function(keyCombination) {\n var modifiers, i\n modifiers = [];\n for(i = 0; i < Kibo.MODIFIERS.length; i++) {\n if(Kibo.stringContains(keyCombination, Kibo.MODIFIERS[i])) {\n modifiers.push(Kibo.MODIFIERS[i]);\n }\n }\n return modifiers;\n}\n\nKibo.extractKey = function(keyCombination) {\n var keys, i;\n keys = Kibo.neatString(keyCombination).split(' ');\n for(i = 0; i < keys.length; i++) {\n if(!Kibo.arrayIncludes(Kibo.MODIFIERS, keys[i])) {\n return keys[i];\n }\n }\n};\n\nKibo.modifiersAndKey = function(keyCombination) {\n var result, key;\n\n if(Kibo.stringContains(keyCombination, 'any')) {\n return Kibo.neatString(keyCombination).split(' ').slice(0, 2).join(' ');\n }\n\n result = Kibo.extractModifiers(keyCombination);\n\n key = Kibo.extractKey(keyCombination);\n if(key && !Kibo.arrayIncludes(Kibo.MODIFIERS, key)) {\n result.push(key);\n }\n\n return result.join(' ');\n}\n\nKibo.keyName = function(keyCode) {\n return Kibo.KEY_NAMES_BY_CODE[keyCode + ''];\n};\n\nKibo.keyCode = function(keyName) {\n return +Kibo.KEY_CODES_BY_NAME[keyName];\n};\n\nKibo.prototype.initialize = function() {\n var i, that = this;\n\n this.lastKeyCode = -1;\n this.lastModifiers = {};\n for(i = 0; i < Kibo.MODIFIERS.length; i++) {\n this.lastModifiers[Kibo.MODIFIERS[i]] = false;\n }\n\n this.keysDown = { any: [] };\n this.keysUp = { any: [] };\n this.downHandler = this.handler('down');\n this.upHandler = this.handler('up');\n\n Kibo.registerEvent(this.element, 'keydown', this.downHandler);\n Kibo.registerEvent(this.element, 'keyup', this.upHandler);\n Kibo.registerEvent(window, 'unload', function unloader() {\n Kibo.unregisterEvent(that.element, 'keydown', that.downHandler);\n Kibo.unregisterEvent(that.element, 'keyup', that.upHandler);\n Kibo.unregisterEvent(window, 'unload', unloader);\n });\n};\n\nKibo.prototype.handler = function(upOrDown) {\n var that = this;\n return function(e) {\n var i, registeredKeys, lastModifiersAndKey;\n\n e = e || window.event;\n\n that.lastKeyCode = e.keyCode;\n for(i = 0; i < Kibo.MODIFIERS.length; i++) {\n that.lastModifiers[Kibo.MODIFIERS[i]] = e[Kibo.MODIFIERS[i] + 'Key'];\n }\n if(Kibo.arrayIncludes(Kibo.MODIFIERS, Kibo.keyName(that.lastKeyCode))) {\n that.lastModifiers[Kibo.keyName(that.lastKeyCode)] = true;\n }\n\n registeredKeys = that['keys' + Kibo.capitalize(upOrDown)];\n\n for(i = 0; i < registeredKeys.any.length; i++) {\n if((registeredKeys.any[i](e) === false) && e.preventDefault) {\n e.preventDefault();\n }\n }\n\n lastModifiersAndKey = that.lastModifiersAndKey();\n if(registeredKeys[lastModifiersAndKey]) {\n for(i = 0; i < registeredKeys[lastModifiersAndKey].length; i++) {\n if((registeredKeys[lastModifiersAndKey][i](e) === false) && e.preventDefault) {\n e.preventDefault();\n }\n }\n }\n };\n};\n\nKibo.prototype.registerKeys = function(upOrDown, newKeys, func) {\n var i, keys, registeredKeys = this['keys' + Kibo.capitalize(upOrDown)];\n\n if(Kibo.isString(newKeys)) {\n newKeys = [newKeys];\n }\n\n for(i = 0; i < newKeys.length; i++) {\n keys = newKeys[i];\n keys = Kibo.modifiersAndKey(keys + '');\n\n if(registeredKeys[keys]) {\n registeredKeys[keys].push(func);\n } else {\n registeredKeys[keys] = [func];\n }\n }\n\n return this;\n};\n\n// jshint maxdepth:5\nKibo.prototype.unregisterKeys = function(upOrDown, newKeys, func) {\n var i, j, keys, registeredKeys = this['keys' + Kibo.capitalize(upOrDown)];\n\n if(Kibo.isString(newKeys)) {\n newKeys = [newKeys];\n }\n\n for(i = 0; i < newKeys.length; i++) {\n keys = newKeys[i];\n keys = Kibo.modifiersAndKey(keys + '');\n\n if(func === null) {\n delete registeredKeys[keys];\n } else {\n if(registeredKeys[keys]) {\n for(j = 0; j < registeredKeys[keys].length; j++) {\n if(String(registeredKeys[keys][j]) === String(func)) {\n registeredKeys[keys].splice(j, 1);\n break;\n }\n }\n }\n }\n }\n\n return this;\n};\n\nKibo.prototype.off = function(keys) {\n return this.unregisterKeys('down', keys, null);\n}\n\nKibo.prototype.delegate = function(upOrDown, keys, func) {\n return (func !== null || func !== undefined) ? this.registerKeys(upOrDown, keys, func) : this.unregisterKeys(upOrDown, keys, func);\n};\n\nKibo.prototype.down = function(keys, func) {\n return this.delegate('down', keys, func);\n};\n\nKibo.prototype.up = function(keys, func) {\n return this.delegate('up', keys, func);\n};\n\nKibo.prototype.lastKey = function(modifier) {\n if(!modifier) {\n return Kibo.keyName(this.lastKeyCode);\n }\n\n return this.lastModifiers[modifier];\n};\n\nKibo.prototype.lastModifiersAndKey = function() {\n var result, i;\n\n result = [];\n for(i = 0; i < Kibo.MODIFIERS.length; i++) {\n if(this.lastKey(Kibo.MODIFIERS[i])) {\n result.push(Kibo.MODIFIERS[i]);\n }\n }\n\n if(!Kibo.arrayIncludes(result, this.lastKey())) {\n result.push(this.lastKey());\n }\n\n return result.join(' ');\n};\n\nexport default Kibo\n\n\n\n// WEBPACK FOOTER //\n// ./src/vendor/kibo.js","exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".container[data-container]{position:absolute;background-color:#000;height:100%;width:100%}.container[data-container] .chromeless{cursor:default}[data-player]:not(.nocursor) .container[data-container]:not(.chromeless).pointer-enabled{cursor:pointer}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/container/public/style.scss\n// module id = 78\n// module chunks = 0","exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"@font-face{font-family:Roboto;font-style:normal;font-weight:400;src:local(\\\"Roboto\\\"),local(\\\"Roboto-Regular\\\"),url(\" + require(\"./Roboto.ttf\") + \") format(\\\"truetype\\\")}[data-player]{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-transform:translateZ(0);transform:translateZ(0);position:relative;margin:0;padding:0;border:0;font-style:normal;font-weight:400;text-align:center;overflow:hidden;font-size:100%;font-family:Roboto,Open Sans,Arial,sans-serif;text-shadow:0 0 0;box-sizing:border-box}[data-player] a,[data-player] abbr,[data-player] acronym,[data-player] address,[data-player] applet,[data-player] article,[data-player] aside,[data-player] audio,[data-player] b,[data-player] big,[data-player] blockquote,[data-player] canvas,[data-player] caption,[data-player] center,[data-player] cite,[data-player] code,[data-player] dd,[data-player] del,[data-player] details,[data-player] dfn,[data-player] div,[data-player] dl,[data-player] dt,[data-player] em,[data-player] embed,[data-player] fieldset,[data-player] figcaption,[data-player] figure,[data-player] footer,[data-player] form,[data-player] h1,[data-player] h2,[data-player] h3,[data-player] h4,[data-player] h5,[data-player] h6,[data-player] header,[data-player] hgroup,[data-player] i,[data-player] iframe,[data-player] img,[data-player] ins,[data-player] kbd,[data-player] label,[data-player] legend,[data-player] li,[data-player] mark,[data-player] menu,[data-player] nav,[data-player] object,[data-player] ol,[data-player] output,[data-player] p,[data-player] pre,[data-player] q,[data-player] ruby,[data-player] s,[data-player] samp,[data-player] section,[data-player] small,[data-player] span,[data-player] strike,[data-player] strong,[data-player] sub,[data-player] summary,[data-player] sup,[data-player] table,[data-player] tbody,[data-player] td,[data-player] tfoot,[data-player] th,[data-player] thead,[data-player] time,[data-player] tr,[data-player] tt,[data-player] u,[data-player] ul,[data-player] var,[data-player] video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}[data-player] table{border-collapse:collapse;border-spacing:0}[data-player] caption,[data-player] td,[data-player] th{text-align:left;font-weight:400;vertical-align:middle}[data-player] blockquote,[data-player] q{quotes:none}[data-player] blockquote:after,[data-player] blockquote:before,[data-player] q:after,[data-player] q:before{content:\\\"\\\";content:none}[data-player] a img{border:none}[data-player]:focus{outline:0}[data-player] *{max-width:none;box-sizing:inherit;float:none}[data-player] div{display:block}[data-player].fullscreen{width:100%!important;height:100%!important;top:0;left:0}[data-player].nocursor{cursor:none}.clappr-style{display:none!important}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/core/public/style.scss\n// module id = 79\n// module chunks = 0","exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".media-control-notransition{-webkit-transition:none!important;transition:none!important}.media-control[data-media-control]{position:absolute;width:100%;height:100%;z-index:9999;pointer-events:none}.media-control[data-media-control].dragging{pointer-events:auto;cursor:-webkit-grabbing!important;cursor:grabbing!important;cursor:url(\" + require(\"./closed-hand.cur\") + \"),move}.media-control[data-media-control].dragging *{cursor:-webkit-grabbing!important;cursor:grabbing!important;cursor:url(\" + require(\"./closed-hand.cur\") + \"),move}.media-control[data-media-control] .media-control-background[data-background]{position:absolute;height:40%;width:100%;bottom:0;background:-webkit-linear-gradient(transparent,rgba(0,0,0,.9));background:linear-gradient(transparent,rgba(0,0,0,.9));-webkit-transition:opacity .6s ease-out;transition:opacity .6s ease-out}.media-control[data-media-control] .media-control-icon{line-height:0;letter-spacing:0;speak:none;color:#fff;opacity:.5;vertical-align:middle;text-align:left;-webkit-transition:all .1s ease;transition:all .1s ease}.media-control[data-media-control] .media-control-icon:hover{color:#fff;opacity:.75;text-shadow:hsla(0,0%,100%,.8) 0 0 5px}.media-control[data-media-control].media-control-hide .media-control-background[data-background]{opacity:0}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls]{bottom:-50px}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls]{position:absolute;bottom:7px;width:100%;height:32px;font-size:0;vertical-align:middle;pointer-events:auto;-webkit-transition:bottom .4s ease-out;transition:bottom .4s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control]{position:absolute;top:0;left:4px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control]{height:100%;text-align:center;line-height:32px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control]{position:absolute;top:0;right:4px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button{background-color:transparent;border:0;margin:0 6px;padding:0;cursor:pointer;display:inline-block;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg{width:100%;height:22px}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg path{fill:#fff}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus{outline:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop]{float:left;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen]{float:right;background-color:transparent;border:0;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator]{cursor:default;float:right;background-color:transparent;border:0;height:100%;display:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled{opacity:1;display:block}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled:hover{opacity:1;text-shadow:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop]{float:left}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration],.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{display:inline-block;font-size:10px;color:#fff;cursor:default;line-height:32px;position:relative}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{margin:0 6px 0 7px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]{color:hsla(0,0%,100%,.5);margin-right:6px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before{content:\\\"|\\\";margin-right:7px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]{position:absolute;top:-20px;left:0;display:inline-block;vertical-align:middle;width:100%;height:25px;cursor:pointer}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar]{width:100%;height:1px;position:relative;top:12px;background-color:#666}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#c2c2c2;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#005aff;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:0;position:absolute;top:-3px;width:5px;height:7px;background-color:hsla(0,0%,100%,.5);-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]:hover .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled{cursor:default}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled:hover .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);top:2px;left:0;width:20px;height:20px;opacity:1;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar]{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:10px;box-shadow:0 0 0 6px hsla(0,0%,100%,.2);background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume]{float:right;display:inline-block;height:32px;cursor:pointer;margin:0 6px;box-sizing:border-box}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume]{float:left;bottom:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]{background-color:transparent;border:0;box-sizing:content-box;width:32px;height:32px;opacity:.5}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:hover{opacity:.75}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg{height:24px;position:relative;top:3px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg path{fill:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted svg{margin-left:2px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume]{float:left;position:relative;overflow:hidden;top:6px;width:42px;height:18px;padding:3px 0;-webkit-transition:width .2s ease-out;transition:width .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume]{height:1px;position:relative;top:7px;margin:0 3px;background-color:#666}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#c2c2c2;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-2[data-volume]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#005aff;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-hover[data-volume]{opacity:0;position:absolute;top:-3px;width:5px;height:7px;background-color:hsla(0,0%,100%,.5);-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume]{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);top:0;left:0;width:20px;height:20px;opacity:1;-webkit-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume]{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:10px;box-shadow:0 0 0 6px hsla(0,0%,100%,.2);background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]{float:left;width:4px;padding-left:2px;height:12px;opacity:.5;box-shadow:inset 2px 0 0 #fff;-webkit-transition:-webkit-transform .2s ease-out;transition:transform .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume].fill{box-shadow:inset 2px 0 0 #fff;opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:nth-of-type(1){padding-left:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:hover{-webkit-transform:scaleY(1.5);transform:scaleY(1.5)}.media-control[data-media-control].w320 .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide{width:0;height:12px;top:9px;padding:0}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/media_control/public/media-control.scss\n// module id = 80\n// module chunks = 0","exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".clappr-flash-playback[data-flash-playback]{display:block;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/playbacks/base_flash_playback/public/flash.scss\n// module id = 81\n// module chunks = 0","exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"[data-html5-video]{position:absolute;height:100%;width:100%;display:block}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/playbacks/html5_video/public/style.scss\n// module id = 82\n// module chunks = 0","exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"[data-html-img]{max-width:100%;max-height:100%}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/playbacks/html_img/public/style.scss\n// module id = 83\n// module chunks = 0","exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"[data-no-op]{position:absolute;height:100%;width:100%;text-align:center}[data-no-op] p[data-no-op-msg]{position:absolute;text-align:center;font-size:25px;left:0;right:0;color:#fff;padding:10px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);max-height:100%;overflow:auto}[data-no-op] canvas[data-no-op-canvas]{background-color:#777;height:100%;width:100%}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/playbacks/no_op/public/style.scss\n// module id = 84\n// module chunks = 0","exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".dvr-controls[data-dvr-controls]{display:inline-block;float:left;color:#fff;line-height:32px;font-size:10px;font-weight:700;margin-left:6px}.dvr-controls[data-dvr-controls] .live-info{cursor:default;font-family:Roboto,Open Sans,Arial,sans-serif;text-transform:uppercase}.dvr-controls[data-dvr-controls] .live-info:before{content:\\\"\\\";display:inline-block;position:relative;width:7px;height:7px;border-radius:3.5px;margin-right:3.5px;background-color:#ff0101}.dvr-controls[data-dvr-controls] .live-info.disabled{opacity:.3}.dvr-controls[data-dvr-controls] .live-info.disabled:before{background-color:#fff}.dvr-controls[data-dvr-controls] .live-button{cursor:pointer;outline:none;display:none;border:0;color:#fff;background-color:transparent;height:32px;padding:0;opacity:.7;font-family:Roboto,Open Sans,Arial,sans-serif;text-transform:uppercase;-webkit-transition:all .1s ease;transition:all .1s ease}.dvr-controls[data-dvr-controls] .live-button:before{content:\\\"\\\";display:inline-block;position:relative;width:7px;height:7px;border-radius:3.5px;margin-right:3.5px;background-color:#fff}.dvr-controls[data-dvr-controls] .live-button:hover{opacity:1;text-shadow:hsla(0,0%,100%,.75) 0 0 5px}.dvr .dvr-controls[data-dvr-controls] .live-info{display:none}.dvr .dvr-controls[data-dvr-controls] .live-button{display:block}.dvr.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{background-color:#005aff}.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{background-color:#ff0101}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/dvr_controls/public/dvr_controls.scss\n// module id = 85\n// module chunks = 0","exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".player-poster[data-poster]{display:-webkit-box;display:-moz-box;display:box;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;box-pack:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-ms-flex-pack:center;-webkit-box-align:center;box-align:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-ms-flex-align:center;position:absolute;height:100%;width:100%;z-index:998;top:0;left:0;background-color:#000;background-size:cover;background-repeat:no-repeat;background-position:50% 50%}.player-poster[data-poster].clickable{cursor:pointer}.player-poster[data-poster]:hover .play-wrapper[data-poster]{opacity:1}.player-poster[data-poster] .play-wrapper[data-poster]{width:100%;height:25%;margin:0 auto;opacity:.75;-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.player-poster[data-poster] .play-wrapper[data-poster] svg{height:100%}.player-poster[data-poster] .play-wrapper[data-poster] svg path{fill:#fff}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/poster/public/poster.scss\n// module id = 86\n// module chunks = 0","exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".seek-time[data-seek-time]{position:absolute;white-space:nowrap;height:20px;line-height:20px;font-size:0;left:-100%;bottom:55px;background-color:rgba(2,2,2,.5);z-index:9999;-webkit-transition:opacity .1s ease;transition:opacity .1s ease}.seek-time[data-seek-time].hidden[data-seek-time]{opacity:0}.seek-time[data-seek-time] [data-seek-time]{display:inline-block;color:#fff;font-size:10px;padding-left:7px;padding-right:7px;vertical-align:top}.seek-time[data-seek-time] [data-duration]{display:inline-block;color:hsla(0,0%,100%,.5);font-size:10px;padding-right:7px;vertical-align:top}.seek-time[data-seek-time] [data-duration]:before{content:\\\"|\\\";margin-right:7px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/seek_time/public/seek_time.scss\n// module id = 87\n// module chunks = 0","exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".spinner-three-bounce[data-spinner]{position:absolute;margin:0 auto;width:70px;text-align:center;z-index:999;left:0;right:0;margin-left:auto;margin-right:auto;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.spinner-three-bounce[data-spinner]>div{width:18px;height:18px;background-color:#fff;border-radius:100%;display:inline-block;-webkit-animation:bouncedelay 1.4s infinite ease-in-out;animation:bouncedelay 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner-three-bounce[data-spinner] [data-bounce1]{-webkit-animation-delay:-.32s;animation-delay:-.32s}.spinner-three-bounce[data-spinner] [data-bounce2]{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/spinner_three_bounce/public/spinner.scss\n// module id = 88\n// module chunks = 0","exports = module.exports = require(\"./../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"[data-watermark]{position:absolute;min-width:70px;max-width:200px;width:12%;text-align:center;z-index:10}[data-watermark] a{outline:none;cursor:pointer}[data-watermark] img{max-width:100%}[data-watermark-bottom-left]{bottom:10px;left:10px}[data-watermark-bottom-right]{bottom:10px;right:42px}[data-watermark-top-left]{top:10px;left:10px}[data-watermark-top-right]{top:10px;right:37px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/watermark/public/watermark.scss\n// module id = 89\n// module chunks = 0","(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.Hls = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n }\n throw TypeError('Uncaught, unspecified \"error\" event.');\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\n},{}],2:[function(_dereq_,module,exports){\nvar bundleFn = arguments[3];\nvar sources = arguments[4];\nvar cache = arguments[5];\n\nvar stringify = JSON.stringify;\n\nmodule.exports = function (fn, options) {\n var wkey;\n var cacheKeys = Object.keys(cache);\n\n for (var i = 0, l = cacheKeys.length; i < l; i++) {\n var key = cacheKeys[i];\n var exp = cache[key].exports;\n // Using babel as a transpiler to use esmodule, the export will always\n // be an object with the default export as a property of it. To ensure\n // the existing api and babel esmodule exports are both supported we\n // check for both\n if (exp === fn || exp && exp.default === fn) {\n wkey = key;\n break;\n }\n }\n\n if (!wkey) {\n wkey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);\n var wcache = {};\n for (var i = 0, l = cacheKeys.length; i < l; i++) {\n var key = cacheKeys[i];\n wcache[key] = key;\n }\n sources[wkey] = [\n Function(['require','module','exports'], '(' + fn + ')(self)'),\n wcache\n ];\n }\n var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);\n\n var scache = {}; scache[wkey] = wkey;\n sources[skey] = [\n Function(['require'], (\n // try to call default if defined to also support babel esmodule\n // exports\n 'var f = require(' + stringify(wkey) + ');' +\n '(f.default ? f.default : f)(self);'\n )),\n scache\n ];\n\n var workerSources = {};\n resolveSources(skey);\n\n function resolveSources(key) {\n workerSources[key] = true;\n\n for (var depPath in sources[key][1]) {\n var depKey = sources[key][1][depPath];\n if (!workerSources[depKey]) {\n resolveSources(depKey);\n }\n }\n }\n\n var src = '(' + bundleFn + ')({'\n + Object.keys(workerSources).map(function (key) {\n return stringify(key) + ':['\n + sources[key][0]\n + ',' + stringify(sources[key][1]) + ']'\n ;\n }).join(',')\n + '},{},[' + stringify(skey) + '])'\n ;\n\n var URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\n\n var blob = new Blob([src], { type: 'text/javascript' });\n if (options && options.bare) { return blob; }\n var workerUrl = URL.createObjectURL(blob);\n var worker = new Worker(workerUrl);\n worker.objectURL = workerUrl;\n return worker;\n};\n\n},{}],3:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(25);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _bufferHelper = _dereq_(28);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _errors = _dereq_(24);\n\nvar _logger = _dereq_(43);\n\nvar _ewmaBandwidthEstimator = _dereq_(8);\n\nvar _ewmaBandwidthEstimator2 = _interopRequireDefault(_ewmaBandwidthEstimator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * simple ABR Controller\n * - compute next level based on last fragment bw heuristics\n * - implement an abandon rules triggered if we have less than 2 frag buffered and if computed bw shows that we risk buffer stalling\n */\n\nvar AbrController = function (_EventHandler) {\n _inherits(AbrController, _EventHandler);\n\n function AbrController(hls) {\n _classCallCheck(this, AbrController);\n\n var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(AbrController).call(this, hls, _events2.default.FRAG_LOADING, _events2.default.FRAG_LOADED, _events2.default.FRAG_BUFFERED, _events2.default.ERROR));\n\n _this.lastLoadedFragLevel = 0;\n _this._autoLevelCapping = -1;\n _this._nextAutoLevel = -1;\n _this.hls = hls;\n _this.onCheck = _this.abandonRulesCheck.bind(_this);\n return _this;\n }\n\n _createClass(AbrController, [{\n key: 'destroy',\n value: function destroy() {\n this.clearTimer();\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onFragLoading',\n value: function onFragLoading(data) {\n var frag = data.frag;\n if (frag.type === 'main') {\n if (!this.timer) {\n this.timer = setInterval(this.onCheck, 100);\n }\n // lazy init of bw Estimator, rationale is that we use different params for Live/VoD\n // so we need to wait for stream manifest / playlist type to instantiate it.\n if (!this.bwEstimator) {\n var hls = this.hls,\n level = data.frag.level,\n isLive = hls.levels[level].details.live,\n config = hls.config,\n ewmaFast = void 0,\n ewmaSlow = void 0;\n\n if (isLive) {\n ewmaFast = config.abrEwmaFastLive;\n ewmaSlow = config.abrEwmaSlowLive;\n } else {\n ewmaFast = config.abrEwmaFastVoD;\n ewmaSlow = config.abrEwmaSlowVoD;\n }\n this.bwEstimator = new _ewmaBandwidthEstimator2.default(hls, ewmaSlow, ewmaFast, config.abrEwmaDefaultEstimate);\n }\n this.fragCurrent = frag;\n }\n }\n }, {\n key: 'abandonRulesCheck',\n value: function abandonRulesCheck() {\n /*\n monitor fragment retrieval time...\n we compute expected time of arrival of the complete fragment.\n we compare it to expected time of buffer starvation\n */\n var hls = this.hls,\n v = hls.media,\n frag = this.fragCurrent,\n loader = frag.loader;\n\n // if loader has been destroyed or loading has been aborted, stop timer and return\n if (!loader || loader.stats && loader.stats.aborted) {\n _logger.logger.warn('frag loader destroy or aborted, disarm abandonRules');\n this.clearTimer();\n return;\n }\n var stats = loader.stats;\n /* only monitor frag retrieval time if\n (video not paused OR first fragment being loaded(ready state === HAVE_NOTHING = 0)) AND autoswitching enabled AND not lowest level (=> means that we have several levels) */\n if (v && (!v.paused && v.playbackRate !== 0 || !v.readyState) && frag.autoLevel && frag.level) {\n var requestDelay = performance.now() - stats.trequest,\n playbackRate = Math.abs(v.playbackRate);\n // monitor fragment load progress after half of expected fragment duration,to stabilize bitrate\n if (requestDelay > 500 * frag.duration / playbackRate) {\n var levels = hls.levels,\n loadRate = Math.max(1, stats.bw ? stats.bw / 8 : stats.loaded * 1000 / requestDelay),\n // byte/s; at least 1 byte/s to avoid division by zero\n // compute expected fragment length using frag duration and level bitrate. also ensure that expected len is gte than already loaded size\n expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levels[frag.level].bitrate / 8)),\n pos = v.currentTime,\n fragLoadedDelay = (expectedLen - stats.loaded) / loadRate,\n bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, hls.config.maxBufferHole).end - pos) / playbackRate;\n // consider emergency switch down only if we have less than 2 frag buffered AND\n // time to finish loading current fragment is bigger than buffer starvation delay\n // ie if we risk buffer starvation if bw does not increase quickly\n if (bufferStarvationDelay < 2 * frag.duration / playbackRate && fragLoadedDelay > bufferStarvationDelay) {\n var fragLevelNextLoadedDelay = void 0,\n nextLoadLevel = void 0;\n // lets iterate through lower level and try to find the biggest one that could avoid rebuffering\n // we start from current level - 1 and we step down , until we find a matching level\n for (nextLoadLevel = frag.level - 1; nextLoadLevel >= 0; nextLoadLevel--) {\n // compute time to load next fragment at lower level\n // 0.8 : consider only 80% of current bw to be conservative\n // 8 = bits per byte (bps/Bps)\n fragLevelNextLoadedDelay = frag.duration * levels[nextLoadLevel].bitrate / (8 * 0.8 * loadRate);\n if (fragLevelNextLoadedDelay < bufferStarvationDelay) {\n // we found a lower level that be rebuffering free with current estimated bw !\n break;\n }\n }\n // only emergency switch down if it takes less time to load new fragment at lowest level instead\n // of finishing loading current one ...\n if (fragLevelNextLoadedDelay < fragLoadedDelay) {\n // ensure nextLoadLevel is not negative\n nextLoadLevel = Math.max(0, nextLoadLevel);\n _logger.logger.warn('loading too slow, abort fragment loading and switch to level ' + nextLoadLevel + ':fragLoadedDelay[' + nextLoadLevel + ']<fragLoadedDelay[' + (frag.level - 1) + '];bufferStarvationDelay:' + fragLevelNextLoadedDelay.toFixed(1) + '<' + fragLoadedDelay.toFixed(1) + ':' + bufferStarvationDelay.toFixed(1));\n // force next load level in auto mode\n hls.nextLoadLevel = nextLoadLevel;\n // update bw estimate for this fragment before cancelling load (this will help reducing the bw)\n this.bwEstimator.sample(requestDelay, stats.loaded);\n //abort fragment loading\n loader.abort();\n // stop abandon rules timer\n this.clearTimer();\n hls.trigger(_events2.default.FRAG_LOAD_EMERGENCY_ABORTED, { frag: frag, stats: stats });\n }\n }\n }\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var frag = data.frag;\n if (frag.type === 'main') {\n // stop monitoring bw once frag loaded\n this.clearTimer();\n // store level id after successful fragment load\n this.lastLoadedFragLevel = frag.level;\n // reset forced auto level value so that next level will be selected\n this._nextAutoLevel = -1;\n // if fragment has been loaded to perform a bitrate test,\n if (data.frag.bitrateTest) {\n var stats = data.stats;\n stats.tparsed = stats.tbuffered = stats.tload;\n this.onFragBuffered(data);\n }\n }\n }\n }, {\n key: 'onFragBuffered',\n value: function onFragBuffered(data) {\n var stats = data.stats,\n frag = data.frag;\n // only update stats on first frag buffering\n // if same frag is loaded multiple times, it might be in browser cache, and loaded quickly\n // and leading to wrong bw estimation\n // on bitrate test, also only update stats once (if tload = tbuffered == on FRAG_LOADED)\n if (stats.aborted !== true && frag.loadCounter === 1 && frag.type === 'main' && (!frag.bitrateTest || stats.tload === stats.tbuffered)) {\n var fragLoadingProcessingMs = stats.tbuffered - stats.trequest;\n _logger.logger.log('latency/loading/parsing/append/kbps:' + Math.round(stats.tfirst - stats.trequest) + '/' + Math.round(stats.tload - stats.tfirst) + '/' + Math.round(stats.tparsed - stats.tload) + '/' + Math.round(stats.tbuffered - stats.tparsed) + '/' + Math.round(8 * stats.loaded / (stats.tbuffered - stats.trequest)));\n this.bwEstimator.sample(fragLoadingProcessingMs, stats.loaded);\n // if fragment has been loaded to perform a bitrate test, (hls.startLevel = -1), store bitrate test delay duration\n if (frag.bitrateTest) {\n this.bitrateTestDelay = fragLoadingProcessingMs / 1000;\n } else {\n this.bitrateTestDelay = 0;\n }\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n // stop timer in case of frag loading error\n switch (data.details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n this.clearTimer();\n break;\n default:\n break;\n }\n }\n }, {\n key: 'clearTimer',\n value: function clearTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n }\n\n /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n\n }, {\n key: 'findBestLevel',\n value: function findBestLevel(currentLevel, currentFragDuration, currentBw, minAutoLevel, maxAutoLevel, maxFetchDuration, bwFactor, bwUpFactor, levels) {\n for (var i = maxAutoLevel; i >= minAutoLevel; i--) {\n var levelInfo = levels[i],\n levelDetails = levelInfo.details,\n avgDuration = levelDetails ? levelDetails.totalduration / levelDetails.fragments.length : currentFragDuration,\n adjustedbw = void 0;\n // follow algorithm captured from stagefright :\n // https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp\n // Pick the highest bandwidth stream below or equal to estimated bandwidth.\n // consider only 80% of the available bandwidth, but if we are switching up,\n // be even more conservative (70%) to avoid overestimating and immediately\n // switching back.\n if (i <= currentLevel) {\n adjustedbw = bwFactor * currentBw;\n } else {\n adjustedbw = bwUpFactor * currentBw;\n }\n var bitrate = levels[i].bitrate,\n fetchDuration = bitrate * avgDuration / adjustedbw;\n\n _logger.logger.trace('level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: ' + i + '/' + Math.round(adjustedbw) + '/' + bitrate + '/' + avgDuration + '/' + maxFetchDuration + '/' + fetchDuration);\n // if adjusted bw is greater than level bitrate AND\n if (adjustedbw > bitrate && (\n // fragment fetchDuration unknown or fragment fetchDuration less than max allowed fetch duration, then this level matches\n !fetchDuration || fetchDuration < maxFetchDuration)) {\n // as we are looping from highest to lowest, this will return the best achievable quality level\n\n return i;\n }\n }\n // not enough time budget even with quality level 0 ... rebuffering might happen\n return -1;\n }\n }, {\n key: 'autoLevelCapping',\n get: function get() {\n return this._autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n ,\n set: function set(newLevel) {\n this._autoLevelCapping = newLevel;\n }\n }, {\n key: 'nextAutoLevel',\n get: function get() {\n var nextAutoLevel = this._nextAutoLevel,\n bwEstimator = this.bwEstimator,\n hls = this.hls,\n levels = hls.levels,\n minAutoBitrate = hls.config.minAutoBitrate;\n // in case next auto level has been forced, and bw not available or not reliable\n if (nextAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {\n // cap next auto level by max auto level\n return Math.min(nextAutoLevel, this.maxAutoLevel);\n }\n // compute next level using ABR logic\n var nextABRAutoLevel = this.nextABRAutoLevel;\n if (nextAutoLevel !== -1) {\n // nextAutoLevel is defined, use it to cap ABR computed quality level\n nextABRAutoLevel = Math.min(nextAutoLevel, nextABRAutoLevel);\n }\n if (minAutoBitrate !== undefined) {\n while (levels[nextABRAutoLevel].bitrate < minAutoBitrate) {\n nextABRAutoLevel++;\n }\n }\n return nextABRAutoLevel;\n },\n set: function set(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n }, {\n key: 'minAutoLevel',\n get: function get() {\n var hls = this.hls,\n levels = hls.levels,\n minAutoBitrate = hls.config.minAutoBitrate;\n for (var i = 0; i < levels.length; i++) {\n if (levels[i].bitrate > minAutoBitrate) {\n return i;\n }\n }\n return 0;\n }\n }, {\n key: 'maxAutoLevel',\n get: function get() {\n var levels = this.hls.levels,\n autoLevelCapping = this._autoLevelCapping,\n maxAutoLevel;\n if (autoLevelCapping === -1 && levels && levels.length) {\n maxAutoLevel = levels.length - 1;\n } else {\n maxAutoLevel = autoLevelCapping;\n }\n return maxAutoLevel;\n }\n }, {\n key: 'nextABRAutoLevel',\n get: function get() {\n var hls = this.hls,\n maxAutoLevel = this.maxAutoLevel,\n levels = hls.levels,\n config = hls.config,\n minAutoLevel = this.minAutoLevel;\n var v = hls.media,\n currentLevel = this.lastLoadedFragLevel,\n currentFragDuration = this.fragCurrent ? this.fragCurrent.duration : 0,\n pos = v ? v.currentTime : 0,\n\n // playbackRate is the absolute value of the playback rate; if v.playbackRate is 0, we use 1 to load as\n // if we're playing back at the normal rate.\n playbackRate = v && v.playbackRate !== 0 ? Math.abs(v.playbackRate) : 1.0,\n avgbw = this.bwEstimator ? this.bwEstimator.getEstimate() : config.abrEwmaDefaultEstimate,\n\n // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.\n bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, config.maxBufferHole).end - pos) / playbackRate;\n\n // First, look to see if we can find a level matching with our avg bandwidth AND that could also guarantee no rebuffering at all\n var bestLevel = this.findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay, config.abrBandWidthFactor, config.abrBandWidthUpFactor, levels);\n if (bestLevel >= 0) {\n return bestLevel;\n } else {\n _logger.logger.trace('rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering');\n // not possible to get rid of rebuffering ... let's try to find level that will guarantee less than maxStarvationDelay of rebuffering\n // if no matching level found, logic will return 0\n var maxStarvationDelay = config.maxStarvationDelay,\n bwFactor = config.abrBandWidthFactor,\n bwUpFactor = config.abrBandWidthUpFactor;\n if (bufferStarvationDelay === 0) {\n // in case buffer is empty, let's check if previous fragment was loaded to perform a bitrate test\n var bitrateTestDelay = this.bitrateTestDelay;\n if (bitrateTestDelay) {\n // if it is the case, then we need to adjust our max starvation delay using maxLoadingDelay config value\n // max video loading delay used in automatic start level selection :\n // in that mode ABR controller will ensure that video loading time (ie the time to fetch the first fragment at lowest quality level +\n // the time to fetch the fragment at the appropriate quality level is less than ```maxLoadingDelay``` )\n maxStarvationDelay = config.maxLoadingDelay - bitrateTestDelay;\n _logger.logger.trace('bitrate test took ' + Math.round(1000 * bitrateTestDelay) + 'ms, set first fragment max fetchDuration to ' + Math.round(1000 * maxStarvationDelay) + ' ms');\n // don't use conservative factor on bitrate test\n bwFactor = bwUpFactor = 1;\n }\n }\n bestLevel = this.findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay + maxStarvationDelay, bwFactor, bwUpFactor, levels);\n return Math.max(bestLevel, 0);\n }\n }\n }]);\n\n return AbrController;\n}(_eventHandler2.default);\n\nexports.default = AbrController;\n\n},{\"24\":24,\"25\":25,\"26\":26,\"28\":28,\"43\":43,\"8\":8}],4:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _binarySearch = _dereq_(39);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(28);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(20);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(25);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(29);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(45);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(24);\n\nvar _logger = _dereq_(43);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Audio Stream Controller\n */\n\nvar State = {\n STOPPED: 'STOPPED',\n STARTING: 'STARTING',\n IDLE: 'IDLE',\n PAUSED: 'PAUSED',\n KEY_LOADING: 'KEY_LOADING',\n FRAG_LOADING: 'FRAG_LOADING',\n FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n WAITING_TRACK: 'WAITING_TRACK',\n PARSING: 'PARSING',\n PARSED: 'PARSED',\n ENDED: 'ENDED',\n ERROR: 'ERROR'\n};\n\nvar AudioStreamController = function (_EventHandler) {\n _inherits(AudioStreamController, _EventHandler);\n\n function AudioStreamController(hls) {\n _classCallCheck(this, AudioStreamController);\n\n var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(AudioStreamController).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.AUDIO_TRACKS_UPDATED, _events2.default.AUDIO_TRACK_SWITCH, _events2.default.AUDIO_TRACK_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this.ontick = _this.tick.bind(_this);\n return _this;\n }\n\n _createClass(AudioStreamController, [{\n key: 'destroy',\n value: function destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n _eventHandler2.default.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n }, {\n key: 'startLoad',\n value: function startLoad(startPosition) {\n if (this.tracks) {\n var media = this.media,\n lastCurrentTime = this.lastCurrentTime;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.fragLoadError = 0;\n if (media && lastCurrentTime) {\n _logger.logger.log('configure startPosition @' + lastCurrentTime);\n this.state = State.IDLE;\n } else {\n this.lastCurrentTime = this.startPosition ? this.startPosition : startPosition;\n this.state = State.STARTING;\n }\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime;\n this.tick();\n } else {\n this.startPosition = startPosition;\n this.state = State.STOPPED;\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n var frag = this.fragCurrent;\n if (frag) {\n if (frag.loader) {\n frag.loader.abort();\n }\n this.fragCurrent = null;\n }\n this.fragPrevious = null;\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n this.state = State.STOPPED;\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n var pos,\n track,\n trackDetails,\n hls = this.hls,\n config = hls.config;\n //logger.log('audioStream:' + this.state);\n switch (this.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n case State.PAUSED:\n //don't do anything in paused state either ...\n break;\n case State.STARTING:\n this.state = State.WAITING_TRACK;\n this.loadedmetadata = false;\n break;\n case State.IDLE:\n // if video not attached AND\n // start fragment already requested OR start frag prefetch disable\n // exit loop\n // => if media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (!this.media && (this.startFragRequested || !config.startFragPrefetch)) {\n break;\n }\n // determine next candidate fragment to be loaded, based on current position and\n // end of buffer position\n // if we have not yet loaded any fragment, start loading from start position\n if (this.loadedmetadata) {\n pos = this.media.currentTime;\n } else {\n pos = this.nextLoadPosition;\n }\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n var bufferInfo = _bufferHelper2.default.bufferInfo(media, pos, config.maxBufferHole),\n bufferLen = bufferInfo.len,\n bufferEnd = bufferInfo.end,\n fragPrevious = this.fragPrevious,\n maxBufLen = config.maxMaxBufferLength;\n\n // if buffer length is less than maxBufLen try to load a new fragment\n if (bufferLen < maxBufLen && this.trackId < this.tracks.length) {\n trackDetails = this.tracks[this.trackId].details;\n // if track info not retrieved yet, switch state and wait for track retrieval\n if (typeof trackDetails === 'undefined') {\n this.state = State.WAITING_TRACK;\n break;\n }\n\n // we just got done loading the final fragment, check if we need to finalize media stream\n if (!trackDetails.live && fragPrevious && fragPrevious.sn === trackDetails.endSN) {\n // if we are not seeking or if we are seeking but everything (almost) til the end is buffered, let's signal eos\n // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference when switching\n // between different renditions. using half frag duration should help cope with these cases.\n if (!this.media.seeking || this.media.duration - bufferEnd < fragPrevious.duration / 2) {\n // Finalize the media stream\n this.hls.trigger(_events2.default.BUFFER_EOS, { type: 'audio' });\n this.state = State.ENDED;\n break;\n }\n }\n\n // find fragment index, contiguous with end of buffer position\n var fragments = trackDetails.fragments,\n fragLen = fragments.length,\n start = fragments[0].start,\n end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,\n frag = void 0;\n\n // if bufferEnd before start of playlist, load first fragment\n if (bufferEnd < start) {\n frag = fragments[0];\n } else {\n (function () {\n var foundFrag = void 0;\n var maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n foundFrag = _binarySearch2.default.search(fragments, function (candidate) {\n // offset should be within fragment boundary - config.maxFragLookUpTolerance\n // this is to cope with situations like\n // bufferEnd = 9.991\n // frag[Ø] : [0,10]\n // frag[1] : [10,20]\n // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n // frag start frag start+duration\n // |-----------------------------|\n // <---> <--->\n // ...--------><-----------------------------><---------....\n // previous frag matching fragment next frag\n // return -1 return 0 return 1\n //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n if (candidate.start + candidate.duration - maxFragLookUpTolerance <= bufferEnd) {\n return 1;\n } else if (candidate.start - maxFragLookUpTolerance > bufferEnd) {\n return -1;\n }\n return 0;\n });\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen - 1];\n }\n if (foundFrag) {\n frag = foundFrag;\n start = foundFrag.start;\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {\n if (frag.sn < trackDetails.endSN) {\n frag = fragments[frag.sn + 1 - trackDetails.startSN];\n _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n } else {\n frag = null;\n }\n }\n }\n })();\n }\n if (frag) {\n //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n if (frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n _logger.logger.log('Loading key for ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + this.trackId);\n this.state = State.KEY_LOADING;\n hls.trigger(_events2.default.KEY_LOADING, { frag: frag });\n } else {\n _logger.logger.log('Loading ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + this.trackId + ', currentTime:' + pos + ',bufferEnd:' + bufferEnd.toFixed(3));\n // ensure that we are not reloading the same fragments in loop ...\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx++;\n } else {\n this.fragLoadIdx = 0;\n }\n if (frag.loadCounter) {\n frag.loadCounter++;\n var maxThreshold = config.fragLoadingLoopThreshold;\n // if this frag has already been loaded 3 times, and if it has been reloaded recently\n if (frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });\n return;\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = this.fragLoadIdx;\n this.fragCurrent = frag;\n this.startFragRequested = true;\n hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n this.state = State.FRAG_LOADING;\n }\n }\n }\n break;\n case State.WAITING_TRACK:\n track = this.tracks[this.trackId];\n // check if playlist is already loaded\n if (track && track.details) {\n this.state = State.IDLE;\n }\n break;\n case State.FRAG_LOADING_WAITING_RETRY:\n var now = performance.now();\n var retryDate = this.retryDate;\n media = this.media;\n var isSeeking = media && media.seeking;\n // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n if (!retryDate || now >= retryDate || isSeeking) {\n _logger.logger.log('audioStreamController: retryDate reached, switch back to IDLE state');\n this.state = State.IDLE;\n }\n break;\n case State.STOPPED:\n case State.FRAG_LOADING:\n case State.PARSING:\n case State.PARSED:\n case State.ENDED:\n break;\n default:\n break;\n }\n }\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n var media = this.media = this.mediaBuffer = data.media;\n this.onvseeking = this.onMediaSeeking.bind(this);\n this.onvended = this.onMediaEnded.bind(this);\n media.addEventListener('seeking', this.onvseeking);\n media.addEventListener('ended', this.onvended);\n var config = this.config;\n if (this.tracks && config.autoStartLoad) {\n this.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n _logger.logger.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery\n var tracks = this.tracks;\n if (tracks) {\n // reset fragment load counter\n tracks.forEach(function (track) {\n if (track.details) {\n track.details.fragments.forEach(function (fragment) {\n fragment.loadCounter = undefined;\n });\n }\n });\n }\n // remove video listeners\n if (media) {\n media.removeEventListener('seeking', this.onvseeking);\n media.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvseeked = this.onvended = null;\n }\n this.media = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n }, {\n key: 'onMediaSeeking',\n value: function onMediaSeeking() {\n if (this.state === State.ENDED) {\n // switch to IDLE state to check for potential new fragment\n this.state = State.IDLE;\n }\n if (this.media) {\n this.lastCurrentTime = this.media.currentTime;\n }\n // avoid reporting fragment loop loading error in case user is seeking several times on same position\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n // tick to speed up processing\n this.tick();\n }\n }, {\n key: 'onMediaEnded',\n value: function onMediaEnded() {\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onAudioTracksUpdated',\n value: function onAudioTracksUpdated(data) {\n _logger.logger.log('audio tracks updated');\n this.tracks = data.audioTracks;\n }\n }, {\n key: 'onAudioTrackSwitch',\n value: function onAudioTrackSwitch(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url;\n this.trackId = data.id;\n this.state = State.IDLE;\n\n this.fragCurrent = null;\n this.state = State.PAUSED;\n // destroy useless demuxer when switching audio to main\n if (!altAudio) {\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n } else {\n // switching to audio track, start timer if not already started\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n }\n // flush audio source buffer\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n this.tick();\n }\n }, {\n key: 'onAudioTrackLoaded',\n value: function onAudioTrackLoaded(data) {\n var details = data.details,\n trackId = data.id,\n track = this.tracks[trackId],\n duration = details.totalduration;\n\n _logger.logger.log('track ' + trackId + ' loaded [' + details.startSN + ',' + details.endSN + '],duration:' + duration);\n details.PTSKnown = false;\n track.details = details;\n\n // compute start position\n if (!this.startFragRequested) {\n // compute start position if set to -1. use it straight away if value is defined\n if (this.startPosition === -1) {\n // first, check if start time offset has been set in playlist, if yes, use this value\n var startTimeOffset = details.startTimeOffset;\n if (!isNaN(startTimeOffset)) {\n _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);\n this.startPosition = startTimeOffset;\n } else {\n this.startPosition = 0;\n }\n }\n this.nextLoadPosition = this.startPosition;\n }\n // only switch batck to IDLE state if we were waiting for track to start downloading a new fragment\n if (this.state === State.WAITING_TRACK) {\n this.state = State.IDLE;\n }\n //trigger handler right now\n this.tick();\n }\n }, {\n key: 'onKeyLoaded',\n value: function onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragCurrent = this.fragCurrent;\n if (this.state === State.FRAG_LOADING && fragCurrent && data.frag.type === 'audio' && data.frag.level === fragCurrent.level && data.frag.sn === fragCurrent.sn) {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.stats = data.stats;\n var track = this.tracks[this.trackId],\n details = track.details,\n duration = details.totalduration,\n start = fragCurrent.start,\n trackId = fragCurrent.level,\n sn = fragCurrent.sn,\n audioCodec = this.config.defaultAudioCodec || track.audioCodec;\n this.pendingAppending = 0;\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(this.hls, 'audio');\n }\n _logger.logger.log('Demuxing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);\n // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)\n var accurateTimeOffset = details.PTSKnown || !details.live;\n this.demuxer.push(data.payload, audioCodec, null, start, fragCurrent.cc, trackId, sn, duration, fragCurrent.decryptdata, accurateTimeOffset);\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n var tracks = data.tracks,\n track = void 0;\n\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if (track) {\n track.levelCodec = 'mp4a.40.2';\n track.id = data.id;\n this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);\n _logger.logger.log('audio track:audio,container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');\n var initSegment = track.initSegment;\n if (initSegment) {\n this.pendingAppending++;\n this.hls.trigger(_events2.default.BUFFER_APPENDING, { type: 'audio', data: initSegment, parent: 'audio', content: 'initSegment' });\n }\n //trigger handler right now\n this.tick();\n }\n }\n }\n }, {\n key: 'onFragParsingData',\n value: function onFragParsingData(data) {\n var _this2 = this;\n\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n var track = this.tracks[this.trackId],\n frag = this.fragCurrent;\n\n _logger.logger.log('parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb);\n _levelHelper2.default.updateFragPTSDTS(track.details, frag.sn, data.startPTS, data.endPTS);\n\n [data.data1, data.data2].forEach(function (buffer) {\n if (buffer) {\n _this2.pendingAppending++;\n _this2.hls.trigger(_events2.default.BUFFER_APPENDING, { type: data.type, data: buffer, parent: 'audio', content: 'data' });\n }\n });\n this.nextLoadPosition = data.endPTS;\n //trigger handler right now\n this.tick();\n }\n }\n }, {\n key: 'onFragParsed',\n value: function onFragParsed(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n }, {\n key: 'onBufferCreated',\n value: function onBufferCreated(data) {\n var audioTrack = data.tracks.audio;\n if (audioTrack) {\n this.mediaBuffer = audioTrack.buffer;\n this.loadedmetadata = true;\n }\n }\n }, {\n key: 'onBufferAppended',\n value: function onBufferAppended(data) {\n if (data.parent === 'audio') {\n switch (this.state) {\n case State.PARSING:\n case State.PARSED:\n this.pendingAppending--;\n this._checkAppendedParsed();\n break;\n default:\n break;\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && this.pendingAppending === 0) {\n var frag = this.fragCurrent,\n stats = this.stats;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = performance.now();\n this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'audio' });\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n _logger.logger.log('audio buffered : ' + _timeRanges2.default.toString(media.buffered));\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n var frag = data.frag;\n // don't handle frag error not related to audio fragment\n if (frag && frag.type !== 'audio') {\n return;\n }\n switch (data.details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n if (!data.fatal) {\n var loadError = this.fragLoadError;\n if (loadError) {\n loadError++;\n } else {\n loadError = 1;\n }\n var config = this.config;\n if (loadError <= config.fragLoadingMaxRetry) {\n this.fragLoadError = loadError;\n // reset load counter to avoid frag loop loading error\n frag.loadCounter = 0;\n // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n _logger.logger.warn('audioStreamController: frag loading failed, retry in ' + delay + ' ms');\n this.retryDate = performance.now() + delay;\n // retry loading state\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n _logger.logger.error('audioStreamController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n break;\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:\n case _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n // when in ERROR state, don't switch back to IDLE state in case a non-fatal error is received\n if (this.state !== State.ERROR) {\n // if fatal error, stop processing, otherwise move to IDLE to retry loading\n this.state = data.fatal ? State.ERROR : State.IDLE;\n _logger.logger.warn('audioStreamController: ' + data.details + ' while loading frag,switch to ' + this.state + ' state ...');\n }\n break;\n default:\n break;\n }\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // move to IDLE once flush complete. this should trigger new fragment loading\n this.state = State.IDLE;\n // reset reference to frag\n this.fragPrevious = null;\n this.tick();\n }\n }]);\n\n return AudioStreamController;\n}(_eventHandler2.default);\n\nexports.default = AudioStreamController;\n\n},{\"20\":20,\"24\":24,\"25\":25,\"26\":26,\"28\":28,\"29\":29,\"39\":39,\"43\":43,\"45\":45}],5:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(25);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(43);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * audio track controller\n */\n\nvar AudioTrackController = function (_EventHandler) {\n _inherits(AudioTrackController, _EventHandler);\n\n function AudioTrackController(hls) {\n _classCallCheck(this, AudioTrackController);\n\n return _possibleConstructorReturn(this, Object.getPrototypeOf(AudioTrackController).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_LOADED, _events2.default.AUDIO_TRACK_LOADED));\n }\n\n _createClass(AudioTrackController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n // reset audio tracks on manifest loading\n this.tracks = [];\n this.trackId = -1;\n }\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var _this2 = this;\n\n var tracks = data.audioTracks || [];\n var defaultFound = false;\n this.tracks = tracks;\n this.hls.trigger(_events2.default.AUDIO_TRACKS_UPDATED, { audioTracks: tracks });\n // loop through available audio tracks and autoselect default if needed\n var id = 0;\n tracks.forEach(function (track) {\n if (track.default) {\n _this2.audioTrack = id;\n defaultFound = true;\n return;\n }\n id++;\n });\n if (defaultFound === false && tracks.length) {\n _logger.logger.log('no default audio track defined, use first audio track as default');\n this.audioTrack = 0;\n }\n }\n }, {\n key: 'onAudioTrackLoaded',\n value: function onAudioTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n _logger.logger.log('audioTrack ' + data.id + ' loaded');\n this.tracks[data.id].details = data.details;\n // check if current playlist is a live playlist\n if (data.details.live && !this.timer) {\n // if live playlist we will have to reload it periodically\n // set reload period to playlist target duration\n this.timer = setInterval(this.ontick, 1000 * data.details.targetduration);\n }\n if (!data.details.live && this.timer) {\n // playlist is not live and timer is armed : stopping it\n clearInterval(this.timer);\n this.timer = null;\n }\n }\n }\n\n /** get alternate audio tracks list from playlist **/\n\n }, {\n key: 'setAudioTrackInternal',\n value: function setAudioTrackInternal(newId) {\n // check if level idx is valid\n if (newId >= 0 && newId < this.tracks.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n this.trackId = newId;\n _logger.logger.log('switching to audioTrack ' + newId);\n var audioTrack = this.tracks[newId],\n type = audioTrack.type,\n url = audioTrack.url;\n this.hls.trigger(_events2.default.AUDIO_TRACK_SWITCH, { id: newId, type: type, url: url });\n // check if we need to load playlist for this audio Track\n var details = audioTrack.details;\n if (url && (details === undefined || details.live === true)) {\n // track not retrieved yet, or live playlist we need to (re)load it\n _logger.logger.log('(re)loading playlist for audioTrack ' + newId);\n this.hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });\n }\n }\n }\n }, {\n key: 'audioTracks',\n get: function get() {\n return this.tracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n\n }, {\n key: 'audioTrack',\n get: function get() {\n return this.trackId;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n ,\n set: function set(audioTrackId) {\n if (this.trackId !== audioTrackId || this.tracks[audioTrackId].details === undefined) {\n this.setAudioTrackInternal(audioTrackId);\n }\n }\n }]);\n\n return AudioTrackController;\n}(_eventHandler2.default);\n\nexports.default = AudioTrackController;\n\n},{\"25\":25,\"26\":26,\"43\":43}],6:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(25);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(43);\n\nvar _errors = _dereq_(24);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Buffer Controller\n */\n\nvar BufferController = function (_EventHandler) {\n _inherits(BufferController, _EventHandler);\n\n function BufferController(hls) {\n _classCallCheck(this, BufferController);\n\n // the value that we have set mediasource.duration to\n // (the actual duration may be tweaked slighly by the browser)\n\n var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(BufferController).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_PARSED, _events2.default.BUFFER_RESET, _events2.default.BUFFER_APPENDING, _events2.default.BUFFER_CODECS, _events2.default.BUFFER_EOS, _events2.default.BUFFER_FLUSHING, _events2.default.LEVEL_UPDATED));\n\n _this._msDuration = null;\n // the value that we want to set mediaSource.duration to\n _this._levelDuration = null;\n\n // Source Buffer listeners\n _this.onsbue = _this.onSBUpdateEnd.bind(_this);\n _this.onsbe = _this.onSBUpdateError.bind(_this);\n _this.pendingTracks = {};\n return _this;\n }\n\n _createClass(BufferController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var audioExpected = data.audio,\n videoExpected = data.video,\n sourceBufferNb = 0;\n // in case of alt audio 2 BUFFER_CODECS events will be triggered, one per stream controller\n // sourcebuffers will be created all at once when the expected nb of tracks will be reached\n // in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller\n // it will contain the expected nb of source buffers, no need to compute it\n if (data.altAudio && (audioExpected || videoExpected)) {\n sourceBufferNb = (audioExpected ? 1 : 0) + (videoExpected ? 1 : 0);\n _logger.logger.log(sourceBufferNb + ' sourceBuffer(s) expected');\n }\n this.sourceBufferNb = sourceBufferNb;\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n var media = this.media = data.media;\n if (media) {\n // setup the media source\n var ms = this.mediaSource = new MediaSource();\n //Media Source listeners\n this.onmso = this.onMediaSourceOpen.bind(this);\n this.onmse = this.onMediaSourceEnded.bind(this);\n this.onmsc = this.onMediaSourceClose.bind(this);\n ms.addEventListener('sourceopen', this.onmso);\n ms.addEventListener('sourceended', this.onmse);\n ms.addEventListener('sourceclose', this.onmsc);\n // link video and media Source\n media.src = URL.createObjectURL(ms);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n _logger.logger.log('media source detaching');\n var ms = this.mediaSource;\n if (ms) {\n if (ms.readyState === 'open') {\n try {\n // endOfStream could trigger exception if any sourcebuffer is in updating state\n // we don't really care about checking sourcebuffer state here,\n // as we are anyway detaching the MediaSource\n // let's just avoid this exception to propagate\n ms.endOfStream();\n } catch (err) {\n _logger.logger.warn('onMediaDetaching:' + err.message + ' while calling endOfStream');\n }\n }\n ms.removeEventListener('sourceopen', this.onmso);\n ms.removeEventListener('sourceended', this.onmse);\n ms.removeEventListener('sourceclose', this.onmsc);\n\n // Detach properly the MediaSource from the HTMLMediaElement as\n // suggested in https://github.com/w3c/media-source/issues/53.\n if (this.media) {\n this.media.removeAttribute('src');\n this.media.load();\n }\n\n this.mediaSource = null;\n this.media = null;\n this.pendingTracks = {};\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n this.onmso = this.onmse = this.onmsc = null;\n this.hls.trigger(_events2.default.MEDIA_DETACHED);\n }\n }, {\n key: 'onMediaSourceOpen',\n value: function onMediaSourceOpen() {\n _logger.logger.log('media source opened');\n this.hls.trigger(_events2.default.MEDIA_ATTACHED, { media: this.media });\n var mediaSource = this.mediaSource;\n if (mediaSource) {\n // once received, don't listen anymore to sourceopen event\n mediaSource.removeEventListener('sourceopen', this.onmso);\n }\n this.checkPendingTracks();\n }\n }, {\n key: 'checkPendingTracks',\n value: function checkPendingTracks() {\n // if any buffer codecs pending, check if we have enough to create sourceBuffers\n var pendingTracks = this.pendingTracks,\n pendingTracksNb = Object.keys(pendingTracks).length;\n // if any pending tracks and (if nb of pending tracks gt or equal than expected nb or if unknown expected nb)\n if (pendingTracksNb && (this.sourceBufferNb <= pendingTracksNb || this.sourceBufferNb === 0)) {\n // ok, let's create them now !\n this.createSourceBuffers(pendingTracks);\n this.pendingTracks = {};\n // append any pending segments now !\n this.doAppending();\n }\n }\n }, {\n key: 'onMediaSourceClose',\n value: function onMediaSourceClose() {\n _logger.logger.log('media source closed');\n }\n }, {\n key: 'onMediaSourceEnded',\n value: function onMediaSourceEnded() {\n _logger.logger.log('media source ended');\n }\n }, {\n key: 'onSBUpdateEnd',\n value: function onSBUpdateEnd() {\n\n if (this._needsFlush) {\n this.doFlush();\n }\n\n if (this._needsEos) {\n this.checkEos();\n }\n this.appending = false;\n this.hls.trigger(_events2.default.BUFFER_APPENDED, { parent: this.parent });\n\n // don't append in flushing mode\n if (!this._needsFlush) {\n this.doAppending();\n }\n\n this.updateMediaElementDuration();\n }\n }, {\n key: 'onSBUpdateError',\n value: function onSBUpdateError(event) {\n _logger.logger.error('sourceBuffer error:' + event);\n // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n // this error might not always be fatal (it is fatal if decode error is set, in that case\n // it will be followed by a mediaElement error ...)\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false });\n // we don't need to do more than that, as accordin to the spec, updateend will be fired just after\n }\n }, {\n key: 'onBufferReset',\n value: function onBufferReset() {\n var sourceBuffer = this.sourceBuffer;\n for (var type in sourceBuffer) {\n var sb = sourceBuffer[type];\n try {\n this.mediaSource.removeSourceBuffer(sb);\n sb.removeEventListener('updateend', this.onsbue);\n sb.removeEventListener('error', this.onsbe);\n } catch (err) {}\n }\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n }, {\n key: 'onBufferCodecs',\n value: function onBufferCodecs(tracks) {\n // if source buffer(s) not created yet, appended buffer tracks in this.pendingTracks\n // if sourcebuffers already created, do nothing ...\n if (Object.keys(this.sourceBuffer).length === 0) {\n for (var trackName in tracks) {\n this.pendingTracks[trackName] = tracks[trackName];\n }\n var mediaSource = this.mediaSource;\n if (mediaSource && mediaSource.readyState === 'open') {\n // try to create sourcebuffers if mediasource opened\n this.checkPendingTracks();\n }\n }\n }\n }, {\n key: 'createSourceBuffers',\n value: function createSourceBuffers(tracks) {\n var sourceBuffer = this.sourceBuffer,\n mediaSource = this.mediaSource;\n\n for (var trackName in tracks) {\n if (!sourceBuffer[trackName]) {\n var track = tracks[trackName];\n // use levelCodec as first priority\n var codec = track.levelCodec || track.codec;\n var mimeType = track.container + ';codecs=' + codec;\n _logger.logger.log('creating sourceBuffer(' + mimeType + ')');\n try {\n var sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n track.buffer = sb;\n } catch (err) {\n _logger.logger.error('error while trying to add sourceBuffer:' + err.message);\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_ADD_CODEC_ERROR, fatal: false, err: err, mimeType: mimeType });\n }\n }\n }\n this.hls.trigger(_events2.default.BUFFER_CREATED, { tracks: tracks });\n }\n }, {\n key: 'onBufferAppending',\n value: function onBufferAppending(data) {\n if (!this._needsFlush) {\n if (!this.segments) {\n this.segments = [data];\n } else {\n this.segments.push(data);\n }\n this.doAppending();\n }\n }\n }, {\n key: 'onBufferAppendFail',\n value: function onBufferAppendFail(data) {\n _logger.logger.error('sourceBuffer error:' + data.event);\n // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n // this error might not always be fatal (it is fatal if decode error is set, in that case\n // it will be followed by a mediaElement error ...)\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false, frag: this.fragCurrent });\n }\n\n // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()\n\n }, {\n key: 'onBufferEos',\n value: function onBufferEos(data) {\n var sb = this.sourceBuffer;\n var dataType = data.type;\n for (var type in sb) {\n if (!dataType || type === dataType) {\n if (!sb[type].ended) {\n sb[type].ended = true;\n _logger.logger.log(type + ' sourceBuffer now EOS');\n }\n }\n }\n this.checkEos();\n }\n\n // if all source buffers are marked as ended, signal endOfStream() to MediaSource.\n\n }, {\n key: 'checkEos',\n value: function checkEos() {\n var sb = this.sourceBuffer,\n mediaSource = this.mediaSource;\n if (!mediaSource || mediaSource.readyState !== 'open') {\n this._needsEos = false;\n return;\n }\n for (var type in sb) {\n if (!sb[type].ended) {\n return;\n }\n if (sb[type].updating) {\n this._needsEos = true;\n return;\n }\n }\n _logger.logger.log('all media data available, signal endOfStream() to MediaSource and stop loading fragment');\n //Notify the media element that it now has all of the media data\n mediaSource.endOfStream();\n this._needsEos = false;\n }\n }, {\n key: 'onBufferFlushing',\n value: function onBufferFlushing(data) {\n this.flushRange.push({ start: data.startOffset, end: data.endOffset, type: data.type });\n // attempt flush immediatly\n this.flushBufferCounter = 0;\n this.doFlush();\n }\n }, {\n key: 'onLevelUpdated',\n value: function onLevelUpdated(event) {\n var details = event.details;\n if (details.fragments.length === 0) {\n return;\n }\n this._levelDuration = details.totalduration + details.fragments[0].start;\n this.updateMediaElementDuration();\n }\n\n // https://github.com/dailymotion/hls.js/issues/355\n\n }, {\n key: 'updateMediaElementDuration',\n value: function updateMediaElementDuration() {\n if (this._levelDuration === null) {\n return;\n }\n var media = this.media,\n mediaSource = this.mediaSource,\n sourceBuffer = this.sourceBuffer;\n if (!media || !mediaSource || !sourceBuffer || media.readyState === 0 || mediaSource.readyState !== 'open') {\n return;\n }\n for (var type in sourceBuffer) {\n if (sourceBuffer[type].updating) {\n // can't set duration whilst a buffer is updating\n return;\n }\n }\n if (this._msDuration === null) {\n // initialise to the value that the media source is reporting\n this._msDuration = mediaSource.duration;\n }\n // this._levelDuration was the last value we set.\n // not using mediaSource.duration as the browser may tweak this value\n // only update mediasource duration if its value increase, this is to avoid\n // flushing already buffered portion when switching between quality level, as they\n if (this._levelDuration > this._msDuration) {\n _logger.logger.log('Updating mediasource duration to ' + this._levelDuration);\n mediaSource.duration = this._levelDuration;\n this._msDuration = this._levelDuration;\n }\n }\n }, {\n key: 'doFlush',\n value: function doFlush() {\n // loop through all buffer ranges to flush\n while (this.flushRange.length) {\n var range = this.flushRange[0];\n // flushBuffer will abort any buffer append in progress and flush Audio/Video Buffer\n if (this.flushBuffer(range.start, range.end, range.type)) {\n // range flushed, remove from flush array\n this.flushRange.shift();\n this.flushBufferCounter = 0;\n } else {\n this._needsFlush = true;\n // avoid looping, wait for SB update end to retrigger a flush\n return;\n }\n }\n if (this.flushRange.length === 0) {\n // everything flushed\n this._needsFlush = false;\n\n // let's recompute this.appended, which is used to avoid flush looping\n var appended = 0;\n var sourceBuffer = this.sourceBuffer;\n for (var type in sourceBuffer) {\n appended += sourceBuffer[type].buffered.length;\n }\n this.appended = appended;\n this.hls.trigger(_events2.default.BUFFER_FLUSHED);\n }\n }\n }, {\n key: 'doAppending',\n value: function doAppending() {\n var hls = this.hls,\n sourceBuffer = this.sourceBuffer,\n segments = this.segments;\n if (Object.keys(sourceBuffer).length) {\n if (this.media.error) {\n this.segments = [];\n _logger.logger.error('trying to append although a media error occured, flush segment and abort');\n return;\n }\n if (this.appending) {\n //logger.log(`sb appending in progress`);\n return;\n }\n if (segments && segments.length) {\n var segment = segments.shift();\n try {\n var type = segment.type;\n if (sourceBuffer[type]) {\n // reset sourceBuffer ended flag before appending segment\n sourceBuffer[type].ended = false;\n //logger.log(`appending ${segment.content} ${segment.type} SB, size:${segment.data.length}, ${segment.parent}`);\n this.parent = segment.parent;\n sourceBuffer[type].appendBuffer(segment.data);\n this.appendError = 0;\n this.appended++;\n this.appending = true;\n } else {\n // in case we don't have any source buffer matching with this segment type,\n // it means that Mediasource fails to create sourcebuffer\n // discard this segment, and trigger update end\n this.onSBUpdateEnd();\n }\n } catch (err) {\n // in case any error occured while appending, put back segment in segments table\n _logger.logger.error('error while trying to append buffer:' + err.message);\n segments.unshift(segment);\n var event = { type: _errors.ErrorTypes.MEDIA_ERROR };\n if (err.code !== 22) {\n if (this.appendError) {\n this.appendError++;\n } else {\n this.appendError = 1;\n }\n event.details = _errors.ErrorDetails.BUFFER_APPEND_ERROR;\n event.frag = this.fragCurrent;\n /* with UHD content, we could get loop of quota exceeded error until\n browser is able to evict some data from sourcebuffer. retrying help recovering this\n */\n if (this.appendError > hls.config.appendErrorMaxRetry) {\n _logger.logger.log('fail ' + hls.config.appendErrorMaxRetry + ' times to append segment in sourceBuffer');\n segments = [];\n event.fatal = true;\n hls.trigger(_events2.default.ERROR, event);\n return;\n } else {\n event.fatal = false;\n hls.trigger(_events2.default.ERROR, event);\n }\n } else {\n // QuotaExceededError: http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror\n // let's stop appending any segments, and report BUFFER_FULL_ERROR error\n this.segments = [];\n event.details = _errors.ErrorDetails.BUFFER_FULL_ERROR;\n hls.trigger(_events2.default.ERROR, event);\n return;\n }\n }\n }\n }\n }\n\n /*\n flush specified buffered range,\n return true once range has been flushed.\n as sourceBuffer.remove() is asynchronous, flushBuffer will be retriggered on sourceBuffer update end\n */\n\n }, {\n key: 'flushBuffer',\n value: function flushBuffer(startOffset, endOffset, typeIn) {\n var sb,\n i,\n bufStart,\n bufEnd,\n flushStart,\n flushEnd,\n sourceBuffer = this.sourceBuffer;\n if (Object.keys(sourceBuffer).length) {\n _logger.logger.log('flushBuffer,pos/start/end: ' + this.media.currentTime + '/' + startOffset + '/' + endOffset);\n // safeguard to avoid infinite looping : don't try to flush more than the nb of appended segments\n if (this.flushBufferCounter < this.appended) {\n for (var type in sourceBuffer) {\n // check if sourcebuffer type is defined (typeIn): if yes, let's only flush this one\n // if no, let's flush all sourcebuffers\n if (typeIn && type !== typeIn) {\n continue;\n }\n sb = sourceBuffer[type];\n // we are going to flush buffer, mark source buffer as 'not ended'\n sb.ended = false;\n if (!sb.updating) {\n for (i = 0; i < sb.buffered.length; i++) {\n bufStart = sb.buffered.start(i);\n bufEnd = sb.buffered.end(i);\n // workaround firefox not able to properly flush multiple buffered range.\n if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1 && endOffset === Number.POSITIVE_INFINITY) {\n flushStart = startOffset;\n flushEnd = endOffset;\n } else {\n flushStart = Math.max(bufStart, startOffset);\n flushEnd = Math.min(bufEnd, endOffset);\n }\n /* sometimes sourcebuffer.remove() does not flush\n the exact expected time range.\n to avoid rounding issues/infinite loop,\n only flush buffer range of length greater than 500ms.\n */\n if (Math.min(flushEnd, bufEnd) - flushStart > 0.5) {\n this.flushBufferCounter++;\n _logger.logger.log('flush ' + type + ' [' + flushStart + ',' + flushEnd + '], of [' + bufStart + ',' + bufEnd + '], pos:' + this.media.currentTime);\n sb.remove(flushStart, flushEnd);\n return false;\n }\n }\n } else {\n //logger.log('abort ' + type + ' append in progress');\n // this will abort any appending in progress\n //sb.abort();\n _logger.logger.warn('cannot flush, sb updating in progress');\n return false;\n }\n }\n } else {\n _logger.logger.warn('abort flushing too many retries');\n }\n _logger.logger.log('buffer flushed');\n }\n // everything flushed !\n return true;\n }\n }]);\n\n return BufferController;\n}(_eventHandler2.default);\n\nexports.default = BufferController;\n\n},{\"24\":24,\"25\":25,\"26\":26,\"43\":43}],7:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(25);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * cap stream level to media size dimension controller\n */\n\nvar CapLevelController = function (_EventHandler) {\n _inherits(CapLevelController, _EventHandler);\n\n function CapLevelController(hls) {\n _classCallCheck(this, CapLevelController);\n\n return _possibleConstructorReturn(this, Object.getPrototypeOf(CapLevelController).call(this, hls, _events2.default.FPS_DROP_LEVEL_CAPPING, _events2.default.MEDIA_ATTACHING, _events2.default.MANIFEST_PARSED));\n }\n\n _createClass(CapLevelController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.hls.config.capLevelToPlayerSize) {\n this.media = this.restrictedLevels = null;\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n if (this.timer) {\n this.timer = clearInterval(this.timer);\n }\n }\n }\n }, {\n key: 'onFpsDropLevelCapping',\n value: function onFpsDropLevelCapping(data) {\n if (!this.restrictedLevels) {\n this.restrictedLevels = [];\n }\n if (!this.isLevelRestricted(data.droppedLevel)) {\n this.restrictedLevels.push(data.droppedLevel);\n }\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n this.media = data.media instanceof HTMLVideoElement ? data.media : null;\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n if (this.hls.config.capLevelToPlayerSize) {\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.levels = data.levels;\n this.hls.firstLevel = this.getMaxLevel(data.firstLevel);\n clearInterval(this.timer);\n this.timer = setInterval(this.detectPlayerSize.bind(this), 1000);\n this.detectPlayerSize();\n }\n }\n }, {\n key: 'detectPlayerSize',\n value: function detectPlayerSize() {\n if (this.media) {\n var levelsLength = this.levels ? this.levels.length : 0;\n if (levelsLength) {\n this.hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);\n if (this.hls.autoLevelCapping > this.autoLevelCapping) {\n // if auto level capping has a higher value for the previous one, flush the buffer using nextLevelSwitch\n // usually happen when the user go to the fullscreen mode.\n this.hls.streamController.nextLevelSwitch();\n }\n this.autoLevelCapping = this.hls.autoLevelCapping;\n }\n }\n }\n\n /*\n * returns level should be the one with the dimensions equal or greater than the media (player) dimensions (so the video will be downscaled)\n */\n\n }, {\n key: 'getMaxLevel',\n value: function getMaxLevel(capLevelIndex) {\n var result = 0,\n i = void 0,\n level = void 0,\n mWidth = this.mediaWidth,\n mHeight = this.mediaHeight,\n lWidth = 0,\n lHeight = 0;\n\n for (i = 0; i <= capLevelIndex; i++) {\n level = this.levels[i];\n if (this.isLevelRestricted(i)) {\n break;\n }\n result = i;\n lWidth = level.width;\n lHeight = level.height;\n if (mWidth <= lWidth || mHeight <= lHeight) {\n break;\n }\n }\n return result;\n }\n }, {\n key: 'isLevelRestricted',\n value: function isLevelRestricted(level) {\n return this.restrictedLevels && this.restrictedLevels.indexOf(level) !== -1 ? true : false;\n }\n }, {\n key: 'contentScaleFactor',\n get: function get() {\n var pixelRatio = 1;\n try {\n pixelRatio = window.devicePixelRatio;\n } catch (e) {}\n return pixelRatio;\n }\n }, {\n key: 'mediaWidth',\n get: function get() {\n var width = void 0;\n if (this.media) {\n width = this.media.width || this.media.clientWidth || this.media.offsetWidth;\n width *= this.contentScaleFactor;\n }\n return width;\n }\n }, {\n key: 'mediaHeight',\n get: function get() {\n var height = void 0;\n if (this.media) {\n height = this.media.height || this.media.clientHeight || this.media.offsetHeight;\n height *= this.contentScaleFactor;\n }\n return height;\n }\n }]);\n\n return CapLevelController;\n}(_eventHandler2.default);\n\nexports.default = CapLevelController;\n\n},{\"25\":25,\"26\":26}],8:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n * EWMA Bandwidth Estimator\n * - heavily inspired from shaka-player\n * Tracks bandwidth samples and estimates available bandwidth.\n * Based on the minimum of two exponentially-weighted moving averages with\n * different half-lives.\n */\n\nvar _ewma = _dereq_(42);\n\nvar _ewma2 = _interopRequireDefault(_ewma);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar EwmaBandWidthEstimator = function () {\n function EwmaBandWidthEstimator(hls, slow, fast, defaultEstimate) {\n _classCallCheck(this, EwmaBandWidthEstimator);\n\n this.hls = hls;\n this.defaultEstimate_ = defaultEstimate;\n this.minWeight_ = 0.001;\n this.minDelayMs_ = 50;\n this.slow_ = new _ewma2.default(slow);\n this.fast_ = new _ewma2.default(fast);\n }\n\n _createClass(EwmaBandWidthEstimator, [{\n key: 'sample',\n value: function sample(durationMs, numBytes) {\n durationMs = Math.max(durationMs, this.minDelayMs_);\n var bandwidth = 8000 * numBytes / durationMs,\n\n //console.log('instant bw:'+ Math.round(bandwidth));\n // we weight sample using loading duration....\n weight = durationMs / 1000;\n this.fast_.sample(weight, bandwidth);\n this.slow_.sample(weight, bandwidth);\n }\n }, {\n key: 'canEstimate',\n value: function canEstimate() {\n var fast = this.fast_;\n return fast && fast.getTotalWeight() >= this.minWeight_;\n }\n }, {\n key: 'getEstimate',\n value: function getEstimate() {\n if (this.canEstimate()) {\n //console.log('slow estimate:'+ Math.round(this.slow_.getEstimate()));\n //console.log('fast estimate:'+ Math.round(this.fast_.getEstimate()));\n // Take the minimum of these two estimates. This should have the effect of\n // adapting down quickly, but up more slowly.\n return Math.min(this.fast_.getEstimate(), this.slow_.getEstimate());\n } else {\n return this.defaultEstimate_;\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {}\n }]);\n\n return EwmaBandWidthEstimator;\n}();\n\nexports.default = EwmaBandWidthEstimator;\n\n},{\"42\":42}],9:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(25);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(43);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * FPS Controller\n */\n\nvar FPSController = function (_EventHandler) {\n _inherits(FPSController, _EventHandler);\n\n function FPSController(hls) {\n _classCallCheck(this, FPSController);\n\n return _possibleConstructorReturn(this, Object.getPrototypeOf(FPSController).call(this, hls, _events2.default.MEDIA_ATTACHING));\n }\n\n _createClass(FPSController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.isVideoPlaybackQualityAvailable = false;\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n if (this.hls.config.capLevelOnFPSDrop) {\n this.video = data.media instanceof HTMLVideoElement ? data.media : null;\n if (typeof this.video.getVideoPlaybackQuality === 'function') {\n this.isVideoPlaybackQualityAvailable = true;\n }\n clearInterval(this.timer);\n this.timer = setInterval(this.checkFPSInterval.bind(this), this.hls.config.fpsDroppedMonitoringPeriod);\n }\n }\n }, {\n key: 'checkFPS',\n value: function checkFPS(video, decodedFrames, droppedFrames) {\n var currentTime = performance.now();\n if (decodedFrames) {\n if (this.lastTime) {\n var currentPeriod = currentTime - this.lastTime,\n currentDropped = droppedFrames - this.lastDroppedFrames,\n currentDecoded = decodedFrames - this.lastDecodedFrames,\n droppedFPS = 1000 * currentDropped / currentPeriod;\n this.hls.trigger(_events2.default.FPS_DROP, { currentDropped: currentDropped, currentDecoded: currentDecoded, totalDroppedFrames: droppedFrames });\n if (droppedFPS > 0) {\n //logger.log('checkFPS : droppedFPS/decodedFPS:' + droppedFPS/(1000 * currentDecoded / currentPeriod));\n if (currentDropped > this.hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n var currentLevel = this.hls.currentLevel;\n _logger.logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n if (currentLevel > 0 && (this.hls.autoLevelCapping === -1 || this.hls.autoLevelCapping >= currentLevel)) {\n currentLevel = currentLevel - 1;\n this.hls.trigger(_events2.default.FPS_DROP_LEVEL_CAPPING, { level: currentLevel, droppedLevel: this.hls.currentLevel });\n this.hls.autoLevelCapping = currentLevel;\n this.hls.streamController.nextLevelSwitch();\n }\n }\n }\n }\n this.lastTime = currentTime;\n this.lastDroppedFrames = droppedFrames;\n this.lastDecodedFrames = decodedFrames;\n }\n }\n }, {\n key: 'checkFPSInterval',\n value: function checkFPSInterval() {\n if (this.video) {\n if (this.isVideoPlaybackQualityAvailable) {\n var videoPlaybackQuality = this.video.getVideoPlaybackQuality();\n this.checkFPS(this.video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n } else {\n this.checkFPS(this.video, this.video.webkitDecodedFrameCount, this.video.webkitDroppedFrameCount);\n }\n }\n }\n }]);\n\n return FPSController;\n}(_eventHandler2.default);\n\nexports.default = FPSController;\n\n},{\"25\":25,\"26\":26,\"43\":43}],10:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(25);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(43);\n\nvar _errors = _dereq_(24);\n\nvar _bufferHelper = _dereq_(28);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Level Controller\n */\n\nvar LevelController = function (_EventHandler) {\n _inherits(LevelController, _EventHandler);\n\n function LevelController(hls) {\n _classCallCheck(this, LevelController);\n\n var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(LevelController).call(this, hls, _events2.default.MANIFEST_LOADED, _events2.default.LEVEL_LOADED, _events2.default.ERROR));\n\n _this.ontick = _this.tick.bind(_this);\n _this._manualLevel = _this._autoLevelCapping = -1;\n return _this;\n }\n\n _createClass(LevelController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this._manualLevel = -1;\n }\n }, {\n key: 'startLoad',\n value: function startLoad() {\n this.canload = true;\n // speed up live playlist refresh if timer exists\n if (this.timer) {\n this.tick();\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n this.canload = false;\n }\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var levels0 = [],\n levels = [],\n bitrateStart,\n i,\n bitrateSet = {},\n videoCodecFound = false,\n audioCodecFound = false,\n hls = this.hls;\n\n // regroup redundant level together\n data.levels.forEach(function (level) {\n if (level.videoCodec) {\n videoCodecFound = true;\n }\n if (level.audioCodec || level.attrs && level.attrs.AUDIO) {\n audioCodecFound = true;\n }\n var redundantLevelId = bitrateSet[level.bitrate];\n if (redundantLevelId === undefined) {\n bitrateSet[level.bitrate] = levels0.length;\n level.url = [level.url];\n level.urlId = 0;\n levels0.push(level);\n } else {\n levels0[redundantLevelId].url.push(level.url);\n }\n });\n\n // remove audio-only level if we also have levels with audio+video codecs signalled\n if (videoCodecFound && audioCodecFound) {\n levels0.forEach(function (level) {\n if (level.videoCodec) {\n levels.push(level);\n }\n });\n } else {\n levels = levels0;\n }\n\n // only keep level with supported audio/video codecs\n levels = levels.filter(function (level) {\n var checkSupportedAudio = function checkSupportedAudio(codec) {\n return MediaSource.isTypeSupported('audio/mp4;codecs=' + codec);\n };\n var checkSupportedVideo = function checkSupportedVideo(codec) {\n return MediaSource.isTypeSupported('video/mp4;codecs=' + codec);\n };\n var audioCodec = level.audioCodec,\n videoCodec = level.videoCodec;\n\n return (!audioCodec || checkSupportedAudio(audioCodec)) && (!videoCodec || checkSupportedVideo(videoCodec));\n });\n\n if (levels.length) {\n // start bitrate is the first bitrate of the manifest\n bitrateStart = levels[0].bitrate;\n // sort level on bitrate\n levels.sort(function (a, b) {\n return a.bitrate - b.bitrate;\n });\n this._levels = levels;\n // find index of first level in sorted levels\n for (i = 0; i < levels.length; i++) {\n if (levels[i].bitrate === bitrateStart) {\n this._firstLevel = i;\n _logger.logger.log('manifest loaded,' + levels.length + ' level(s) found, first bitrate:' + bitrateStart);\n break;\n }\n }\n hls.trigger(_events2.default.MANIFEST_PARSED, { levels: this._levels, firstLevel: this._firstLevel, stats: data.stats, audio: audioCodecFound, video: videoCodecFound, altAudio: data.audioTracks.length > 0 });\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR, fatal: true, url: hls.url, reason: 'no level with compatible codecs found in manifest' });\n }\n return;\n }\n }, {\n key: 'setLevelInternal',\n value: function setLevelInternal(newLevel) {\n var levels = this._levels;\n // check if level idx is valid\n if (newLevel >= 0 && newLevel < levels.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n if (this._level !== newLevel) {\n _logger.logger.log('switching to level ' + newLevel);\n this._level = newLevel;\n }\n this.hls.trigger(_events2.default.LEVEL_SWITCH, { level: newLevel });\n var level = levels[newLevel],\n levelDetails = level.details;\n // check if we need to load playlist for this level\n if (!levelDetails || levelDetails.live === true) {\n // level not retrieved yet, or live playlist we need to (re)load it\n var urlId = level.urlId;\n this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: newLevel, id: urlId });\n }\n } else {\n // invalid level id given, trigger error\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx' });\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n if (data.fatal) {\n return;\n }\n\n var details = data.details,\n hls = this.hls,\n levelId = void 0,\n level = void 0,\n levelError = false;\n // try to recover not fatal errors\n switch (details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n levelId = data.frag.level;\n break;\n case _errors.ErrorDetails.LEVEL_LOAD_ERROR:\n case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n levelId = data.context.level;\n levelError = true;\n break;\n default:\n break;\n }\n /* try to switch to a redundant stream if any available.\n * if no redundant stream available, emergency switch down (if in auto mode and current level not 0)\n * otherwise, we cannot recover this network error ...\n */\n if (levelId !== undefined) {\n level = this._levels[levelId];\n if (level.urlId < level.url.length - 1) {\n level.urlId++;\n level.details = undefined;\n _logger.logger.warn('level controller,' + details + ' for level ' + levelId + ': switching to redundant stream id ' + level.urlId);\n } else {\n // we could try to recover if in auto mode and current level not lowest level (0)\n var recoverable = this._manualLevel === -1 && levelId;\n if (recoverable) {\n _logger.logger.warn('level controller,' + details + ': emergency switch-down for next fragment');\n hls.abrController.nextAutoLevel = 0;\n } else if (level && level.details && level.details.live) {\n _logger.logger.warn('level controller,' + details + ' on live stream, discard');\n if (levelError) {\n // reset this._level so that another call to set level() will retrigger a frag load\n this._level = undefined;\n }\n // other errors are handled by stream controller\n } else if (details === _errors.ErrorDetails.LEVEL_LOAD_ERROR || details === _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT) {\n var _hls = this.hls,\n media = _hls.media,\n\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);\n if (mediaBuffered) {\n var retryDelay = _hls.config.levelLoadingRetryDelay;\n _logger.logger.warn('level controller,' + details + ', but media buffered, retry in ' + retryDelay + 'ms');\n this.timer = setTimeout(this.ontick, retryDelay);\n } else {\n _logger.logger.error('cannot recover ' + details + ' error');\n this._level = undefined;\n // stopping live reloading timer if any\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n // redispatch same error but with fatal set to true\n data.fatal = true;\n _hls.trigger(_events2.default.ERROR, data);\n }\n }\n }\n }\n }\n }, {\n key: 'onLevelLoaded',\n value: function onLevelLoaded(data) {\n // only process level loaded events matching with expected level\n if (data.level === this._level) {\n var newDetails = data.details;\n // if current playlist is a live playlist, arm a timer to reload it\n if (newDetails.live) {\n var reloadInterval = 1000 * (newDetails.averagetargetduration ? newDetails.averagetargetduration : newDetails.targetduration),\n curLevel = this._levels[data.level],\n curDetails = curLevel.details;\n if (curDetails && newDetails.endSN === curDetails.endSN) {\n // follow HLS Spec, If the client reloads a Playlist file and finds that it has not\n // changed then it MUST wait for a period of one-half the target\n // duration before retrying.\n reloadInterval /= 2;\n _logger.logger.log('same live playlist, reload twice faster');\n }\n // decrement reloadInterval with level loading delay\n reloadInterval -= performance.now() - data.stats.trequest;\n // in any case, don't reload more than every second\n reloadInterval = Math.max(1000, Math.round(reloadInterval));\n _logger.logger.log('live playlist, reload in ' + reloadInterval + ' ms');\n this.timer = setTimeout(this.ontick, reloadInterval);\n } else {\n this.timer = null;\n }\n }\n }\n }, {\n key: 'tick',\n value: function tick() {\n var levelId = this._level;\n if (levelId !== undefined && this.canload) {\n var level = this._levels[levelId],\n urlId = level.urlId;\n this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: levelId, id: urlId });\n }\n }\n }, {\n key: 'levels',\n get: function get() {\n return this._levels;\n }\n }, {\n key: 'level',\n get: function get() {\n return this._level;\n },\n set: function set(newLevel) {\n var levels = this._levels;\n if (levels && levels.length > newLevel) {\n if (this._level !== newLevel || levels[newLevel].details === undefined) {\n this.setLevelInternal(newLevel);\n }\n }\n }\n }, {\n key: 'manualLevel',\n get: function get() {\n return this._manualLevel;\n },\n set: function set(newLevel) {\n this._manualLevel = newLevel;\n if (this._startLevel === undefined) {\n this._startLevel = newLevel;\n }\n if (newLevel !== -1) {\n this.level = newLevel;\n }\n }\n }, {\n key: 'firstLevel',\n get: function get() {\n return this._firstLevel;\n },\n set: function set(newLevel) {\n this._firstLevel = newLevel;\n }\n }, {\n key: 'startLevel',\n get: function get() {\n // hls.startLevel takes precedence over config.startLevel\n // if none of these values are defined, fallback on this._firstLevel (first quality level appearing in variant manifest)\n if (this._startLevel === undefined) {\n var configStartLevel = this.hls.config.startLevel;\n if (configStartLevel !== undefined) {\n return configStartLevel;\n } else {\n return this._firstLevel;\n }\n } else {\n return this._startLevel;\n }\n },\n set: function set(newLevel) {\n this._startLevel = newLevel;\n }\n }, {\n key: 'nextLoadLevel',\n get: function get() {\n if (this._manualLevel !== -1) {\n return this._manualLevel;\n } else {\n return this.hls.abrController.nextAutoLevel;\n }\n },\n set: function set(nextLevel) {\n this.level = nextLevel;\n if (this._manualLevel === -1) {\n this.hls.abrController.nextAutoLevel = nextLevel;\n }\n }\n }]);\n\n return LevelController;\n}(_eventHandler2.default);\n\nexports.default = LevelController;\n\n},{\"24\":24,\"25\":25,\"26\":26,\"28\":28,\"43\":43}],11:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _binarySearch = _dereq_(39);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(28);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(20);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(25);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(29);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(45);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(24);\n\nvar _logger = _dereq_(43);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Stream Controller\n */\n\nvar State = {\n STOPPED: 'STOPPED',\n IDLE: 'IDLE',\n PAUSED: 'PAUSED',\n KEY_LOADING: 'KEY_LOADING',\n FRAG_LOADING: 'FRAG_LOADING',\n FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n WAITING_LEVEL: 'WAITING_LEVEL',\n PARSING: 'PARSING',\n PARSED: 'PARSED',\n ENDED: 'ENDED',\n ERROR: 'ERROR'\n};\n\nvar StreamController = function (_EventHandler) {\n _inherits(StreamController, _EventHandler);\n\n function StreamController(hls) {\n _classCallCheck(this, StreamController);\n\n var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(StreamController).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_PARSED, _events2.default.LEVEL_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_LOAD_EMERGENCY_ABORTED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.AUDIO_TRACK_SWITCH, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this.ontick = _this.tick.bind(_this);\n return _this;\n }\n\n _createClass(StreamController, [{\n key: 'destroy',\n value: function destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n _eventHandler2.default.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n }, {\n key: 'startLoad',\n value: function startLoad(startPosition) {\n if (this.levels) {\n var media = this.media,\n lastCurrentTime = this.lastCurrentTime,\n hls = this.hls;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.level = -1;\n this.fragLoadError = 0;\n if (media && lastCurrentTime > 0) {\n _logger.logger.log('configure startPosition @' + lastCurrentTime.toFixed(3));\n if (!this.lastPaused) {\n _logger.logger.log('resuming video');\n media.play();\n }\n } else {\n this.lastCurrentTime = this.startPosition ? this.startPosition : startPosition;\n }\n if (!this.startFragRequested) {\n // determine load level\n var startLevel = hls.startLevel;\n if (startLevel === -1) {\n // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level\n startLevel = 0;\n this.bitrateTest = true;\n }\n // set new level to playlist loader : this will trigger start level load\n // hls.nextLoadLevel remains until it is set to a new value or until a new frag is successfully loaded\n this.level = hls.nextLoadLevel = startLevel;\n this.loadedmetadata = false;\n }\n this.state = State.IDLE;\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime;\n this.tick();\n } else {\n _logger.logger.warn('cannot start loading as manifest not parsed yet');\n this.state = State.STOPPED;\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n var frag = this.fragCurrent;\n if (frag) {\n if (frag.loader) {\n frag.loader.abort();\n }\n this.fragCurrent = null;\n }\n this.fragPrevious = null;\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n this.state = State.STOPPED;\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n switch (this.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n case State.PAUSED:\n //don't do anything in paused state either ...\n break;\n case State.IDLE:\n // when this returns false there was an error and we shall return immediatly\n // from current tick\n if (!this._doTickIdle()) {\n return;\n }\n break;\n case State.WAITING_LEVEL:\n var level = this.levels[this.level];\n // check if playlist is already loaded\n if (level && level.details) {\n this.state = State.IDLE;\n }\n break;\n case State.FRAG_LOADING_WAITING_RETRY:\n var now = performance.now();\n var retryDate = this.retryDate;\n // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n if (!retryDate || now >= retryDate || this.media && this.media.seeking) {\n _logger.logger.log('mediaController: retryDate reached, switch back to IDLE state');\n this.state = State.IDLE;\n }\n break;\n case State.ERROR:\n case State.PAUSED:\n case State.STOPPED:\n case State.FRAG_LOADING:\n case State.PARSING:\n case State.PARSED:\n case State.ENDED:\n break;\n default:\n break;\n }\n // check buffer\n this._checkBuffer();\n // check/update current fragment\n this._checkFragmentChanged();\n }\n\n // Ironically the \"idle\" state is the on we do the most logic in it seems ....\n // NOTE: Maybe we could rather schedule a check for buffer length after half of the currently\n // played segment, or on pause/play/seek instead of naively checking every 100ms?\n\n }, {\n key: '_doTickIdle',\n value: function _doTickIdle() {\n var hls = this.hls,\n config = hls.config,\n media = this.media;\n\n // if video not attached AND\n // start fragment already requested OR start frag prefetch disable\n // exit loop\n // => if media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (!media && (this.startFragRequested || !config.startFragPrefetch)) {\n return true;\n }\n\n // if we have not yet loaded any fragment, start loading from start position\n var pos = void 0;\n if (this.loadedmetadata) {\n pos = media.currentTime;\n } else {\n pos = this.nextLoadPosition;\n }\n // determine next load level\n var level = hls.nextLoadLevel;\n\n // compute max Buffer Length that we could get from this load level, based on level bitrate. don't buffer more than 60 MB and more than 30s\n var maxBufLen = void 0;\n if (this.levels[level].hasOwnProperty('bitrate')) {\n maxBufLen = Math.max(8 * config.maxBufferSize / this.levels[level].bitrate, config.maxBufferLength);\n } else {\n maxBufLen = config.maxBufferLength;\n }\n maxBufLen = Math.min(maxBufLen, config.maxMaxBufferLength);\n\n // determine next candidate fragment to be loaded, based on current position and end of buffer position\n // ensure up to `config.maxMaxBufferLength` of buffer upfront\n\n var bufferInfo = _bufferHelper2.default.bufferInfo(this.mediaBuffer ? this.mediaBuffer : media, pos, config.maxBufferHole),\n bufferLen = bufferInfo.len;\n // Stay idle if we are still with buffer margins\n if (bufferLen >= maxBufLen) {\n return true;\n }\n\n // if buffer length is less than maxBufLen try to load a new fragment ...\n _logger.logger.trace('buffer length of ' + bufferLen.toFixed(3) + ' is below max of ' + maxBufLen.toFixed(3) + '. checking for more payload ...');\n\n // set next load level : this will trigger a playlist load if needed\n hls.nextLoadLevel = level;\n this.level = level;\n\n var levelDetails = this.levels[level].details;\n // if level info not retrieved yet, switch state and wait for level retrieval\n // if live playlist, ensure that new playlist has been refreshed to avoid loading/try to load\n // a useless and outdated fragment (that might even introduce load error if it is already out of the live playlist)\n if (typeof levelDetails === 'undefined' || levelDetails.live && this.levelLastLoaded !== level) {\n this.state = State.WAITING_LEVEL;\n return true;\n }\n\n // we just got done loading the final fragment, check if we need to finalize media stream\n var fragPrevious = this.fragPrevious;\n if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN) {\n // if (we are not seeking AND current position is buffered) OR (if we are seeking but everything (almost) til the end is buffered), let's signal eos\n // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference when switching\n // between different renditions. using half frag duration should help cope with these cases.\n if (!media.seeking && bufferInfo.len || media.duration - bufferInfo.end <= fragPrevious.duration / 2) {\n // Finalize the media stream\n var data = {};\n if (this.altAudio) {\n data.type = 'video';\n }\n this.hls.trigger(_events2.default.BUFFER_EOS, data);\n this.state = State.ENDED;\n return true;\n }\n }\n\n // if we have the levelDetails for the selected variant, lets continue enrichen our stream (load keys/fragments or trigger EOS, etc..)\n return this._fetchPayloadOrEos({ pos: pos, bufferInfo: bufferInfo, levelDetails: levelDetails });\n }\n }, {\n key: '_fetchPayloadOrEos',\n value: function _fetchPayloadOrEos(_ref) {\n var pos = _ref.pos;\n var bufferInfo = _ref.bufferInfo;\n var levelDetails = _ref.levelDetails;\n\n var fragPrevious = this.fragPrevious,\n level = this.level,\n fragments = levelDetails.fragments,\n fragLen = fragments.length;\n\n // empty playlist\n if (fragLen === 0) {\n return false;\n }\n\n // find fragment index, contiguous with end of buffer position\n var start = fragments[0].start,\n end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,\n bufferEnd = bufferInfo.end,\n frag = void 0;\n\n // in case of live playlist we need to ensure that requested position is not located before playlist start\n if (levelDetails.live) {\n frag = this._ensureFragmentAtLivePoint({ levelDetails: levelDetails, bufferEnd: bufferEnd, start: start, end: end, fragPrevious: fragPrevious, fragments: fragments, fragLen: fragLen });\n // if it explicitely returns null don't load any fragment and exit function now\n if (frag === null) {\n return false;\n }\n } else {\n // VoD playlist: if bufferEnd before start of playlist, load first fragment\n if (bufferEnd < start) {\n frag = fragments[0];\n }\n }\n if (!frag) {\n frag = this._findFragment({ start: start, fragPrevious: fragPrevious, fragLen: fragLen, fragments: fragments, bufferEnd: bufferEnd, end: end, levelDetails: levelDetails });\n }\n if (frag) {\n return this._loadFragmentOrKey({ frag: frag, level: level, levelDetails: levelDetails, pos: pos, bufferEnd: bufferEnd });\n }\n return true;\n }\n }, {\n key: '_ensureFragmentAtLivePoint',\n value: function _ensureFragmentAtLivePoint(_ref2) {\n var levelDetails = _ref2.levelDetails;\n var bufferEnd = _ref2.bufferEnd;\n var start = _ref2.start;\n var end = _ref2.end;\n var fragPrevious = _ref2.fragPrevious;\n var fragments = _ref2.fragments;\n var fragLen = _ref2.fragLen;\n\n var config = this.hls.config,\n media = this.media;\n\n var frag = void 0;\n\n // check if requested position is within seekable boundaries :\n //logger.log(`start/pos/bufEnd/seeking:${start.toFixed(3)}/${pos.toFixed(3)}/${bufferEnd.toFixed(3)}/${this.media.seeking}`);\n var maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount * levelDetails.targetduration;\n\n if (bufferEnd < Math.max(start, end - maxLatency)) {\n var liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);\n _logger.logger.log('buffer end: ' + bufferEnd.toFixed(3) + ' is located too far from the end of live sliding playlist, reset currentTime to : ' + liveSyncPosition.toFixed(3));\n bufferEnd = liveSyncPosition;\n if (media && media.readyState && media.duration > liveSyncPosition) {\n media.currentTime = liveSyncPosition;\n }\n }\n\n // if end of buffer greater than live edge, don't load any fragment\n // this could happen if live playlist intermittently slides in the past.\n // level 1 loaded [182580161,182580167]\n // level 1 loaded [182580162,182580169]\n // Loading 182580168 of [182580162 ,182580169],level 1 ..\n // Loading 182580169 of [182580162 ,182580169],level 1 ..\n // level 1 loaded [182580162,182580168] <============= here we should have bufferEnd > end. in that case break to avoid reloading 182580168\n // level 1 loaded [182580164,182580171]\n //\n // don't return null in case media not loaded yet (readystate === 0)\n if (levelDetails.PTSKnown && bufferEnd > end && media && media.readyState) {\n return null;\n }\n\n if (this.startFragRequested && !levelDetails.PTSKnown) {\n /* we are switching level on live playlist, but we don't have any PTS info for that quality level ...\n try to load frag matching with next SN.\n even if SN are not synchronized between playlists, loading this frag will help us\n compute playlist sliding and find the right one after in case it was not the right consecutive one */\n if (fragPrevious) {\n var targetSN = fragPrevious.sn + 1;\n if (targetSN >= levelDetails.startSN && targetSN <= levelDetails.endSN) {\n frag = fragments[targetSN - levelDetails.startSN];\n _logger.logger.log('live playlist, switching playlist, load frag with next SN: ' + frag.sn);\n }\n }\n if (!frag) {\n /* we have no idea about which fragment should be loaded.\n so let's load mid fragment. it will help computing playlist sliding and find the right one\n */\n frag = fragments[Math.min(fragLen - 1, Math.round(fragLen / 2))];\n _logger.logger.log('live playlist, switching playlist, unknown, load middle frag : ' + frag.sn);\n }\n }\n return frag;\n }\n }, {\n key: '_findFragment',\n value: function _findFragment(_ref3) {\n var start = _ref3.start;\n var fragPrevious = _ref3.fragPrevious;\n var fragLen = _ref3.fragLen;\n var fragments = _ref3.fragments;\n var bufferEnd = _ref3.bufferEnd;\n var end = _ref3.end;\n var levelDetails = _ref3.levelDetails;\n\n var config = this.hls.config;\n\n var frag = void 0,\n foundFrag = void 0,\n maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n foundFrag = _binarySearch2.default.search(fragments, function (candidate) {\n // offset should be within fragment boundary - config.maxFragLookUpTolerance\n // this is to cope with situations like\n // bufferEnd = 9.991\n // frag[Ø] : [0,10]\n // frag[1] : [10,20]\n // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n // frag start frag start+duration\n // |-----------------------------|\n // <---> <--->\n // ...--------><-----------------------------><---------....\n // previous frag matching fragment next frag\n // return -1 return 0 return 1\n //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n if (candidate.start + candidate.duration - maxFragLookUpTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - maxFragLookUpTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n });\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen - 1];\n }\n if (foundFrag) {\n frag = foundFrag;\n start = foundFrag.start;\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {\n if (frag.sn < levelDetails.endSN) {\n var deltaPTS = fragPrevious.deltaPTS,\n curSNIdx = frag.sn - levelDetails.startSN;\n // if there is a significant delta between audio and video, larger than max allowed hole,\n // and if previous remuxed fragment did not start with a keyframe. (fragPrevious.dropped)\n // let's try to load previous fragment again to get last keyframe\n // then we will reload again current fragment (that way we should be able to fill the buffer hole ...)\n if (deltaPTS && deltaPTS > config.maxBufferHole && fragPrevious.dropped && curSNIdx) {\n frag = fragments[curSNIdx - 1];\n _logger.logger.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');\n // decrement previous frag load counter to avoid frag loop loading error when next fragment will get reloaded\n fragPrevious.loadCounter--;\n } else {\n frag = fragments[curSNIdx + 1];\n _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n }\n } else {\n frag = null;\n }\n }\n }\n return frag;\n }\n }, {\n key: '_loadFragmentOrKey',\n value: function _loadFragmentOrKey(_ref4) {\n var frag = _ref4.frag;\n var level = _ref4.level;\n var levelDetails = _ref4.levelDetails;\n var pos = _ref4.pos;\n var bufferEnd = _ref4.bufferEnd;\n\n var hls = this.hls,\n config = hls.config;\n\n //logger.log('loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n if (frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n _logger.logger.log('Loading key for ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level);\n this.state = State.KEY_LOADING;\n hls.trigger(_events2.default.KEY_LOADING, { frag: frag });\n } else {\n _logger.logger.log('Loading ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level + ', currentTime:' + pos.toFixed(3) + ',bufferEnd:' + bufferEnd.toFixed(3));\n // ensure that we are not reloading the same fragments in loop ...\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx++;\n } else {\n this.fragLoadIdx = 0;\n }\n if (frag.loadCounter) {\n frag.loadCounter++;\n var maxThreshold = config.fragLoadingLoopThreshold;\n // if this frag has already been loaded 3 times, and if it has been reloaded recently\n if (frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });\n return false;\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = this.fragLoadIdx;\n this.fragCurrent = frag;\n this.startFragRequested = true;\n frag.autoLevel = hls.autoLevelEnabled;\n frag.bitrateTest = this.bitrateTest;\n hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n this.state = State.FRAG_LOADING;\n return true;\n }\n }\n }, {\n key: 'getBufferRange',\n value: function getBufferRange(position) {\n var i,\n range,\n bufferRange = this.bufferRange;\n if (bufferRange) {\n for (i = bufferRange.length - 1; i >= 0; i--) {\n range = bufferRange[i];\n if (position >= range.start && position <= range.end) {\n return range;\n }\n }\n }\n return null;\n }\n }, {\n key: 'followingBufferRange',\n value: function followingBufferRange(range) {\n if (range) {\n // try to get range of next fragment (500ms after this range)\n return this.getBufferRange(range.end + 0.5);\n }\n return null;\n }\n }, {\n key: '_checkFragmentChanged',\n value: function _checkFragmentChanged() {\n var rangeCurrent,\n currentTime,\n video = this.media;\n if (video && video.readyState && video.seeking === false) {\n currentTime = video.currentTime;\n /* if video element is in seeked state, currentTime can only increase.\n (assuming that playback rate is positive ...)\n As sometimes currentTime jumps back to zero after a\n media decode error, check this, to avoid seeking back to\n wrong position after a media decode error\n */\n if (currentTime > video.playbackRate * this.lastCurrentTime) {\n this.lastCurrentTime = currentTime;\n }\n if (_bufferHelper2.default.isBuffered(video, currentTime)) {\n rangeCurrent = this.getBufferRange(currentTime);\n } else if (_bufferHelper2.default.isBuffered(video, currentTime + 0.1)) {\n /* ensure that FRAG_CHANGED event is triggered at startup,\n when first video frame is displayed and playback is paused.\n add a tolerance of 100ms, in case current position is not buffered,\n check if current pos+100ms is buffered and use that buffer range\n for FRAG_CHANGED event reporting */\n rangeCurrent = this.getBufferRange(currentTime + 0.1);\n }\n if (rangeCurrent) {\n var fragPlaying = rangeCurrent.frag;\n if (fragPlaying !== this.fragPlaying) {\n this.fragPlaying = fragPlaying;\n this.hls.trigger(_events2.default.FRAG_CHANGED, { frag: fragPlaying });\n }\n }\n }\n }\n\n /*\n on immediate level switch :\n - pause playback if playing\n - cancel any pending load request\n - and trigger a buffer flush\n */\n\n }, {\n key: 'immediateLevelSwitch',\n value: function immediateLevelSwitch() {\n _logger.logger.log('immediateLevelSwitch');\n if (!this.immediateSwitch) {\n this.immediateSwitch = true;\n var media = this.media,\n previouslyPaused = void 0;\n if (media) {\n previouslyPaused = media.paused;\n media.pause();\n } else {\n // don't restart playback after instant level switch in case media not attached\n previouslyPaused = true;\n }\n this.previouslyPaused = previouslyPaused;\n }\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && fragCurrent.loader) {\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n this.state = State.PAUSED;\n // flush everything\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY });\n }\n\n /*\n on immediate level switch end, after new fragment has been buffered :\n - nudge video decoder by slightly adjusting video currentTime (if currentTime buffered)\n - resume the playback if needed\n */\n\n }, {\n key: 'immediateLevelSwitchEnd',\n value: function immediateLevelSwitchEnd() {\n var media = this.media;\n if (media && media.buffered.length) {\n this.immediateSwitch = false;\n if (_bufferHelper2.default.isBuffered(media, media.currentTime)) {\n // only nudge if currentTime is buffered\n media.currentTime -= 0.0001;\n }\n if (!this.previouslyPaused) {\n media.play();\n }\n }\n }\n }, {\n key: 'nextLevelSwitch',\n value: function nextLevelSwitch() {\n /* try to switch ASAP without breaking video playback :\n in order to ensure smooth but quick level switching,\n we need to find the next flushable buffer range\n we should take into account new segment fetch time\n */\n var media = this.media;\n // ensure that media is defined and that metadata are available (to retrieve currentTime)\n if (media && media.readyState) {\n var fetchdelay = void 0,\n currentRange = void 0,\n nextRange = void 0;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n currentRange = this.getBufferRange(media.currentTime);\n if (currentRange && currentRange.start > 1) {\n // flush buffer preceding current fragment (flush until current fragment start offset)\n // minus 1s to avoid video freezing, that could happen if we flush keyframe of current video ...\n this.state = State.PAUSED;\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: currentRange.start - 1 });\n }\n if (!media.paused) {\n // add a safety delay of 1s\n var nextLevelId = this.hls.nextLoadLevel,\n nextLevel = this.levels[nextLevelId],\n fragLastKbps = this.fragLastKbps;\n if (fragLastKbps && this.fragCurrent) {\n fetchdelay = this.fragCurrent.duration * nextLevel.bitrate / (1000 * fragLastKbps) + 1;\n } else {\n fetchdelay = 0;\n }\n } else {\n fetchdelay = 0;\n }\n //logger.log('fetchdelay:'+fetchdelay);\n // find buffer range that will be reached once new fragment will be fetched\n nextRange = this.getBufferRange(media.currentTime + fetchdelay);\n if (nextRange) {\n // we can flush buffer range following this one without stalling playback\n nextRange = this.followingBufferRange(nextRange);\n if (nextRange) {\n // if we are here, we can also cancel any loading/demuxing in progress, as they are useless\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && fragCurrent.loader) {\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n // flush position is the start position of this new buffer\n this.state = State.PAUSED;\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: nextRange.start, endOffset: Number.POSITIVE_INFINITY });\n }\n }\n }\n }\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n var media = this.media = this.mediaBuffer = data.media;\n this.onvseeking = this.onMediaSeeking.bind(this);\n this.onvseeked = this.onMediaSeeked.bind(this);\n this.onvended = this.onMediaEnded.bind(this);\n media.addEventListener('seeking', this.onvseeking);\n media.addEventListener('seeked', this.onvseeked);\n media.addEventListener('ended', this.onvended);\n var config = this.config;\n if (this.levels && config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n _logger.logger.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery\n var levels = this.levels;\n if (levels) {\n // reset fragment load counter\n levels.forEach(function (level) {\n if (level.details) {\n level.details.fragments.forEach(function (fragment) {\n fragment.loadCounter = undefined;\n });\n }\n });\n }\n // remove video listeners\n if (media) {\n media.removeEventListener('seeking', this.onvseeking);\n media.removeEventListener('seeked', this.onvseeked);\n media.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvseeked = this.onvended = null;\n }\n this.media = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n }, {\n key: 'onMediaSeeking',\n value: function onMediaSeeking() {\n var media = this.media,\n currentTime = media ? media.currentTime : undefined,\n config = this.config;\n _logger.logger.log('media seeking to ' + currentTime.toFixed(3));\n if (this.state === State.FRAG_LOADING) {\n var bufferInfo = _bufferHelper2.default.bufferInfo(media, currentTime, this.config.maxBufferHole),\n fragCurrent = this.fragCurrent;\n // check if we are seeking to a unbuffered area AND if frag loading is in progress\n if (bufferInfo.len === 0 && fragCurrent) {\n var tolerance = config.maxFragLookUpTolerance,\n fragStartOffset = fragCurrent.start - tolerance,\n fragEndOffset = fragCurrent.start + fragCurrent.duration + tolerance;\n // check if we seek position will be out of currently loaded frag range : if out cancel frag load, if in, don't do anything\n if (currentTime < fragStartOffset || currentTime > fragEndOffset) {\n if (fragCurrent.loader) {\n _logger.logger.log('seeking outside of buffer while fragment load in progress, cancel fragment load');\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n this.fragPrevious = null;\n // switch to IDLE state to load new fragment\n this.state = State.IDLE;\n } else {\n _logger.logger.log('seeking outside of buffer but within currently loaded fragment range');\n }\n }\n } else if (this.state === State.ENDED) {\n // switch to IDLE state to check for potential new fragment\n this.state = State.IDLE;\n }\n if (media) {\n this.lastCurrentTime = currentTime;\n }\n // avoid reporting fragment loop loading error in case user is seeking several times on same position\n if (this.state !== State.FRAG_LOADING && this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n // tick to speed up processing\n this.tick();\n }\n }, {\n key: 'onMediaSeeked',\n value: function onMediaSeeked() {\n _logger.logger.log('media seeked to ' + this.media.currentTime.toFixed(3));\n // tick to speed up FRAGMENT_PLAYING triggering\n this.tick();\n }\n }, {\n key: 'onMediaEnded',\n value: function onMediaEnded() {\n _logger.logger.log('media ended');\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n // reset buffer on manifest loading\n _logger.logger.log('trigger BUFFER_RESET');\n this.hls.trigger(_events2.default.BUFFER_RESET);\n this.bufferRange = [];\n this.stalled = false;\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var aac = false,\n heaac = false,\n codec;\n data.levels.forEach(function (level) {\n // detect if we have different kind of audio codecs used amongst playlists\n codec = level.audioCodec;\n if (codec) {\n if (codec.indexOf('mp4a.40.2') !== -1) {\n aac = true;\n }\n if (codec.indexOf('mp4a.40.5') !== -1) {\n heaac = true;\n }\n }\n });\n this.audioCodecSwitch = aac && heaac;\n if (this.audioCodecSwitch) {\n _logger.logger.log('both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC');\n }\n this.levels = data.levels;\n this.startLevelLoaded = false;\n this.startFragRequested = false;\n var config = this.config;\n if (config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onLevelLoaded',\n value: function onLevelLoaded(data) {\n var newDetails = data.details,\n newLevelId = data.level,\n curLevel = this.levels[newLevelId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n _logger.logger.log('level ' + newLevelId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);\n this.levelLastLoaded = newLevelId;\n\n if (newDetails.live) {\n var curDetails = curLevel.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n _levelHelper2.default.mergeDetails(curDetails, newDetails);\n sliding = newDetails.fragments[0].start;\n this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n _logger.logger.log('live playlist sliding:' + sliding.toFixed(3));\n } else {\n _logger.logger.log('live playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n _logger.logger.log('live playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n // override level info\n curLevel.details = newDetails;\n this.hls.trigger(_events2.default.LEVEL_UPDATED, { details: newDetails, level: newLevelId });\n\n if (this.startFragRequested === false) {\n // compute start position if set to -1. use it straight away if value is defined\n if (this.startPosition === -1 || this.lastCurrentTime === -1) {\n // first, check if start time offset has been set in playlist, if yes, use this value\n var startTimeOffset = newDetails.startTimeOffset;\n if (!isNaN(startTimeOffset)) {\n if (startTimeOffset < 0) {\n _logger.logger.log('negative start time offset ' + startTimeOffset + ', count from end of last fragment');\n startTimeOffset = sliding + duration + startTimeOffset;\n }\n _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);\n this.startPosition = startTimeOffset;\n } else {\n // if live playlist, set start position to be fragment N-this.config.liveSyncDurationCount (usually 3)\n if (newDetails.live) {\n this.startPosition = this.computeLivePosition(sliding, newDetails);\n _logger.logger.log('configure startPosition to ' + this.startPosition);\n } else {\n this.startPosition = 0;\n }\n }\n }\n this.nextLoadPosition = this.startPosition;\n }\n // only switch batck to IDLE state if we were waiting for level to start downloading a new fragment\n if (this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n //trigger handler right now\n this.tick();\n }\n }, {\n key: 'onKeyLoaded',\n value: function onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING && fragCurrent && fragLoaded.type === 'main' && fragLoaded.level === fragCurrent.level && fragLoaded.sn === fragCurrent.sn) {\n var stats = data.stats,\n currentLevel = this.levels[fragCurrent.level],\n details = currentLevel.details;\n _logger.logger.log('Loaded ' + fragCurrent.sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + fragCurrent.level);\n // reset frag bitrate test in any case after frag loaded event\n this.bitrateTest = false;\n // if this frag was loaded to perform a bitrate test AND if hls.nextLoadLevel is greater than 0\n // then this means that we should be able to load a fragment at a higher quality level\n if (fragLoaded.bitrateTest === true && this.hls.nextLoadLevel) {\n // switch back to IDLE state ... we just loaded a fragment to determine adequate start bitrate and initialize autoswitch algo\n this.state = State.IDLE;\n this.startFragRequested = false;\n stats.tparsed = stats.tbuffered = performance.now();\n this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'main' });\n this.tick();\n } else {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.stats = stats;\n var duration = details.totalduration,\n start = !isNaN(fragCurrent.startDTS) ? fragCurrent.startDTS : fragCurrent.start,\n level = fragCurrent.level,\n sn = fragCurrent.sn,\n audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;\n if (this.audioCodecSwap) {\n _logger.logger.log('swapping playlist audio codec');\n if (audioCodec === undefined) {\n audioCodec = this.lastAudioCodec;\n }\n if (audioCodec) {\n if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n audioCodec = 'mp4a.40.2';\n } else {\n audioCodec = 'mp4a.40.5';\n }\n }\n }\n this.pendingAppending = 0;\n _logger.logger.log('Parsing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + level + ', cc ' + fragCurrent.cc);\n var demuxer = this.demuxer;\n if (!demuxer) {\n demuxer = this.demuxer = new _demuxer2.default(this.hls, 'main');\n }\n // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)\n var accurateTimeOffset = details.PTSKnown || !details.live;\n demuxer.push(data.payload, audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, sn, duration, fragCurrent.decryptdata, accurateTimeOffset);\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n var tracks = data.tracks,\n trackName,\n track;\n\n // if audio track is expected to come from audio stream controller, discard any coming from main\n if (tracks.audio && this.altAudio) {\n delete tracks.audio;\n }\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if (track) {\n var audioCodec = this.levels[this.level].audioCodec,\n ua = navigator.userAgent.toLowerCase();\n if (audioCodec && this.audioCodecSwap) {\n _logger.logger.log('swapping playlist audio codec');\n if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n audioCodec = 'mp4a.40.2';\n } else {\n audioCodec = 'mp4a.40.5';\n }\n }\n // in case AAC and HE-AAC audio codecs are signalled in manifest\n // force HE-AAC , as it seems that most browsers prefers that way,\n // except for mono streams OR on FF\n // these conditions might need to be reviewed ...\n if (this.audioCodecSwitch) {\n // don't force HE-AAC if mono stream\n if (track.metadata.channelCount !== 1 &&\n // don't force HE-AAC if firefox\n ua.indexOf('firefox') === -1) {\n audioCodec = 'mp4a.40.5';\n }\n }\n // HE-AAC is broken on Android, always signal audio codec as AAC even if variant manifest states otherwise\n if (ua.indexOf('android') !== -1) {\n audioCodec = 'mp4a.40.2';\n _logger.logger.log('Android: force audio codec to' + audioCodec);\n }\n track.levelCodec = audioCodec;\n track.id = data.id;\n }\n track = tracks.video;\n if (track) {\n track.levelCodec = this.levels[this.level].videoCodec;\n track.id = data.id;\n }\n\n // if remuxer specify that a unique track needs to generated,\n // let's merge all tracks together\n if (data.unique) {\n var mergedTrack = {\n codec: '',\n levelCodec: ''\n };\n for (trackName in data.tracks) {\n track = tracks[trackName];\n mergedTrack.container = track.container;\n if (mergedTrack.codec) {\n mergedTrack.codec += ',';\n mergedTrack.levelCodec += ',';\n }\n if (track.codec) {\n mergedTrack.codec += track.codec;\n }\n if (track.levelCodec) {\n mergedTrack.levelCodec += track.levelCodec;\n }\n }\n tracks = { audiovideo: mergedTrack };\n }\n this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);\n // loop through tracks that are going to be provided to bufferController\n for (trackName in tracks) {\n track = tracks[trackName];\n _logger.logger.log('main track:' + trackName + ',container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');\n var initSegment = track.initSegment;\n if (initSegment) {\n this.pendingAppending++;\n this.hls.trigger(_events2.default.BUFFER_APPENDING, { type: trackName, data: initSegment, parent: 'main', content: 'initSegment' });\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }, {\n key: 'onFragParsingData',\n value: function onFragParsingData(data) {\n var _this2 = this;\n\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && !(data.type === 'audio' && this.altAudio) && // filter out main audio if audio track is loaded through audio stream controller\n this.state === State.PARSING) {\n var level = this.levels[this.level],\n frag = this.fragCurrent;\n\n _logger.logger.log('Parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb + ',dropped:' + (data.dropped || 0));\n\n var drift = _levelHelper2.default.updateFragPTSDTS(level.details, frag.sn, data.startPTS, data.endPTS, data.startDTS, data.endDTS),\n hls = this.hls;\n hls.trigger(_events2.default.LEVEL_PTS_UPDATED, { details: level.details, level: this.level, drift: drift });\n\n // has remuxer dropped video frames located before first keyframe ?\n if (data.type === 'video') {\n frag.dropped = data.dropped;\n }\n\n [data.data1, data.data2].forEach(function (buffer) {\n if (buffer) {\n _this2.pendingAppending++;\n hls.trigger(_events2.default.BUFFER_APPENDING, { type: data.type, data: buffer, parent: 'main', content: 'data' });\n }\n });\n\n this.nextLoadPosition = data.endPTS;\n this.bufferRange.push({ type: data.type, start: data.startPTS, end: data.endPTS, frag: frag });\n\n //trigger handler right now\n this.tick();\n }\n }\n }, {\n key: 'onFragParsed',\n value: function onFragParsed(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n }, {\n key: 'onAudioTrackSwitch',\n value: function onAudioTrackSwitch(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url;\n // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n if (!altAudio) {\n if (this.mediaBuffer !== this.media) {\n _logger.logger.log('switching on main audio, use media.buffered to schedule main fragment loading');\n this.mediaBuffer = this.media;\n var fragCurrent = this.fragCurrent;\n // we need to refill audio buffer from main: cancel any frag loading to speed up audio switch\n if (fragCurrent.loader) {\n _logger.logger.log('switching to main audio track, cancel main fragment load');\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n this.fragPrevious = null;\n // destroy demuxer to force init segment generation (following audio switch)\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n // switch to IDLE state to load new fragment\n this.state = State.IDLE;\n }\n } else {\n // if we switch on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n if (this.videoBuffer && this.mediaBuffer !== this.videoBuffer) {\n _logger.logger.log('switching on alternate audio, use video.buffered to schedule main fragment loading');\n this.mediaBuffer = this.videoBuffer;\n }\n }\n this.altAudio = altAudio;\n }\n }, {\n key: 'onBufferCreated',\n value: function onBufferCreated(data) {\n var tracks = data.tracks,\n mediaTrack = void 0,\n name = void 0,\n alternate = false;\n for (var type in tracks) {\n var track = tracks[type];\n if (track.id === 'main') {\n name = type;\n mediaTrack = track;\n // keep video source buffer reference\n if (type === 'video') {\n this.videoBuffer = tracks[type].buffer;\n }\n } else {\n alternate = true;\n }\n }\n if (alternate && mediaTrack) {\n _logger.logger.log('alternate track found, use ' + name + '.buffered to schedule main fragment loading');\n this.mediaBuffer = mediaTrack.buffer;\n } else {\n this.mediaBuffer = this.media;\n }\n }\n }, {\n key: 'onBufferAppended',\n value: function onBufferAppended(data) {\n if (data.parent === 'main') {\n switch (this.state) {\n case State.PARSING:\n case State.PARSED:\n this.pendingAppending--;\n this._checkAppendedParsed();\n break;\n default:\n break;\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && this.pendingAppending === 0) {\n var frag = this.fragCurrent,\n stats = this.stats;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = performance.now();\n // we should get rid of this.fragLastKbps\n this.fragLastKbps = Math.round(8 * stats.total / (stats.tbuffered - stats.tfirst));\n this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'main' });\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n _logger.logger.log('main buffered : ' + _timeRanges2.default.toString(media.buffered));\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n var frag = data.frag || this.fragCurrent;\n // don't handle frag error not related to main fragment\n if (frag && frag.type !== 'main') {\n return;\n }\n var media = this.media,\n\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);\n switch (data.details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n if (!data.fatal) {\n var loadError = this.fragLoadError;\n if (loadError) {\n loadError++;\n } else {\n loadError = 1;\n }\n var config = this.config;\n // keep retrying / don't raise fatal network error if current position is buffered\n if (loadError <= config.fragLoadingMaxRetry || mediaBuffered) {\n this.fragLoadError = loadError;\n // reset load counter to avoid frag loop loading error\n frag.loadCounter = 0;\n // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n _logger.logger.warn('mediaController: frag loading failed, retry in ' + delay + ' ms');\n this.retryDate = performance.now() + delay;\n // retry loading state\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n _logger.logger.error('mediaController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n break;\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n if (!data.fatal) {\n // if buffer is not empty\n if (mediaBuffered) {\n // try to reduce max buffer length : rationale is that we could get\n // frag loop loading error because of buffer eviction\n this._reduceMaxBufferLength(frag.duration);\n this.state = State.IDLE;\n } else {\n // buffer empty. report as fatal if in manual mode or if lowest level.\n // level controller takes care of emergency switch down logic\n if (!frag.autoLevel || frag.level === 0) {\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n }\n break;\n case _errors.ErrorDetails.LEVEL_LOAD_ERROR:\n case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n // when in ERROR state, don't switch back to IDLE state in case a non-fatal error is received\n if (this.state !== State.ERROR) {\n // if fatal error, stop processing, otherwise move to IDLE to retry loading\n this.state = data.fatal ? State.ERROR : State.IDLE;\n _logger.logger.warn('mediaController: ' + data.details + ' while loading frag,switch to ' + this.state + ' state ...');\n }\n break;\n case _errors.ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (this.state === State.PARSING || this.state === State.PARSED) {\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n this._reduceMaxBufferLength(frag.duration);\n this.state = State.IDLE;\n } else {\n // current position is not buffered, but browser is still complaining about buffer full error\n // this happens on IE/Edge, refer to https://github.com/dailymotion/hls.js/pull/708\n // in that case flush the whole buffer to recover\n _logger.logger.warn('buffer full error also media.currentTime is not buffered, flush everything');\n this.fragCurrent = null;\n this.state = State.PAUSED;\n // flush everything\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY });\n }\n }\n break;\n default:\n break;\n }\n }\n }, {\n key: '_reduceMaxBufferLength',\n value: function _reduceMaxBufferLength(minLength) {\n var config = this.config;\n if (config.maxMaxBufferLength >= minLength) {\n // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...\n config.maxMaxBufferLength /= 2;\n _logger.logger.warn('reduce max buffer length to ' + config.maxMaxBufferLength + 's and switch to IDLE state');\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n }\n }, {\n key: '_checkBuffer',\n value: function _checkBuffer() {\n var media = this.media;\n // if ready state different from HAVE_NOTHING (numeric value 0), we are allowed to seek\n if (media && media.readyState) {\n var currentTime = media.currentTime,\n buffered = media.buffered;\n // adjust currentTime to start position on loaded metadata\n if (!this.loadedmetadata && buffered.length) {\n this.loadedmetadata = true;\n // only adjust currentTime if different from startPosition or if startPosition not buffered\n // at that stage, there should be only one buffered range, as we reach that code after first fragment has been buffered\n var startPosition = this.startPosition,\n startPositionBuffered = _bufferHelper2.default.isBuffered(media, startPosition);\n // if currentTime not matching with expected startPosition or startPosition not buffered\n if (currentTime !== startPosition || !startPositionBuffered) {\n _logger.logger.log('target start position:' + startPosition);\n // if startPosition not buffered, let's seek to buffered.start(0)\n if (!startPositionBuffered) {\n startPosition = buffered.start(0);\n _logger.logger.log('target start position not buffered, seek to buffered.start(0) ' + startPosition);\n }\n _logger.logger.log('adjust currentTime from ' + currentTime + ' to ' + startPosition);\n media.currentTime = startPosition;\n }\n } else if (this.immediateSwitch) {\n this.immediateLevelSwitchEnd();\n } else {\n var bufferInfo = _bufferHelper2.default.bufferInfo(media, currentTime, 0),\n expectedPlaying = !(media.paused || // not playing when media is paused\n media.ended || // not playing when media is ended\n media.buffered.length === 0),\n // not playing if nothing buffered\n jumpThreshold = 0.5,\n // tolerance needed as some browsers stalls playback before reaching buffered range end\n playheadMoving = currentTime > media.playbackRate * this.lastCurrentTime,\n config = this.config;\n\n if (this.stalled && playheadMoving) {\n this.stalled = false;\n _logger.logger.log('playback not stuck anymore @' + currentTime);\n }\n // check buffer upfront\n // if less than jumpThreshold second is buffered, let's check in more details\n if (expectedPlaying && bufferInfo.len <= jumpThreshold) {\n if (playheadMoving) {\n // playhead moving\n jumpThreshold = 0;\n this.seekHoleNudgeDuration = 0;\n } else {\n // playhead not moving AND media expected to play\n if (!this.stalled) {\n this.seekHoleNudgeDuration = 0;\n _logger.logger.log('playback seems stuck @' + currentTime);\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false });\n this.stalled = true;\n } else {\n this.seekHoleNudgeDuration += config.seekHoleNudgeDuration;\n }\n }\n // if we are below threshold, try to jump to start of next buffer range if close\n if (bufferInfo.len <= jumpThreshold) {\n // no buffer available @ currentTime, check if next buffer is close (within a config.maxSeekHole second range)\n var nextBufferStart = bufferInfo.nextStart,\n delta = nextBufferStart - currentTime;\n if (nextBufferStart && delta < config.maxSeekHole && delta > 0) {\n // next buffer is close ! adjust currentTime to nextBufferStart\n // this will ensure effective video decoding\n _logger.logger.log('adjust currentTime from ' + media.currentTime + ' to next buffered @ ' + nextBufferStart + ' + nudge ' + this.seekHoleNudgeDuration);\n var hole = nextBufferStart + this.seekHoleNudgeDuration - media.currentTime;\n media.currentTime = nextBufferStart + this.seekHoleNudgeDuration;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole: hole });\n }\n }\n }\n }\n }\n }\n }, {\n key: 'onFragLoadEmergencyAborted',\n value: function onFragLoadEmergencyAborted() {\n this.state = State.IDLE;\n // if loadedmetadata is not set, it means that we are emergency switch down on first frag\n // in that case, reset startFragRequested flag\n if (!this.loadedmetadata) {\n this.startFragRequested = false;\n }\n this.tick();\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n /* after successful buffer flushing, rebuild buffer Range array\n loop through existing buffer range and check if\n corresponding range is still buffered. only push to new array already buffered range\n use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)\n */\n var media = this.mediaBuffer ? this.mediaBuffer : this.media,\n bufferRange = this.bufferRange,\n newRange = [],\n range = void 0,\n i = void 0;\n for (i = 0; i < bufferRange.length; i++) {\n range = bufferRange[i];\n if (_bufferHelper2.default.isBuffered(media, (range.start + range.end) / 2)) {\n newRange.push(range);\n }\n }\n this.bufferRange = newRange;\n\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // move to IDLE once flush complete. this should trigger new fragment loading\n this.state = State.IDLE;\n // reset reference to frag\n this.fragPrevious = null;\n }\n }, {\n key: 'swapAudioCodec',\n value: function swapAudioCodec() {\n this.audioCodecSwap = !this.audioCodecSwap;\n }\n }, {\n key: 'computeLivePosition',\n value: function computeLivePosition(sliding, levelDetails) {\n var targetLatency = this.config.liveSyncDuration !== undefined ? this.config.liveSyncDuration : this.config.liveSyncDurationCount * levelDetails.targetduration;\n return sliding + Math.max(0, levelDetails.totalduration - targetLatency);\n }\n }, {\n key: 'state',\n set: function set(nextState) {\n if (this.state !== nextState) {\n var previousState = this.state;\n this._state = nextState;\n _logger.logger.log('engine state transition from ' + previousState + ' to ' + nextState);\n this.hls.trigger(_events2.default.STREAM_STATE_TRANSITION, { previousState: previousState, nextState: nextState });\n }\n },\n get: function get() {\n return this._state;\n }\n }, {\n key: 'currentLevel',\n get: function get() {\n var media = this.media;\n if (media) {\n var range = this.getBufferRange(media.currentTime);\n if (range) {\n return range.frag.level;\n }\n }\n return -1;\n }\n }, {\n key: 'nextBufferRange',\n get: function get() {\n var media = this.media;\n if (media) {\n // first get end range of current fragment\n return this.followingBufferRange(this.getBufferRange(media.currentTime));\n } else {\n return null;\n }\n }\n }, {\n key: 'nextLevel',\n get: function get() {\n var range = this.nextBufferRange;\n if (range) {\n return range.frag.level;\n } else {\n return -1;\n }\n }\n }, {\n key: 'liveSyncPosition',\n get: function get() {\n return this._liveSyncPosition;\n },\n set: function set(value) {\n this._liveSyncPosition = value;\n }\n }]);\n\n return StreamController;\n}(_eventHandler2.default);\n\nexports.default = StreamController;\n\n},{\"20\":20,\"24\":24,\"25\":25,\"26\":26,\"28\":28,\"29\":29,\"39\":39,\"43\":43,\"45\":45}],12:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(25);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _cea608Parser = _dereq_(40);\n\nvar _cea608Parser2 = _interopRequireDefault(_cea608Parser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Timeline Controller\n */\n\nvar TimelineController = function (_EventHandler) {\n _inherits(TimelineController, _EventHandler);\n\n function TimelineController(hls) {\n _classCallCheck(this, TimelineController);\n\n var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(TimelineController).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.FRAG_PARSING_USERDATA, _events2.default.MANIFEST_LOADING, _events2.default.FRAG_LOADED, _events2.default.LEVEL_SWITCH));\n\n _this.hls = hls;\n _this.config = hls.config;\n _this.enabled = true;\n _this.Cues = hls.config.cueHandler;\n\n if (_this.config.enableCEA708Captions) {\n var self = _this;\n\n var channel1 = {\n 'newCue': function newCue(startTime, endTime, screen) {\n if (!self.textTrack1) {\n //Enable reuse of existing text track.\n var existingTrack1 = self.getExistingTrack('1');\n if (!existingTrack1) {\n self.textTrack1 = self.createTextTrack('captions', 'English', 'en');\n self.textTrack1.textTrack1 = true;\n } else {\n self.textTrack1 = existingTrack1;\n self.clearCurrentCues(self.textTrack1);\n\n var e = new window.Event('addtrack');\n e.track = self.textTrack1;\n self.media.dispatchEvent(e);\n }\n }\n\n self.Cues.newCue(self.textTrack1, startTime, endTime, screen);\n }\n };\n\n var channel2 = {\n 'newCue': function newCue(startTime, endTime, screen) {\n if (!self.textTrack2) {\n //Enable reuse of existing text track.\n var existingTrack2 = self.getExistingTrack('2');\n if (!existingTrack2) {\n self.textTrack2 = self.createTextTrack('captions', 'Spanish', 'es');\n self.textTrack2.textTrack2 = true;\n } else {\n self.textTrack2 = existingTrack2;\n self.clearCurrentCues(self.textTrack2);\n\n var e = new window.Event('addtrack');\n e.track = self.textTrack2;\n self.media.dispatchEvent(e);\n }\n }\n\n self.Cues.newCue(self.textTrack2, startTime, endTime, screen);\n }\n };\n\n _this.cea608Parser = new _cea608Parser2.default(0, channel1, channel2);\n }\n return _this;\n }\n\n _createClass(TimelineController, [{\n key: 'clearCurrentCues',\n value: function clearCurrentCues(track) {\n if (track && track.cues) {\n while (track.cues.length > 0) {\n track.removeCue(track.cues[0]);\n }\n }\n }\n }, {\n key: 'getExistingTrack',\n value: function getExistingTrack(channelNumber) {\n var media = this.media;\n if (media) {\n for (var i = 0; i < media.textTracks.length; i++) {\n var textTrack = media.textTracks[i];\n var propName = 'textTrack' + channelNumber;\n if (textTrack[propName] === true) {\n return textTrack;\n }\n }\n }\n return null;\n }\n }, {\n key: 'createTextTrack',\n value: function createTextTrack(kind, label, lang) {\n if (this.media) {\n return this.media.addTextTrack(kind, label, lang);\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n this.media = data.media;\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {}\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n this.lastPts = Number.NEGATIVE_INFINITY;\n }\n }, {\n key: 'onLevelSwitch',\n value: function onLevelSwitch() {\n if (this.hls.currentLevel.closedCaptions === 'NONE') {\n this.enabled = false;\n } else {\n this.enabled = true;\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n if (data.frag.type === 'main') {\n var pts = data.frag.start; //Number.POSITIVE_INFINITY;\n // if this is a frag for a previously loaded timerange, remove all captions\n // TODO: consider just removing captions for the timerange\n if (pts <= this.lastPts) {\n this.clearCurrentCues(this.textTrack1);\n this.clearCurrentCues(this.textTrack2);\n }\n this.lastPts = pts;\n }\n }\n }, {\n key: 'onFragParsingUserdata',\n value: function onFragParsingUserdata(data) {\n // push all of the CEA-708 messages into the interpreter\n // immediately. It will create the proper timestamps based on our PTS value\n if (this.enabled) {\n for (var i = 0; i < data.samples.length; i++) {\n var ccdatas = this.extractCea608Data(data.samples[i].bytes);\n this.cea608Parser.addData(data.samples[i].pts, ccdatas);\n }\n }\n }\n }, {\n key: 'extractCea608Data',\n value: function extractCea608Data(byteArray) {\n var count = byteArray[0] & 31;\n var position = 2;\n var tmpByte, ccbyte1, ccbyte2, ccValid, ccType;\n var actualCCBytes = [];\n\n for (var j = 0; j < count; j++) {\n tmpByte = byteArray[position++];\n ccbyte1 = 0x7F & byteArray[position++];\n ccbyte2 = 0x7F & byteArray[position++];\n ccValid = (4 & tmpByte) === 0 ? false : true;\n ccType = 3 & tmpByte;\n\n if (ccbyte1 === 0 && ccbyte2 === 0) {\n continue;\n }\n\n if (ccValid) {\n if (ccType === 0) // || ccType === 1\n {\n actualCCBytes.push(ccbyte1);\n actualCCBytes.push(ccbyte2);\n }\n }\n }\n return actualCCBytes;\n }\n }]);\n\n return TimelineController;\n}(_eventHandler2.default);\n\nexports.default = TimelineController;\n\n},{\"25\":25,\"26\":26,\"40\":40}],13:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*\n *\n * This file contains an adaptation of the AES decryption algorithm\n * from the Standford Javascript Cryptography Library. That work is\n * covered by the following copyright and permissions notice:\n *\n * Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation\n * are those of the authors and should not be interpreted as representing\n * official policies, either expressed or implied, of the authors.\n */\n\nvar AES = function () {\n\n /**\n * Schedule out an AES key for both encryption and decryption. This\n * is a low-level class. Use a cipher mode to do bulk encryption.\n *\n * @constructor\n * @param key {Array} The key as an array of 4, 6 or 8 words.\n */\n\n function AES(key) {\n _classCallCheck(this, AES);\n\n /**\n * The expanded S-box and inverse S-box tables. These will be computed\n * on the client so that we don't have to send them down the wire.\n *\n * There are two tables, _tables[0] is for encryption and\n * _tables[1] is for decryption.\n *\n * The first 4 sub-tables are the expanded S-box with MixColumns. The\n * last (_tables[01][4]) is the S-box itself.\n *\n * @private\n */\n this._tables = [[[], [], [], [], []], [[], [], [], [], []]];\n\n this._precompute();\n\n var i,\n j,\n tmp,\n encKey,\n decKey,\n sbox = this._tables[0][4],\n decTable = this._tables[1],\n keyLen = key.length,\n rcon = 1;\n\n if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n throw new Error('Invalid aes key size=' + keyLen);\n }\n\n encKey = key.slice(0);\n decKey = [];\n this._key = [encKey, decKey];\n\n // schedule encryption keys\n for (i = keyLen; i < 4 * keyLen + 28; i++) {\n tmp = encKey[i - 1];\n\n // apply sbox\n if (i % keyLen === 0 || keyLen === 8 && i % keyLen === 4) {\n tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];\n\n // shift rows and add rcon\n if (i % keyLen === 0) {\n tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n rcon = rcon << 1 ^ (rcon >> 7) * 283;\n }\n }\n\n encKey[i] = encKey[i - keyLen] ^ tmp;\n }\n\n // schedule decryption keys\n for (j = 0; i; j++, i--) {\n tmp = encKey[j & 3 ? i : i - 4];\n if (i <= 4 || j < 4) {\n decKey[j] = tmp;\n } else {\n decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];\n }\n }\n }\n\n /**\n * Expand the S-box tables.\n *\n * @private\n */\n\n\n _createClass(AES, [{\n key: '_precompute',\n value: function _precompute() {\n var encTable = this._tables[0],\n decTable = this._tables[1],\n sbox = encTable[4],\n sboxInv = decTable[4],\n i,\n x,\n xInv,\n d = [],\n th = [],\n x2,\n x4,\n x8,\n s,\n tEnc,\n tDec;\n\n // Compute double and third tables\n for (i = 0; i < 256; i++) {\n th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n }\n\n for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n // Compute sbox\n s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n s = s >> 8 ^ s & 255 ^ 99;\n sbox[x] = s;\n sboxInv[s] = x;\n\n // Compute MixColumns\n x8 = d[x4 = d[x2 = d[x]]];\n tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n tEnc = d[s] * 0x101 ^ s * 0x1010100;\n\n for (i = 0; i < 4; i++) {\n encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n }\n }\n\n // Compactify. Considerable speedup on Firefox.\n for (i = 0; i < 5; i++) {\n encTable[i] = encTable[i].slice(0);\n decTable[i] = decTable[i].slice(0);\n }\n }\n\n /**\n * Decrypt 16 bytes, specified as four 32-bit words.\n * @param encrypted0 {number} the first word to decrypt\n * @param encrypted1 {number} the second word to decrypt\n * @param encrypted2 {number} the third word to decrypt\n * @param encrypted3 {number} the fourth word to decrypt\n * @param out {Int32Array} the array to write the decrypted words\n * into\n * @param offset {number} the offset into the output array to start\n * writing results\n * @return {Array} The plaintext.\n */\n\n }, {\n key: 'decrypt',\n value: function decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {\n var key = this._key[1],\n\n // state variables a,b,c,d are loaded with pre-whitened data\n a = encrypted0 ^ key[0],\n b = encrypted3 ^ key[1],\n c = encrypted2 ^ key[2],\n d = encrypted1 ^ key[3],\n a2,\n b2,\n c2,\n nInnerRounds = key.length / 4 - 2,\n // key.length === 2 ?\n i,\n kIndex = 4,\n table = this._tables[1],\n\n\n // load up the tables\n table0 = table[0],\n table1 = table[1],\n table2 = table[2],\n table3 = table[3],\n sbox = table[4];\n\n // Inner rounds. Cribbed from OpenSSL.\n for (i = 0; i < nInnerRounds; i++) {\n a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d & 255] ^ key[kIndex];\n b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];\n c2 = table0[c >>> 24] ^ table1[d >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];\n d = table0[d >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];\n kIndex += 4;\n a = a2;b = b2;c = c2;\n }\n\n // Last round.\n for (i = 0; i < 4; i++) {\n out[(3 & -i) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d & 255] ^ key[kIndex++];\n a2 = a;a = b;b = c;c = d;d = a2;\n }\n }\n }]);\n\n return AES;\n}();\n\nexports.default = AES;\n\n},{}],14:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n *\n * This file contains an adaptation of the AES decryption algorithm\n * from the Standford Javascript Cryptography Library. That work is\n * covered by the following copyright and permissions notice:\n *\n * Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation\n * are those of the authors and should not be interpreted as representing\n * official policies, either expressed or implied, of the authors.\n */\n\nvar _aes = _dereq_(13);\n\nvar _aes2 = _interopRequireDefault(_aes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AES128Decrypter = function () {\n function AES128Decrypter(key, initVector) {\n _classCallCheck(this, AES128Decrypter);\n\n this.key = key;\n this.iv = initVector;\n }\n\n /**\n * Convert network-order (big-endian) bytes into their little-endian\n * representation.\n */\n\n\n _createClass(AES128Decrypter, [{\n key: 'ntoh',\n value: function ntoh(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n }\n\n /**\n * Decrypt bytes using AES-128 with CBC and PKCS#7 padding.\n * @param encrypted {Uint8Array} the encrypted bytes\n * @param key {Uint32Array} the bytes of the decryption key\n * @param initVector {Uint32Array} the initialization vector (IV) to\n * use for the first round of CBC.\n * @return {Uint8Array} the decrypted bytes\n *\n * @see http://en.wikipedia.org/wiki/Advanced_Encryption_Standard\n * @see http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29\n * @see https://tools.ietf.org/html/rfc2315\n */\n\n }, {\n key: 'doDecrypt',\n value: function doDecrypt(encrypted, key, initVector) {\n var\n // word-level access to the encrypted bytes\n encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2),\n decipher = new _aes2.default(Array.prototype.slice.call(key)),\n\n\n // byte and word-level access for the decrypted output\n decrypted = new Uint8Array(encrypted.byteLength),\n decrypted32 = new Int32Array(decrypted.buffer),\n\n\n // temporary variables for working with the IV, encrypted, and\n // decrypted data\n init0,\n init1,\n init2,\n init3,\n encrypted0,\n encrypted1,\n encrypted2,\n encrypted3,\n\n\n // iteration variable\n wordIx;\n\n // pull out the words of the IV to ensure we don't modify the\n // passed-in reference and easier access\n init0 = ~ ~initVector[0];\n init1 = ~ ~initVector[1];\n init2 = ~ ~initVector[2];\n init3 = ~ ~initVector[3];\n\n // decrypt four word sequences, applying cipher-block chaining (CBC)\n // to each decrypted block\n for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {\n // convert big-endian (network order) words into little-endian\n // (javascript order)\n encrypted0 = ~ ~this.ntoh(encrypted32[wordIx]);\n encrypted1 = ~ ~this.ntoh(encrypted32[wordIx + 1]);\n encrypted2 = ~ ~this.ntoh(encrypted32[wordIx + 2]);\n encrypted3 = ~ ~this.ntoh(encrypted32[wordIx + 3]);\n\n // decrypt the block\n decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx);\n\n // XOR with the IV, and restore network byte-order to obtain the\n // plaintext\n decrypted32[wordIx] = this.ntoh(decrypted32[wordIx] ^ init0);\n decrypted32[wordIx + 1] = this.ntoh(decrypted32[wordIx + 1] ^ init1);\n decrypted32[wordIx + 2] = this.ntoh(decrypted32[wordIx + 2] ^ init2);\n decrypted32[wordIx + 3] = this.ntoh(decrypted32[wordIx + 3] ^ init3);\n\n // setup the IV for the next round\n init0 = encrypted0;\n init1 = encrypted1;\n init2 = encrypted2;\n init3 = encrypted3;\n }\n\n return decrypted;\n }\n }, {\n key: 'localDecrypt',\n value: function localDecrypt(encrypted, key, initVector, decrypted) {\n var bytes = this.doDecrypt(encrypted, key, initVector);\n decrypted.set(bytes, encrypted.byteOffset);\n }\n }, {\n key: 'decrypt',\n value: function decrypt(encrypted) {\n var step = 4 * 8000,\n\n //encrypted32 = new Int32Array(encrypted.buffer),\n encrypted32 = new Int32Array(encrypted),\n decrypted = new Uint8Array(encrypted.byteLength),\n i = 0;\n\n // split up the encryption job and do the individual chunks asynchronously\n var key = this.key;\n var initVector = this.iv;\n this.localDecrypt(encrypted32.subarray(i, i + step), key, initVector, decrypted);\n\n for (i = step; i < encrypted32.length; i += step) {\n initVector = new Uint32Array([this.ntoh(encrypted32[i - 4]), this.ntoh(encrypted32[i - 3]), this.ntoh(encrypted32[i - 2]), this.ntoh(encrypted32[i - 1])]);\n this.localDecrypt(encrypted32.subarray(i, i + step), key, initVector, decrypted);\n }\n\n return decrypted;\n }\n }]);\n\n return AES128Decrypter;\n}();\n\nexports.default = AES128Decrypter;\n\n},{\"13\":13}],15:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n * AES128 decryption.\n */\n\nvar _aes128Decrypter = _dereq_(14);\n\nvar _aes128Decrypter2 = _interopRequireDefault(_aes128Decrypter);\n\nvar _errors = _dereq_(24);\n\nvar _logger = _dereq_(43);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Decrypter = function () {\n function Decrypter(hls) {\n _classCallCheck(this, Decrypter);\n\n this.hls = hls;\n try {\n var browserCrypto = window ? window.crypto : crypto;\n this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n this.disableWebCrypto = !this.subtle;\n } catch (e) {\n this.disableWebCrypto = true;\n }\n }\n\n _createClass(Decrypter, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'decrypt',\n value: function decrypt(data, key, iv, callback) {\n if (this.disableWebCrypto && this.hls.config.enableSoftwareAES) {\n this.decryptBySoftware(data, key, iv, callback);\n } else {\n this.decryptByWebCrypto(data, key, iv, callback);\n }\n }\n }, {\n key: 'decryptByWebCrypto',\n value: function decryptByWebCrypto(data, key, iv, callback) {\n var _this = this;\n\n _logger.logger.log('decrypting by WebCrypto API');\n\n this.subtle.importKey('raw', key, { name: 'AES-CBC', length: 128 }, false, ['decrypt']).then(function (importedKey) {\n _this.subtle.decrypt({ name: 'AES-CBC', iv: iv.buffer }, importedKey, data).then(callback).catch(function (err) {\n _this.onWebCryptoError(err, data, key, iv, callback);\n });\n }).catch(function (err) {\n _this.onWebCryptoError(err, data, key, iv, callback);\n });\n }\n }, {\n key: 'decryptBySoftware',\n value: function decryptBySoftware(data, key8, iv8, callback) {\n _logger.logger.log('decrypting by JavaScript Implementation');\n\n var view = new DataView(key8.buffer);\n var key = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);\n\n view = new DataView(iv8.buffer);\n var iv = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);\n\n var decrypter = new _aes128Decrypter2.default(key, iv);\n callback(decrypter.decrypt(data).buffer);\n }\n }, {\n key: 'onWebCryptoError',\n value: function onWebCryptoError(err, data, key, iv, callback) {\n if (this.hls.config.enableSoftwareAES) {\n _logger.logger.log('disabling to use WebCrypto API');\n this.disableWebCrypto = true;\n this.decryptBySoftware(data, key, iv, callback);\n } else {\n _logger.logger.error('decrypting error : ' + err.message);\n this.hls.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_DECRYPT_ERROR, fatal: true, reason: err.message });\n }\n }\n }]);\n\n return Decrypter;\n}();\n\nexports.default = Decrypter;\n\n},{\"14\":14,\"24\":24,\"43\":43}],16:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * AAC demuxer\n */\n\n\nvar _adts = _dereq_(17);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _logger = _dereq_(43);\n\nvar _id = _dereq_(22);\n\nvar _id2 = _interopRequireDefault(_id);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AACDemuxer = function () {\n function AACDemuxer(observer, id, remuxerClass, config) {\n _classCallCheck(this, AACDemuxer);\n\n this.observer = observer;\n this.id = id;\n this.remuxerClass = remuxerClass;\n this.config = config;\n this.remuxer = new this.remuxerClass(observer, id, config);\n this.insertDiscontinuity();\n }\n\n _createClass(AACDemuxer, [{\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this._aacTrack = { container: 'audio/adts', type: 'audio', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n }\n }, {\n key: 'push',\n\n\n // feed incoming data to the front of the parsing pipeline\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset) {\n var track,\n id3 = new _id2.default(data),\n pts = 90 * id3.timeStamp,\n config,\n frameLength,\n frameDuration,\n frameIndex,\n offset,\n headerLength,\n stamp,\n len,\n aacSample;\n\n var contiguous = false;\n if (cc !== this.lastCC) {\n _logger.logger.log(this.id + ' discontinuity detected');\n this.lastCC = cc;\n this.insertDiscontinuity();\n this.remuxer.switchLevel();\n this.remuxer.insertDiscontinuity();\n } else if (level !== this.lastLevel) {\n _logger.logger.log('audio track switch detected');\n this.lastLevel = level;\n this.remuxer.switchLevel();\n this.insertDiscontinuity();\n } else if (sn === this.lastSN + 1) {\n contiguous = true;\n }\n track = this._aacTrack;\n this.lastSN = sn;\n this.lastLevel = level;\n\n // look for ADTS header (0xFFFx)\n for (offset = id3.length, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n\n if (!track.audiosamplerate) {\n config = _adts2.default.getAudioConfig(this.observer, data, offset, audioCodec);\n track.config = config.config;\n track.audiosamplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.duration = duration;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.audiosamplerate;\n while (offset + 5 < len) {\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;\n // retrieve frame size\n frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n frameLength -= headerLength;\n //stamp = pes.pts;\n\n if (frameLength > 0 && offset + headerLength + frameLength <= len) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n track.samples.push(aacSample);\n track.len += frameLength;\n offset += frameLength + headerLength;\n frameIndex++;\n // look for ADTS header (0xFFFx)\n for (; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n } else {\n break;\n }\n }\n this.remuxer.remux(level, sn, this._aacTrack, { samples: [] }, { samples: [{ pts: pts, dts: pts, unit: id3.payload }] }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset);\n }\n }, {\n key: 'destroy',\n value: function destroy() {}\n }], [{\n key: 'probe',\n value: function probe(data) {\n // check if data contains ID3 timestamp and ADTS sync worc\n var id3 = new _id2.default(data),\n offset,\n len;\n if (id3.hasTimeStamp) {\n // look for ADTS header (0xFFFx)\n for (offset = id3.length, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n //logger.log('ADTS sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n }]);\n\n return AACDemuxer;\n}();\n\nexports.default = AACDemuxer;\n\n},{\"17\":17,\"22\":22,\"43\":43}],17:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * ADTS parser helper\n */\n\n\nvar _logger = _dereq_(43);\n\nvar _errors = _dereq_(24);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ADTS = function () {\n function ADTS() {\n _classCallCheck(this, ADTS);\n }\n\n _createClass(ADTS, null, [{\n key: 'getAudioConfig',\n value: function getAudioConfig(observer, data, offset, audioCodec) {\n var adtsObjectType,\n // :int\n adtsSampleingIndex,\n // :int\n adtsExtensionSampleingIndex,\n // :int\n adtsChanelConfig,\n // :int\n config,\n userAgent = navigator.userAgent.toLowerCase(),\n adtsSampleingRates = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n // byte 2\n adtsObjectType = ((data[offset + 2] & 0xC0) >>> 6) + 1;\n adtsSampleingIndex = (data[offset + 2] & 0x3C) >>> 2;\n if (adtsSampleingIndex > adtsSampleingRates.length - 1) {\n observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'invalid ADTS sampling index:' + adtsSampleingIndex });\n return;\n }\n adtsChanelConfig = (data[offset + 2] & 0x01) << 2;\n // byte 3\n adtsChanelConfig |= (data[offset + 3] & 0xC0) >>> 6;\n _logger.logger.log('manifest codec:' + audioCodec + ',ADTS data:type:' + adtsObjectType + ',sampleingIndex:' + adtsSampleingIndex + '[' + adtsSampleingRates[adtsSampleingIndex] + 'Hz],channelConfig:' + adtsChanelConfig);\n // firefox/Opera: freq less than 24kHz = AAC SBR (HE-AAC)\n if (/firefox|OPR/i.test(userAgent)) {\n if (adtsSampleingIndex >= 6) {\n adtsObjectType = 5;\n config = new Array(4);\n // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n // there is a factor 2 between frame sample rate and output sample rate\n // multiply frequency by 2 (see table below, equivalent to substract 3)\n adtsExtensionSampleingIndex = adtsSampleingIndex - 3;\n } else {\n adtsObjectType = 2;\n config = new Array(2);\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n }\n // Android : always use AAC\n } else if (userAgent.indexOf('android') !== -1) {\n adtsObjectType = 2;\n config = new Array(2);\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n } else {\n /* for other browsers (Chrome/Vivaldi ...)\n always force audio type to be HE-AAC SBR, as some browsers do not support audio codec switch properly (like Chrome ...)\n */\n adtsObjectType = 5;\n config = new Array(4);\n // if (manifest codec is HE-AAC or HE-AACv2) OR (manifest codec not specified AND frequency less than 24kHz)\n if (audioCodec && (audioCodec.indexOf('mp4a.40.29') !== -1 || audioCodec.indexOf('mp4a.40.5') !== -1) || !audioCodec && adtsSampleingIndex >= 6) {\n // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n // there is a factor 2 between frame sample rate and output sample rate\n // multiply frequency by 2 (see table below, equivalent to substract 3)\n adtsExtensionSampleingIndex = adtsSampleingIndex - 3;\n } else {\n // if (manifest codec is AAC) AND (frequency less than 24kHz AND nb channel is 1) OR (manifest codec not specified and mono audio)\n // Chrome fails to play back with low frequency AAC LC mono when initialized with HE-AAC. This is not a problem with stereo.\n if (audioCodec && audioCodec.indexOf('mp4a.40.2') !== -1 && adtsSampleingIndex >= 6 && adtsChanelConfig === 1 || !audioCodec && adtsChanelConfig === 1) {\n adtsObjectType = 2;\n config = new Array(2);\n }\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n }\n }\n /* refer to http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio#Audio_Specific_Config\n ISO 14496-3 (AAC).pdf - Table 1.13 — Syntax of AudioSpecificConfig()\n Audio Profile / Audio Object Type\n 0: Null\n 1: AAC Main\n 2: AAC LC (Low Complexity)\n 3: AAC SSR (Scalable Sample Rate)\n 4: AAC LTP (Long Term Prediction)\n 5: SBR (Spectral Band Replication)\n 6: AAC Scalable\n sampling freq\n 0: 96000 Hz\n 1: 88200 Hz\n 2: 64000 Hz\n 3: 48000 Hz\n 4: 44100 Hz\n 5: 32000 Hz\n 6: 24000 Hz\n 7: 22050 Hz\n 8: 16000 Hz\n 9: 12000 Hz\n 10: 11025 Hz\n 11: 8000 Hz\n 12: 7350 Hz\n 13: Reserved\n 14: Reserved\n 15: frequency is written explictly\n Channel Configurations\n These are the channel configurations:\n 0: Defined in AOT Specifc Config\n 1: 1 channel: front-center\n 2: 2 channels: front-left, front-right\n */\n // audioObjectType = profile => profile, the MPEG-4 Audio Object Type minus 1\n config[0] = adtsObjectType << 3;\n // samplingFrequencyIndex\n config[0] |= (adtsSampleingIndex & 0x0E) >> 1;\n config[1] |= (adtsSampleingIndex & 0x01) << 7;\n // channelConfiguration\n config[1] |= adtsChanelConfig << 3;\n if (adtsObjectType === 5) {\n // adtsExtensionSampleingIndex\n config[1] |= (adtsExtensionSampleingIndex & 0x0E) >> 1;\n config[2] = (adtsExtensionSampleingIndex & 0x01) << 7;\n // adtsObjectType (force to 2, chrome is checking that object type is less than 5 ???\n // https://chromium.googlesource.com/chromium/src.git/+/master/media/formats/mp4/aac.cc\n config[2] |= 2 << 2;\n config[3] = 0;\n }\n return { config: config, samplerate: adtsSampleingRates[adtsSampleingIndex], channelCount: adtsChanelConfig, codec: 'mp4a.40.' + adtsObjectType };\n }\n }]);\n\n return ADTS;\n}();\n\nexports.default = ADTS;\n\n},{\"24\":24,\"43\":43}],18:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* inline demuxer.\n * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n */\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(24);\n\nvar _aacdemuxer = _dereq_(16);\n\nvar _aacdemuxer2 = _interopRequireDefault(_aacdemuxer);\n\nvar _tsdemuxer = _dereq_(23);\n\nvar _tsdemuxer2 = _interopRequireDefault(_tsdemuxer);\n\nvar _mp4Remuxer = _dereq_(36);\n\nvar _mp4Remuxer2 = _interopRequireDefault(_mp4Remuxer);\n\nvar _passthroughRemuxer = _dereq_(37);\n\nvar _passthroughRemuxer2 = _interopRequireDefault(_passthroughRemuxer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DemuxerInline = function () {\n function DemuxerInline(hls, id, typeSupported) {\n var config = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3];\n\n _classCallCheck(this, DemuxerInline);\n\n this.hls = hls;\n this.id = id;\n this.config = this.hls.config || config;\n this.typeSupported = typeSupported;\n }\n\n _createClass(DemuxerInline, [{\n key: 'destroy',\n value: function destroy() {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n }\n }\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset) {\n var demuxer = this.demuxer;\n if (!demuxer) {\n var hls = this.hls,\n id = this.id;\n // probe for content type\n if (_tsdemuxer2.default.probe(data)) {\n if (this.typeSupported.mp2t === true) {\n demuxer = new _tsdemuxer2.default(hls, id, _passthroughRemuxer2.default, this.config);\n } else {\n demuxer = new _tsdemuxer2.default(hls, id, _mp4Remuxer2.default, this.config);\n }\n } else if (_aacdemuxer2.default.probe(data)) {\n demuxer = new _aacdemuxer2.default(hls, id, _mp4Remuxer2.default, this.config);\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found' });\n return;\n }\n this.demuxer = demuxer;\n }\n demuxer.push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset);\n }\n }]);\n\n return DemuxerInline;\n}();\n\nexports.default = DemuxerInline;\n\n},{\"16\":16,\"23\":23,\"24\":24,\"26\":26,\"36\":36,\"37\":37}],19:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _demuxerInline = _dereq_(18);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(43);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/* demuxer web worker.\n * - listen to worker message, and trigger DemuxerInline upon reception of Fragments.\n * - provides MP4 Boxes back to main thread using [transferable objects](https://developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast) in order to minimize message passing overhead.\n */\n\nvar DemuxerWorker = function DemuxerWorker(self) {\n // observer setup\n var observer = new _events4.default();\n observer.trigger = function trigger(event) {\n for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n\n observer.emit.apply(observer, [event, event].concat(data));\n };\n\n observer.off = function off(event) {\n for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n data[_key2 - 1] = arguments[_key2];\n }\n\n observer.removeListener.apply(observer, [event].concat(data));\n };\n\n var forwardMessage = function forwardMessage(ev, data) {\n self.postMessage({ event: ev, data: data });\n };\n\n self.addEventListener('message', function (ev) {\n var data = ev.data;\n //console.log('demuxer cmd:' + data.cmd);\n switch (data.cmd) {\n case 'init':\n var config = JSON.parse(data.config);\n self.demuxer = new _demuxerInline2.default(observer, data.id, data.typeSupported, config);\n try {\n (0, _logger.enableLogs)(config.debug);\n } catch (err) {\n console.warn('demuxerWorker: unable to enable logs');\n }\n // signal end of worker init\n forwardMessage('init', null);\n break;\n case 'demux':\n self.demuxer.push(new Uint8Array(data.data), data.audioCodec, data.videoCodec, data.timeOffset, data.cc, data.level, data.sn, data.duration, data.accurateTimeOffset);\n break;\n default:\n break;\n }\n });\n\n // forward events to main thread\n observer.on(_events2.default.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(_events2.default.FRAG_PARSED, forwardMessage);\n observer.on(_events2.default.ERROR, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_USERDATA, forwardMessage);\n\n // special case for FRAG_PARSING_DATA: pass data1/data2 as transferable object (no copy)\n observer.on(_events2.default.FRAG_PARSING_DATA, function (ev, data) {\n var data1 = data.data1.buffer,\n data2 = data.data2.buffer;\n // remove data1 and data2 reference from data to avoid copying them ...\n delete data.data1;\n delete data.data2;\n self.postMessage({ event: ev, data: data, data1: data1, data2: data2 }, [data1, data2]);\n });\n};\n\nexports.default = DemuxerWorker;\n\n},{\"1\":1,\"18\":18,\"26\":26,\"43\":43}],20:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _demuxerInline = _dereq_(18);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _demuxerWorker = _dereq_(19);\n\nvar _demuxerWorker2 = _interopRequireDefault(_demuxerWorker);\n\nvar _logger = _dereq_(43);\n\nvar _decrypter = _dereq_(15);\n\nvar _decrypter2 = _interopRequireDefault(_decrypter);\n\nvar _errors = _dereq_(24);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Demuxer = function () {\n function Demuxer(hls, id) {\n _classCallCheck(this, Demuxer);\n\n this.hls = hls;\n this.id = id;\n var typeSupported = {\n mp4: MediaSource.isTypeSupported('video/mp4'),\n mp2t: hls.config.enableMP2TPassThrough && MediaSource.isTypeSupported('video/mp2t')\n };\n if (hls.config.enableWorker && typeof Worker !== 'undefined') {\n _logger.logger.log('demuxing in webworker');\n var w = void 0;\n try {\n var work = _dereq_(2);\n w = this.w = work(_demuxerWorker2.default);\n this.onwmsg = this.onWorkerMessage.bind(this);\n w.addEventListener('message', this.onwmsg);\n w.onerror = function (event) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: true, event: 'demuxerWorker', err: { message: event.message + ' (' + event.filename + ':' + event.lineno + ')' } });\n };\n w.postMessage({ cmd: 'init', typeSupported: typeSupported, id: id, config: JSON.stringify(hls.config) });\n } catch (err) {\n _logger.logger.error('error while initializing DemuxerWorker, fallback on DemuxerInline');\n if (w) {\n // revoke the Object URL that was used to create demuxer worker, so as not to leak it\n URL.revokeObjectURL(w.objectURL);\n }\n this.demuxer = new _demuxerInline2.default(hls, id, typeSupported);\n }\n } else {\n this.demuxer = new _demuxerInline2.default(hls, id, typeSupported);\n }\n this.demuxInitialized = true;\n }\n\n _createClass(Demuxer, [{\n key: 'destroy',\n value: function destroy() {\n var w = this.w;\n if (w) {\n w.removeEventListener('message', this.onwmsg);\n w.terminate();\n this.w = null;\n } else {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n this.demuxer = null;\n }\n }\n var decrypter = this.decrypter;\n if (decrypter) {\n decrypter.destroy();\n this.decrypter = null;\n }\n }\n }, {\n key: 'pushDecrypted',\n value: function pushDecrypted(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset) {\n var w = this.w;\n if (w) {\n // post fragment payload as transferable objects (no copy)\n w.postMessage({ cmd: 'demux', data: data, audioCodec: audioCodec, videoCodec: videoCodec, timeOffset: timeOffset, cc: cc, level: level, sn: sn, duration: duration, accurateTimeOffset: accurateTimeOffset }, [data]);\n } else {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.push(new Uint8Array(data), audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset);\n }\n }\n }\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset) {\n if (data.byteLength > 0 && decryptdata != null && decryptdata.key != null && decryptdata.method === 'AES-128') {\n if (this.decrypter == null) {\n this.decrypter = new _decrypter2.default(this.hls);\n }\n\n var localthis = this;\n this.decrypter.decrypt(data, decryptdata.key, decryptdata.iv, function (decryptedData) {\n localthis.pushDecrypted(decryptedData, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset);\n });\n } else {\n this.pushDecrypted(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset);\n }\n }\n }, {\n key: 'onWorkerMessage',\n value: function onWorkerMessage(ev) {\n var data = ev.data,\n hls = this.hls;\n //console.log('onWorkerMessage:' + data.event);\n switch (data.event) {\n case 'init':\n // revoke the Object URL that was used to create demuxer worker, so as not to leak it\n URL.revokeObjectURL(this.w.objectURL);\n break;\n // special case for FRAG_PARSING_DATA: data1 and data2 are transferable objects\n case _events2.default.FRAG_PARSING_DATA:\n data.data.data1 = new Uint8Array(data.data1);\n data.data.data2 = new Uint8Array(data.data2);\n /* falls through */\n default:\n hls.trigger(data.event, data.data);\n break;\n }\n }\n }]);\n\n return Demuxer;\n}();\n\nexports.default = Demuxer;\n\n},{\"15\":15,\"18\":18,\"19\":19,\"2\":2,\"24\":24,\"26\":26,\"43\":43}],21:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.\n */\n\nvar _logger = _dereq_(43);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ExpGolomb = function () {\n function ExpGolomb(data) {\n _classCallCheck(this, ExpGolomb);\n\n this.data = data;\n // the number of bytes left to examine in this.data\n this.bytesAvailable = this.data.byteLength;\n // the current word being examined\n this.word = 0; // :uint\n // the number of bits left to examine in the current word\n this.bitsAvailable = 0; // :uint\n }\n\n // ():void\n\n\n _createClass(ExpGolomb, [{\n key: 'loadWord',\n value: function loadWord() {\n var position = this.data.byteLength - this.bytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, this.bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(this.data.subarray(position, position + availableBytes));\n this.word = new DataView(workingBytes.buffer).getUint32(0);\n // track the amount of this.data that has been processed\n this.bitsAvailable = availableBytes * 8;\n this.bytesAvailable -= availableBytes;\n }\n\n // (count:int):void\n\n }, {\n key: 'skipBits',\n value: function skipBits(count) {\n var skipBytes; // :int\n if (this.bitsAvailable > count) {\n this.word <<= count;\n this.bitsAvailable -= count;\n } else {\n count -= this.bitsAvailable;\n skipBytes = count >> 3;\n count -= skipBytes >> 3;\n this.bytesAvailable -= skipBytes;\n this.loadWord();\n this.word <<= count;\n this.bitsAvailable -= count;\n }\n }\n\n // (size:int):uint\n\n }, {\n key: 'readBits',\n value: function readBits(size) {\n var bits = Math.min(this.bitsAvailable, size),\n // :uint\n valu = this.word >>> 32 - bits; // :uint\n if (size > 32) {\n _logger.logger.error('Cannot read more than 32 bits at a time');\n }\n this.bitsAvailable -= bits;\n if (this.bitsAvailable > 0) {\n this.word <<= bits;\n } else if (this.bytesAvailable > 0) {\n this.loadWord();\n }\n bits = size - bits;\n if (bits > 0 && this.bitsAvailable) {\n return valu << bits | this.readBits(bits);\n } else {\n return valu;\n }\n }\n\n // ():uint\n\n }, {\n key: 'skipLZ',\n value: function skipLZ() {\n var leadingZeroCount; // :uint\n for (leadingZeroCount = 0; leadingZeroCount < this.bitsAvailable; ++leadingZeroCount) {\n if (0 !== (this.word & 0x80000000 >>> leadingZeroCount)) {\n // the first bit of working word is 1\n this.word <<= leadingZeroCount;\n this.bitsAvailable -= leadingZeroCount;\n return leadingZeroCount;\n }\n }\n // we exhausted word and still have not found a 1\n this.loadWord();\n return leadingZeroCount + this.skipLZ();\n }\n\n // ():void\n\n }, {\n key: 'skipUEG',\n value: function skipUEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():void\n\n }, {\n key: 'skipEG',\n value: function skipEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():uint\n\n }, {\n key: 'readUEG',\n value: function readUEG() {\n var clz = this.skipLZ(); // :uint\n return this.readBits(clz + 1) - 1;\n }\n\n // ():int\n\n }, {\n key: 'readEG',\n value: function readEG() {\n var valu = this.readUEG(); // :int\n if (0x01 & valu) {\n // the number is odd if the low order bit is set\n return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n } else {\n return -1 * (valu >>> 1); // divide by two then make it negative\n }\n }\n\n // Some convenience functions\n // :Boolean\n\n }, {\n key: 'readBoolean',\n value: function readBoolean() {\n return 1 === this.readBits(1);\n }\n\n // ():int\n\n }, {\n key: 'readUByte',\n value: function readUByte() {\n return this.readBits(8);\n }\n\n // ():int\n\n }, {\n key: 'readUShort',\n value: function readUShort() {\n return this.readBits(16);\n }\n // ():int\n\n }, {\n key: 'readUInt',\n value: function readUInt() {\n return this.readBits(32);\n }\n\n /**\n * Advance the ExpGolomb decoder past a scaling list. The scaling\n * list is optionally transmitted as part of a sequence parameter\n * set and is not relevant to transmuxing.\n * @param count {number} the number of entries in this scaling list\n * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n */\n\n }, {\n key: 'skipScalingList',\n value: function skipScalingList(count) {\n var lastScale = 8,\n nextScale = 8,\n j,\n deltaScale;\n for (j = 0; j < count; j++) {\n if (nextScale !== 0) {\n deltaScale = this.readEG();\n nextScale = (lastScale + deltaScale + 256) % 256;\n }\n lastScale = nextScale === 0 ? lastScale : nextScale;\n }\n }\n\n /**\n * Read a sequence parameter set and return some interesting video\n * properties. A sequence parameter set is the H264 metadata that\n * describes the properties of upcoming video frames.\n * @param data {Uint8Array} the bytes of a sequence parameter set\n * @return {object} an object with configuration parsed from the\n * sequence parameter set, including the dimensions of the\n * associated video frames.\n */\n\n }, {\n key: 'readSPS',\n value: function readSPS() {\n var frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n sarScale = 1,\n profileIdc,\n profileCompat,\n levelIdc,\n numRefFramesInPicOrderCntCycle,\n picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n i;\n this.readUByte();\n profileIdc = this.readUByte(); // profile_idc\n profileCompat = this.readBits(5); // constraint_set[0-4]_flag, u(5)\n this.skipBits(3); // reserved_zero_3bits u(3),\n levelIdc = this.readUByte(); //level_idc u(8)\n this.skipUEG(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n if (profileIdc === 100 || profileIdc === 110 || profileIdc === 122 || profileIdc === 244 || profileIdc === 44 || profileIdc === 83 || profileIdc === 86 || profileIdc === 118 || profileIdc === 128) {\n var chromaFormatIdc = this.readUEG();\n if (chromaFormatIdc === 3) {\n this.skipBits(1); // separate_colour_plane_flag\n }\n this.skipUEG(); // bit_depth_luma_minus8\n this.skipUEG(); // bit_depth_chroma_minus8\n this.skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (this.readBoolean()) {\n // seq_scaling_matrix_present_flag\n scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (this.readBoolean()) {\n // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n this.skipScalingList(16);\n } else {\n this.skipScalingList(64);\n }\n }\n }\n }\n }\n this.skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = this.readUEG();\n if (picOrderCntType === 0) {\n this.readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n this.skipBits(1); // delta_pic_order_always_zero_flag\n this.skipEG(); // offset_for_non_ref_pic\n this.skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = this.readUEG();\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n this.skipEG(); // offset_for_ref_frame[ i ]\n }\n }\n this.skipUEG(); // max_num_ref_frames\n this.skipBits(1); // gaps_in_frame_num_value_allowed_flag\n picWidthInMbsMinus1 = this.readUEG();\n picHeightInMapUnitsMinus1 = this.readUEG();\n frameMbsOnlyFlag = this.readBits(1);\n if (frameMbsOnlyFlag === 0) {\n this.skipBits(1); // mb_adaptive_frame_field_flag\n }\n this.skipBits(1); // direct_8x8_inference_flag\n if (this.readBoolean()) {\n // frame_cropping_flag\n frameCropLeftOffset = this.readUEG();\n frameCropRightOffset = this.readUEG();\n frameCropTopOffset = this.readUEG();\n frameCropBottomOffset = this.readUEG();\n }\n if (this.readBoolean()) {\n // vui_parameters_present_flag\n if (this.readBoolean()) {\n // aspect_ratio_info_present_flag\n var sarRatio = void 0;\n var aspectRatioIdc = this.readUByte();\n switch (aspectRatioIdc) {\n case 1:\n sarRatio = [1, 1];break;\n case 2:\n sarRatio = [12, 11];break;\n case 3:\n sarRatio = [10, 11];break;\n case 4:\n sarRatio = [16, 11];break;\n case 5:\n sarRatio = [40, 33];break;\n case 6:\n sarRatio = [24, 11];break;\n case 7:\n sarRatio = [20, 11];break;\n case 8:\n sarRatio = [32, 11];break;\n case 9:\n sarRatio = [80, 33];break;\n case 10:\n sarRatio = [18, 11];break;\n case 11:\n sarRatio = [15, 11];break;\n case 12:\n sarRatio = [64, 33];break;\n case 13:\n sarRatio = [160, 99];break;\n case 14:\n sarRatio = [4, 3];break;\n case 15:\n sarRatio = [3, 2];break;\n case 16:\n sarRatio = [2, 1];break;\n case 255:\n {\n sarRatio = [this.readUByte() << 8 | this.readUByte(), this.readUByte() << 8 | this.readUByte()];\n break;\n }\n }\n if (sarRatio) {\n sarScale = sarRatio[0] / sarRatio[1];\n }\n }\n }\n return {\n width: Math.ceil(((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2) * sarScale),\n height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - (frameMbsOnlyFlag ? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset)\n };\n }\n }, {\n key: 'readSliceType',\n value: function readSliceType() {\n // skip NALu type\n this.readUByte();\n // discard first_mb_in_slice\n this.readUEG();\n // return slice_type\n return this.readUEG();\n }\n }]);\n\n return ExpGolomb;\n}();\n\nexports.default = ExpGolomb;\n\n},{\"43\":43}],22:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * ID3 parser\n */\n\n\nvar _logger = _dereq_(43);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n//import Hex from '../utils/hex';\n\nvar ID3 = function () {\n function ID3(data) {\n _classCallCheck(this, ID3);\n\n this._hasTimeStamp = false;\n var offset = 0,\n byte1,\n byte2,\n byte3,\n byte4,\n tagSize,\n endPos,\n header,\n len;\n do {\n header = this.readUTF(data, offset, 3);\n offset += 3;\n // first check for ID3 header\n if (header === 'ID3') {\n // skip 24 bits\n offset += 3;\n // retrieve tag(s) length\n byte1 = data[offset++] & 0x7f;\n byte2 = data[offset++] & 0x7f;\n byte3 = data[offset++] & 0x7f;\n byte4 = data[offset++] & 0x7f;\n tagSize = (byte1 << 21) + (byte2 << 14) + (byte3 << 7) + byte4;\n endPos = offset + tagSize;\n //logger.log(`ID3 tag found, size/end: ${tagSize}/${endPos}`);\n\n // read ID3 tags\n this._parseID3Frames(data, offset, endPos);\n offset = endPos;\n } else if (header === '3DI') {\n // http://id3.org/id3v2.4.0-structure chapter 3.4. ID3v2 footer\n offset += 7;\n _logger.logger.log('3DI footer found, end: ' + offset);\n } else {\n offset -= 3;\n len = offset;\n if (len) {\n //logger.log(`ID3 len: ${len}`);\n if (!this.hasTimeStamp) {\n _logger.logger.warn('ID3 tag found, but no timestamp');\n }\n this._length = len;\n this._payload = data.subarray(0, len);\n }\n return;\n }\n } while (true);\n }\n\n _createClass(ID3, [{\n key: 'readUTF',\n value: function readUTF(data, start, len) {\n\n var result = '',\n offset = start,\n end = start + len;\n do {\n result += String.fromCharCode(data[offset++]);\n } while (offset < end);\n return result;\n }\n }, {\n key: '_parseID3Frames',\n value: function _parseID3Frames(data, offset, endPos) {\n var tagId, tagLen, tagStart, tagFlags, timestamp;\n while (offset + 8 <= endPos) {\n tagId = this.readUTF(data, offset, 4);\n offset += 4;\n\n tagLen = data[offset++] << 24 + data[offset++] << 16 + data[offset++] << 8 + data[offset++];\n\n tagFlags = data[offset++] << 8 + data[offset++];\n\n tagStart = offset;\n //logger.log(\"ID3 tag id:\" + tagId);\n switch (tagId) {\n case 'PRIV':\n //logger.log('parse frame:' + Hex.hexDump(data.subarray(offset,endPos)));\n // owner should be \"com.apple.streaming.transportStreamTimestamp\"\n if (this.readUTF(data, offset, 44) === 'com.apple.streaming.transportStreamTimestamp') {\n offset += 44;\n // smelling even better ! we found the right descriptor\n // skip null character (string end) + 3 first bytes\n offset += 4;\n\n // timestamp is 33 bit expressed as a big-endian eight-octet number, with the upper 31 bits set to zero.\n var pts33Bit = data[offset++] & 0x1;\n this._hasTimeStamp = true;\n\n timestamp = ((data[offset++] << 23) + (data[offset++] << 15) + (data[offset++] << 7) + data[offset++]) / 45;\n\n if (pts33Bit) {\n timestamp += 47721858.84; // 2^32 / 90\n }\n timestamp = Math.round(timestamp);\n _logger.logger.trace('ID3 timestamp found: ' + timestamp);\n this._timeStamp = timestamp;\n }\n break;\n default:\n break;\n }\n }\n }\n }, {\n key: 'hasTimeStamp',\n get: function get() {\n return this._hasTimeStamp;\n }\n }, {\n key: 'timeStamp',\n get: function get() {\n return this._timeStamp;\n }\n }, {\n key: 'length',\n get: function get() {\n return this._length;\n }\n }, {\n key: 'payload',\n get: function get() {\n return this._payload;\n }\n }]);\n\n return ID3;\n}();\n\nexports.default = ID3;\n\n},{\"43\":43}],23:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * highly optimized TS demuxer:\n * parse PAT, PMT\n * extract PES packet from audio and video PIDs\n * extract AVC/H264 NAL units and AAC/ADTS samples from PES packet\n * trigger the remuxer upon parsing completion\n * it also tries to workaround as best as it can audio codec switch (HE-AAC to AAC and vice versa), without having to restart the MediaSource.\n * it also controls the remuxing process :\n * upon discontinuity or level switch detection, it will also notifies the remuxer so that it can reset its state.\n */\n\n// import Hex from '../utils/hex';\n\n\nvar _adts = _dereq_(17);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _expGolomb = _dereq_(21);\n\nvar _expGolomb2 = _interopRequireDefault(_expGolomb);\n\nvar _logger = _dereq_(43);\n\nvar _errors = _dereq_(24);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TSDemuxer = function () {\n function TSDemuxer(observer, id, remuxerClass, config) {\n _classCallCheck(this, TSDemuxer);\n\n this.observer = observer;\n this.id = id;\n this.remuxerClass = remuxerClass;\n this.config = config;\n this.lastCC = 0;\n this.remuxer = new this.remuxerClass(observer, id, config);\n }\n\n _createClass(TSDemuxer, [{\n key: 'switchLevel',\n value: function switchLevel() {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = { container: 'video/mp2t', type: 'video', id: -1, sequenceNumber: 0, samples: [], len: 0, dropped: 0 };\n this._aacTrack = { container: 'video/mp2t', type: 'audio', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n this._id3Track = { type: 'id3', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n this._txtTrack = { type: 'text', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n // flush any partial content\n this.aacOverFlow = null;\n this.aacLastPTS = null;\n this.avcSample = null;\n this.remuxer.switchLevel();\n }\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this.switchLevel();\n this.remuxer.insertDiscontinuity();\n }\n\n // feed incoming data to the front of the parsing pipeline\n\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset) {\n var start,\n len = data.length,\n stt,\n pid,\n atf,\n offset,\n pes,\n codecsOnly = this.remuxer.passthrough,\n unknownPIDs = false;\n\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this._duration = duration;\n this.contiguous = false;\n this.accurateTimeOffset = accurateTimeOffset;\n if (cc !== this.lastCC) {\n _logger.logger.log('discontinuity detected');\n this.insertDiscontinuity();\n this.lastCC = cc;\n }\n if (level !== this.lastLevel) {\n _logger.logger.log('level switch detected');\n this.switchLevel();\n this.lastLevel = level;\n } else if (sn === this.lastSN + 1) {\n this.contiguous = true;\n }\n this.lastSN = sn;\n\n var pmtParsed = this.pmtParsed,\n avcTrack = this._avcTrack,\n aacTrack = this._aacTrack,\n id3Track = this._id3Track,\n avcId = avcTrack.id,\n aacId = aacTrack.id,\n id3Id = id3Track.id,\n pmtId = this._pmtId,\n avcData = avcTrack.pesData,\n aacData = aacTrack.pesData,\n id3Data = id3Track.pesData,\n parsePAT = this._parsePAT,\n parsePMT = this._parsePMT,\n parsePES = this._parsePES,\n parseAVCPES = this._parseAVCPES.bind(this),\n parseAACPES = this._parseAACPES.bind(this),\n parseID3PES = this._parseID3PES.bind(this);\n\n // don't parse last TS packet if incomplete\n len -= len % 188;\n // loop through TS packets\n for (start = 0; start < len; start += 188) {\n if (data[start] === 0x47) {\n stt = !!(data[start + 1] & 0x40);\n // pid is a 13-bit field starting at the last bit of TS[1]\n pid = ((data[start + 1] & 0x1f) << 8) + data[start + 2];\n atf = (data[start + 3] & 0x30) >> 4;\n // if an adaption field is present, its length is specified by the fifth byte of the TS packet header.\n if (atf > 1) {\n offset = start + 5 + data[start + 4];\n // continue if there is only adaptation field\n if (offset === start + 188) {\n continue;\n }\n } else {\n offset = start + 4;\n }\n switch (pid) {\n case avcId:\n if (stt) {\n if (avcData && (pes = parsePES(avcData))) {\n parseAVCPES(pes, false);\n if (codecsOnly) {\n // if we have video codec info AND\n // if audio PID is undefined OR if we have audio codec info,\n // we have all codec info !\n if (avcTrack.codec && (aacId === -1 || aacTrack.codec)) {\n this.remux(level, sn, data, timeOffset);\n return;\n }\n }\n }\n avcData = { data: [], size: 0 };\n }\n if (avcData) {\n avcData.data.push(data.subarray(offset, start + 188));\n avcData.size += start + 188 - offset;\n }\n break;\n case aacId:\n if (stt) {\n if (aacData && (pes = parsePES(aacData))) {\n parseAACPES(pes);\n if (codecsOnly) {\n // here we now that we have audio codec info\n // if video PID is undefined OR if we have video codec info,\n // we have all codec infos !\n if (aacTrack.codec && (avcId === -1 || avcTrack.codec)) {\n this.remux(level, sn, data, timeOffset);\n return;\n }\n }\n }\n aacData = { data: [], size: 0 };\n }\n if (aacData) {\n aacData.data.push(data.subarray(offset, start + 188));\n aacData.size += start + 188 - offset;\n }\n break;\n case id3Id:\n if (stt) {\n if (id3Data && (pes = parsePES(id3Data))) {\n parseID3PES(pes);\n }\n id3Data = { data: [], size: 0 };\n }\n if (id3Data) {\n id3Data.data.push(data.subarray(offset, start + 188));\n id3Data.size += start + 188 - offset;\n }\n break;\n case 0:\n if (stt) {\n offset += data[offset] + 1;\n }\n pmtId = this._pmtId = parsePAT(data, offset);\n break;\n case pmtId:\n if (stt) {\n offset += data[offset] + 1;\n }\n var parsedPIDs = parsePMT(data, offset);\n avcId = avcTrack.id = parsedPIDs.avc;\n aacId = aacTrack.id = parsedPIDs.aac;\n id3Id = id3Track.id = parsedPIDs.id3;\n if (unknownPIDs && !pmtParsed) {\n _logger.logger.log('reparse from beginning');\n unknownPIDs = false;\n // we set it to -188, the += 188 in the for loop will reset start to 0\n start = -188;\n }\n pmtParsed = this.pmtParsed = true;\n break;\n case 17:\n case 0x1fff:\n break;\n default:\n unknownPIDs = true;\n break;\n }\n } else {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'TS packet did not start with 0x47' });\n }\n }\n // try to parse last PES packets\n if (avcData && (pes = parsePES(avcData))) {\n parseAVCPES(pes, true);\n avcTrack.pesData = null;\n } else {\n // either avcData null or PES truncated, keep it for next frag parsing\n avcTrack.pesData = avcData;\n }\n\n if (aacData && (pes = parsePES(aacData))) {\n parseAACPES(pes);\n aacTrack.pesData = null;\n } else {\n if (aacData && aacData.size) {\n _logger.logger.log('last AAC PES packet truncated,might overlap between fragments');\n }\n // either aacData null or PES truncated, keep it for next frag parsing\n aacTrack.pesData = aacData;\n }\n\n if (id3Data && (pes = parsePES(id3Data))) {\n parseID3PES(pes);\n id3Track.pesData = null;\n } else {\n // either id3Data null or PES truncated, keep it for next frag parsing\n id3Track.pesData = id3Data;\n }\n this.remux(level, sn, null, timeOffset);\n }\n }, {\n key: 'remux',\n value: function remux(level, sn, data, timeOffset) {\n var avcTrack = this._avcTrack,\n samples = avcTrack.samples;\n\n // compute total/avc sample length and nb of NAL units\n var trackData = samples.reduce(function (prevSampleData, curSample) {\n var sampleData = curSample.units.units.reduce(function (prevUnitData, curUnit) {\n return {\n len: prevUnitData.len + curUnit.data.length,\n nbNalu: prevUnitData.nbNalu + 1\n };\n }, { len: 0, nbNalu: 0 });\n curSample.length = sampleData.len;\n return {\n len: prevSampleData.len + sampleData.len,\n nbNalu: prevSampleData.nbNalu + sampleData.nbNalu\n };\n }, { len: 0, nbNalu: 0 });\n avcTrack.len = trackData.len;\n avcTrack.nbNalu = trackData.nbNalu;\n this.remuxer.remux(level, sn, this._aacTrack, this._avcTrack, this._id3Track, this._txtTrack, timeOffset, this.contiguous, this.accurateTimeOffset, data);\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.switchLevel();\n this._initPTS = this._initDTS = undefined;\n this._duration = 0;\n }\n }, {\n key: '_parsePAT',\n value: function _parsePAT(data, offset) {\n // skip the PSI header and parse the first PMT entry\n return (data[offset + 10] & 0x1F) << 8 | data[offset + 11];\n //logger.log('PMT PID:' + this._pmtId);\n }\n }, {\n key: '_parsePMT',\n value: function _parsePMT(data, offset) {\n var sectionLength,\n tableEnd,\n programInfoLength,\n pid,\n result = { aac: -1, avc: -1, id3: -1 };\n sectionLength = (data[offset + 1] & 0x0f) << 8 | data[offset + 2];\n tableEnd = offset + 3 + sectionLength - 4;\n // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n programInfoLength = (data[offset + 10] & 0x0f) << 8 | data[offset + 11];\n // advance the offset to the first entry in the mapping table\n offset += 12 + programInfoLength;\n while (offset < tableEnd) {\n pid = (data[offset + 1] & 0x1F) << 8 | data[offset + 2];\n switch (data[offset]) {\n // ISO/IEC 13818-7 ADTS AAC (MPEG-2 lower bit-rate audio)\n case 0x0f:\n //logger.log('AAC PID:' + pid);\n if (result.aac === -1) {\n result.aac = pid;\n }\n break;\n // Packetized metadata (ID3)\n case 0x15:\n //logger.log('ID3 PID:' + pid);\n if (result.id3 === -1) {\n result.id3 = pid;\n }\n break;\n // ITU-T Rec. H.264 and ISO/IEC 14496-10 (lower bit-rate video)\n case 0x1b:\n //logger.log('AVC PID:' + pid);\n if (result.avc === -1) {\n result.avc = pid;\n }\n break;\n case 0x24:\n _logger.logger.warn('HEVC stream type found, not supported for now');\n break;\n default:\n _logger.logger.log('unkown stream type:' + data[offset]);\n break;\n }\n // move to the next table entry\n // skip past the elementary stream descriptors, if present\n offset += ((data[offset + 3] & 0x0F) << 8 | data[offset + 4]) + 5;\n }\n return result;\n }\n }, {\n key: '_parsePES',\n value: function _parsePES(stream) {\n var i = 0,\n frag,\n pesFlags,\n pesPrefix,\n pesLen,\n pesHdrLen,\n pesData,\n pesPts,\n pesDts,\n payloadStartOffset,\n data = stream.data;\n // safety check\n if (!stream || stream.size === 0) {\n return null;\n }\n\n // we might need up to 19 bytes to read PES header\n // if first chunk of data is less than 19 bytes, let's merge it with following ones until we get 19 bytes\n // usually only one merge is needed (and this is rare ...)\n while (data[0].length < 19 && data.length > 1) {\n var newData = new Uint8Array(data[0].length + data[1].length);\n newData.set(data[0]);\n newData.set(data[1], data[0].length);\n data[0] = newData;\n data.splice(1, 1);\n }\n //retrieve PTS/DTS from first fragment\n frag = data[0];\n pesPrefix = (frag[0] << 16) + (frag[1] << 8) + frag[2];\n if (pesPrefix === 1) {\n pesLen = (frag[4] << 8) + frag[5];\n // if PES len is not zero and not matching with total len, stop parsing. PES might be truncated\n // minus 6 : PES header size\n if (pesLen && pesLen !== stream.size - 6) {\n return null;\n }\n pesFlags = frag[7];\n if (pesFlags & 0xC0) {\n /* PES header described here : http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n as PTS / DTS is 33 bit we cannot use bitwise operator in JS,\n as Bitwise operators treat their operands as a sequence of 32 bits */\n pesPts = (frag[9] & 0x0E) * 536870912 + // 1 << 29\n (frag[10] & 0xFF) * 4194304 + // 1 << 22\n (frag[11] & 0xFE) * 16384 + // 1 << 14\n (frag[12] & 0xFF) * 128 + // 1 << 7\n (frag[13] & 0xFE) / 2;\n // check if greater than 2^32 -1\n if (pesPts > 4294967295) {\n // decrement 2^33\n pesPts -= 8589934592;\n }\n if (pesFlags & 0x40) {\n pesDts = (frag[14] & 0x0E) * 536870912 + // 1 << 29\n (frag[15] & 0xFF) * 4194304 + // 1 << 22\n (frag[16] & 0xFE) * 16384 + // 1 << 14\n (frag[17] & 0xFF) * 128 + // 1 << 7\n (frag[18] & 0xFE) / 2;\n // check if greater than 2^32 -1\n if (pesDts > 4294967295) {\n // decrement 2^33\n pesDts -= 8589934592;\n }\n } else {\n pesDts = pesPts;\n }\n }\n pesHdrLen = frag[8];\n // 9 bytes : 6 bytes for PES header + 3 bytes for PES extension\n payloadStartOffset = pesHdrLen + 9;\n\n stream.size -= payloadStartOffset;\n //reassemble PES packet\n pesData = new Uint8Array(stream.size);\n while (data.length) {\n frag = data.shift();\n var len = frag.byteLength;\n if (payloadStartOffset) {\n if (payloadStartOffset > len) {\n // trim full frag if PES header bigger than frag\n payloadStartOffset -= len;\n continue;\n } else {\n // trim partial frag if PES header smaller than frag\n frag = frag.subarray(payloadStartOffset);\n len -= payloadStartOffset;\n payloadStartOffset = 0;\n }\n }\n pesData.set(frag, i);\n i += len;\n }\n if (pesLen) {\n // payload size : remove PES header + PES extension\n pesLen -= pesHdrLen + 3;\n }\n return { data: pesData, pts: pesPts, dts: pesDts, len: pesLen };\n } else {\n return null;\n }\n }\n }, {\n key: 'pushAccesUnit',\n value: function pushAccesUnit(avcSample, avcTrack) {\n if (avcSample.units.units.length) {\n // only push AVC sample if starting with a keyframe is not mandatory OR\n // if keyframe already found in this fragment OR\n // keyframe found in last fragment (track.sps) AND\n // samples already appended (we already found a keyframe in this fragment) OR fragment is contiguous\n if (!this.config.forceKeyFrameOnDiscontinuity || avcSample.key === true || avcTrack.sps && (avcTrack.samples.length || this.contiguous)) {\n avcTrack.samples.push(avcSample);\n } else {\n // dropped samples, track it\n avcTrack.dropped++;\n }\n }\n if (avcSample.debug.length) {\n _logger.logger.log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug + ',' + avcSample.units.length);\n }\n }\n }, {\n key: '_parseAVCPES',\n value: function _parseAVCPES(pes, last) {\n var _this = this;\n\n //logger.log('parse new PES');\n var track = this._avcTrack,\n units = this._parseAVCNALu(pes.data),\n debug = false,\n expGolombDecoder,\n avcSample = this.avcSample,\n push,\n i;\n //free pes.data to save up some memory\n pes.data = null;\n\n units.forEach(function (unit) {\n switch (unit.type) {\n //NDR\n case 1:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'NDR ';\n }\n break;\n //IDR\n case 5:\n push = true;\n // handle PES not starting with AUD\n if (!avcSample) {\n avcSample = _this.avcSample = _this._createAVCSample(true, pes.pts, pes.dts, '');\n }\n if (debug) {\n avcSample.debug += 'IDR ';\n }\n avcSample.key = true;\n break;\n //SEI\n case 6:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'SEI ';\n }\n expGolombDecoder = new _expGolomb2.default(_this.discardEPB(unit.data));\n\n // skip frameType\n expGolombDecoder.readUByte();\n\n var payloadType = 0;\n var payloadSize = 0;\n var endOfCaptions = false;\n var b = 0;\n\n while (!endOfCaptions && expGolombDecoder.bytesAvailable > 1) {\n payloadType = 0;\n do {\n b = expGolombDecoder.readUByte();\n payloadType += b;\n } while (b === 0xFF);\n\n // Parse payload size.\n payloadSize = 0;\n do {\n b = expGolombDecoder.readUByte();\n payloadSize += b;\n } while (b === 0xFF);\n\n // TODO: there can be more than one payload in an SEI packet...\n // TODO: need to read type and size in a while loop to get them all\n if (payloadType === 4 && expGolombDecoder.bytesAvailable !== 0) {\n\n endOfCaptions = true;\n\n var countryCode = expGolombDecoder.readUByte();\n\n if (countryCode === 181) {\n var providerCode = expGolombDecoder.readUShort();\n\n if (providerCode === 49) {\n var userStructure = expGolombDecoder.readUInt();\n\n if (userStructure === 0x47413934) {\n var userDataType = expGolombDecoder.readUByte();\n\n // Raw CEA-608 bytes wrapped in CEA-708 packet\n if (userDataType === 3) {\n var firstByte = expGolombDecoder.readUByte();\n var secondByte = expGolombDecoder.readUByte();\n\n var totalCCs = 31 & firstByte;\n var byteArray = [firstByte, secondByte];\n\n for (i = 0; i < totalCCs; i++) {\n // 3 bytes per CC\n byteArray.push(expGolombDecoder.readUByte());\n byteArray.push(expGolombDecoder.readUByte());\n byteArray.push(expGolombDecoder.readUByte());\n }\n\n _this._insertSampleInOrder(_this._txtTrack.samples, { type: 3, pts: pes.pts, bytes: byteArray });\n }\n }\n }\n }\n } else if (payloadSize < expGolombDecoder.bytesAvailable) {\n for (i = 0; i < payloadSize; i++) {\n expGolombDecoder.readUByte();\n }\n }\n }\n break;\n //SPS\n case 7:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'SPS ';\n }\n if (!track.sps) {\n expGolombDecoder = new _expGolomb2.default(unit.data);\n var config = expGolombDecoder.readSPS();\n track.width = config.width;\n track.height = config.height;\n track.sps = [unit.data];\n track.duration = _this._duration;\n var codecarray = unit.data.subarray(1, 4);\n var codecstring = 'avc1.';\n for (i = 0; i < 3; i++) {\n var h = codecarray[i].toString(16);\n if (h.length < 2) {\n h = '0' + h;\n }\n codecstring += h;\n }\n track.codec = codecstring;\n }\n break;\n //PPS\n case 8:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'PPS ';\n }\n if (!track.pps) {\n track.pps = [unit.data];\n }\n break;\n // AUD\n case 9:\n push = false;\n if (avcSample) {\n _this.pushAccesUnit(avcSample, track);\n }\n avcSample = _this.avcSample = _this._createAVCSample(false, pes.pts, pes.dts, debug ? 'AUD ' : '');\n break;\n // Filler Data\n case 12:\n push = false;\n break;\n default:\n push = false;\n if (avcSample) {\n avcSample.debug += 'unknown NAL ' + unit.type + ' ';\n }\n break;\n }\n if (avcSample && push) {\n var _units = avcSample.units;\n _units.units.push(unit);\n }\n });\n // if last PES packet, push samples\n if (last && avcSample) {\n this.pushAccesUnit(avcSample, track);\n this.avcSample = null;\n }\n }\n }, {\n key: '_createAVCSample',\n value: function _createAVCSample(key, pts, dts, debug) {\n return { key: key, pts: pts, dts: dts, units: { units: [], length: 0 }, debug: debug };\n }\n }, {\n key: '_insertSampleInOrder',\n value: function _insertSampleInOrder(arr, data) {\n var len = arr.length;\n if (len > 0) {\n if (data.pts >= arr[len - 1].pts) {\n arr.push(data);\n } else {\n for (var pos = len - 1; pos >= 0; pos--) {\n if (data.pts < arr[pos].pts) {\n arr.splice(pos, 0, data);\n break;\n }\n }\n }\n } else {\n arr.push(data);\n }\n }\n }, {\n key: '_getLastNalUnit',\n value: function _getLastNalUnit() {\n var avcSample = this.avcSample,\n lastUnit = void 0;\n // try to fallback to previous sample if current one is empty\n if (!avcSample || avcSample.units.units.length === 0) {\n var track = this._avcTrack,\n samples = track.samples;\n avcSample = samples[samples.length - 1];\n }\n if (avcSample) {\n var units = avcSample.units.units;\n lastUnit = units[units.length - 1];\n }\n return lastUnit;\n }\n }, {\n key: '_parseAVCNALu',\n value: function _parseAVCNALu(array) {\n var i = 0,\n len = array.byteLength,\n value,\n overflow,\n track = this._avcTrack,\n state = track.naluState || 0,\n lastState = state;\n var units = [],\n unit,\n unitType,\n lastUnitStart = -1,\n lastUnitType;\n //logger.log('PES:' + Hex.hexDump(array));\n while (i < len) {\n value = array[i++];\n // finding 3 or 4-byte start codes (00 00 01 OR 00 00 00 01)\n switch (state) {\n case 0:\n if (value === 0) {\n state = 1;\n }\n break;\n case 1:\n if (value === 0) {\n state = 2;\n } else {\n state = 0;\n }\n break;\n case 2:\n case 3:\n if (value === 0) {\n state = 3;\n } else if (value === 1) {\n if (lastUnitStart >= 0) {\n unit = { data: array.subarray(lastUnitStart, i - state - 1), type: lastUnitType };\n //logger.log('pushing NALU, type/size:' + unit.type + '/' + unit.data.byteLength);\n units.push(unit);\n } else {\n // lastUnitStart is undefined => this is the first start code found in this PES packet\n // first check if start code delimiter is overlapping between 2 PES packets,\n // ie it started in last packet (lastState not zero)\n // and ended at the beginning of this PES packet (i <= 4 - lastState)\n var lastUnit = this._getLastNalUnit();\n if (lastUnit) {\n if (lastState && i <= 4 - lastState) {\n // start delimiter overlapping between PES packets\n // strip start delimiter bytes from the end of last NAL unit\n // check if lastUnit had a state different from zero\n if (lastUnit.state) {\n // strip last bytes\n lastUnit.data = lastUnit.data.subarray(0, lastUnit.data.byteLength - lastState);\n }\n }\n // If NAL units are not starting right at the beginning of the PES packet, push preceding data into previous NAL unit.\n overflow = i - state - 1;\n if (overflow > 0) {\n //logger.log('first NALU found with overflow:' + overflow);\n var tmp = new Uint8Array(lastUnit.data.byteLength + overflow);\n tmp.set(lastUnit.data, 0);\n tmp.set(array.subarray(0, overflow), lastUnit.data.byteLength);\n lastUnit.data = tmp;\n }\n }\n }\n // check if we can read unit type\n if (i < len) {\n unitType = array[i] & 0x1f;\n //logger.log('find NALU @ offset:' + i + ',type:' + unitType);\n lastUnitStart = i;\n lastUnitType = unitType;\n state = 0;\n } else {\n // not enough byte to read unit type. let's read it on next PES parsing\n state = -1;\n }\n } else {\n state = 0;\n }\n break;\n case -1:\n // special use case where we found 3 or 4-byte start codes exactly at the end of previous PES packet\n lastUnitStart = 0;\n // NALu type is value read from offset 0\n lastUnitType = value & 0x1f;\n state = 0;\n break;\n default:\n break;\n }\n }\n if (lastUnitStart >= 0 && state >= 0) {\n unit = { data: array.subarray(lastUnitStart, len), type: lastUnitType, state: state };\n units.push(unit);\n //logger.log('pushing NALU, type/size/state:' + unit.type + '/' + unit.data.byteLength + '/' + state);\n }\n // no NALu found\n if (units.length === 0) {\n // append pes.data to previous NAL unit\n var _lastUnit = this._getLastNalUnit();\n if (_lastUnit) {\n var _tmp = new Uint8Array(_lastUnit.data.byteLength + array.byteLength);\n _tmp.set(_lastUnit.data, 0);\n _tmp.set(array, _lastUnit.data.byteLength);\n _lastUnit.data = _tmp;\n }\n }\n track.naluState = state;\n return units;\n }\n\n /**\n * remove Emulation Prevention bytes from a RBSP\n */\n\n }, {\n key: 'discardEPB',\n value: function discardEPB(data) {\n var length = data.byteLength,\n EPBPositions = [],\n i = 1,\n newLength,\n newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n EPBPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n }\n\n // If no Emulation Prevention Bytes were found just return the original\n // array\n if (EPBPositions.length === 0) {\n return data;\n }\n\n // Create a new array to hold the NAL unit data\n newLength = length - EPBPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === EPBPositions[0]) {\n // Skip this byte\n sourceIndex++;\n // Remove this position index\n EPBPositions.shift();\n }\n newData[i] = data[sourceIndex];\n }\n return newData;\n }\n }, {\n key: '_parseAACPES',\n value: function _parseAACPES(pes) {\n var track = this._aacTrack,\n data = pes.data,\n pts = pes.pts,\n startOffset = 0,\n aacOverFlow = this.aacOverFlow,\n aacLastPTS = this.aacLastPTS,\n config,\n frameLength,\n frameDuration,\n frameIndex,\n offset,\n headerLength,\n stamp,\n len,\n aacSample;\n if (aacOverFlow) {\n var tmp = new Uint8Array(aacOverFlow.byteLength + data.byteLength);\n tmp.set(aacOverFlow, 0);\n tmp.set(data, aacOverFlow.byteLength);\n //logger.log(`AAC: append overflowing ${aacOverFlow.byteLength} bytes to beginning of new PES`);\n data = tmp;\n }\n // look for ADTS header (0xFFFx)\n for (offset = startOffset, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n // if ADTS header does not start straight from the beginning of the PES payload, raise an error\n if (offset) {\n var reason, fatal;\n if (offset < len - 1) {\n reason = 'AAC PES did not start with ADTS header,offset:' + offset;\n fatal = false;\n } else {\n reason = 'no ADTS header found in AAC PES';\n fatal = true;\n }\n _logger.logger.warn('parsing error:' + reason);\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason });\n if (fatal) {\n return;\n }\n }\n if (!track.audiosamplerate) {\n config = _adts2.default.getAudioConfig(this.observer, data, offset, this.audioCodec);\n track.config = config.config;\n track.audiosamplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.duration = this._duration;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.audiosamplerate;\n\n // if last AAC frame is overflowing, we should ensure timestamps are contiguous:\n // first sample PTS should be equal to last sample PTS + frameDuration\n if (aacOverFlow && aacLastPTS) {\n var newPTS = aacLastPTS + frameDuration;\n if (Math.abs(newPTS - pts) > 1) {\n _logger.logger.log('AAC: align PTS for overlapping frames by ' + Math.round((newPTS - pts) / 90));\n pts = newPTS;\n }\n }\n\n while (offset + 5 < len) {\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;\n // retrieve frame size\n frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n frameLength -= headerLength;\n //stamp = pes.pts;\n\n if (frameLength > 0 && offset + headerLength + frameLength <= len) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n track.samples.push(aacSample);\n track.len += frameLength;\n offset += frameLength + headerLength;\n frameIndex++;\n // look for ADTS header (0xFFFx)\n for (; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n } else {\n break;\n }\n }\n if (offset < len) {\n aacOverFlow = data.subarray(offset, len);\n //logger.log(`AAC: overflow detected:${len-offset}`);\n } else {\n aacOverFlow = null;\n }\n this.aacOverFlow = aacOverFlow;\n this.aacLastPTS = stamp;\n }\n }, {\n key: '_parseID3PES',\n value: function _parseID3PES(pes) {\n this._id3Track.samples.push(pes);\n }\n }], [{\n key: 'probe',\n value: function probe(data) {\n // a TS fragment should contain at least 3 TS packets, a PAT, a PMT, and one PID, each starting with 0x47\n if (data.length >= 3 * 188 && data[0] === 0x47 && data[188] === 0x47 && data[2 * 188] === 0x47) {\n return true;\n } else {\n return false;\n }\n }\n }]);\n\n return TSDemuxer;\n}();\n\nexports.default = TSDemuxer;\n\n},{\"17\":17,\"21\":21,\"24\":24,\"26\":26,\"43\":43}],24:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar ErrorTypes = exports.ErrorTypes = {\n // Identifier for a network error (loading error / timeout ...)\n NETWORK_ERROR: 'networkError',\n // Identifier for a media Error (video/parsing/mediasource error)\n MEDIA_ERROR: 'mediaError',\n // Identifier for all other errors\n OTHER_ERROR: 'otherError'\n};\n\nvar ErrorDetails = exports.ErrorDetails = {\n // Identifier for a manifest load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n MANIFEST_LOAD_ERROR: 'manifestLoadError',\n // Identifier for a manifest load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n MANIFEST_LOAD_TIMEOUT: 'manifestLoadTimeOut',\n // Identifier for a manifest parsing error - data: { url : faulty URL, reason : error reason}\n MANIFEST_PARSING_ERROR: 'manifestParsingError',\n // Identifier for a manifest with only incompatible codecs error - data: { url : faulty URL, reason : error reason}\n MANIFEST_INCOMPATIBLE_CODECS_ERROR: 'manifestIncompatibleCodecsError',\n // Identifier for a level load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n LEVEL_LOAD_ERROR: 'levelLoadError',\n // Identifier for a level load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n LEVEL_LOAD_TIMEOUT: 'levelLoadTimeOut',\n // Identifier for a level switch error - data: { level : faulty level Id, event : error description}\n LEVEL_SWITCH_ERROR: 'levelSwitchError',\n // Identifier for an audio track load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n AUDIO_TRACK_LOAD_ERROR: 'audioTrackLoadError',\n // Identifier for an audio track load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n AUDIO_TRACK_LOAD_TIMEOUT: 'audioTrackLoadTimeOut',\n // Identifier for fragment load error - data: { frag : fragment object, response : { code: error code, text: error text }}\n FRAG_LOAD_ERROR: 'fragLoadError',\n // Identifier for fragment loop loading error - data: { frag : fragment object}\n FRAG_LOOP_LOADING_ERROR: 'fragLoopLoadingError',\n // Identifier for fragment load timeout error - data: { frag : fragment object}\n FRAG_LOAD_TIMEOUT: 'fragLoadTimeOut',\n // Identifier for a fragment decryption error event - data: parsing error description\n FRAG_DECRYPT_ERROR: 'fragDecryptError',\n // Identifier for a fragment parsing error event - data: parsing error description\n FRAG_PARSING_ERROR: 'fragParsingError',\n // Identifier for decrypt key load error - data: { frag : fragment object, response : { code: error code, text: error text }}\n KEY_LOAD_ERROR: 'keyLoadError',\n // Identifier for decrypt key load timeout error - data: { frag : fragment object}\n KEY_LOAD_TIMEOUT: 'keyLoadTimeOut',\n // Triggered when an exception occurs while adding a sourceBuffer to MediaSource - data : { err : exception , mimeType : mimeType }\n BUFFER_ADD_CODEC_ERROR: 'bufferAddCodecError',\n // Identifier for a buffer append error - data: append error description\n BUFFER_APPEND_ERROR: 'bufferAppendError',\n // Identifier for a buffer appending error event - data: appending error description\n BUFFER_APPENDING_ERROR: 'bufferAppendingError',\n // Identifier for a buffer stalled error event\n BUFFER_STALLED_ERROR: 'bufferStalledError',\n // Identifier for a buffer full event\n BUFFER_FULL_ERROR: 'bufferFullError',\n // Identifier for a buffer seek over hole event\n BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole',\n // Identifier for an internal exception happening inside hls.js while handling an event\n INTERNAL_EXCEPTION: 'internalException'\n};\n\n},{}],25:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n *\n * All objects in the event handling chain should inherit from this class\n *\n */\n\nvar _logger = _dereq_(43);\n\nvar _errors = _dereq_(24);\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar EventHandler = function () {\n function EventHandler(hls) {\n _classCallCheck(this, EventHandler);\n\n this.hls = hls;\n this.onEvent = this.onEvent.bind(this);\n\n for (var _len = arguments.length, events = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n events[_key - 1] = arguments[_key];\n }\n\n this.handledEvents = events;\n this.useGenericHandler = true;\n\n this.registerListeners();\n }\n\n _createClass(EventHandler, [{\n key: 'destroy',\n value: function destroy() {\n this.unregisterListeners();\n }\n }, {\n key: 'isEventHandler',\n value: function isEventHandler() {\n return _typeof(this.handledEvents) === 'object' && this.handledEvents.length && typeof this.onEvent === 'function';\n }\n }, {\n key: 'registerListeners',\n value: function registerListeners() {\n if (this.isEventHandler()) {\n this.handledEvents.forEach(function (event) {\n if (event === 'hlsEventGeneric') {\n throw new Error('Forbidden event name: ' + event);\n }\n this.hls.on(event, this.onEvent);\n }.bind(this));\n }\n }\n }, {\n key: 'unregisterListeners',\n value: function unregisterListeners() {\n if (this.isEventHandler()) {\n this.handledEvents.forEach(function (event) {\n this.hls.off(event, this.onEvent);\n }.bind(this));\n }\n }\n\n /**\n * arguments: event (string), data (any)\n */\n\n }, {\n key: 'onEvent',\n value: function onEvent(event, data) {\n this.onEventGeneric(event, data);\n }\n }, {\n key: 'onEventGeneric',\n value: function onEventGeneric(event, data) {\n var eventToFunction = function eventToFunction(event, data) {\n var funcName = 'on' + event.replace('hls', '');\n if (typeof this[funcName] !== 'function') {\n throw new Error('Event ' + event + ' has no generic handler in this ' + this.constructor.name + ' class (tried ' + funcName + ')');\n }\n return this[funcName].bind(this, data);\n };\n try {\n eventToFunction.call(this, event, data).call();\n } catch (err) {\n _logger.logger.error('internal error happened while processing ' + event + ':' + err.message);\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event: event, err: err });\n }\n }\n }]);\n\n return EventHandler;\n}();\n\nexports.default = EventHandler;\n\n},{\"24\":24,\"26\":26,\"43\":43}],26:[function(_dereq_,module,exports){\n'use strict';\n\nmodule.exports = {\n // fired before MediaSource is attaching to media element - data: { media }\n MEDIA_ATTACHING: 'hlsMediaAttaching',\n // fired when MediaSource has been succesfully attached to media element - data: { }\n MEDIA_ATTACHED: 'hlsMediaAttached',\n // fired before detaching MediaSource from media element - data: { }\n MEDIA_DETACHING: 'hlsMediaDetaching',\n // fired when MediaSource has been detached from media element - data: { }\n MEDIA_DETACHED: 'hlsMediaDetached',\n // fired when we buffer is going to be resetted\n BUFFER_RESET: 'hlsBufferReset',\n // fired when we know about the codecs that we need buffers for to push into - data: {tracks : { container, codec, levelCodec, initSegment, metadata }}\n BUFFER_CODECS: 'hlsBufferCodecs',\n // fired when sourcebuffers have been created data: { tracks : tracks}\n BUFFER_CREATED: 'hlsBufferCreated',\n // fired when we append a segment to the buffer - data: { segment: segment object }\n BUFFER_APPENDING: 'hlsBufferAppending',\n // fired when we are done with appending a media segment to the buffer data : { parent : segment parent that triggered BUFFER_APPENDING }\n BUFFER_APPENDED: 'hlsBufferAppended',\n // fired when the stream is finished and we want to notify the media buffer that there will be no more data\n BUFFER_EOS: 'hlsBufferEos',\n // fired when the media buffer should be flushed - data {startOffset, endOffset}\n BUFFER_FLUSHING: 'hlsBufferFlushing',\n // fired when the media has been flushed\n BUFFER_FLUSHED: 'hlsBufferFlushed',\n // fired to signal that a manifest loading starts - data: { url : manifestURL}\n MANIFEST_LOADING: 'hlsManifestLoading',\n // fired after manifest has been loaded - data: { levels : [available quality levels] , audioTracks : [ available audio tracks], url : manifestURL, stats : { trequest, tfirst, tload, mtime}}\n MANIFEST_LOADED: 'hlsManifestLoaded',\n // fired after manifest has been parsed - data: { levels : [available quality levels] , firstLevel : index of first quality level appearing in Manifest}\n MANIFEST_PARSED: 'hlsManifestParsed',\n // fired when a level playlist loading starts - data: { url : level URL level : id of level being loaded}\n LEVEL_LOADING: 'hlsLevelLoading',\n // fired when a level playlist loading finishes - data: { details : levelDetails object, level : id of loaded level, stats : { trequest, tfirst, tload, mtime} }\n LEVEL_LOADED: 'hlsLevelLoaded',\n // fired when a level's details have been updated based on previous details, after it has been loaded. - data: { details : levelDetails object, level : id of updated level }\n LEVEL_UPDATED: 'hlsLevelUpdated',\n // fired when a level's PTS information has been updated after parsing a fragment - data: { details : levelDetails object, level : id of updated level, drift: PTS drift observed when parsing last fragment }\n LEVEL_PTS_UPDATED: 'hlsLevelPtsUpdated',\n // fired when a level switch is requested - data: { level : id of new level }\n LEVEL_SWITCH: 'hlsLevelSwitch',\n // fired to notify that audio track lists has been updated data: { audioTracks : audioTracks}\n AUDIO_TRACKS_UPDATED: 'hlsAudioTracksUpdated',\n // fired when an audio track switch occurs - data: { id : audio track id}\n AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',\n // fired when an audio track loading starts - data: { url : audio track URL id : audio track id}\n AUDIO_TRACK_LOADING: 'hlsAudioTrackLoading',\n // fired when an audio track loading finishes - data: { details : levelDetails object, id : audio track id, stats : { trequest, tfirst, tload, mtime} }\n AUDIO_TRACK_LOADED: 'hlsAudioTrackLoaded',\n // fired when a fragment loading starts - data: { frag : fragment object}\n FRAG_LOADING: 'hlsFragLoading',\n // fired when a fragment loading is progressing - data: { frag : fragment object, { trequest, tfirst, loaded}}\n FRAG_LOAD_PROGRESS: 'hlsFragLoadProgress',\n // Identifier for fragment load aborting for emergency switch down - data: {frag : fragment object}\n FRAG_LOAD_EMERGENCY_ABORTED: 'hlsFragLoadEmergencyAborted',\n // fired when a fragment loading is completed - data: { frag : fragment object, payload : fragment payload, stats : { trequest, tfirst, tload, length}}\n FRAG_LOADED: 'hlsFragLoaded',\n // fired when Init Segment has been extracted from fragment - data: { id : demuxer id, level : levelId, sn : sequence number, moov : moov MP4 box, codecs : codecs found while parsing fragment}\n FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n // fired when parsing sei text is completed - data: { id : demuxer id, , level : levelId, sn : sequence number, samples : [ sei samples pes ] }\n FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',\n // fired when parsing id3 is completed - data: { id : demuxer id, , level : levelId, sn : sequence number, samples : [ id3 samples pes ] }\n FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',\n // fired when data have been extracted from fragment - data: { id : demuxer id, level : levelId, sn : sequence number, data1 : moof MP4 box or TS fragments, data2 : mdat MP4 box or null}\n FRAG_PARSING_DATA: 'hlsFragParsingData',\n // fired when fragment parsing is completed - data: { id : demuxer id; level : levelId, sn : sequence number, }\n FRAG_PARSED: 'hlsFragParsed',\n // fired when fragment remuxed MP4 boxes have all been appended into SourceBuffer - data: { id : demuxer id,frag : fragment object, stats : { trequest, tfirst, tload, tparsed, tbuffered, length} }\n FRAG_BUFFERED: 'hlsFragBuffered',\n // fired when fragment matching with current media position is changing - data : { id : demuxer id, frag : fragment object }\n FRAG_CHANGED: 'hlsFragChanged',\n // Identifier for a FPS drop event - data: {curentDropped, currentDecoded, totalDroppedFrames}\n FPS_DROP: 'hlsFpsDrop',\n //triggered when FPS drop triggers auto level capping - data: {level, droppedlevel}\n FPS_DROP_LEVEL_CAPPING: 'hlsFpsDropLevelCapping',\n // Identifier for an error event - data: { type : error type, details : error details, fatal : if true, hls.js cannot/will not try to recover, if false, hls.js will try to recover,other error specific data}\n ERROR: 'hlsError',\n // fired when hls.js instance starts destroying. Different from MEDIA_DETACHED as one could want to detach and reattach a media to the instance of hls.js to handle mid-rolls for example\n DESTROYING: 'hlsDestroying',\n // fired when a decrypt key loading starts - data: { frag : fragment object}\n KEY_LOADING: 'hlsKeyLoading',\n // fired when a decrypt key loading is completed - data: { frag : fragment object, payload : key payload, stats : { trequest, tfirst, tload, length}}\n KEY_LOADED: 'hlsKeyLoaded',\n // fired upon stream controller state transitions - data: {previousState, nextState}\n STREAM_STATE_TRANSITION: 'hlsStreamStateTransition'\n};\n\n},{}],27:[function(_dereq_,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * AAC helper\n */\n\nvar AAC = function () {\n function AAC() {\n _classCallCheck(this, AAC);\n }\n\n _createClass(AAC, null, [{\n key: \"getSilentFrame\",\n value: function getSilentFrame(channelCount) {\n if (channelCount === 1) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x23, 0x80]);\n } else if (channelCount === 2) {\n return new Uint8Array([0x21, 0x00, 0x49, 0x90, 0x02, 0x19, 0x00, 0x23, 0x80]);\n } else if (channelCount === 3) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x8e]);\n } else if (channelCount === 4) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x80, 0x2c, 0x80, 0x08, 0x02, 0x38]);\n } else if (channelCount === 5) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x38]);\n } else if (channelCount === 6) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x00, 0xb2, 0x00, 0x20, 0x08, 0xe0]);\n }\n return null;\n }\n }]);\n\n return AAC;\n}();\n\nexports.default = AAC;\n\n},{}],28:[function(_dereq_,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Buffer Helper class, providing methods dealing buffer length retrieval\n*/\n\nvar BufferHelper = function () {\n function BufferHelper() {\n _classCallCheck(this, BufferHelper);\n }\n\n _createClass(BufferHelper, null, [{\n key: \"isBuffered\",\n value: function isBuffered(media, position) {\n if (media) {\n var buffered = media.buffered;\n for (var i = 0; i < buffered.length; i++) {\n if (position >= buffered.start(i) && position <= buffered.end(i)) {\n return true;\n }\n }\n }\n return false;\n }\n }, {\n key: \"bufferInfo\",\n value: function bufferInfo(media, pos, maxHoleDuration) {\n if (media) {\n var vbuffered = media.buffered,\n buffered = [],\n i;\n for (i = 0; i < vbuffered.length; i++) {\n buffered.push({ start: vbuffered.start(i), end: vbuffered.end(i) });\n }\n return this.bufferedInfo(buffered, pos, maxHoleDuration);\n } else {\n return { len: 0, start: 0, end: 0, nextStart: undefined };\n }\n }\n }, {\n key: \"bufferedInfo\",\n value: function bufferedInfo(buffered, pos, maxHoleDuration) {\n var buffered2 = [],\n\n // bufferStart and bufferEnd are buffer boundaries around current video position\n bufferLen,\n bufferStart,\n bufferEnd,\n bufferStartNext,\n i;\n // sort on buffer.start/smaller end (IE does not always return sorted buffered range)\n buffered.sort(function (a, b) {\n var diff = a.start - b.start;\n if (diff) {\n return diff;\n } else {\n return b.end - a.end;\n }\n });\n // there might be some small holes between buffer time range\n // consider that holes smaller than maxHoleDuration are irrelevant and build another\n // buffer time range representations that discards those holes\n for (i = 0; i < buffered.length; i++) {\n var buf2len = buffered2.length;\n if (buf2len) {\n var buf2end = buffered2[buf2len - 1].end;\n // if small hole (value between 0 or maxHoleDuration ) or overlapping (negative)\n if (buffered[i].start - buf2end < maxHoleDuration) {\n // merge overlapping time ranges\n // update lastRange.end only if smaller than item.end\n // e.g. [ 1, 15] with [ 2,8] => [ 1,15] (no need to modify lastRange.end)\n // whereas [ 1, 8] with [ 2,15] => [ 1,15] ( lastRange should switch from [1,8] to [1,15])\n if (buffered[i].end > buf2end) {\n buffered2[buf2len - 1].end = buffered[i].end;\n }\n } else {\n // big hole\n buffered2.push(buffered[i]);\n }\n } else {\n // first value\n buffered2.push(buffered[i]);\n }\n }\n for (i = 0, bufferLen = 0, bufferStart = bufferEnd = pos; i < buffered2.length; i++) {\n var start = buffered2[i].start,\n end = buffered2[i].end;\n //logger.log('buf start/end:' + buffered.start(i) + '/' + buffered.end(i));\n if (pos + maxHoleDuration >= start && pos < end) {\n // play position is inside this buffer TimeRange, retrieve end of buffer position and buffer length\n bufferStart = start;\n bufferEnd = end;\n bufferLen = bufferEnd - pos;\n } else if (pos + maxHoleDuration < start) {\n bufferStartNext = start;\n break;\n }\n }\n return { len: bufferLen, start: bufferStart, end: bufferEnd, nextStart: bufferStartNext };\n }\n }]);\n\n return BufferHelper;\n}();\n\nexports.default = BufferHelper;\n\n},{}],29:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Level Helper class, providing methods dealing with playlist sliding and drift\n */\n\nvar _logger = _dereq_(43);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LevelHelper = function () {\n function LevelHelper() {\n _classCallCheck(this, LevelHelper);\n }\n\n _createClass(LevelHelper, null, [{\n key: 'mergeDetails',\n value: function mergeDetails(oldDetails, newDetails) {\n var start = Math.max(oldDetails.startSN, newDetails.startSN) - newDetails.startSN,\n end = Math.min(oldDetails.endSN, newDetails.endSN) - newDetails.startSN,\n delta = newDetails.startSN - oldDetails.startSN,\n oldfragments = oldDetails.fragments,\n newfragments = newDetails.fragments,\n ccOffset = 0,\n PTSFrag;\n\n // check if old/new playlists have fragments in common\n if (end < start) {\n newDetails.PTSKnown = false;\n return;\n }\n // loop through overlapping SN and update startPTS , cc, and duration if any found\n for (var i = start; i <= end; i++) {\n var oldFrag = oldfragments[delta + i],\n newFrag = newfragments[i];\n if (newFrag && oldFrag) {\n ccOffset = oldFrag.cc - newFrag.cc;\n if (!isNaN(oldFrag.startPTS)) {\n newFrag.start = newFrag.startPTS = oldFrag.startPTS;\n newFrag.endPTS = oldFrag.endPTS;\n newFrag.duration = oldFrag.duration;\n PTSFrag = newFrag;\n }\n }\n }\n\n if (ccOffset) {\n _logger.logger.log('discontinuity sliding from playlist, take drift into account');\n for (i = 0; i < newfragments.length; i++) {\n newfragments[i].cc += ccOffset;\n }\n }\n\n // if at least one fragment contains PTS info, recompute PTS information for all fragments\n if (PTSFrag) {\n LevelHelper.updateFragPTSDTS(newDetails, PTSFrag.sn, PTSFrag.startPTS, PTSFrag.endPTS, PTSFrag.startDTS, PTSFrag.endDTS);\n } else {\n // ensure that delta is within oldfragments range\n // also adjust sliding in case delta is 0 (we could have old=[50-60] and new=old=[50-61])\n // in that case we also need to adjust start offset of all fragments\n if (delta >= 0 && delta < oldfragments.length) {\n // adjust start by sliding offset\n var sliding = oldfragments[delta].start;\n for (i = 0; i < newfragments.length; i++) {\n newfragments[i].start += sliding;\n }\n }\n }\n // if we are here, it means we have fragments overlapping between\n // old and new level. reliable PTS info is thus relying on old level\n newDetails.PTSKnown = oldDetails.PTSKnown;\n return;\n }\n }, {\n key: 'updateFragPTSDTS',\n value: function updateFragPTSDTS(details, sn, startPTS, endPTS, startDTS, endDTS) {\n var fragIdx, fragments, frag, i;\n // exit if sn out of range\n if (sn < details.startSN || sn > details.endSN) {\n return 0;\n }\n fragIdx = sn - details.startSN;\n fragments = details.fragments;\n frag = fragments[fragIdx];\n if (!isNaN(frag.startPTS)) {\n // delta PTS between audio and video\n var deltaPTS = Math.abs(frag.startPTS - startPTS);\n if (isNaN(frag.deltaPTS)) {\n frag.deltaPTS = deltaPTS;\n } else {\n frag.deltaPTS = Math.max(deltaPTS, frag.deltaPTS);\n }\n startPTS = Math.min(startPTS, frag.startPTS);\n endPTS = Math.max(endPTS, frag.endPTS);\n startDTS = Math.min(startDTS, frag.startDTS);\n endDTS = Math.max(endDTS, frag.endDTS);\n }\n\n var drift = startPTS - frag.start;\n\n frag.start = frag.startPTS = startPTS;\n frag.endPTS = endPTS;\n frag.startDTS = startDTS;\n frag.endDTS = endDTS;\n frag.duration = endPTS - startPTS;\n // adjust fragment PTS/duration from seqnum-1 to frag 0\n for (i = fragIdx; i > 0; i--) {\n LevelHelper.updatePTS(fragments, i, i - 1);\n }\n\n // adjust fragment PTS/duration from seqnum to last frag\n for (i = fragIdx; i < fragments.length - 1; i++) {\n LevelHelper.updatePTS(fragments, i, i + 1);\n }\n details.PTSKnown = true;\n //logger.log(` frag start/end:${startPTS.toFixed(3)}/${endPTS.toFixed(3)}`);\n\n return drift;\n }\n }, {\n key: 'updatePTS',\n value: function updatePTS(fragments, fromIdx, toIdx) {\n var fragFrom = fragments[fromIdx],\n fragTo = fragments[toIdx],\n fragToPTS = fragTo.startPTS;\n // if we know startPTS[toIdx]\n if (!isNaN(fragToPTS)) {\n // update fragment duration.\n // it helps to fix drifts between playlist reported duration and fragment real duration\n if (toIdx > fromIdx) {\n fragFrom.duration = fragToPTS - fragFrom.start;\n if (fragFrom.duration < 0) {\n _logger.logger.warn('negative duration computed for frag ' + fragFrom.sn + ',level ' + fragFrom.level + ', there should be some duration drift between playlist and fragment!');\n }\n } else {\n fragTo.duration = fragFrom.start - fragToPTS;\n if (fragTo.duration < 0) {\n _logger.logger.warn('negative duration computed for frag ' + fragTo.sn + ',level ' + fragTo.level + ', there should be some duration drift between playlist and fragment!');\n }\n }\n } else {\n // we dont know startPTS[toIdx]\n if (toIdx > fromIdx) {\n fragTo.start = fragFrom.start + fragFrom.duration;\n } else {\n fragTo.start = fragFrom.start - fragTo.duration;\n }\n }\n }\n }]);\n\n return LevelHelper;\n}();\n\nexports.default = LevelHelper;\n\n},{\"43\":43}],30:[function(_dereq_,module,exports){\n/**\n * HLS interface\n */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n//import FetchLoader from './utils/fetch-loader';\n\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(24);\n\nvar _playlistLoader = _dereq_(34);\n\nvar _playlistLoader2 = _interopRequireDefault(_playlistLoader);\n\nvar _fragmentLoader = _dereq_(32);\n\nvar _fragmentLoader2 = _interopRequireDefault(_fragmentLoader);\n\nvar _abrController = _dereq_(3);\n\nvar _abrController2 = _interopRequireDefault(_abrController);\n\nvar _bufferController = _dereq_(6);\n\nvar _bufferController2 = _interopRequireDefault(_bufferController);\n\nvar _capLevelController = _dereq_(7);\n\nvar _capLevelController2 = _interopRequireDefault(_capLevelController);\n\nvar _audioStreamController = _dereq_(4);\n\nvar _audioStreamController2 = _interopRequireDefault(_audioStreamController);\n\nvar _streamController = _dereq_(11);\n\nvar _streamController2 = _interopRequireDefault(_streamController);\n\nvar _levelController = _dereq_(10);\n\nvar _levelController2 = _interopRequireDefault(_levelController);\n\nvar _timelineController = _dereq_(12);\n\nvar _timelineController2 = _interopRequireDefault(_timelineController);\n\nvar _fpsController = _dereq_(9);\n\nvar _fpsController2 = _interopRequireDefault(_fpsController);\n\nvar _audioTrackController = _dereq_(5);\n\nvar _audioTrackController2 = _interopRequireDefault(_audioTrackController);\n\nvar _logger = _dereq_(43);\n\nvar _xhrLoader = _dereq_(47);\n\nvar _xhrLoader2 = _interopRequireDefault(_xhrLoader);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\n\nvar _keyLoader = _dereq_(33);\n\nvar _keyLoader2 = _interopRequireDefault(_keyLoader);\n\nvar _cues = _dereq_(41);\n\nvar _cues2 = _interopRequireDefault(_cues);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Hls = function () {\n _createClass(Hls, null, [{\n key: 'isSupported',\n value: function isSupported() {\n return window.MediaSource && typeof window.MediaSource.isTypeSupported === 'function' && window.MediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n }\n }, {\n key: 'version',\n get: function get() {\n // replaced with browserify-versionify transform\n return '0.6.7';\n }\n }, {\n key: 'Events',\n get: function get() {\n return _events2.default;\n }\n }, {\n key: 'ErrorTypes',\n get: function get() {\n return _errors.ErrorTypes;\n }\n }, {\n key: 'ErrorDetails',\n get: function get() {\n return _errors.ErrorDetails;\n }\n }, {\n key: 'DefaultConfig',\n get: function get() {\n if (!Hls.defaultConfig) {\n Hls.defaultConfig = {\n autoStartLoad: true,\n startPosition: -1,\n defaultAudioCodec: undefined,\n debug: false,\n capLevelOnFPSDrop: false,\n capLevelToPlayerSize: false,\n maxBufferLength: 30,\n maxBufferSize: 60 * 1000 * 1000,\n maxBufferHole: 0.5,\n maxSeekHole: 2,\n seekHoleNudgeDuration: 0.01,\n stalledInBufferedNudgeThreshold: 10,\n maxFragLookUpTolerance: 0.2,\n liveSyncDurationCount: 3,\n liveMaxLatencyDurationCount: Infinity,\n liveSyncDuration: undefined,\n liveMaxLatencyDuration: undefined,\n maxMaxBufferLength: 600,\n enableWorker: true,\n enableSoftwareAES: true,\n manifestLoadingTimeOut: 10000,\n manifestLoadingMaxRetry: 1,\n manifestLoadingRetryDelay: 1000,\n manifestLoadingMaxRetryTimeout: 64000,\n startLevel: undefined,\n levelLoadingTimeOut: 10000,\n levelLoadingMaxRetry: 4,\n levelLoadingRetryDelay: 1000,\n levelLoadingMaxRetryTimeout: 64000,\n fragLoadingTimeOut: 20000,\n fragLoadingMaxRetry: 6,\n fragLoadingRetryDelay: 1000,\n fragLoadingMaxRetryTimeout: 64000,\n fragLoadingLoopThreshold: 3,\n startFragPrefetch: false,\n fpsDroppedMonitoringPeriod: 5000,\n fpsDroppedMonitoringThreshold: 0.2,\n appendErrorMaxRetry: 3,\n loader: _xhrLoader2.default,\n //loader: FetchLoader,\n fLoader: undefined,\n pLoader: undefined,\n xhrSetup: undefined,\n fetchSetup: undefined,\n abrController: _abrController2.default,\n bufferController: _bufferController2.default,\n capLevelController: _capLevelController2.default,\n fpsController: _fpsController2.default,\n streamController: _streamController2.default,\n audioStreamController: _audioStreamController2.default,\n timelineController: _timelineController2.default,\n cueHandler: _cues2.default,\n enableCEA708Captions: true,\n enableMP2TPassThrough: false,\n stretchShortVideoTrack: false,\n forceKeyFrameOnDiscontinuity: true,\n abrEwmaFastLive: 5,\n abrEwmaSlowLive: 9,\n abrEwmaFastVoD: 3,\n abrEwmaSlowVoD: 9,\n abrEwmaDefaultEstimate: 5e5, // 500 kbps\n abrBandWidthFactor: 0.8,\n abrBandWidthUpFactor: 0.7,\n maxStarvationDelay: 4,\n maxLoadingDelay: 4,\n minAutoBitrate: 0\n };\n }\n return Hls.defaultConfig;\n },\n set: function set(defaultConfig) {\n Hls.defaultConfig = defaultConfig;\n }\n }]);\n\n function Hls() {\n var config = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n _classCallCheck(this, Hls);\n\n var defaultConfig = Hls.DefaultConfig;\n\n if ((config.liveSyncDurationCount || config.liveMaxLatencyDurationCount) && (config.liveSyncDuration || config.liveMaxLatencyDuration)) {\n throw new Error('Illegal hls.js config: don\\'t mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration');\n }\n\n for (var prop in defaultConfig) {\n if (prop in config) {\n continue;\n }\n config[prop] = defaultConfig[prop];\n }\n\n if (config.liveMaxLatencyDurationCount !== undefined && config.liveMaxLatencyDurationCount <= config.liveSyncDurationCount) {\n throw new Error('Illegal hls.js config: \"liveMaxLatencyDurationCount\" must be gt \"liveSyncDurationCount\"');\n }\n\n if (config.liveMaxLatencyDuration !== undefined && (config.liveMaxLatencyDuration <= config.liveSyncDuration || config.liveSyncDuration === undefined)) {\n throw new Error('Illegal hls.js config: \"liveMaxLatencyDuration\" must be gt \"liveSyncDuration\"');\n }\n\n (0, _logger.enableLogs)(config.debug);\n this.config = config;\n // observer setup\n var observer = this.observer = new _events4.default();\n observer.trigger = function trigger(event) {\n for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n\n observer.emit.apply(observer, [event, event].concat(data));\n };\n\n observer.off = function off(event) {\n for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n data[_key2 - 1] = arguments[_key2];\n }\n\n observer.removeListener.apply(observer, [event].concat(data));\n };\n this.on = observer.on.bind(observer);\n this.off = observer.off.bind(observer);\n this.trigger = observer.trigger.bind(observer);\n this.playlistLoader = new _playlistLoader2.default(this);\n this.fragmentLoader = new _fragmentLoader2.default(this);\n this.levelController = new _levelController2.default(this);\n this.abrController = new config.abrController(this);\n this.bufferController = new config.bufferController(this);\n this.capLevelController = new config.capLevelController(this);\n this.fpsController = new config.fpsController(this);\n this.streamController = new config.streamController(this);\n this.audioStreamController = new config.audioStreamController(this);\n this.timelineController = new config.timelineController(this);\n this.audioTrackController = new _audioTrackController2.default(this);\n this.keyLoader = new _keyLoader2.default(this);\n }\n\n _createClass(Hls, [{\n key: 'destroy',\n value: function destroy() {\n _logger.logger.log('destroy');\n this.trigger(_events2.default.DESTROYING);\n this.detachMedia();\n this.playlistLoader.destroy();\n this.fragmentLoader.destroy();\n this.levelController.destroy();\n this.abrController.destroy();\n this.bufferController.destroy();\n this.capLevelController.destroy();\n this.fpsController.destroy();\n this.streamController.destroy();\n this.audioStreamController.destroy();\n this.timelineController.destroy();\n this.audioTrackController.destroy();\n this.keyLoader.destroy();\n this.url = null;\n this.observer.removeAllListeners();\n }\n }, {\n key: 'attachMedia',\n value: function attachMedia(media) {\n _logger.logger.log('attachMedia');\n this.media = media;\n this.trigger(_events2.default.MEDIA_ATTACHING, { media: media });\n }\n }, {\n key: 'detachMedia',\n value: function detachMedia() {\n _logger.logger.log('detachMedia');\n this.trigger(_events2.default.MEDIA_DETACHING);\n this.media = null;\n }\n }, {\n key: 'loadSource',\n value: function loadSource(url) {\n _logger.logger.log('loadSource:' + url);\n this.url = url;\n // when attaching to a source URL, trigger a playlist load\n this.trigger(_events2.default.MANIFEST_LOADING, { url: url });\n }\n }, {\n key: 'startLoad',\n value: function startLoad() {\n var startPosition = arguments.length <= 0 || arguments[0] === undefined ? -1 : arguments[0];\n\n _logger.logger.log('startLoad');\n this.levelController.startLoad();\n this.streamController.startLoad(startPosition);\n this.audioStreamController.startLoad(startPosition);\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n _logger.logger.log('stopLoad');\n this.levelController.stopLoad();\n this.streamController.stopLoad();\n this.audioStreamController.stopLoad();\n }\n }, {\n key: 'swapAudioCodec',\n value: function swapAudioCodec() {\n _logger.logger.log('swapAudioCodec');\n this.streamController.swapAudioCodec();\n }\n }, {\n key: 'recoverMediaError',\n value: function recoverMediaError() {\n _logger.logger.log('recoverMediaError');\n var media = this.media;\n this.detachMedia();\n this.attachMedia(media);\n }\n\n /** Return all quality levels **/\n\n }, {\n key: 'levels',\n get: function get() {\n return this.levelController.levels;\n }\n\n /** Return current playback quality level **/\n\n }, {\n key: 'currentLevel',\n get: function get() {\n return this.streamController.currentLevel;\n }\n\n /* set quality level immediately (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set currentLevel:' + newLevel);\n this.loadLevel = newLevel;\n this.streamController.immediateLevelSwitch();\n }\n\n /** Return next playback quality level (quality level of next fragment) **/\n\n }, {\n key: 'nextLevel',\n get: function get() {\n return this.streamController.nextLevel;\n }\n\n /* set quality level for next fragment (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set nextLevel:' + newLevel);\n this.levelController.manualLevel = newLevel;\n this.streamController.nextLevelSwitch();\n }\n\n /** Return the quality level of current/last loaded fragment **/\n\n }, {\n key: 'loadLevel',\n get: function get() {\n return this.levelController.level;\n }\n\n /* set quality level for current/next loaded fragment (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set loadLevel:' + newLevel);\n this.levelController.manualLevel = newLevel;\n }\n\n /** Return the quality level of next loaded fragment **/\n\n }, {\n key: 'nextLoadLevel',\n get: function get() {\n return this.levelController.nextLoadLevel;\n }\n\n /** set quality level of next loaded fragment **/\n ,\n set: function set(level) {\n this.levelController.nextLoadLevel = level;\n }\n\n /** Return first level (index of first level referenced in manifest)\n **/\n\n }, {\n key: 'firstLevel',\n get: function get() {\n return this.levelController.firstLevel;\n }\n\n /** set first level (index of first level referenced in manifest)\n **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set firstLevel:' + newLevel);\n this.levelController.firstLevel = newLevel;\n }\n\n /** Return start level (level of first fragment that will be played back)\n if not overrided by user, first level appearing in manifest will be used as start level\n if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)\n **/\n\n }, {\n key: 'startLevel',\n get: function get() {\n return this.levelController.startLevel;\n }\n\n /** set start level (level of first fragment that will be played back)\n if not overrided by user, first level appearing in manifest will be used as start level\n if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)\n **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set startLevel:' + newLevel);\n this.levelController.startLevel = newLevel;\n }\n\n /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n\n }, {\n key: 'autoLevelCapping',\n get: function get() {\n return this.abrController.autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set autoLevelCapping:' + newLevel);\n this.abrController.autoLevelCapping = newLevel;\n }\n\n /* check if we are in automatic level selection mode */\n\n }, {\n key: 'autoLevelEnabled',\n get: function get() {\n return this.levelController.manualLevel === -1;\n }\n\n /* return manual level */\n\n }, {\n key: 'manualLevel',\n get: function get() {\n return this.levelController.manualLevel;\n }\n\n /** get alternate audio tracks list from playlist **/\n\n }, {\n key: 'audioTracks',\n get: function get() {\n return this.audioTrackController.audioTracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n\n }, {\n key: 'audioTrack',\n get: function get() {\n return this.audioTrackController.audioTrack;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n ,\n set: function set(audioTrackId) {\n this.audioTrackController.audioTrack = audioTrackId;\n }\n }, {\n key: 'liveSyncPosition',\n get: function get() {\n return this.streamController.liveSyncPosition;\n }\n }]);\n\n return Hls;\n}();\n\nexports.default = Hls;\n\n},{\"1\":1,\"10\":10,\"11\":11,\"12\":12,\"24\":24,\"26\":26,\"3\":3,\"32\":32,\"33\":33,\"34\":34,\"4\":4,\"41\":41,\"43\":43,\"47\":47,\"5\":5,\"6\":6,\"7\":7,\"9\":9}],31:[function(_dereq_,module,exports){\n'use strict';\n\n// This is mostly for support of the es6 module export\n// syntax with the babel compiler, it looks like it doesnt support\n// function exports like we are used to in node/commonjs\nmodule.exports = _dereq_(30).default;\n\n},{\"30\":30}],32:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(25);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(24);\n\nvar _logger = _dereq_(43);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Fragment Loader\n */\n\nvar FragmentLoader = function (_EventHandler) {\n _inherits(FragmentLoader, _EventHandler);\n\n function FragmentLoader(hls) {\n _classCallCheck(this, FragmentLoader);\n\n var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(FragmentLoader).call(this, hls, _events2.default.FRAG_LOADING));\n\n _this.loaders = {};\n return _this;\n }\n\n _createClass(FragmentLoader, [{\n key: 'destroy',\n value: function destroy() {\n var loaders = this.loaders;\n for (var loaderName in loaders) {\n var loader = loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onFragLoading',\n value: function onFragLoading(data) {\n var frag = data.frag,\n type = frag.type,\n loader = this.loaders[type],\n config = this.hls.config;\n\n frag.loaded = 0;\n if (loader) {\n _logger.logger.warn('abort previous fragment loader for type:' + type);\n loader.abort();\n }\n loader = this.loaders[type] = frag.loader = typeof config.fLoader !== 'undefined' ? new config.fLoader(config) : new config.loader(config);\n\n var loaderContext = void 0,\n loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderContext = { url: frag.url, frag: frag, responseType: 'arraybuffer', progressData: false };\n var start = frag.byteRangeStartOffset,\n end = frag.byteRangeEndOffset;\n if (!isNaN(start) && !isNaN(end)) {\n loaderContext.rangeStart = start;\n loaderContext.rangeEnd = end;\n }\n loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: 0, retryDelay: 0, maxRetryDelay: config.fragLoadingMaxRetryTimeout };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this), onProgress: this.loadprogress.bind(this) };\n loader.load(loaderContext, loaderConfig, loaderCallbacks);\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var payload = response.data,\n frag = context.frag;\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(_events2.default.FRAG_LOADED, { payload: payload, frag: frag, stats: stats });\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag });\n }\n\n // data will be used for progressive parsing\n\n }, {\n key: 'loadprogress',\n value: function loadprogress(stats, context, data) {\n // jshint ignore:line\n var frag = context.frag;\n frag.loaded = stats.loaded;\n this.hls.trigger(_events2.default.FRAG_LOAD_PROGRESS, { frag: frag, stats: stats });\n }\n }]);\n\n return FragmentLoader;\n}(_eventHandler2.default);\n\nexports.default = FragmentLoader;\n\n},{\"24\":24,\"25\":25,\"26\":26,\"43\":43}],33:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(25);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(24);\n\nvar _logger = _dereq_(43);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Decrypt key Loader\n */\n\nvar KeyLoader = function (_EventHandler) {\n _inherits(KeyLoader, _EventHandler);\n\n function KeyLoader(hls) {\n _classCallCheck(this, KeyLoader);\n\n var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(KeyLoader).call(this, hls, _events2.default.KEY_LOADING));\n\n _this.loaders = {};\n _this.decryptkey = null;\n _this.decrypturl = null;\n return _this;\n }\n\n _createClass(KeyLoader, [{\n key: 'destroy',\n value: function destroy() {\n for (var loaderName in this.loaders) {\n var loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onKeyLoading',\n value: function onKeyLoading(data) {\n var frag = data.frag,\n type = frag.type,\n loader = this.loaders[type],\n decryptdata = frag.decryptdata,\n uri = decryptdata.uri;\n // if uri is different from previous one or if decrypt key not retrieved yet\n if (uri !== this.decrypturl || this.decryptkey === null) {\n var config = this.hls.config;\n\n if (loader) {\n _logger.logger.warn('abort previous fragment loader for type:' + type);\n loader.abort();\n }\n frag.loader = this.loaders[type] = new config.loader(config);\n this.decrypturl = uri;\n this.decryptkey = null;\n\n var loaderContext = void 0,\n loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderContext = { url: uri, frag: frag, responseType: 'arraybuffer' };\n loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: config.fragLoadingMaxRetry, retryDelay: config.fragLoadingRetryDelay, maxRetryDelay: config.fragLoadingMaxRetryTimeout };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };\n frag.loader.load(loaderContext, loaderConfig, loaderCallbacks);\n } else if (this.decryptkey) {\n // we already loaded this key, return it\n decryptdata.key = this.decryptkey;\n this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });\n }\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var frag = context.frag;\n this.decryptkey = frag.decryptdata.key = new Uint8Array(response.data);\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_ERROR, fatal: false, frag: frag, response: response });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_TIMEOUT, fatal: false, frag: frag });\n }\n }]);\n\n return KeyLoader;\n}(_eventHandler2.default);\n\nexports.default = KeyLoader;\n\n},{\"24\":24,\"25\":25,\"26\":26,\"43\":43}],34:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(25);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(24);\n\nvar _url = _dereq_(46);\n\nvar _url2 = _interopRequireDefault(_url);\n\nvar _attrList = _dereq_(38);\n\nvar _attrList2 = _interopRequireDefault(_attrList);\n\nvar _logger = _dereq_(43);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * Playlist Loader\n */\n\nvar PlaylistLoader = function (_EventHandler) {\n _inherits(PlaylistLoader, _EventHandler);\n\n function PlaylistLoader(hls) {\n _classCallCheck(this, PlaylistLoader);\n\n var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(PlaylistLoader).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.LEVEL_LOADING, _events2.default.AUDIO_TRACK_LOADING));\n\n _this.loaders = {};\n return _this;\n }\n\n _createClass(PlaylistLoader, [{\n key: 'destroy',\n value: function destroy() {\n for (var loaderName in this.loaders) {\n var loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading(data) {\n this.load(data.url, { type: 'manifest' });\n }\n }, {\n key: 'onLevelLoading',\n value: function onLevelLoading(data) {\n this.load(data.url, { type: 'level', level: data.level, id: data.id });\n }\n }, {\n key: 'onAudioTrackLoading',\n value: function onAudioTrackLoading(data) {\n this.load(data.url, { type: 'audioTrack', id: data.id });\n }\n }, {\n key: 'load',\n value: function load(url, context) {\n var loader = this.loaders[context.type];\n if (loader) {\n var loaderContext = loader.context;\n if (loaderContext && loaderContext.url === url) {\n _logger.logger.trace('playlist request ongoing');\n return;\n } else {\n _logger.logger.warn('abort previous loader for type:' + context.type);\n loader.abort();\n }\n }\n var config = this.hls.config,\n retry = void 0,\n timeout = void 0,\n retryDelay = void 0,\n maxRetryDelay = void 0;\n if (context.type === 'manifest') {\n retry = config.manifestLoadingMaxRetry;\n timeout = config.manifestLoadingTimeOut;\n retryDelay = config.manifestLoadingRetryDelay;\n maxRetryDelay = config.manifestLoadingMaxRetryTimeOut;\n } else {\n retry = config.levelLoadingMaxRetry;\n timeout = config.levelLoadingTimeOut;\n retryDelay = config.levelLoadingRetryDelay;\n maxRetryDelay = config.levelLoadingMaxRetryTimeOut;\n _logger.logger.log('loading playlist for level ' + context.level);\n }\n loader = this.loaders[context.type] = context.loader = typeof config.pLoader !== 'undefined' ? new config.pLoader(config) : new config.loader(config);\n context.url = url;\n context.responseType = '';\n\n var loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderConfig = { timeout: timeout, maxRetry: retry, retryDelay: retryDelay, maxRetryDelay: maxRetryDelay };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };\n loader.load(context, loaderConfig, loaderCallbacks);\n }\n }, {\n key: 'resolve',\n value: function resolve(url, baseUrl) {\n return _url2.default.buildAbsoluteURL(baseUrl, url);\n }\n }, {\n key: 'parseMasterPlaylist',\n value: function parseMasterPlaylist(string, baseurl) {\n var levels = [],\n result = void 0;\n\n // https://regex101.com is your friend\n var re = /#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g;\n while ((result = re.exec(string)) != null) {\n var level = {};\n\n var attrs = level.attrs = new _attrList2.default(result[1]);\n level.url = this.resolve(result[2], baseurl);\n\n var resolution = attrs.decimalResolution('RESOLUTION');\n if (resolution) {\n level.width = resolution.width;\n level.height = resolution.height;\n }\n level.bitrate = attrs.decimalInteger('AVERAGE-BANDWIDTH') || attrs.decimalInteger('BANDWIDTH');\n level.name = attrs.NAME;\n\n var codecs = attrs.CODECS;\n if (codecs) {\n codecs = codecs.split(',');\n for (var i = 0; i < codecs.length; i++) {\n var codec = codecs[i];\n if (codec.indexOf('avc1') !== -1) {\n level.videoCodec = this.avc1toavcoti(codec);\n } else {\n level.audioCodec = codec;\n }\n }\n }\n\n levels.push(level);\n }\n return levels;\n }\n }, {\n key: 'parseMasterPlaylistMedia',\n value: function parseMasterPlaylistMedia(string, baseurl, type) {\n var result = void 0,\n medias = [];\n\n // https://regex101.com is your friend\n var re = /#EXT-X-MEDIA:(.*)/g;\n while ((result = re.exec(string)) != null) {\n var media = {};\n var attrs = new _attrList2.default(result[1]);\n if (attrs.TYPE === type) {\n media.groupId = attrs['GROUP-ID'];\n media.name = attrs.NAME;\n media.type = type;\n media.default = attrs.DEFAULT === 'YES';\n media.autoselect = attrs.AUTOSELECT === 'YES';\n media.forced = attrs.FORCED === 'YES';\n if (attrs.URI) {\n media.url = this.resolve(attrs.URI, baseurl);\n }\n media.lang = attrs.LANGUAGE;\n if (!media.name) {\n media.name = media.lang;\n }\n medias.push(media);\n }\n }\n return medias;\n }\n /**\n * Utility method for parseLevelPlaylist to create an initialization vector for a given segment\n * @returns {Uint8Array}\n */\n\n }, {\n key: 'createInitializationVector',\n value: function createInitializationVector(segmentNumber) {\n var uint8View = new Uint8Array(16);\n\n for (var i = 12; i < 16; i++) {\n uint8View[i] = segmentNumber >> 8 * (15 - i) & 0xff;\n }\n\n return uint8View;\n }\n\n /**\n * Utility method for parseLevelPlaylist to get a fragment's decryption data from the currently parsed encryption key data\n * @param levelkey - a playlist's encryption info\n * @param segmentNumber - the fragment's segment number\n * @returns {*} - an object to be applied as a fragment's decryptdata\n */\n\n }, {\n key: 'fragmentDecryptdataFromLevelkey',\n value: function fragmentDecryptdataFromLevelkey(levelkey, segmentNumber) {\n var decryptdata = levelkey;\n\n if (levelkey && levelkey.method && levelkey.uri && !levelkey.iv) {\n decryptdata = this.cloneObj(levelkey);\n decryptdata.iv = this.createInitializationVector(segmentNumber);\n }\n\n return decryptdata;\n }\n }, {\n key: 'avc1toavcoti',\n value: function avc1toavcoti(codec) {\n var result,\n avcdata = codec.split('.');\n if (avcdata.length > 2) {\n result = avcdata.shift() + '.';\n result += parseInt(avcdata.shift()).toString(16);\n result += ('000' + parseInt(avcdata.shift()).toString(16)).substr(-4);\n } else {\n result = codec;\n }\n return result;\n }\n }, {\n key: 'cloneObj',\n value: function cloneObj(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n }, {\n key: 'parseLevelPlaylist',\n value: function parseLevelPlaylist(string, baseurl, id, type) {\n var currentSN = 0,\n fragdecryptdata,\n totalduration = 0,\n level = { type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0 },\n levelkey = { method: null, key: null, iv: null, uri: null },\n cc = 0,\n programDateTime = null,\n frag = null,\n result,\n regexp,\n duration = null,\n title = null,\n byteRangeEndOffset = null,\n byteRangeStartOffset = null,\n tagList = [];\n\n regexp = /(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE):(\\d+))|(?:#EXT-X-(TARGETDURATION):(\\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT(INF):(\\d+(?:\\.\\d+)?)(?:,(.*))?)|(?:(?!#)()(\\S.+))|(?:#EXT-X-(BYTERANGE):(\\d+(?:@\\d+(?:\\.\\d+)?)?)|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(PROGRAM-DATE-TIME):(.+))|(?:#EXT-X-(VERSION):(\\d+))|(?:(#)(.*):(.*))|(?:(#)(.*)))(?:.*)\\r?\\n?/g;\n while ((result = regexp.exec(string)) !== null) {\n result.shift();\n result = result.filter(function (n) {\n return n !== undefined;\n });\n switch (result[0]) {\n case 'PLAYLIST-TYPE':\n level.type = result[1].toUpperCase();\n break;\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(result[1]);\n break;\n case 'TARGETDURATION':\n level.targetduration = parseFloat(result[1]);\n break;\n case 'VERSION':\n level.version = parseInt(result[1]);\n break;\n case 'EXTM3U':\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case 'DIS':\n cc++;\n tagList.push(result);\n break;\n case 'BYTERANGE':\n var params = result[1].split('@');\n if (params.length === 1) {\n byteRangeStartOffset = byteRangeEndOffset;\n } else {\n byteRangeStartOffset = parseInt(params[1]);\n }\n byteRangeEndOffset = parseInt(params[0]) + byteRangeStartOffset;\n break;\n case 'INF':\n duration = parseFloat(result[1]);\n title = result[2] ? result[2] : null;\n tagList.push(result);\n break;\n case '':\n // url\n if (!isNaN(duration)) {\n var sn = currentSN++;\n fragdecryptdata = this.fragmentDecryptdataFromLevelkey(levelkey, sn);\n var url = result[1] ? this.resolve(result[1], baseurl) : null;\n frag = { url: url,\n type: type,\n duration: duration,\n title: title,\n start: totalduration,\n sn: sn,\n level: id,\n cc: cc,\n decryptdata: fragdecryptdata,\n programDateTime: programDateTime,\n tagList: tagList };\n // only include byte range options if used/needed\n if (byteRangeStartOffset !== null) {\n frag.byteRangeStartOffset = byteRangeStartOffset;\n frag.byteRangeEndOffset = byteRangeEndOffset;\n }\n level.fragments.push(frag);\n totalduration += duration;\n duration = null;\n title = null;\n byteRangeStartOffset = null;\n programDateTime = null;\n tagList = [];\n }\n break;\n case 'KEY':\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4\n var decryptparams = result[1];\n var keyAttrs = new _attrList2.default(decryptparams);\n var decryptmethod = keyAttrs.enumeratedString('METHOD'),\n decrypturi = keyAttrs.URI,\n decryptiv = keyAttrs.hexadecimalInteger('IV');\n if (decryptmethod) {\n levelkey = { method: null, key: null, iv: null, uri: null };\n if (decrypturi && decryptmethod === 'AES-128') {\n levelkey.method = decryptmethod;\n // URI to get the key\n levelkey.uri = this.resolve(decrypturi, baseurl);\n levelkey.key = null;\n // Initialization Vector (IV)\n levelkey.iv = decryptiv;\n }\n }\n break;\n case 'START':\n var startParams = result[1];\n var startAttrs = new _attrList2.default(startParams);\n var startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');\n //TIME-OFFSET can be 0\n if (!isNaN(startTimeOffset)) {\n level.startTimeOffset = startTimeOffset;\n }\n break;\n case 'PROGRAM-DATE-TIME':\n programDateTime = new Date(Date.parse(result[1]));\n tagList.push(result);\n break;\n case '#':\n result.shift();\n tagList.push(result);\n break;\n default:\n _logger.logger.warn('line parsed but not handled: ' + result);\n break;\n }\n }\n //logger.log('found ' + level.fragments.length + ' fragments');\n if (frag && !frag.url) {\n level.fragments.pop();\n totalduration -= frag.duration;\n }\n level.totalduration = totalduration;\n level.averagetargetduration = totalduration / level.fragments.length;\n level.endSN = currentSN - 1;\n return level;\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var string = response.data,\n url = response.url,\n type = context.type,\n id = context.id,\n level = context.level,\n hls = this.hls;\n\n this.loaders[type] = undefined;\n // responseURL not supported on some browsers (it is used to detect URL redirection)\n // data-uri mode also not supported (but no need to detect redirection)\n if (url === undefined || url.indexOf('data:') === 0) {\n // fallback to initial URL\n url = context.url;\n }\n stats.tload = performance.now();\n //stats.mtime = new Date(target.getResponseHeader('Last-Modified'));\n if (string.indexOf('#EXTM3U') === 0) {\n if (string.indexOf('#EXTINF:') > 0) {\n var isLevel = type !== 'audioTrack',\n levelDetails = this.parseLevelPlaylist(string, url, (isLevel ? level : id) || 0, isLevel ? 'main' : 'audio');\n if (type === 'manifest') {\n // first request, stream manifest (no master playlist), fire manifest loaded event with level details\n hls.trigger(_events2.default.MANIFEST_LOADED, { levels: [{ url: url, details: levelDetails }], audioTracks: [], url: url, stats: stats });\n }\n stats.tparsed = performance.now();\n if (isLevel) {\n hls.trigger(_events2.default.LEVEL_LOADED, { details: levelDetails, level: level || 0, id: id || 0, stats: stats });\n } else {\n hls.trigger(_events2.default.AUDIO_TRACK_LOADED, { details: levelDetails, id: id, stats: stats });\n }\n } else {\n var levels = this.parseMasterPlaylist(string, url);\n // multi level playlist, parse level info\n if (levels.length) {\n var audiotracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO');\n if (audiotracks.length) {\n // check if we have found an audio track embedded in main playlist (audio track without URI attribute)\n var embeddedAudioFound = false;\n audiotracks.forEach(function (audioTrack) {\n if (!audioTrack.url) {\n embeddedAudioFound = true;\n }\n });\n // if no embedded audio track defined, but audio codec signaled in quality level, we need to signal this main audio track\n // this could happen with playlists with alt audio rendition in which quality levels (main) contains both audio+video. but with mixed audio track not signaled\n if (embeddedAudioFound === false && levels[0].audioCodec && !levels[0].attrs.AUDIO) {\n _logger.logger.log('audio codec signaled in quality level, but no embedded audio track signaled, create one');\n audiotracks.unshift({ type: 'main', name: 'main' });\n }\n }\n hls.trigger(_events2.default.MANIFEST_LOADED, { levels: levels, audioTracks: audiotracks, url: url, stats: stats });\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest' });\n }\n }\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter' });\n }\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var details,\n fatal,\n loader = context.loader;\n switch (context.type) {\n case 'manifest':\n details = _errors.ErrorDetails.MANIFEST_LOAD_ERROR;\n fatal = true;\n break;\n case 'level':\n details = _errors.ErrorDetails.LEVEL_LOAD_ERROR;\n fatal = false;\n break;\n case 'audioTrack':\n details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR;\n fatal = false;\n break;\n }\n if (loader) {\n loader.abort();\n this.loaders[context.type] = undefined;\n }\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context: context });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var details,\n fatal,\n loader = context.loader;\n switch (context.type) {\n case 'manifest':\n details = _errors.ErrorDetails.MANIFEST_LOAD_TIMEOUT;\n fatal = true;\n break;\n case 'level':\n details = _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT;\n fatal = false;\n break;\n case 'audioTrack':\n details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT;\n fatal = false;\n break;\n }\n if (loader) {\n loader.abort();\n this.loaders[context.type] = undefined;\n }\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context: context });\n }\n }]);\n\n return PlaylistLoader;\n}(_eventHandler2.default);\n\nexports.default = PlaylistLoader;\n\n},{\"24\":24,\"25\":25,\"26\":26,\"38\":38,\"43\":43,\"46\":46}],35:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Generate MP4 Box\n*/\n\n//import Hex from '../utils/hex';\n\nvar MP4 = function () {\n function MP4() {\n _classCallCheck(this, MP4);\n }\n\n _createClass(MP4, null, [{\n key: 'init',\n value: function init() {\n MP4.types = {\n avc1: [], // codingname\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [],\n mvex: [],\n mvhd: [],\n sdtp: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: [],\n smhd: []\n };\n\n var i;\n for (i in MP4.types) {\n if (MP4.types.hasOwnProperty(i)) {\n MP4.types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n }\n }\n\n var videoHdlr = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n\n var audioHdlr = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n\n MP4.HDLR_TYPES = {\n 'video': videoHdlr,\n 'audio': audioHdlr\n };\n\n var dref = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // entry_count\n 0x00, 0x00, 0x00, 0x0c, // entry_size\n 0x75, 0x72, 0x6c, 0x20, // 'url' type\n 0x00, // version 0\n 0x00, 0x00, 0x01 // entry_flags\n ]);\n\n var stco = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n\n MP4.STTS = MP4.STSC = MP4.STCO = stco;\n\n MP4.STSZ = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00]);\n // sample_count\n MP4.VMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n ]);\n MP4.SMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance\n 0x00, 0x00 // reserved\n ]);\n\n MP4.STSD = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01]); // entry_count\n\n var majorBrand = new Uint8Array([105, 115, 111, 109]); // isom\n var avc1Brand = new Uint8Array([97, 118, 99, 49]); // avc1\n var minorVersion = new Uint8Array([0, 0, 0, 1]);\n\n MP4.FTYP = MP4.box(MP4.types.ftyp, majorBrand, minorVersion, majorBrand, avc1Brand);\n MP4.DINF = MP4.box(MP4.types.dinf, MP4.box(MP4.types.dref, dref));\n }\n }, {\n key: 'box',\n value: function box(type) {\n var payload = Array.prototype.slice.call(arguments, 1),\n size = 8,\n i = payload.length,\n len = i,\n result;\n // calculate the total size we need to allocate\n while (i--) {\n size += payload[i].byteLength;\n }\n result = new Uint8Array(size);\n result[0] = size >> 24 & 0xff;\n result[1] = size >> 16 & 0xff;\n result[2] = size >> 8 & 0xff;\n result[3] = size & 0xff;\n result.set(type, 4);\n // copy the payload into the result\n for (i = 0, size = 8; i < len; i++) {\n // copy payload[i] array @ offset size\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n return result;\n }\n }, {\n key: 'hdlr',\n value: function hdlr(type) {\n return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);\n }\n }, {\n key: 'mdat',\n value: function mdat(data) {\n return MP4.box(MP4.types.mdat, data);\n }\n }, {\n key: 'mdhd',\n value: function mdhd(timescale, duration) {\n duration *= timescale;\n return MP4.box(MP4.types.mdhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x03, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00]));\n }\n }, {\n key: 'mdia',\n value: function mdia(track) {\n return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale, track.duration), MP4.hdlr(track.type), MP4.minf(track));\n }\n }, {\n key: 'mfhd',\n value: function mfhd(sequenceNumber) {\n return MP4.box(MP4.types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags\n sequenceNumber >> 24, sequenceNumber >> 16 & 0xFF, sequenceNumber >> 8 & 0xFF, sequenceNumber & 0xFF]));\n }\n }, {\n key: 'minf',\n // sequence_number\n value: function minf(track) {\n if (track.type === 'audio') {\n return MP4.box(MP4.types.minf, MP4.box(MP4.types.smhd, MP4.SMHD), MP4.DINF, MP4.stbl(track));\n } else {\n return MP4.box(MP4.types.minf, MP4.box(MP4.types.vmhd, MP4.VMHD), MP4.DINF, MP4.stbl(track));\n }\n }\n }, {\n key: 'moof',\n value: function moof(sn, baseMediaDecodeTime, track) {\n return MP4.box(MP4.types.moof, MP4.mfhd(sn), MP4.traf(track, baseMediaDecodeTime));\n }\n /**\n * @param tracks... (optional) {array} the tracks associated with this movie\n */\n\n }, {\n key: 'moov',\n value: function moov(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = MP4.trak(tracks[i]);\n }\n\n return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale, tracks[0].duration)].concat(boxes).concat(MP4.mvex(tracks)));\n }\n }, {\n key: 'mvex',\n value: function mvex(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = MP4.trex(tracks[i]);\n }\n return MP4.box.apply(null, [MP4.types.mvex].concat(boxes));\n }\n }, {\n key: 'mvhd',\n value: function mvhd(timescale, duration) {\n duration *= timescale;\n var bytes = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // creation_time\n 0x00, 0x00, 0x00, 0x02, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n duration >> 24 & 0xFF, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x00, 0x01, 0x00, 0x00, // 1.0 rate\n 0x01, 0x00, // 1.0 volume\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0xff, 0xff, 0xff, 0xff // next_track_ID\n ]);\n return MP4.box(MP4.types.mvhd, bytes);\n }\n }, {\n key: 'sdtp',\n value: function sdtp(track) {\n var samples = track.samples || [],\n bytes = new Uint8Array(4 + samples.length),\n flags,\n i;\n // leave the full box header (4 bytes) all zero\n // write the sample table\n for (i = 0; i < samples.length; i++) {\n flags = samples[i].flags;\n bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n }\n\n return MP4.box(MP4.types.sdtp, bytes);\n }\n }, {\n key: 'stbl',\n value: function stbl(track) {\n return MP4.box(MP4.types.stbl, MP4.stsd(track), MP4.box(MP4.types.stts, MP4.STTS), MP4.box(MP4.types.stsc, MP4.STSC), MP4.box(MP4.types.stsz, MP4.STSZ), MP4.box(MP4.types.stco, MP4.STCO));\n }\n }, {\n key: 'avc1',\n value: function avc1(track) {\n var sps = [],\n pps = [],\n i,\n data,\n len;\n // assemble the SPSs\n\n for (i = 0; i < track.sps.length; i++) {\n data = track.sps[i];\n len = data.byteLength;\n sps.push(len >>> 8 & 0xFF);\n sps.push(len & 0xFF);\n sps = sps.concat(Array.prototype.slice.call(data)); // SPS\n }\n\n // assemble the PPSs\n for (i = 0; i < track.pps.length; i++) {\n data = track.pps[i];\n len = data.byteLength;\n pps.push(len >>> 8 & 0xFF);\n pps.push(len & 0xFF);\n pps = pps.concat(Array.prototype.slice.call(data));\n }\n\n var avcc = MP4.box(MP4.types.avcC, new Uint8Array([0x01, // version\n sps[3], // profile\n sps[4], // profile compat\n sps[5], // level\n 0xfc | 3, // lengthSizeMinusOne, hard-coded to 4 bytes\n 0xE0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets\n ].concat(sps).concat([track.pps.length // numOfPictureParameterSets\n ]).concat(pps))),\n // \"PPS\"\n width = track.width,\n height = track.height;\n //console.log('avcc:' + Hex.hexDump(avcc));\n return MP4.box(MP4.types.avc1, new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n width >> 8 & 0xFF, width & 0xff, // width\n height >> 8 & 0xFF, height & 0xff, // height\n 0x00, 0x48, 0x00, 0x00, // horizresolution\n 0x00, 0x48, 0x00, 0x00, // vertresolution\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // frame_count\n 0x12, 0x64, 0x61, 0x69, 0x6C, //dailymotion/hls.js\n 0x79, 0x6D, 0x6F, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x68, 0x6C, 0x73, 0x2E, 0x6A, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11]), // pre_defined = -1\n avcc, MP4.box(MP4.types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])) // avgBitrate\n );\n }\n }, {\n key: 'esds',\n value: function esds(track) {\n var configlen = track.config.length;\n return new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n\n 0x03, // descriptor_type\n 0x17 + configlen, // length\n 0x00, 0x01, //es_id\n 0x00, // stream_priority\n\n 0x04, // descriptor_type\n 0x0f + configlen, // length\n 0x40, //codec : mpeg4_audio\n 0x15, // stream_type\n 0x00, 0x00, 0x00, // buffer_size\n 0x00, 0x00, 0x00, 0x00, // maxBitrate\n 0x00, 0x00, 0x00, 0x00, // avgBitrate\n\n 0x05 // descriptor_type\n ].concat([configlen]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor\n }\n }, {\n key: 'mp4a',\n value: function mp4a(track) {\n var audiosamplerate = track.audiosamplerate;\n return MP4.box(MP4.types.mp4a, new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n audiosamplerate >> 8 & 0xFF, audiosamplerate & 0xff, //\n 0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));\n }\n }, {\n key: 'stsd',\n value: function stsd(track) {\n if (track.type === 'audio') {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp4a(track));\n } else {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.avc1(track));\n }\n }\n }, {\n key: 'tkhd',\n value: function tkhd(track) {\n var id = track.id,\n duration = track.duration * track.timescale,\n width = track.width,\n height = track.height;\n return MP4.box(MP4.types.tkhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, // creation_time\n 0x00, 0x00, 0x00, 0x00, // modification_time\n id >> 24 & 0xFF, id >> 16 & 0xFF, id >> 8 & 0xFF, id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, // layer\n 0x00, 0x00, // alternate_group\n 0x00, 0x00, // non-audio track volume\n 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n width >> 8 & 0xFF, width & 0xFF, 0x00, 0x00, // width\n height >> 8 & 0xFF, height & 0xFF, 0x00, 0x00 // height\n ]));\n }\n }, {\n key: 'traf',\n value: function traf(track, baseMediaDecodeTime) {\n var sampleDependencyTable = MP4.sdtp(track),\n id = track.id;\n return MP4.box(MP4.types.traf, MP4.box(MP4.types.tfhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF])), // track_ID\n MP4.box(MP4.types.tfdt, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n baseMediaDecodeTime >> 24, baseMediaDecodeTime >> 16 & 0XFF, baseMediaDecodeTime >> 8 & 0XFF, baseMediaDecodeTime & 0xFF])), // baseMediaDecodeTime\n MP4.trun(track, sampleDependencyTable.length + 16 + // tfhd\n 16 + // tfdt\n 8 + // traf header\n 16 + // mfhd\n 8 + // moof header\n 8), // mdat header\n sampleDependencyTable);\n }\n\n /**\n * Generate a track box.\n * @param track {object} a track definition\n * @return {Uint8Array} the track box\n */\n\n }, {\n key: 'trak',\n value: function trak(track) {\n track.duration = track.duration || 0xffffffff;\n return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));\n }\n }, {\n key: 'trex',\n value: function trex(track) {\n var id = track.id;\n return MP4.box(MP4.types.trex, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]));\n }\n }, {\n key: 'trun',\n value: function trun(track, offset) {\n var samples = track.samples || [],\n len = samples.length,\n arraylen = 12 + 16 * len,\n array = new Uint8Array(arraylen),\n i,\n sample,\n duration,\n size,\n flags,\n cts;\n offset += 8 + arraylen;\n array.set([0x00, // version 0\n 0x00, 0x0f, 0x01, // flags\n len >>> 24 & 0xFF, len >>> 16 & 0xFF, len >>> 8 & 0xFF, len & 0xFF, // sample_count\n offset >>> 24 & 0xFF, offset >>> 16 & 0xFF, offset >>> 8 & 0xFF, offset & 0xFF // data_offset\n ], 0);\n for (i = 0; i < len; i++) {\n sample = samples[i];\n duration = sample.duration;\n size = sample.size;\n flags = sample.flags;\n cts = sample.cts;\n array.set([duration >>> 24 & 0xFF, duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, // sample_duration\n size >>> 24 & 0xFF, size >>> 16 & 0xFF, size >>> 8 & 0xFF, size & 0xFF, // sample_size\n flags.isLeading << 2 | flags.dependsOn, flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.paddingValue << 1 | flags.isNonSync, flags.degradPrio & 0xF0 << 8, flags.degradPrio & 0x0F, // sample_flags\n cts >>> 24 & 0xFF, cts >>> 16 & 0xFF, cts >>> 8 & 0xFF, cts & 0xFF // sample_composition_time_offset\n ], 12 + 16 * i);\n }\n return MP4.box(MP4.types.trun, array);\n }\n }, {\n key: 'initSegment',\n value: function initSegment(tracks) {\n if (!MP4.types) {\n MP4.init();\n }\n var movie = MP4.moov(tracks),\n result;\n result = new Uint8Array(MP4.FTYP.byteLength + movie.byteLength);\n result.set(MP4.FTYP);\n result.set(movie, MP4.FTYP.byteLength);\n return result;\n }\n }]);\n\n return MP4;\n}();\n\nexports.default = MP4;\n\n},{}],36:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * fMP4 remuxer\n */\n\nvar _aac = _dereq_(27);\n\nvar _aac2 = _interopRequireDefault(_aac);\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(43);\n\nvar _mp4Generator = _dereq_(35);\n\nvar _mp4Generator2 = _interopRequireDefault(_mp4Generator);\n\nvar _errors = _dereq_(24);\n\n_dereq_(44);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar MP4Remuxer = function () {\n function MP4Remuxer(observer, id, config) {\n _classCallCheck(this, MP4Remuxer);\n\n this.observer = observer;\n this.id = id;\n this.config = config;\n this.ISGenerated = false;\n this.PES2MP4SCALEFACTOR = 4;\n this.PES_TIMESCALE = 90000;\n this.MP4_TIMESCALE = this.PES_TIMESCALE / this.PES2MP4SCALEFACTOR;\n }\n\n _createClass(MP4Remuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this._initPTS = this._initDTS = undefined;\n }\n }, {\n key: 'switchLevel',\n value: function switchLevel() {\n this.ISGenerated = false;\n }\n }, {\n key: 'remux',\n value: function remux(level, sn, audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n this.level = level;\n this.sn = sn;\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n this.generateIS(audioTrack, videoTrack, timeOffset);\n }\n\n if (this.ISGenerated) {\n // Purposefully remuxing audio before video, so that remuxVideo can use nextAacPts, which is\n // calculated in remuxAudio.\n //logger.log('nb AAC samples:' + audioTrack.samples.length);\n if (audioTrack.samples.length) {\n var audioData = this.remuxAudio(audioTrack, timeOffset, contiguous, accurateTimeOffset);\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n var audioTrackLength = void 0;\n if (audioData) {\n audioTrackLength = audioData.endPTS - audioData.startPTS;\n }\n this.remuxVideo(videoTrack, timeOffset, contiguous, audioTrackLength);\n }\n } else {\n var videoData = void 0;\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n videoData = this.remuxVideo(videoTrack, timeOffset, contiguous);\n }\n if (videoData && audioTrack.codec) {\n this.remuxEmptyAudio(audioTrack, timeOffset, contiguous, videoData);\n }\n }\n }\n //logger.log('nb ID3 samples:' + audioTrack.samples.length);\n if (id3Track.samples.length) {\n this.remuxID3(id3Track, timeOffset);\n }\n //logger.log('nb ID3 samples:' + audioTrack.samples.length);\n if (textTrack.samples.length) {\n this.remuxText(textTrack, timeOffset);\n }\n //notify end of parsing\n this.observer.trigger(_events2.default.FRAG_PARSED, { id: this.id, level: this.level, sn: this.sn });\n }\n }, {\n key: 'generateIS',\n value: function generateIS(audioTrack, videoTrack, timeOffset) {\n var observer = this.observer,\n audioSamples = audioTrack.samples,\n videoSamples = videoTrack.samples,\n pesTimeScale = this.PES_TIMESCALE,\n tracks = {},\n data = { id: this.id, level: this.level, sn: this.sn, tracks: tracks, unique: false },\n computePTSDTS = this._initPTS === undefined,\n initPTS,\n initDTS;\n\n if (computePTSDTS) {\n initPTS = initDTS = Infinity;\n }\n if (audioTrack.config && audioSamples.length) {\n audioTrack.timescale = audioTrack.audiosamplerate;\n // MP4 duration (track duration in seconds multiplied by timescale) is coded on 32 bits\n // we know that each AAC sample contains 1024 frames....\n // in order to avoid overflowing the 32 bit counter for large duration, we use smaller timescale (timescale/gcd)\n // we just need to ensure that AAC sample duration will still be an integer (will be 1024/gcd)\n if (audioTrack.timescale * audioTrack.duration > Math.pow(2, 32)) {\n (function () {\n var greatestCommonDivisor = function greatestCommonDivisor(a, b) {\n if (!b) {\n return a;\n }\n return greatestCommonDivisor(b, a % b);\n };\n audioTrack.timescale = audioTrack.audiosamplerate / greatestCommonDivisor(audioTrack.audiosamplerate, 1024);\n })();\n }\n _logger.logger.log('audio mp4 timescale :' + audioTrack.timescale);\n tracks.audio = {\n container: 'audio/mp4',\n codec: audioTrack.codec,\n initSegment: _mp4Generator2.default.initSegment([audioTrack]),\n metadata: {\n channelCount: audioTrack.channelCount\n }\n };\n if (computePTSDTS) {\n // remember first PTS of this demuxing context. for audio, PTS = DTS\n initPTS = initDTS = audioSamples[0].pts - pesTimeScale * timeOffset;\n }\n }\n\n if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n videoTrack.timescale = this.MP4_TIMESCALE;\n tracks.video = {\n container: 'video/mp4',\n codec: videoTrack.codec,\n initSegment: _mp4Generator2.default.initSegment([videoTrack]),\n metadata: {\n width: videoTrack.width,\n height: videoTrack.height\n }\n };\n if (computePTSDTS) {\n initPTS = Math.min(initPTS, videoSamples[0].pts - pesTimeScale * timeOffset);\n initDTS = Math.min(initDTS, videoSamples[0].dts - pesTimeScale * timeOffset);\n }\n }\n\n if (Object.keys(tracks).length) {\n observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);\n this.ISGenerated = true;\n if (computePTSDTS) {\n this._initPTS = initPTS;\n this._initDTS = initDTS;\n }\n } else {\n observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'no audio/video samples found' });\n }\n }\n }, {\n key: 'remuxVideo',\n value: function remuxVideo(track, timeOffset, contiguous, audioTrackLength) {\n var offset = 8,\n pesTimeScale = this.PES_TIMESCALE,\n pes2mp4ScaleFactor = this.PES2MP4SCALEFACTOR,\n mp4SampleDuration,\n mdat,\n moof,\n firstPTS,\n firstDTS,\n nextDTS,\n lastPTS,\n lastDTS,\n inputSamples = track.samples,\n outputSamples = [];\n\n // for (let i = 0; i < track.samples.length; i++) {\n // let avcSample = track.samples[i];\n // let units = avcSample.units.units;\n // let unitsString = '';\n // for (let j = 0; j < units.length ; j++) {\n // unitsString += units[j].type + ',';\n // if (units[j].data.length < 500) {\n // unitsString += Hex.hexDump(units[j].data);\n // }\n // }\n // logger.log(avcSample.pts + '/' + avcSample.dts + ',' + unitsString + avcSample.units.length);\n // }\n\n // handle broken streams with PTS < DTS, tolerance up 200ms (18000 in 90kHz timescale)\n var PTSDTSshift = inputSamples.reduce(function (prev, curr) {\n return Math.max(Math.min(prev, curr.pts - curr.dts), -18000);\n }, 0);\n if (PTSDTSshift < 0) {\n _logger.logger.warn('PTS < DTS detected in video samples, shifting DTS by ' + Math.round(PTSDTSshift / 90) + ' ms to overcome this issue');\n for (var i = 0; i < inputSamples.length; i++) {\n inputSamples[i].dts += PTSDTSshift;\n }\n }\n\n // PTS is coded on 33bits, and can loop from -2^32 to 2^32\n // PTSNormalize will make PTS/DTS value monotonic, we use last known DTS value as reference value\n var nextAvcDts = void 0;\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n if (contiguous) {\n // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n nextAvcDts = this.nextAvcDts;\n } else {\n // if not contiguous, let's use target timeOffset\n nextAvcDts = timeOffset * pesTimeScale;\n }\n\n // compute first DTS and last DTS, normalize them against reference value\n var sample = inputSamples[0];\n firstDTS = Math.max(this._PTSNormalize(sample.dts - this._initDTS, nextAvcDts), 0);\n firstPTS = Math.max(this._PTSNormalize(sample.pts - this._initDTS, nextAvcDts), 0);\n\n // check timestamp continuity accross consecutive fragments (this is to remove inter-fragment gap/hole)\n var delta = Math.round((firstDTS - nextAvcDts) / 90);\n // if fragment are contiguous, detect hole/overlapping between fragments\n if (contiguous) {\n if (delta) {\n if (delta > 1) {\n _logger.logger.log('AVC:' + delta + ' ms hole between fragments detected,filling it');\n } else if (delta < -1) {\n _logger.logger.log('AVC:' + -delta + ' ms overlapping between fragments detected');\n }\n // remove hole/gap : set DTS to next expected DTS\n firstDTS = nextAvcDts;\n inputSamples[0].dts = firstDTS + this._initDTS;\n // offset PTS as well, ensure that PTS is smaller or equal than new DTS\n firstPTS = Math.max(firstPTS - delta, nextAvcDts);\n inputSamples[0].pts = firstPTS + this._initDTS;\n _logger.logger.log('Video/PTS/DTS adjusted: ' + Math.round(firstPTS / 90) + '/' + Math.round(firstDTS / 90) + ',delta:' + delta + ' ms');\n }\n }\n nextDTS = firstDTS;\n\n // compute lastPTS/lastDTS\n sample = inputSamples[inputSamples.length - 1];\n lastDTS = Math.max(this._PTSNormalize(sample.dts - this._initDTS, nextAvcDts), 0);\n lastPTS = Math.max(this._PTSNormalize(sample.pts - this._initDTS, nextAvcDts), 0);\n lastPTS = Math.max(lastPTS, lastDTS);\n\n var vendor = navigator.vendor,\n userAgent = navigator.userAgent,\n isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');\n\n // on Safari let's signal the same sample duration for all samples\n // sample duration (as expected by trun MP4 boxes), should be the delta between sample DTS\n // set this constant duration as being the avg delta between consecutive DTS.\n if (isSafari) {\n mp4SampleDuration = Math.round((lastDTS - firstDTS) / (pes2mp4ScaleFactor * (inputSamples.length - 1)));\n }\n\n // normalize all PTS/DTS now ...\n for (var _i = 0; _i < inputSamples.length; _i++) {\n var _sample = inputSamples[_i];\n if (isSafari) {\n // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples\n _sample.dts = firstDTS + _i * pes2mp4ScaleFactor * mp4SampleDuration;\n } else {\n // ensure sample monotonic DTS\n _sample.dts = Math.max(this._PTSNormalize(_sample.dts - this._initDTS, nextAvcDts), firstDTS);\n // ensure dts is a multiple of scale factor to avoid rounding issues\n _sample.dts = Math.round(_sample.dts / pes2mp4ScaleFactor) * pes2mp4ScaleFactor;\n }\n // we normalize PTS against nextAvcDts, we also substract initDTS (some streams don't start @ PTS O)\n // and we ensure that computed value is greater or equal than sample DTS\n _sample.pts = Math.max(this._PTSNormalize(_sample.pts - this._initDTS, nextAvcDts), _sample.dts);\n // ensure pts is a multiple of scale factor to avoid rounding issues\n _sample.pts = Math.round(_sample.pts / pes2mp4ScaleFactor) * pes2mp4ScaleFactor;\n }\n\n /* concatenate the video data and construct the mdat in place\n (need 8 more bytes to fill length and mpdat type) */\n mdat = new Uint8Array(track.len + 4 * track.nbNalu + 8);\n var view = new DataView(mdat.buffer);\n view.setUint32(0, mdat.byteLength);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n\n for (var _i2 = 0; _i2 < inputSamples.length; _i2++) {\n var avcSample = inputSamples[_i2],\n mp4SampleLength = 0,\n compositionTimeOffset = void 0;\n // convert NALU bitstream to MP4 format (prepend NALU with size field)\n while (avcSample.units.units.length) {\n var unit = avcSample.units.units.shift();\n view.setUint32(offset, unit.data.byteLength);\n offset += 4;\n mdat.set(unit.data, offset);\n offset += unit.data.byteLength;\n mp4SampleLength += 4 + unit.data.byteLength;\n }\n\n if (!isSafari) {\n // expected sample duration is the Decoding Timestamp diff of consecutive samples\n if (_i2 < inputSamples.length - 1) {\n mp4SampleDuration = inputSamples[_i2 + 1].dts - avcSample.dts;\n } else {\n var config = this.config,\n lastFrameDuration = avcSample.dts - inputSamples[_i2 > 0 ? _i2 - 1 : _i2].dts;\n if (config.stretchShortVideoTrack) {\n // In some cases, a segment's audio track duration may exceed the video track duration.\n // Since we've already remuxed audio, and we know how long the audio track is, we look to\n // see if the delta to the next segment is longer than the minimum of maxBufferHole and\n // maxSeekHole. If so, playback would potentially get stuck, so we artificially inflate\n // the duration of the last frame to minimize any potential gap between segments.\n var maxBufferHole = config.maxBufferHole,\n maxSeekHole = config.maxSeekHole,\n gapTolerance = Math.floor(Math.min(maxBufferHole, maxSeekHole) * pesTimeScale),\n deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * pesTimeScale : this.nextAacPts) - avcSample.pts;\n if (deltaToFrameEnd > gapTolerance) {\n // We subtract lastFrameDuration from deltaToFrameEnd to try to prevent any video\n // frame overlap. maxBufferHole/maxSeekHole should be >> lastFrameDuration anyway.\n mp4SampleDuration = deltaToFrameEnd - lastFrameDuration;\n if (mp4SampleDuration < 0) {\n mp4SampleDuration = lastFrameDuration;\n }\n _logger.logger.log('It is approximately ' + deltaToFrameEnd / 90 + ' ms to the next segment; using duration ' + mp4SampleDuration / 90 + ' ms for the last video frame.');\n } else {\n mp4SampleDuration = lastFrameDuration;\n }\n } else {\n mp4SampleDuration = lastFrameDuration;\n }\n }\n mp4SampleDuration /= pes2mp4ScaleFactor;\n compositionTimeOffset = Math.round((avcSample.pts - avcSample.dts) / pes2mp4ScaleFactor);\n } else {\n compositionTimeOffset = Math.max(0, mp4SampleDuration * Math.round((avcSample.pts - avcSample.dts) / (pes2mp4ScaleFactor * mp4SampleDuration)));\n }\n\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${this._initDTS}/${ptsnorm}/${dtsnorm}/${(avcSample.pts/4294967296).toFixed(3)}');\n outputSamples.push({\n size: mp4SampleLength,\n // constant duration\n duration: mp4SampleDuration,\n cts: compositionTimeOffset,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: avcSample.key ? 2 : 1,\n isNonSync: avcSample.key ? 0 : 1\n }\n });\n }\n // next AVC sample DTS should be equal to last sample DTS + last sample duration (in PES timescale)\n this.nextAvcDts = lastDTS + mp4SampleDuration * pes2mp4ScaleFactor;\n var dropped = track.dropped;\n track.len = 0;\n track.nbNalu = 0;\n track.dropped = 0;\n if (outputSamples.length && navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {\n var flags = outputSamples[0].flags;\n // chrome workaround, mark first sample as being a Random Access Point to avoid sourcebuffer append issue\n // https://code.google.com/p/chromium/issues/detail?id=229412\n flags.dependsOn = 2;\n flags.isNonSync = 0;\n }\n track.samples = outputSamples;\n moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS / pes2mp4ScaleFactor, track);\n track.samples = [];\n\n var data = {\n id: this.id,\n level: this.level,\n sn: this.sn,\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / pesTimeScale,\n endPTS: (lastPTS + pes2mp4ScaleFactor * mp4SampleDuration) / pesTimeScale,\n startDTS: firstDTS / pesTimeScale,\n endDTS: this.nextAvcDts / pesTimeScale,\n type: 'video',\n nb: outputSamples.length,\n dropped: dropped\n };\n this.observer.trigger(_events2.default.FRAG_PARSING_DATA, data);\n return data;\n }\n }, {\n key: 'remuxAudio',\n value: function remuxAudio(track, timeOffset, contiguous, accurateTimeOffset) {\n var pesTimeScale = this.PES_TIMESCALE,\n mp4timeScale = track.timescale,\n pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,\n expectedSampleDuration = track.timescale * 1024 / track.audiosamplerate;\n var view,\n offset = 8,\n aacSample,\n mp4Sample,\n unit,\n mdat,\n moof,\n firstPTS,\n firstDTS,\n lastDTS,\n pts,\n dts,\n ptsnorm,\n dtsnorm,\n samples = [],\n samples0 = [],\n fillFrame,\n newStamp;\n\n track.samples.sort(function (a, b) {\n return a.pts - b.pts;\n });\n samples0 = track.samples;\n\n // for audio samples, also consider consecutive fragments as being contiguous (even if a level switch occurs),\n // for sake of clarity:\n // consecutive fragments are frags with less than 100ms gaps between new time offset and next expected PTS\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n // this helps ensuring audio continuity\n // and this also avoids audio glitches/cut when switching quality, or reporting wrong duration on first audio frame\n\n contiguous |= samples0.length && this.nextAacPts && Math.abs(timeOffset - this.nextAacPts / pesTimeScale) < 0.1;\n\n var nextAacPts = contiguous ? this.nextAacPts : timeOffset * pesTimeScale;\n\n // If the audio track is missing samples, the frames seem to get \"left-shifted\" within the\n // resulting mp4 segment, causing sync issues and leaving gaps at the end of the audio segment.\n // In an effort to prevent this from happening, we inject frames here where there are gaps.\n // When possible, we inject a silent frame; when that's not possible, we duplicate the last\n // frame.\n var pesFrameDuration = expectedSampleDuration * pes2mp4ScaleFactor;\n var nextPtsNorm = nextAacPts;\n\n // only inject/drop audio frames in case time offset is accurate\n if (accurateTimeOffset) {\n for (var i = 0; i < samples0.length;) {\n // First, let's see how far off this frame is from where we expect it to be\n var sample = samples0[i],\n ptsNorm = this._PTSNormalize(sample.pts - this._initDTS, nextAacPts),\n delta = ptsNorm - nextPtsNorm;\n\n // If we're overlapping by more than a duration, drop this sample\n if (delta <= -pesFrameDuration) {\n _logger.logger.warn('Dropping 1 audio frame @ ' + Math.round(nextPtsNorm / 90) / 1000 + 's due to ' + Math.round(Math.abs(delta / 90)) + ' ms overlap.');\n samples0.splice(i, 1);\n track.len -= sample.unit.length;\n // Don't touch nextPtsNorm or i\n }\n // Otherwise, if we're more than a frame away from where we should be, insert missing frames\n else if (delta >= pesFrameDuration) {\n var missing = Math.round(delta / pesFrameDuration);\n _logger.logger.warn('Injecting ' + missing + ' audio frame @ ' + Math.round(nextPtsNorm / 90) / 1000 + 's due to ' + Math.round(delta / 90) + ' ms gap.');\n for (var j = 0; j < missing; j++) {\n newStamp = nextPtsNorm + this._initDTS;\n newStamp = Math.max(newStamp, this._initDTS);\n fillFrame = _aac2.default.getSilentFrame(track.channelCount);\n if (!fillFrame) {\n _logger.logger.log('Unable to get silent frame for given audio codec; duplicating last frame instead.');\n fillFrame = sample.unit.slice(0);\n }\n samples0.splice(i, 0, { unit: fillFrame, pts: newStamp, dts: newStamp });\n track.len += fillFrame.length;\n nextPtsNorm += pesFrameDuration;\n i += 1;\n }\n\n // Adjust sample to next expected pts\n sample.pts = sample.dts = nextPtsNorm + this._initDTS;\n nextPtsNorm += pesFrameDuration;\n i += 1;\n }\n // Otherwise, we're within half a frame duration, so just adjust pts\n else {\n if (Math.abs(delta) > 0.1 * pesFrameDuration) {\n //logger.log(`Invalid frame delta ${Math.round(ptsNorm - nextPtsNorm + pesFrameDuration)} at PTS ${Math.round(ptsNorm / 90)} (should be ${Math.round(pesFrameDuration)}).`);\n }\n nextPtsNorm += pesFrameDuration;\n if (i === 0) {\n sample.pts = sample.dts = this._initDTS + nextAacPts;\n } else {\n sample.pts = sample.dts = samples0[i - 1].pts + pesFrameDuration;\n }\n i += 1;\n }\n }\n }\n\n while (samples0.length) {\n aacSample = samples0.shift();\n unit = aacSample.unit;\n pts = aacSample.pts - this._initDTS;\n dts = aacSample.dts - this._initDTS;\n //logger.log(`Audio/PTS:${Math.round(pts/90)}`);\n // if not first sample\n if (lastDTS !== undefined) {\n ptsnorm = this._PTSNormalize(pts, lastDTS);\n dtsnorm = this._PTSNormalize(dts, lastDTS);\n mp4Sample.duration = Math.round((dtsnorm - lastDTS) / pes2mp4ScaleFactor);\n } else {\n ptsnorm = this._PTSNormalize(pts, nextAacPts);\n dtsnorm = this._PTSNormalize(dts, nextAacPts);\n var _delta = Math.round(1000 * (ptsnorm - nextAacPts) / pesTimeScale),\n numMissingFrames = 0;\n // if fragment are contiguous, detect hole/overlapping between fragments\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n if (contiguous) {\n // log delta\n if (_delta) {\n if (_delta > 0) {\n numMissingFrames = Math.round((ptsnorm - nextAacPts) / pesFrameDuration);\n _logger.logger.log(_delta + ' ms hole between AAC samples detected,filling it');\n if (numMissingFrames > 0) {\n fillFrame = _aac2.default.getSilentFrame(track.channelCount);\n if (!fillFrame) {\n fillFrame = unit.slice(0);\n }\n track.len += numMissingFrames * fillFrame.length;\n }\n // if we have frame overlap, overlapping for more than half a frame duraion\n } else if (_delta < -12) {\n // drop overlapping audio frames... browser will deal with it\n _logger.logger.log(-_delta + ' ms overlapping between AAC samples detected, drop frame');\n track.len -= unit.byteLength;\n continue;\n }\n // set PTS/DTS to expected PTS/DTS\n ptsnorm = dtsnorm = nextAacPts;\n }\n }\n // remember first PTS of our aacSamples, ensure value is positive\n firstPTS = Math.max(0, ptsnorm);\n firstDTS = Math.max(0, dtsnorm);\n if (track.len > 0) {\n /* concatenate the audio data and construct the mdat in place\n (need 8 more bytes to fill length and mdat type) */\n mdat = new Uint8Array(track.len + 8);\n view = new DataView(mdat.buffer);\n view.setUint32(0, mdat.byteLength);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n } else {\n // no audio samples\n return;\n }\n for (var _i3 = 0; _i3 < numMissingFrames; _i3++) {\n newStamp = ptsnorm - (numMissingFrames - _i3) * pesFrameDuration;\n fillFrame = _aac2.default.getSilentFrame(track.channelCount);\n if (!fillFrame) {\n _logger.logger.log('Unable to get silent frame for given audio codec; duplicating this frame instead.');\n fillFrame = unit.slice(0);\n }\n mdat.set(fillFrame, offset);\n offset += fillFrame.byteLength;\n mp4Sample = {\n size: fillFrame.byteLength,\n cts: 0,\n duration: 1024,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: 1\n }\n };\n samples.push(mp4Sample);\n }\n }\n mdat.set(unit, offset);\n offset += unit.byteLength;\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${aacSample.pts}/${aacSample.dts}/${this._initDTS}/${ptsnorm}/${dtsnorm}/${(aacSample.pts/4294967296).toFixed(3)}');\n mp4Sample = {\n size: unit.byteLength,\n cts: 0,\n duration: 0,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: 1\n }\n };\n samples.push(mp4Sample);\n lastDTS = dtsnorm;\n }\n var lastSampleDuration = 0;\n var nbSamples = samples.length;\n //set last sample duration as being identical to previous sample\n if (nbSamples >= 2) {\n lastSampleDuration = samples[nbSamples - 2].duration;\n mp4Sample.duration = lastSampleDuration;\n }\n if (nbSamples) {\n // next aac sample PTS should be equal to last sample PTS + duration\n this.nextAacPts = ptsnorm + pes2mp4ScaleFactor * lastSampleDuration;\n //logger.log('Audio/PTS/PTSend:' + aacSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));\n track.len = 0;\n track.samples = samples;\n moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS / pes2mp4ScaleFactor, track);\n track.samples = [];\n var audioData = {\n id: this.id,\n level: this.level,\n sn: this.sn,\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / pesTimeScale,\n endPTS: this.nextAacPts / pesTimeScale,\n startDTS: firstDTS / pesTimeScale,\n endDTS: (dtsnorm + pes2mp4ScaleFactor * lastSampleDuration) / pesTimeScale,\n type: 'audio',\n nb: nbSamples\n };\n this.observer.trigger(_events2.default.FRAG_PARSING_DATA, audioData);\n return audioData;\n }\n return null;\n }\n }, {\n key: 'remuxEmptyAudio',\n value: function remuxEmptyAudio(track, timeOffset, contiguous, videoData) {\n var pesTimeScale = this.PES_TIMESCALE,\n mp4timeScale = track.timescale ? track.timescale : track.audiosamplerate,\n pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,\n\n\n // sync with video's timestamp\n startDTS = videoData.startDTS * pesTimeScale + this._initDTS,\n endDTS = videoData.endDTS * pesTimeScale + this._initDTS,\n\n\n // one sample's duration value\n sampleDuration = 1024,\n frameDuration = pes2mp4ScaleFactor * sampleDuration,\n\n\n // samples count of this segment's duration\n nbSamples = Math.ceil((endDTS - startDTS) / frameDuration),\n\n\n // silent frame\n silentFrame = _aac2.default.getSilentFrame(track.channelCount);\n\n // Can't remux if we can't generate a silent frame...\n if (!silentFrame) {\n _logger.logger.trace('Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!');\n return;\n }\n\n var samples = [];\n for (var i = 0; i < nbSamples; i++) {\n var stamp = startDTS + i * frameDuration;\n samples.push({ unit: silentFrame.slice(0), pts: stamp, dts: stamp });\n track.len += silentFrame.length;\n }\n track.samples = samples;\n\n this.remuxAudio(track, timeOffset, contiguous);\n }\n }, {\n key: 'remuxID3',\n value: function remuxID3(track, timeOffset) {\n var length = track.samples.length,\n sample;\n // consume samples\n if (length) {\n for (var index = 0; index < length; index++) {\n sample = track.samples[index];\n // setting id3 pts, dts to relative time\n // using this._initPTS and this._initDTS to calculate relative time\n sample.pts = (sample.pts - this._initPTS) / this.PES_TIMESCALE;\n sample.dts = (sample.dts - this._initDTS) / this.PES_TIMESCALE;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_METADATA, {\n id: this.id,\n level: this.level,\n sn: this.sn,\n samples: track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n }, {\n key: 'remuxText',\n value: function remuxText(track, timeOffset) {\n track.samples.sort(function (a, b) {\n return a.pts - b.pts;\n });\n\n var length = track.samples.length,\n sample;\n // consume samples\n if (length) {\n for (var index = 0; index < length; index++) {\n sample = track.samples[index];\n // setting text pts, dts to relative time\n // using this._initPTS and this._initDTS to calculate relative time\n sample.pts = (sample.pts - this._initPTS) / this.PES_TIMESCALE;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_USERDATA, {\n id: this.id,\n level: this.level,\n sn: this.sn,\n samples: track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n }, {\n key: '_PTSNormalize',\n value: function _PTSNormalize(value, reference) {\n var offset;\n if (reference === undefined) {\n return value;\n }\n if (reference < value) {\n // - 2^33\n offset = -8589934592;\n } else {\n // + 2^33\n offset = 8589934592;\n }\n /* PTS is 33bit (from 0 to 2^33 -1)\n if diff between value and reference is bigger than half of the amplitude (2^32) then it means that\n PTS looping occured. fill the gap */\n while (Math.abs(value - reference) > 4294967296) {\n value += offset;\n }\n return value;\n }\n }, {\n key: 'passthrough',\n get: function get() {\n return false;\n }\n }]);\n\n return MP4Remuxer;\n}();\n\nexports.default = MP4Remuxer;\n\n},{\"24\":24,\"26\":26,\"27\":27,\"35\":35,\"43\":43,\"44\":44}],37:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * passthrough remuxer\n */\n\n\nvar _events = _dereq_(26);\n\nvar _events2 = _interopRequireDefault(_events);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar PassThroughRemuxer = function () {\n function PassThroughRemuxer(observer, id) {\n _classCallCheck(this, PassThroughRemuxer);\n\n this.observer = observer;\n this.id = id;\n this.ISGenerated = false;\n }\n\n _createClass(PassThroughRemuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {}\n }, {\n key: 'switchLevel',\n value: function switchLevel() {\n this.ISGenerated = false;\n }\n }, {\n key: 'remux',\n value: function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, rawData) {\n var observer = this.observer;\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n var tracks = {},\n data = { id: this.id, tracks: tracks, unique: true },\n track = videoTrack,\n codec = track.codec;\n\n if (codec) {\n data.tracks.video = {\n container: track.container,\n codec: codec,\n metadata: {\n width: track.width,\n height: track.height\n }\n };\n }\n\n track = audioTrack;\n codec = track.codec;\n if (codec) {\n data.tracks.audio = {\n container: track.container,\n codec: codec,\n metadata: {\n channelCount: track.channelCount\n }\n };\n }\n this.ISGenerated = true;\n observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);\n }\n observer.trigger(_events2.default.FRAG_PARSING_DATA, {\n id: this.id,\n data1: rawData,\n startPTS: timeOffset,\n startDTS: timeOffset,\n type: 'audiovideo',\n nb: 1,\n dropped: 0\n });\n }\n }, {\n key: 'passthrough',\n get: function get() {\n return true;\n }\n }]);\n\n return PassThroughRemuxer;\n}();\n\nexports.default = PassThroughRemuxer;\n\n},{\"26\":26}],38:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js\n\nvar AttrList = function () {\n function AttrList(attrs) {\n _classCallCheck(this, AttrList);\n\n if (typeof attrs === 'string') {\n attrs = AttrList.parseAttrList(attrs);\n }\n for (var attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n this[attr] = attrs[attr];\n }\n }\n }\n\n _createClass(AttrList, [{\n key: 'decimalInteger',\n value: function decimalInteger(attrName) {\n var intValue = parseInt(this[attrName], 10);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n }, {\n key: 'hexadecimalInteger',\n value: function hexadecimalInteger(attrName) {\n if (this[attrName]) {\n var stringValue = (this[attrName] || '0x').slice(2);\n stringValue = (stringValue.length & 1 ? '0' : '') + stringValue;\n\n var value = new Uint8Array(stringValue.length / 2);\n for (var i = 0; i < stringValue.length / 2; i++) {\n value[i] = parseInt(stringValue.slice(i * 2, i * 2 + 2), 16);\n }\n return value;\n } else {\n return null;\n }\n }\n }, {\n key: 'hexadecimalIntegerAsNumber',\n value: function hexadecimalIntegerAsNumber(attrName) {\n var intValue = parseInt(this[attrName], 16);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n }, {\n key: 'decimalFloatingPoint',\n value: function decimalFloatingPoint(attrName) {\n return parseFloat(this[attrName]);\n }\n }, {\n key: 'enumeratedString',\n value: function enumeratedString(attrName) {\n return this[attrName];\n }\n }, {\n key: 'decimalResolution',\n value: function decimalResolution(attrName) {\n var res = /^(\\d+)x(\\d+)$/.exec(this[attrName]);\n if (res === null) {\n return undefined;\n }\n return {\n width: parseInt(res[1], 10),\n height: parseInt(res[2], 10)\n };\n }\n }], [{\n key: 'parseAttrList',\n value: function parseAttrList(input) {\n var re = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g;\n var match,\n attrs = {};\n while ((match = re.exec(input)) !== null) {\n var value = match[2],\n quote = '\"';\n\n if (value.indexOf(quote) === 0 && value.lastIndexOf(quote) === value.length - 1) {\n value = value.slice(1, -1);\n }\n attrs[match[1]] = value;\n }\n return attrs;\n }\n }]);\n\n return AttrList;\n}();\n\nexports.default = AttrList;\n\n},{}],39:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BinarySearch = {\n /**\n * Searches for an item in an array which matches a certain condition.\n * This requires the condition to only match one item in the array,\n * and for the array to be ordered.\n *\n * @param {Array} list The array to search.\n * @param {Function} comparisonFunction\n * Called and provided a candidate item as the first argument.\n * Should return:\n * > -1 if the item should be located at a lower index than the provided item.\n * > 1 if the item should be located at a higher index than the provided item.\n * > 0 if the item is the item you're looking for.\n *\n * @return {*} The object if it is found or null otherwise.\n */\n search: function search(list, comparisonFunction) {\n var minIndex = 0;\n var maxIndex = list.length - 1;\n var currentIndex = null;\n var currentElement = null;\n\n while (minIndex <= maxIndex) {\n currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = list[currentIndex];\n\n var comparisonResult = comparisonFunction(currentElement);\n if (comparisonResult > 0) {\n minIndex = currentIndex + 1;\n } else if (comparisonResult < 0) {\n maxIndex = currentIndex - 1;\n } else {\n return currentElement;\n }\n }\n\n return null;\n }\n};\n\nmodule.exports = BinarySearch;\n\n},{}],40:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n *\n * This code was ported from the dash.js project at:\n * https://github.com/Dash-Industry-Forum/dash.js/blob/development/externals/cea608-parser.js\n * https://github.com/Dash-Industry-Forum/dash.js/commit/8269b26a761e0853bb21d78780ed945144ecdd4d#diff-71bc295a2d6b6b7093a1d3290d53a4b2\n *\n * The original copyright appears below:\n *\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2015-2016, DASH Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * 2. Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Exceptions from regular ASCII. CodePoints are mapped to UTF-16 codes\n */\n\nvar specialCea608CharsCodes = {\n 0x2a: 0xe1, // lowercase a, acute accent\n 0x5c: 0xe9, // lowercase e, acute accent\n 0x5e: 0xed, // lowercase i, acute accent\n 0x5f: 0xf3, // lowercase o, acute accent\n 0x60: 0xfa, // lowercase u, acute accent\n 0x7b: 0xe7, // lowercase c with cedilla\n 0x7c: 0xf7, // division symbol\n 0x7d: 0xd1, // uppercase N tilde\n 0x7e: 0xf1, // lowercase n tilde\n 0x7f: 0x2588, // Full block\n // THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F\n // THIS MEANS THAT \\x50 MUST BE ADDED TO THE VALUES\n 0x80: 0xae, // Registered symbol (R)\n 0x81: 0xb0, // degree sign\n 0x82: 0xbd, // 1/2 symbol\n 0x83: 0xbf, // Inverted (open) question mark\n 0x84: 0x2122, // Trademark symbol (TM)\n 0x85: 0xa2, // Cents symbol\n 0x86: 0xa3, // Pounds sterling\n 0x87: 0x266a, // Music 8'th note\n 0x88: 0xe0, // lowercase a, grave accent\n 0x89: 0x20, // transparent space (regular)\n 0x8a: 0xe8, // lowercase e, grave accent\n 0x8b: 0xe2, // lowercase a, circumflex accent\n 0x8c: 0xea, // lowercase e, circumflex accent\n 0x8d: 0xee, // lowercase i, circumflex accent\n 0x8e: 0xf4, // lowercase o, circumflex accent\n 0x8f: 0xfb, // lowercase u, circumflex accent\n // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F\n 0x90: 0xc1, // capital letter A with acute\n 0x91: 0xc9, // capital letter E with acute\n 0x92: 0xd3, // capital letter O with acute\n 0x93: 0xda, // capital letter U with acute\n 0x94: 0xdc, // capital letter U with diaresis\n 0x95: 0xfc, // lowercase letter U with diaeresis\n 0x96: 0x2018, // opening single quote\n 0x97: 0xa1, // inverted exclamation mark\n 0x98: 0x2a, // asterisk\n 0x99: 0x2019, // closing single quote\n 0x9a: 0x2501, // box drawings heavy horizontal\n 0x9b: 0xa9, // copyright sign\n 0x9c: 0x2120, // Service mark\n 0x9d: 0x2022, // (round) bullet\n 0x9e: 0x201c, // Left double quotation mark\n 0x9f: 0x201d, // Right double quotation mark\n 0xa0: 0xc0, // uppercase A, grave accent\n 0xa1: 0xc2, // uppercase A, circumflex\n 0xa2: 0xc7, // uppercase C with cedilla\n 0xa3: 0xc8, // uppercase E, grave accent\n 0xa4: 0xca, // uppercase E, circumflex\n 0xa5: 0xcb, // capital letter E with diaresis\n 0xa6: 0xeb, // lowercase letter e with diaresis\n 0xa7: 0xce, // uppercase I, circumflex\n 0xa8: 0xcf, // uppercase I, with diaresis\n 0xa9: 0xef, // lowercase i, with diaresis\n 0xaa: 0xd4, // uppercase O, circumflex\n 0xab: 0xd9, // uppercase U, grave accent\n 0xac: 0xf9, // lowercase u, grave accent\n 0xad: 0xdb, // uppercase U, circumflex\n 0xae: 0xab, // left-pointing double angle quotation mark\n 0xaf: 0xbb, // right-pointing double angle quotation mark\n // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F\n 0xb0: 0xc3, // Uppercase A, tilde\n 0xb1: 0xe3, // Lowercase a, tilde\n 0xb2: 0xcd, // Uppercase I, acute accent\n 0xb3: 0xcc, // Uppercase I, grave accent\n 0xb4: 0xec, // Lowercase i, grave accent\n 0xb5: 0xd2, // Uppercase O, grave accent\n 0xb6: 0xf2, // Lowercase o, grave accent\n 0xb7: 0xd5, // Uppercase O, tilde\n 0xb8: 0xf5, // Lowercase o, tilde\n 0xb9: 0x7b, // Open curly brace\n 0xba: 0x7d, // Closing curly brace\n 0xbb: 0x5c, // Backslash\n 0xbc: 0x5e, // Caret\n 0xbd: 0x5f, // Underscore\n 0xbe: 0x7c, // Pipe (vertical line)\n 0xbf: 0x223c, // Tilde operator\n 0xc0: 0xc4, // Uppercase A, umlaut\n 0xc1: 0xe4, // Lowercase A, umlaut\n 0xc2: 0xd6, // Uppercase O, umlaut\n 0xc3: 0xf6, // Lowercase o, umlaut\n 0xc4: 0xdf, // Esszett (sharp S)\n 0xc5: 0xa5, // Yen symbol\n 0xc6: 0xa4, // Generic currency sign\n 0xc7: 0x2503, // Box drawings heavy vertical\n 0xc8: 0xc5, // Uppercase A, ring\n 0xc9: 0xe5, // Lowercase A, ring\n 0xca: 0xd8, // Uppercase O, stroke\n 0xcb: 0xf8, // Lowercase o, strok\n 0xcc: 0x250f, // Box drawings heavy down and right\n 0xcd: 0x2513, // Box drawings heavy down and left\n 0xce: 0x2517, // Box drawings heavy up and right\n 0xcf: 0x251b // Box drawings heavy up and left\n};\n\n/**\n * Utils\n */\nvar getCharForByte = function getCharForByte(byte) {\n var charCode = byte;\n if (specialCea608CharsCodes.hasOwnProperty(byte)) {\n charCode = specialCea608CharsCodes[byte];\n }\n return String.fromCharCode(charCode);\n};\n\nvar NR_ROWS = 15,\n NR_COLS = 32;\n// Tables to look up row from PAC data\nvar rowsLowCh1 = { 0x11: 1, 0x12: 3, 0x15: 5, 0x16: 7, 0x17: 9, 0x10: 11, 0x13: 12, 0x14: 14 };\nvar rowsHighCh1 = { 0x11: 2, 0x12: 4, 0x15: 6, 0x16: 8, 0x17: 10, 0x13: 13, 0x14: 15 };\nvar rowsLowCh2 = { 0x19: 1, 0x1A: 3, 0x1D: 5, 0x1E: 7, 0x1F: 9, 0x18: 11, 0x1B: 12, 0x1C: 14 };\nvar rowsHighCh2 = { 0x19: 2, 0x1A: 4, 0x1D: 6, 0x1E: 8, 0x1F: 10, 0x1B: 13, 0x1C: 15 };\n\nvar backgroundColors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'black', 'transparent'];\n\n/**\n * Simple logger class to be able to write with time-stamps and filter on level.\n */\nvar logger = {\n verboseFilter: { 'DATA': 3, 'DEBUG': 3, 'INFO': 2, 'WARNING': 2, 'TEXT': 1, 'ERROR': 0 },\n time: null,\n verboseLevel: 0, // Only write errors\n setTime: function setTime(newTime) {\n this.time = newTime;\n },\n log: function log(severity, msg) {\n var minLevel = this.verboseFilter[severity];\n if (this.verboseLevel >= minLevel) {\n console.log(this.time + ' [' + severity + '] ' + msg);\n }\n }\n};\n\nvar numArrayToHexArray = function numArrayToHexArray(numArray) {\n var hexArray = [];\n for (var j = 0; j < numArray.length; j++) {\n hexArray.push(numArray[j].toString(16));\n }\n return hexArray;\n};\n\nvar PenState = function () {\n function PenState(foreground, underline, italics, background, flash) {\n _classCallCheck(this, PenState);\n\n this.foreground = foreground || 'white';\n this.underline = underline || false;\n this.italics = italics || false;\n this.background = background || 'black';\n this.flash = flash || false;\n }\n\n _createClass(PenState, [{\n key: 'reset',\n value: function reset() {\n this.foreground = 'white';\n this.underline = false;\n this.italics = false;\n this.background = 'black';\n this.flash = false;\n }\n }, {\n key: 'setStyles',\n value: function setStyles(styles) {\n var attribs = ['foreground', 'underline', 'italics', 'background', 'flash'];\n for (var i = 0; i < attribs.length; i++) {\n var style = attribs[i];\n if (styles.hasOwnProperty(style)) {\n this[style] = styles[style];\n }\n }\n }\n }, {\n key: 'isDefault',\n value: function isDefault() {\n return this.foreground === 'white' && !this.underline && !this.italics && this.background === 'black' && !this.flash;\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n return this.foreground === other.foreground && this.underline === other.underline && this.italics === other.italics && this.background === other.background && this.flash === other.flash;\n }\n }, {\n key: 'copy',\n value: function copy(newPenState) {\n this.foreground = newPenState.foreground;\n this.underline = newPenState.underline;\n this.italics = newPenState.italics;\n this.background = newPenState.background;\n this.flash = newPenState.flash;\n }\n }, {\n key: 'toString',\n value: function toString() {\n return 'color=' + this.foreground + ', underline=' + this.underline + ', italics=' + this.italics + ', background=' + this.background + ', flash=' + this.flash;\n }\n }]);\n\n return PenState;\n}();\n\n/**\n * Unicode character with styling and background.\n * @constructor\n */\n\n\nvar StyledUnicodeChar = function () {\n function StyledUnicodeChar(uchar, foreground, underline, italics, background, flash) {\n _classCallCheck(this, StyledUnicodeChar);\n\n this.uchar = uchar || ' '; // unicode character\n this.penState = new PenState(foreground, underline, italics, background, flash);\n }\n\n _createClass(StyledUnicodeChar, [{\n key: 'reset',\n value: function reset() {\n this.uchar = ' ';\n this.penState.reset();\n }\n }, {\n key: 'setChar',\n value: function setChar(uchar, newPenState) {\n this.uchar = uchar;\n this.penState.copy(newPenState);\n }\n }, {\n key: 'setPenState',\n value: function setPenState(newPenState) {\n this.penState.copy(newPenState);\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n return this.uchar === other.uchar && this.penState.equals(other.penState);\n }\n }, {\n key: 'copy',\n value: function copy(newChar) {\n this.uchar = newChar.uchar;\n this.penState.copy(newChar.penState);\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n return this.uchar === ' ' && this.penState.isDefault();\n }\n }]);\n\n return StyledUnicodeChar;\n}();\n\n/**\n * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.\n * @constructor\n */\n\n\nvar Row = function () {\n function Row() {\n _classCallCheck(this, Row);\n\n this.chars = [];\n for (var i = 0; i < NR_COLS; i++) {\n this.chars.push(new StyledUnicodeChar());\n }\n this.pos = 0;\n this.currPenState = new PenState();\n }\n\n _createClass(Row, [{\n key: 'equals',\n value: function equals(other) {\n var equal = true;\n for (var i = 0; i < NR_COLS; i++) {\n if (!this.chars[i].equals(other.chars[i])) {\n equal = false;\n break;\n }\n }\n return equal;\n }\n }, {\n key: 'copy',\n value: function copy(other) {\n for (var i = 0; i < NR_COLS; i++) {\n this.chars[i].copy(other.chars[i]);\n }\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n var empty = true;\n for (var i = 0; i < NR_COLS; i++) {\n if (!this.chars[i].isEmpty()) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n\n /**\n * Set the cursor to a valid column.\n */\n\n }, {\n key: 'setCursor',\n value: function setCursor(absPos) {\n if (this.pos !== absPos) {\n this.pos = absPos;\n }\n if (this.pos < 0) {\n logger.log('ERROR', 'Negative cursor position ' + this.pos);\n this.pos = 0;\n } else if (this.pos > NR_COLS) {\n logger.log('ERROR', 'Too large cursor position ' + this.pos);\n this.pos = NR_COLS;\n }\n }\n\n /**\n * Move the cursor relative to current position.\n */\n\n }, {\n key: 'moveCursor',\n value: function moveCursor(relPos) {\n var newPos = this.pos + relPos;\n if (relPos > 1) {\n for (var i = this.pos + 1; i < newPos + 1; i++) {\n this.chars[i].setPenState(this.currPenState);\n }\n }\n this.setCursor(newPos);\n }\n\n /**\n * Backspace, move one step back and clear character.\n */\n\n }, {\n key: 'backSpace',\n value: function backSpace() {\n this.moveCursor(-1);\n this.chars[this.pos].setChar(' ', this.currPenState);\n }\n }, {\n key: 'insertChar',\n value: function insertChar(byte) {\n if (byte >= 0x90) {\n //Extended char\n this.backSpace();\n }\n var char = getCharForByte(byte);\n if (this.pos >= NR_COLS) {\n logger.log('ERROR', 'Cannot insert ' + byte.toString(16) + ' (' + char + ') at position ' + this.pos + '. Skipping it!');\n return;\n }\n this.chars[this.pos].setChar(char, this.currPenState);\n this.moveCursor(1);\n }\n }, {\n key: 'clearFromPos',\n value: function clearFromPos(startPos) {\n var i;\n for (i = startPos; i < NR_COLS; i++) {\n this.chars[i].reset();\n }\n }\n }, {\n key: 'clear',\n value: function clear() {\n this.clearFromPos(0);\n this.pos = 0;\n this.currPenState.reset();\n }\n }, {\n key: 'clearToEndOfRow',\n value: function clearToEndOfRow() {\n this.clearFromPos(this.pos);\n }\n }, {\n key: 'getTextString',\n value: function getTextString() {\n var chars = [];\n var empty = true;\n for (var i = 0; i < NR_COLS; i++) {\n var char = this.chars[i].uchar;\n if (char !== ' ') {\n empty = false;\n }\n chars.push(char);\n }\n if (empty) {\n return '';\n } else {\n return chars.join('');\n }\n }\n }, {\n key: 'setPenStyles',\n value: function setPenStyles(styles) {\n this.currPenState.setStyles(styles);\n var currChar = this.chars[this.pos];\n currChar.setPenState(this.currPenState);\n }\n }]);\n\n return Row;\n}();\n\n/**\n * Keep a CEA-608 screen of 32x15 styled characters\n * @constructor\n*/\n\n\nvar CaptionScreen = function () {\n function CaptionScreen() {\n _classCallCheck(this, CaptionScreen);\n\n this.rows = [];\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows.push(new Row()); // Note that we use zero-based numbering (0-14)\n }\n this.currRow = NR_ROWS - 1;\n this.nrRollUpRows = null;\n this.reset();\n }\n\n _createClass(CaptionScreen, [{\n key: 'reset',\n value: function reset() {\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n this.currRow = NR_ROWS - 1;\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n var equal = true;\n for (var i = 0; i < NR_ROWS; i++) {\n if (!this.rows[i].equals(other.rows[i])) {\n equal = false;\n break;\n }\n }\n return equal;\n }\n }, {\n key: 'copy',\n value: function copy(other) {\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].copy(other.rows[i]);\n }\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n var empty = true;\n for (var i = 0; i < NR_ROWS; i++) {\n if (!this.rows[i].isEmpty()) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n }, {\n key: 'backSpace',\n value: function backSpace() {\n var row = this.rows[this.currRow];\n row.backSpace();\n }\n }, {\n key: 'clearToEndOfRow',\n value: function clearToEndOfRow() {\n var row = this.rows[this.currRow];\n row.clearToEndOfRow();\n }\n\n /**\n * Insert a character (without styling) in the current row.\n */\n\n }, {\n key: 'insertChar',\n value: function insertChar(char) {\n var row = this.rows[this.currRow];\n row.insertChar(char);\n }\n }, {\n key: 'setPen',\n value: function setPen(styles) {\n var row = this.rows[this.currRow];\n row.setPenStyles(styles);\n }\n }, {\n key: 'moveCursor',\n value: function moveCursor(relPos) {\n var row = this.rows[this.currRow];\n row.moveCursor(relPos);\n }\n }, {\n key: 'setCursor',\n value: function setCursor(absPos) {\n logger.log('INFO', 'setCursor: ' + absPos);\n var row = this.rows[this.currRow];\n row.setCursor(absPos);\n }\n }, {\n key: 'setPAC',\n value: function setPAC(pacData) {\n logger.log('INFO', 'pacData = ' + JSON.stringify(pacData));\n var newRow = pacData.row - 1;\n if (this.nrRollUpRows && newRow < this.nrRollUpRows - 1) {\n newRow = this.nrRollUpRows - 1;\n }\n this.currRow = newRow;\n var row = this.rows[this.currRow];\n if (pacData.indent !== null) {\n var indent = pacData.indent;\n var prevPos = Math.max(indent - 1, 0);\n row.setCursor(pacData.indent);\n pacData.color = row.chars[prevPos].penState.foreground;\n }\n var styles = { foreground: pacData.color, underline: pacData.underline, italics: pacData.italics, background: 'black', flash: false };\n this.setPen(styles);\n }\n\n /**\n * Set background/extra foreground, but first do back_space, and then insert space (backwards compatibility).\n */\n\n }, {\n key: 'setBkgData',\n value: function setBkgData(bkgData) {\n\n logger.log('INFO', 'bkgData = ' + JSON.stringify(bkgData));\n this.backSpace();\n this.setPen(bkgData);\n this.insertChar(0x20); //Space\n }\n }, {\n key: 'setRollUpRows',\n value: function setRollUpRows(nrRows) {\n this.nrRollUpRows = nrRows;\n }\n }, {\n key: 'rollUp',\n value: function rollUp() {\n if (this.nrRollUpRows === null) {\n logger.log('DEBUG', 'roll_up but nrRollUpRows not set yet');\n return; //Not properly setup\n }\n logger.log('TEXT', this.getDisplayText());\n var topRowIndex = this.currRow + 1 - this.nrRollUpRows;\n var topRow = this.rows.splice(topRowIndex, 1)[0];\n topRow.clear();\n this.rows.splice(this.currRow, 0, topRow);\n logger.log('INFO', 'Rolling up');\n //logger.log('TEXT', this.get_display_text())\n }\n\n /**\n * Get all non-empty rows with as unicode text.\n */\n\n }, {\n key: 'getDisplayText',\n value: function getDisplayText(asOneRow) {\n asOneRow = asOneRow || false;\n var displayText = [];\n var text = '';\n var rowNr = -1;\n for (var i = 0; i < NR_ROWS; i++) {\n var rowText = this.rows[i].getTextString();\n if (rowText) {\n rowNr = i + 1;\n if (asOneRow) {\n displayText.push('Row ' + rowNr + ': \\'' + rowText + '\\'');\n } else {\n displayText.push(rowText.trim());\n }\n }\n }\n if (displayText.length > 0) {\n if (asOneRow) {\n text = '[' + displayText.join(' | ') + ']';\n } else {\n text = displayText.join('\\n');\n }\n }\n return text;\n }\n }, {\n key: 'getTextAndFormat',\n value: function getTextAndFormat() {\n return this.rows;\n }\n }]);\n\n return CaptionScreen;\n}();\n\n//var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];\n\nvar Cea608Channel = function () {\n function Cea608Channel(channelNumber, outputFilter) {\n _classCallCheck(this, Cea608Channel);\n\n this.chNr = channelNumber;\n this.outputFilter = outputFilter;\n this.mode = null;\n this.verbose = 0;\n this.displayedMemory = new CaptionScreen();\n this.nonDisplayedMemory = new CaptionScreen();\n this.lastOutputScreen = new CaptionScreen();\n this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];\n this.writeScreen = this.displayedMemory;\n this.mode = null;\n this.cueStartTime = null; // Keeps track of where a cue started.\n }\n\n _createClass(Cea608Channel, [{\n key: 'reset',\n value: function reset() {\n this.mode = null;\n this.displayedMemory.reset();\n this.nonDisplayedMemory.reset();\n this.lastOutputScreen.reset();\n this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];\n this.writeScreen = this.displayedMemory;\n this.mode = null;\n this.cueStartTime = null;\n this.lastCueEndTime = null;\n }\n }, {\n key: 'getHandler',\n value: function getHandler() {\n return this.outputFilter;\n }\n }, {\n key: 'setHandler',\n value: function setHandler(newHandler) {\n this.outputFilter = newHandler;\n }\n }, {\n key: 'setPAC',\n value: function setPAC(pacData) {\n this.writeScreen.setPAC(pacData);\n }\n }, {\n key: 'setBkgData',\n value: function setBkgData(bkgData) {\n this.writeScreen.setBkgData(bkgData);\n }\n }, {\n key: 'setMode',\n value: function setMode(newMode) {\n if (newMode === this.mode) {\n return;\n }\n this.mode = newMode;\n logger.log('INFO', 'MODE=' + newMode);\n if (this.mode === 'MODE_POP-ON') {\n this.writeScreen = this.nonDisplayedMemory;\n } else {\n this.writeScreen = this.displayedMemory;\n this.writeScreen.reset();\n }\n if (this.mode !== 'MODE_ROLL-UP') {\n this.displayedMemory.nrRollUpRows = null;\n this.nonDisplayedMemory.nrRollUpRows = null;\n }\n this.mode = newMode;\n }\n }, {\n key: 'insertChars',\n value: function insertChars(chars) {\n for (var i = 0; i < chars.length; i++) {\n this.writeScreen.insertChar(chars[i]);\n }\n var screen = this.writeScreen === this.displayedMemory ? 'DISP' : 'NON_DISP';\n logger.log('INFO', screen + ': ' + this.writeScreen.getDisplayText(true));\n if (this.mode === 'MODE_PAINT-ON' || this.mode === 'MODE_ROLL-UP') {\n logger.log('TEXT', 'DISPLAYED: ' + this.displayedMemory.getDisplayText(true));\n this.outputDataUpdate();\n }\n }\n }, {\n key: 'ccRCL',\n value: function ccRCL() {\n // Resume Caption Loading (switch mode to Pop On)\n logger.log('INFO', 'RCL - Resume Caption Loading');\n this.setMode('MODE_POP-ON');\n }\n }, {\n key: 'ccBS',\n value: function ccBS() {\n // BackSpace\n logger.log('INFO', 'BS - BackSpace');\n if (this.mode === 'MODE_TEXT') {\n return;\n }\n this.writeScreen.backSpace();\n if (this.writeScreen === this.displayedMemory) {\n this.outputDataUpdate();\n }\n }\n }, {\n key: 'ccAOF',\n value: function ccAOF() {\n // Reserved (formerly Alarm Off)\n return;\n }\n }, {\n key: 'ccAON',\n value: function ccAON() {\n // Reserved (formerly Alarm On)\n return;\n }\n }, {\n key: 'ccDER',\n value: function ccDER() {\n // Delete to End of Row\n logger.log('INFO', 'DER- Delete to End of Row');\n this.writeScreen.clearToEndOfRow();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccRU',\n value: function ccRU(nrRows) {\n //Roll-Up Captions-2,3,or 4 Rows\n logger.log('INFO', 'RU(' + nrRows + ') - Roll Up');\n this.writeScreen = this.displayedMemory;\n this.setMode('MODE_ROLL-UP');\n this.writeScreen.setRollUpRows(nrRows);\n }\n }, {\n key: 'ccFON',\n value: function ccFON() {\n //Flash On\n logger.log('INFO', 'FON - Flash On');\n this.writeScreen.setPen({ flash: true });\n }\n }, {\n key: 'ccRDC',\n value: function ccRDC() {\n // Resume Direct Captioning (switch mode to PaintOn)\n logger.log('INFO', 'RDC - Resume Direct Captioning');\n this.setMode('MODE_PAINT-ON');\n }\n }, {\n key: 'ccTR',\n value: function ccTR() {\n // Text Restart in text mode (not supported, however)\n logger.log('INFO', 'TR');\n this.setMode('MODE_TEXT');\n }\n }, {\n key: 'ccRTD',\n value: function ccRTD() {\n // Resume Text Display in Text mode (not supported, however)\n logger.log('INFO', 'RTD');\n this.setMode('MODE_TEXT');\n }\n }, {\n key: 'ccEDM',\n value: function ccEDM() {\n // Erase Displayed Memory\n logger.log('INFO', 'EDM - Erase Displayed Memory');\n this.displayedMemory.reset();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccCR',\n value: function ccCR() {\n // Carriage Return\n logger.log('CR - Carriage Return');\n this.writeScreen.rollUp();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccENM',\n value: function ccENM() {\n //Erase Non-Displayed Memory\n logger.log('INFO', 'ENM - Erase Non-displayed Memory');\n this.nonDisplayedMemory.reset();\n }\n }, {\n key: 'ccEOC',\n value: function ccEOC() {\n //End of Caption (Flip Memories)\n logger.log('INFO', 'EOC - End Of Caption');\n if (this.mode === 'MODE_POP-ON') {\n var tmp = this.displayedMemory;\n this.displayedMemory = this.nonDisplayedMemory;\n this.nonDisplayedMemory = tmp;\n this.writeScreen = this.nonDisplayedMemory;\n logger.log('TEXT', 'DISP: ' + this.displayedMemory.getDisplayText());\n }\n this.outputDataUpdate();\n }\n }, {\n key: 'ccTO',\n value: function ccTO(nrCols) {\n // Tab Offset 1,2, or 3 columns\n logger.log('INFO', 'TO(' + nrCols + ') - Tab Offset');\n this.writeScreen.moveCursor(nrCols);\n }\n }, {\n key: 'ccMIDROW',\n value: function ccMIDROW(secondByte) {\n // Parse MIDROW command\n var styles = { flash: false };\n styles.underline = secondByte % 2 === 1;\n styles.italics = secondByte >= 0x2e;\n if (!styles.italics) {\n var colorIndex = Math.floor(secondByte / 2) - 0x10;\n var colors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta'];\n styles.foreground = colors[colorIndex];\n } else {\n styles.foreground = 'white';\n }\n logger.log('INFO', 'MIDROW: ' + JSON.stringify(styles));\n this.writeScreen.setPen(styles);\n }\n }, {\n key: 'outputDataUpdate',\n value: function outputDataUpdate() {\n var t = logger.time;\n if (t === null) {\n return;\n }\n if (this.outputFilter) {\n if (this.outputFilter.updateData) {\n this.outputFilter.updateData(t, this.displayedMemory);\n }\n if (this.cueStartTime === null && !this.displayedMemory.isEmpty()) {\n // Start of a new cue\n this.cueStartTime = t;\n } else {\n if (!this.displayedMemory.equals(this.lastOutputScreen)) {\n if (this.outputFilter.newCue) {\n this.outputFilter.newCue(this.cueStartTime, t, this.lastOutputScreen);\n }\n this.cueStartTime = this.displayedMemory.isEmpty() ? null : t;\n }\n }\n this.lastOutputScreen.copy(this.displayedMemory);\n }\n }\n }, {\n key: 'cueSplitAtTime',\n value: function cueSplitAtTime(t) {\n if (this.outputFilter) {\n if (!this.displayedMemory.isEmpty()) {\n if (this.outputFilter.newCue) {\n this.outputFilter.newCue(this.cueStartTime, t, this.displayedMemory);\n }\n this.cueStartTime = t;\n }\n }\n }\n }]);\n\n return Cea608Channel;\n}();\n\nvar Cea608Parser = function () {\n function Cea608Parser(field, out1, out2) {\n _classCallCheck(this, Cea608Parser);\n\n this.field = field || 1;\n this.outputs = [out1, out2];\n this.channels = [new Cea608Channel(1, out1), new Cea608Channel(2, out2)];\n this.currChNr = -1; // Will be 1 or 2\n this.lastCmdA = null; // First byte of last command\n this.lastCmdB = null; // Second byte of last command\n this.bufferedData = [];\n this.startTime = null;\n this.lastTime = null;\n this.dataCounters = { 'padding': 0, 'char': 0, 'cmd': 0, 'other': 0 };\n }\n\n _createClass(Cea608Parser, [{\n key: 'getHandler',\n value: function getHandler(index) {\n return this.channels[index].getHandler();\n }\n }, {\n key: 'setHandler',\n value: function setHandler(index, newHandler) {\n this.channels[index].setHandler(newHandler);\n }\n\n /**\n * Add data for time t in forms of list of bytes (unsigned ints). The bytes are treated as pairs.\n */\n\n }, {\n key: 'addData',\n value: function addData(t, byteList) {\n var cmdFound,\n a,\n b,\n charsFound = false;\n\n this.lastTime = t;\n logger.setTime(t);\n\n for (var i = 0; i < byteList.length; i += 2) {\n a = byteList[i] & 0x7f;\n b = byteList[i + 1] & 0x7f;\n if (a === 0 && b === 0) {\n this.dataCounters.padding += 2;\n continue;\n } else {\n logger.log('DATA', '[' + numArrayToHexArray([byteList[i], byteList[i + 1]]) + '] -> (' + numArrayToHexArray([a, b]) + ')');\n }\n cmdFound = this.parseCmd(a, b);\n if (!cmdFound) {\n cmdFound = this.parseMidrow(a, b);\n }\n if (!cmdFound) {\n cmdFound = this.parsePAC(a, b);\n }\n if (!cmdFound) {\n cmdFound = this.parseBackgroundAttributes(a, b);\n }\n if (!cmdFound) {\n charsFound = this.parseChars(a, b);\n if (charsFound) {\n if (this.currChNr && this.currChNr >= 0) {\n var channel = this.channels[this.currChNr - 1];\n channel.insertChars(charsFound);\n } else {\n logger.log('WARNING', 'No channel found yet. TEXT-MODE?');\n }\n }\n }\n if (cmdFound) {\n this.dataCounters.cmd += 2;\n } else if (charsFound) {\n this.dataCounters.char += 2;\n } else {\n this.dataCounters.other += 2;\n logger.log('WARNING', 'Couldn\\'t parse cleaned data ' + numArrayToHexArray([a, b]) + ' orig: ' + numArrayToHexArray([byteList[i], byteList[i + 1]]));\n }\n }\n }\n\n /**\n * Parse Command.\n * @returns {Boolean} Tells if a command was found\n */\n\n }, {\n key: 'parseCmd',\n value: function parseCmd(a, b) {\n var chNr = null;\n\n var cond1 = (a === 0x14 || a === 0x1C) && 0x20 <= b && b <= 0x2F;\n var cond2 = (a === 0x17 || a === 0x1F) && 0x21 <= b && b <= 0x23;\n if (!(cond1 || cond2)) {\n return false;\n }\n\n if (a === this.lastCmdA && b === this.lastCmdB) {\n this.lastCmdA = null;\n this.lastCmdB = null; // Repeated commands are dropped (once)\n logger.log('DEBUG', 'Repeated command (' + numArrayToHexArray([a, b]) + ') is dropped');\n return true;\n }\n\n if (a === 0x14 || a === 0x17) {\n chNr = 1;\n } else {\n chNr = 2; // (a === 0x1C || a=== 0x1f)\n }\n\n var channel = this.channels[chNr - 1];\n\n if (a === 0x14 || a === 0x1C) {\n if (b === 0x20) {\n channel.ccRCL();\n } else if (b === 0x21) {\n channel.ccBS();\n } else if (b === 0x22) {\n channel.ccAOF();\n } else if (b === 0x23) {\n channel.ccAON();\n } else if (b === 0x24) {\n channel.ccDER();\n } else if (b === 0x25) {\n channel.ccRU(2);\n } else if (b === 0x26) {\n channel.ccRU(3);\n } else if (b === 0x27) {\n channel.ccRU(4);\n } else if (b === 0x28) {\n channel.ccFON();\n } else if (b === 0x29) {\n channel.ccRDC();\n } else if (b === 0x2A) {\n channel.ccTR();\n } else if (b === 0x2B) {\n channel.ccRTD();\n } else if (b === 0x2C) {\n channel.ccEDM();\n } else if (b === 0x2D) {\n channel.ccCR();\n } else if (b === 0x2E) {\n channel.ccENM();\n } else if (b === 0x2F) {\n channel.ccEOC();\n }\n } else {\n //a == 0x17 || a == 0x1F\n channel.ccTO(b - 0x20);\n }\n this.lastCmdA = a;\n this.lastCmdB = b;\n this.currChNr = chNr;\n return true;\n }\n\n /**\n * Parse midrow styling command\n * @returns {Boolean}\n */\n\n }, {\n key: 'parseMidrow',\n value: function parseMidrow(a, b) {\n var chNr = null;\n\n if ((a === 0x11 || a === 0x19) && 0x20 <= b && b <= 0x2f) {\n if (a === 0x11) {\n chNr = 1;\n } else {\n chNr = 2;\n }\n if (chNr !== this.currChNr) {\n logger.log('ERROR', 'Mismatch channel in midrow parsing');\n return false;\n }\n var channel = this.channels[chNr - 1];\n channel.ccMIDROW(b);\n logger.log('DEBUG', 'MIDROW (' + numArrayToHexArray([a, b]) + ')');\n return true;\n }\n return false;\n }\n /**\n * Parse Preable Access Codes (Table 53).\n * @returns {Boolean} Tells if PAC found\n */\n\n }, {\n key: 'parsePAC',\n value: function parsePAC(a, b) {\n\n var chNr = null;\n var row = null;\n\n var case1 = (0x11 <= a && a <= 0x17 || 0x19 <= a && a <= 0x1F) && 0x40 <= b && b <= 0x7F;\n var case2 = (a === 0x10 || a === 0x18) && 0x40 <= b && b <= 0x5F;\n if (!(case1 || case2)) {\n return false;\n }\n\n if (a === this.lastCmdA && b === this.lastCmdB) {\n this.lastCmdA = null;\n this.lastCmdB = null;\n return true; // Repeated commands are dropped (once)\n }\n\n chNr = a <= 0x17 ? 1 : 2;\n\n if (0x40 <= b && b <= 0x5F) {\n row = chNr === 1 ? rowsLowCh1[a] : rowsLowCh2[a];\n } else {\n // 0x60 <= b <= 0x7F\n row = chNr === 1 ? rowsHighCh1[a] : rowsHighCh2[a];\n }\n var pacData = this.interpretPAC(row, b);\n var channel = this.channels[chNr - 1];\n channel.setPAC(pacData);\n this.lastCmdA = a;\n this.lastCmdB = b;\n this.currChNr = chNr;\n return true;\n }\n\n /**\n * Interpret the second byte of the pac, and return the information.\n * @returns {Object} pacData with style parameters.\n */\n\n }, {\n key: 'interpretPAC',\n value: function interpretPAC(row, byte) {\n var pacIndex = byte;\n var pacData = { color: null, italics: false, indent: null, underline: false, row: row };\n\n if (byte > 0x5F) {\n pacIndex = byte - 0x60;\n } else {\n pacIndex = byte - 0x40;\n }\n pacData.underline = (pacIndex & 1) === 1;\n if (pacIndex <= 0xd) {\n pacData.color = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'white'][Math.floor(pacIndex / 2)];\n } else if (pacIndex <= 0xf) {\n pacData.italics = true;\n pacData.color = 'white';\n } else {\n pacData.indent = Math.floor((pacIndex - 0x10) / 2) * 4;\n }\n return pacData; // Note that row has zero offset. The spec uses 1.\n }\n\n /**\n * Parse characters.\n * @returns An array with 1 to 2 codes corresponding to chars, if found. null otherwise.\n */\n\n }, {\n key: 'parseChars',\n value: function parseChars(a, b) {\n\n var channelNr = null,\n charCodes = null,\n charCode1 = null;\n\n if (a >= 0x19) {\n channelNr = 2;\n charCode1 = a - 8;\n } else {\n channelNr = 1;\n charCode1 = a;\n }\n if (0x11 <= charCode1 && charCode1 <= 0x13) {\n // Special character\n var oneCode = b;\n if (charCode1 === 0x11) {\n oneCode = b + 0x50;\n } else if (charCode1 === 0x12) {\n oneCode = b + 0x70;\n } else {\n oneCode = b + 0x90;\n }\n logger.log('INFO', 'Special char \\'' + getCharForByte(oneCode) + '\\' in channel ' + channelNr);\n charCodes = [oneCode];\n } else if (0x20 <= a && a <= 0x7f) {\n charCodes = b === 0 ? [a] : [a, b];\n }\n if (charCodes) {\n var hexCodes = numArrayToHexArray(charCodes);\n logger.log('DEBUG', 'Char codes = ' + hexCodes.join(','));\n this.lastCmdA = null;\n this.lastCmdB = null;\n }\n return charCodes;\n }\n\n /**\n * Parse extended background attributes as well as new foreground color black.\n * @returns{Boolean} Tells if background attributes are found\n */\n\n }, {\n key: 'parseBackgroundAttributes',\n value: function parseBackgroundAttributes(a, b) {\n var bkgData, index, chNr, channel;\n\n var case1 = (a === 0x10 || a === 0x18) && 0x20 <= b && b <= 0x2f;\n var case2 = (a === 0x17 || a === 0x1f) && 0x2d <= b && b <= 0x2f;\n if (!(case1 || case2)) {\n return false;\n }\n bkgData = {};\n if (a === 0x10 || a === 0x18) {\n index = Math.floor((b - 0x20) / 2);\n bkgData.background = backgroundColors[index];\n if (b % 2 === 1) {\n bkgData.background = bkgData.background + '_semi';\n }\n } else if (b === 0x2d) {\n bkgData.background = 'transparent';\n } else {\n bkgData.foreground = 'black';\n if (b === 0x2f) {\n bkgData.underline = true;\n }\n }\n chNr = a < 0x18 ? 1 : 2;\n channel = this.channels[chNr - 1];\n channel.setBkgData(bkgData);\n this.lastCmdA = null;\n this.lastCmdB = null;\n return true;\n }\n\n /**\n * Reset state of parser and its channels.\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n for (var i = 0; i < this.channels.length; i++) {\n if (this.channels[i]) {\n this.channels[i].reset();\n }\n }\n this.lastCmdA = null;\n this.lastCmdB = null;\n }\n\n /**\n * Trigger the generation of a cue, and the start of a new one if displayScreens are not empty.\n */\n\n }, {\n key: 'cueSplitAtTime',\n value: function cueSplitAtTime(t) {\n for (var i = 0; i < this.channels.length; i++) {\n if (this.channels[i]) {\n this.channels[i].cueSplitAtTime(t);\n }\n }\n }\n }]);\n\n return Cea608Parser;\n}();\n\nexports.default = Cea608Parser;\n\n},{}],41:[function(_dereq_,module,exports){\n'use strict';\n\nvar Cues = {\n\n newCue: function newCue(track, startTime, endTime, captionScreen) {\n var row;\n var cue;\n var indenting;\n var indent;\n var text;\n var VTTCue = window.VTTCue || window.TextTrackCue;\n\n for (var r = 0; r < captionScreen.rows.length; r++) {\n row = captionScreen.rows[r];\n indenting = true;\n indent = 0;\n text = '';\n\n if (!row.isEmpty()) {\n for (var c = 0; c < row.chars.length; c++) {\n if (row.chars[c].uchar.match(/\\s/) && indenting) {\n indent++;\n } else {\n text += row.chars[c].uchar;\n indenting = false;\n }\n }\n cue = new VTTCue(startTime, endTime, text.trim());\n\n if (indent >= 16) {\n indent--;\n } else {\n indent++;\n }\n\n // VTTCue.line get's flakey when using controls, so let's now include line 13&14\n // also, drop line 1 since it's to close to the top\n if (navigator.userAgent.match(/Firefox\\//)) {\n cue.line = r + 1;\n } else {\n cue.line = r > 7 ? r - 2 : r + 1;\n }\n cue.align = 'left';\n cue.position = 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\\//) ? 50 : 0);\n track.addCue(cue);\n }\n }\n }\n\n};\n\nmodule.exports = Cues;\n\n},{}],42:[function(_dereq_,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*\n * compute an Exponential Weighted moving average\n * - https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average\n * - heavily inspired from shaka-player\n */\n\nvar EWMA = function () {\n\n // About half of the estimated value will be from the last |halfLife| samples by weight.\n\n function EWMA(halfLife) {\n _classCallCheck(this, EWMA);\n\n // Larger values of alpha expire historical data more slowly.\n this.alpha_ = halfLife ? Math.exp(Math.log(0.5) / halfLife) : 0;\n this.estimate_ = 0;\n this.totalWeight_ = 0;\n }\n\n _createClass(EWMA, [{\n key: \"sample\",\n value: function sample(weight, value) {\n var adjAlpha = Math.pow(this.alpha_, weight);\n this.estimate_ = value * (1 - adjAlpha) + adjAlpha * this.estimate_;\n this.totalWeight_ += weight;\n }\n }, {\n key: \"getTotalWeight\",\n value: function getTotalWeight() {\n return this.totalWeight_;\n }\n }, {\n key: \"getEstimate\",\n value: function getEstimate() {\n if (this.alpha_) {\n var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);\n return this.estimate_ / zeroFactor;\n } else {\n return this.estimate_;\n }\n }\n }]);\n\n return EWMA;\n}();\n\nexports.default = EWMA;\n\n},{}],43:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nfunction noop() {}\n\nvar fakeLogger = {\n trace: noop,\n debug: noop,\n log: noop,\n warn: noop,\n info: noop,\n error: noop\n};\n\nvar exportedLogger = fakeLogger;\n\n/*globals self: false */\n\n//let lastCallTime;\n// function formatMsgWithTimeInfo(type, msg) {\n// const now = Date.now();\n// const diff = lastCallTime ? '+' + (now - lastCallTime) : '0';\n// lastCallTime = now;\n// msg = (new Date(now)).toISOString() + ' | [' + type + '] > ' + msg + ' ( ' + diff + ' ms )';\n// return msg;\n// }\n\nfunction formatMsg(type, msg) {\n msg = '[' + type + '] > ' + msg;\n return msg;\n}\n\nfunction consolePrintFn(type) {\n var func = self.console[type];\n if (func) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args[0]) {\n args[0] = formatMsg(type, args[0]);\n }\n func.apply(self.console, args);\n };\n }\n return noop;\n}\n\nfunction exportLoggerFunctions(debugConfig) {\n for (var _len2 = arguments.length, functions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n functions[_key2 - 1] = arguments[_key2];\n }\n\n functions.forEach(function (type) {\n exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);\n });\n}\n\nvar enableLogs = exports.enableLogs = function enableLogs(debugConfig) {\n if (debugConfig === true || (typeof debugConfig === 'undefined' ? 'undefined' : _typeof(debugConfig)) === 'object') {\n exportLoggerFunctions(debugConfig,\n // Remove out from list here to hard-disable a log-level\n //'trace',\n 'debug', 'log', 'info', 'warn', 'error');\n // Some browsers don't allow to use bind on console object anyway\n // fallback to default if needed\n try {\n exportedLogger.log();\n } catch (e) {\n exportedLogger = fakeLogger;\n }\n } else {\n exportedLogger = fakeLogger;\n }\n};\n\nvar logger = exports.logger = exportedLogger;\n\n},{}],44:[function(_dereq_,module,exports){\n'use strict';\n\nif (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {\n ArrayBuffer.prototype.slice = function (start, end) {\n var that = new Uint8Array(this);\n if (end === undefined) {\n end = that.length;\n }\n var result = new ArrayBuffer(end - start);\n var resultArray = new Uint8Array(result);\n for (var i = 0; i < resultArray.length; i++) {\n resultArray[i] = that[i + start];\n }\n return result;\n };\n}\n\n},{}],45:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * TimeRanges to string helper\n */\n\nvar TimeRanges = function () {\n function TimeRanges() {\n _classCallCheck(this, TimeRanges);\n }\n\n _createClass(TimeRanges, null, [{\n key: 'toString',\n value: function toString(r) {\n var log = '',\n len = r.length;\n for (var i = 0; i < len; i++) {\n log += '[' + r.start(i).toFixed(3) + ',' + r.end(i).toFixed(3) + ']';\n }\n return log;\n }\n }]);\n\n return TimeRanges;\n}();\n\nexports.default = TimeRanges;\n\n},{}],46:[function(_dereq_,module,exports){\n'use strict';\n\nvar URLHelper = {\n // build an absolute URL from a relative one using the provided baseURL\n // if relativeURL is an absolute URL it will be returned as is.\n buildAbsoluteURL: function buildAbsoluteURL(baseURL, relativeURL) {\n // remove any remaining space and CRLF\n relativeURL = relativeURL.trim();\n if (/^[a-z]+:/i.test(relativeURL)) {\n // complete url, not relative\n return relativeURL;\n }\n\n var relativeURLQuery = null;\n var relativeURLHash = null;\n\n var relativeURLHashSplit = /^([^#]*)(.*)$/.exec(relativeURL);\n if (relativeURLHashSplit) {\n relativeURLHash = relativeURLHashSplit[2];\n relativeURL = relativeURLHashSplit[1];\n }\n var relativeURLQuerySplit = /^([^\\?]*)(.*)$/.exec(relativeURL);\n if (relativeURLQuerySplit) {\n relativeURLQuery = relativeURLQuerySplit[2];\n relativeURL = relativeURLQuerySplit[1];\n }\n\n var baseURLHashSplit = /^([^#]*)(.*)$/.exec(baseURL);\n if (baseURLHashSplit) {\n baseURL = baseURLHashSplit[1];\n }\n var baseURLQuerySplit = /^([^\\?]*)(.*)$/.exec(baseURL);\n if (baseURLQuerySplit) {\n baseURL = baseURLQuerySplit[1];\n }\n\n var baseURLDomainSplit = /^(([a-z]+:)?\\/\\/[a-z0-9\\.\\-_~]+(:[0-9]+)?)?(\\/.*)$/i.exec(baseURL);\n if (!baseURLDomainSplit) {\n throw new Error('Error trying to parse base URL.');\n }\n\n // e.g. 'http:', 'https:', ''\n var baseURLProtocol = baseURLDomainSplit[2] || '';\n // e.g. 'http://example.com', '//example.com', ''\n var baseURLProtocolDomain = baseURLDomainSplit[1] || '';\n // e.g. '/a/b/c/playlist.m3u8'\n var baseURLPath = baseURLDomainSplit[4];\n\n var builtURL = null;\n if (/^\\/\\//.test(relativeURL)) {\n // relative url starts wth '//' so copy protocol (which may be '' if baseUrl didn't provide one)\n builtURL = baseURLProtocol + '//' + URLHelper.buildAbsolutePath('', relativeURL.substring(2));\n } else if (/^\\//.test(relativeURL)) {\n // relative url starts with '/' so start from root of domain\n builtURL = baseURLProtocolDomain + '/' + URLHelper.buildAbsolutePath('', relativeURL.substring(1));\n } else {\n builtURL = URLHelper.buildAbsolutePath(baseURLProtocolDomain + baseURLPath, relativeURL);\n }\n\n // put the query and hash parts back\n if (relativeURLQuery) {\n builtURL += relativeURLQuery;\n }\n if (relativeURLHash) {\n builtURL += relativeURLHash;\n }\n return builtURL;\n },\n\n // build an absolute path using the provided basePath\n // adapted from https://developer.mozilla.org/en-US/docs/Web/API/document/cookie#Using_relative_URLs_in_the_path_parameter\n // this does not handle the case where relativePath is \"/\" or \"//\". These cases should be handled outside this.\n buildAbsolutePath: function buildAbsolutePath(basePath, relativePath) {\n var sRelPath = relativePath;\n var nUpLn,\n sDir = '',\n sPath = basePath.replace(/[^\\/]*$/, sRelPath.replace(/(\\/|^)(?:\\.?\\/+)+/g, '$1'));\n for (var nEnd, nStart = 0; nEnd = sPath.indexOf('/../', nStart), nEnd > -1; nStart = nEnd + nUpLn) {\n nUpLn = /^\\/(?:\\.\\.\\/)*/.exec(sPath.slice(nEnd))[0].length;\n sDir = (sDir + sPath.substring(nStart, nEnd)).replace(new RegExp('(?:\\\\\\/+[^\\\\\\/]*){0,' + (nUpLn - 1) / 3 + '}$'), '/');\n }\n return sDir + sPath.substr(nStart);\n }\n};\n\nmodule.exports = URLHelper;\n\n},{}],47:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * XHR based logger\n */\n\nvar _logger = _dereq_(43);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar XhrLoader = function () {\n function XhrLoader(config) {\n _classCallCheck(this, XhrLoader);\n\n if (config && config.xhrSetup) {\n this.xhrSetup = config.xhrSetup;\n }\n }\n\n _createClass(XhrLoader, [{\n key: 'destroy',\n value: function destroy() {\n this.abort();\n this.loader = null;\n }\n }, {\n key: 'abort',\n value: function abort() {\n var loader = this.loader;\n if (loader && loader.readyState !== 4) {\n this.stats.aborted = true;\n loader.abort();\n }\n\n window.clearTimeout(this.requestTimeout);\n this.requestTimeout = null;\n window.clearTimeout(this.retryTimeout);\n this.retryTimeout = null;\n }\n }, {\n key: 'load',\n value: function load(context, config, callbacks) {\n this.context = context;\n this.config = config;\n this.callbacks = callbacks;\n this.stats = { trequest: performance.now(), retry: 0 };\n this.retryDelay = config.retryDelay;\n this.loadInternal();\n }\n }, {\n key: 'loadInternal',\n value: function loadInternal() {\n var xhr,\n context = this.context;\n\n if (typeof XDomainRequest !== 'undefined') {\n xhr = this.loader = new XDomainRequest();\n } else {\n xhr = this.loader = new XMLHttpRequest();\n }\n\n xhr.onreadystatechange = this.readystatechange.bind(this);\n xhr.onprogress = this.loadprogress.bind(this);\n\n xhr.open('GET', context.url, true);\n\n if (context.rangeEnd) {\n xhr.setRequestHeader('Range', 'bytes=' + context.rangeStart + '-' + (context.rangeEnd - 1));\n }\n xhr.responseType = context.responseType;\n var stats = this.stats;\n stats.tfirst = 0;\n stats.loaded = 0;\n if (this.xhrSetup) {\n this.xhrSetup(xhr, context.url);\n }\n // setup timeout before we perform request\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), this.config.timeout);\n xhr.send();\n }\n }, {\n key: 'readystatechange',\n value: function readystatechange(event) {\n var xhr = event.currentTarget,\n readyState = xhr.readyState,\n stats = this.stats,\n context = this.context,\n config = this.config;\n\n // don't proceed if xhr has been aborted\n if (stats.aborted) {\n return;\n }\n\n // in any case clear the current xhrs timeout\n window.clearTimeout(this.requestTimeout);\n\n // HEADERS_RECEIVED\n if (readyState >= 2) {\n if (stats.tfirst === 0) {\n stats.tfirst = Math.max(performance.now(), stats.trequest);\n // reset timeout to total timeout duration minus the time it took to receive headers\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout - (stats.tfirst - stats.trequest));\n }\n if (readyState === 4) {\n var status = xhr.status;\n // http status between 200 to 299 are all successful\n if (status >= 200 && status < 300) {\n stats.tload = Math.max(stats.tfirst, performance.now());\n var data = void 0,\n len = void 0;\n if (context.responseType === 'arraybuffer') {\n data = xhr.response;\n len = data.byteLength;\n } else {\n data = xhr.responseText;\n len = data.length;\n }\n stats.loaded = stats.total = len;\n var response = { url: xhr.responseURL, data: data };\n this.callbacks.onSuccess(response, stats, context);\n } else {\n // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error\n if (stats.retry >= config.maxRetry || status >= 400 && status < 499) {\n _logger.logger.error(status + ' while loading ' + context.url);\n this.callbacks.onError({ code: status, text: xhr.statusText }, context);\n } else {\n // retry\n _logger.logger.warn(status + ' while loading ' + context.url + ', retrying in ' + this.retryDelay + '...');\n // aborts and resets internal state\n this.destroy();\n // schedule retry\n this.retryTimeout = window.setTimeout(this.loadInternal.bind(this), this.retryDelay);\n // set exponential backoff\n this.retryDelay = Math.min(2 * this.retryDelay, config.maxRetryDelay);\n stats.retry++;\n }\n }\n }\n }\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout() {\n _logger.logger.warn('timeout while loading ' + this.context.url);\n this.callbacks.onTimeout(this.stats, this.context);\n }\n }, {\n key: 'loadprogress',\n value: function loadprogress(event) {\n var stats = this.stats;\n stats.loaded = event.loaded;\n if (event.lengthComputable) {\n stats.total = event.total;\n }\n var onProgress = this.callbacks.onProgress;\n if (onProgress) {\n // last args is to provide on progress data\n onProgress(stats, this.context, null);\n }\n }\n }]);\n\n return XhrLoader;\n}();\n\nexports.default = XhrLoader;\n\n},{\"43\":43}]},{},[31])(31)\n});\n//# sourceMappingURL=hls.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hls.js/dist/hls.js\n// module id = 90\n// module chunks = 0","module.exports = \"<div class=\\\"media-control-background\\\" data-background></div>\\n<div class=\\\"media-control-layer\\\" data-controls>\\n <% var renderBar = function(name) { %>\\n <div class=\\\"bar-container\\\" data-<%= name %>>\\n <div class=\\\"bar-background\\\" data-<%= name %>>\\n <div class=\\\"bar-fill-1\\\" data-<%= name %>></div>\\n <div class=\\\"bar-fill-2\\\" data-<%= name %>></div>\\n <div class=\\\"bar-hover\\\" data-<%= name %>></div>\\n </div>\\n <div class=\\\"bar-scrubber\\\" data-<%= name %>>\\n <div class=\\\"bar-scrubber-icon\\\" data-<%= name %>></div>\\n </div>\\n </div>\\n <% }; %>\\n <% var renderSegmentedBar = function(name, segments) {\\n segments = segments || 10; %>\\n <div class=\\\"bar-container\\\" data-<%= name %>>\\n <% for (var i = 0; i < segments; i++) { %>\\n <div class=\\\"segmented-bar-element\\\" data-<%= name %>></div>\\n <% } %>\\n </div>\\n <% }; %>\\n <% var renderDrawer = function(name, renderContent) { %>\\n <div class=\\\"drawer-container\\\" data-<%= name %>>\\n <div class=\\\"drawer-icon-container\\\" data-<%= name %>>\\n <div class=\\\"drawer-icon media-control-icon\\\" data-<%= name %>></div>\\n <span class=\\\"drawer-text\\\" data-<%= name %>></span>\\n </div>\\n <% renderContent(name); %>\\n </div>\\n <% }; %>\\n <% var renderIndicator = function(name) { %>\\n <div class=\\\"media-control-indicator\\\" data-<%= name %>></div>\\n <% }; %>\\n <% var renderButton = function(name) { %>\\n <button type=\\\"button\\\" class=\\\"media-control-button media-control-icon\\\" data-<%= name %>></button>\\n <% }; %>\\n <% var templates = {\\n bar: renderBar,\\n segmentedBar: renderSegmentedBar,\\n };\\n var render = function(settingsList) {\\n settingsList.forEach(function(setting) {\\n if(setting === \\\"seekbar\\\") {\\n renderBar(setting);\\n } else if (setting === \\\"volume\\\") {\\n renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function(name) { return renderSegmentedBar(name); });\\n } else if (setting === \\\"duration\\\" || setting === \\\"position\\\") {\\n renderIndicator(setting);\\n } else {\\n renderButton(setting);\\n }\\n });\\n }; %>\\n <% if (settings.default && settings.default.length) { %>\\n <div class=\\\"media-control-center-panel\\\" data-media-control>\\n <% render(settings.default); %>\\n </div>\\n <% } %>\\n <% if (settings.left && settings.left.length) { %>\\n <div class=\\\"media-control-left-panel\\\" data-media-control>\\n <% render(settings.left); %>\\n </div>\\n <% } %>\\n <% if (settings.right && settings.right.length) { %>\\n <div class=\\\"media-control-right-panel\\\" data-media-control>\\n <% render(settings.right); %>\\n </div>\\n <% } %>\\n</div>\\n\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/media_control/public/media-control.html\n// module id = 91\n// module chunks = 0","module.exports = \"<param name=\\\"movie\\\" value=\\\"<%= swfPath %>?inline=1\\\">\\n<param name=\\\"quality\\\" value=\\\"autohigh\\\">\\n<param name=\\\"swliveconnect\\\" value=\\\"true\\\">\\n<param name=\\\"allowScriptAccess\\\" value=\\\"always\\\">\\n<param name=\\\"bgcolor\\\" value=\\\"#000000\\\">\\n<param name=\\\"allowFullScreen\\\" value=\\\"false\\\">\\n<param name=\\\"wmode\\\" value=\\\"<%= wmode %>\\\">\\n<param name=\\\"tabindex\\\" value=\\\"1\\\">\\n<param name=\\\"FlashVars\\\" value=\\\"playbackId=<%= playbackId %>&callback=<%= callbackName %>\\\">\\n<embed\\n name=\\\"<%= cid %>\\\"\\n type=\\\"application/x-shockwave-flash\\\"\\n disabled=\\\"disabled\\\"\\n tabindex=\\\"-1\\\"\\n enablecontextmenu=\\\"false\\\"\\n allowScriptAccess=\\\"always\\\"\\n quality=\\\"autohigh\\\"\\n pluginspage=\\\"http://www.macromedia.com/go/getflashplayer\\\"\\n wmode=\\\"<%= wmode %>\\\"\\n swliveconnect=\\\"true\\\"\\n allowfullscreen=\\\"false\\\"\\n bgcolor=\\\"#000000\\\"\\n FlashVars=\\\"playbackId=<%= playbackId %>&callback=<%= callbackName %>\\\"\\n src=\\\"<%= swfPath %>\\\"\\n width=\\\"100%\\\"\\n height=\\\"100%\\\">\\n</embed>\\n\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/playbacks/base_flash_playback/public/flash.html\n// module id = 92\n// module chunks = 0","module.exports = \"<canvas data-no-op-canvas></canvas>\\n<p data-no-op-msg><%=message%><p>\\n\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/playbacks/no_op/public/error.html\n// module id = 93\n// module chunks = 0","module.exports = \"<div class=\\\"live-info\\\"><%= live %></div>\\n<button type=\\\"button\\\" class=\\\"live-button\\\"><%= backToLive %></button>\\n\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/dvr_controls/public/index.html\n// module id = 94\n// module chunks = 0","module.exports = \"<div class=\\\"play-wrapper\\\" data-poster></div>\\n\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/poster/public/poster.html\n// module id = 95\n// module chunks = 0","module.exports = \"<span data-seek-time></span>\\n<span data-duration></span>\\n\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/seek_time/public/seek_time.html\n// module id = 96\n// module chunks = 0","module.exports = \"<div data-bounce1></div><div data-bounce2></div><div data-bounce3></div>\\n\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/spinner_three_bounce/public/spinner.html\n// module id = 97\n// module chunks = 0","module.exports = \"<div data-watermark data-watermark-<%=position %>>\\n<% if(typeof imageLink !== 'undefined') { %>\\n<a target=_blank href=\\\"<%= imageLink %>\\\">\\n<% } %>\\n<img src=\\\"<%= imageUrl %>\\\">\\n<% if(typeof imageLink !== 'undefined') { %>\\n</a>\\n<% } %>\\n</div>\\n\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/watermark/public/watermark.html\n// module id = 98\n// module chunks = 0","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for comparison styles. */\nvar UNORDERED_COMPARE_FLAG = 1,\n PARTIAL_COMPARE_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n * The bitmask may be composed of the following flags:\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = getTag(object);\n objTag = objTag == argsTag ? objectTag : objTag;\n }\n if (!othIsArr) {\n othTag = getTag(other);\n othTag = othTag == argsTag ? objectTag : othTag;\n }\n var objIsObj = objTag == objectTag && !isHostObject(object),\n othIsObj = othTag == objectTag && !isHostObject(other),\n isSameTag = objTag == othTag;\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n }\n if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!seen.has(othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n return seen.add(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, customizer, bitmask, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= UNORDERED_COMPARE_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are **not** supported.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = isEqual;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.isequal/index.js\n// module id = 99\n// module chunks = 0","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) ||\n objectToString.call(value) != objectTag || isHostObject(value)) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return (typeof Ctor == 'function' &&\n Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);\n}\n\nmodule.exports = isPlainObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.isplainobject/index.js\n// module id = 100\n// module chunks = 0","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\nfunction before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n}\n\n/**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\nfunction once(func) {\n return before(2, func);\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = once;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.once/index.js\n// module id = 101\n// module chunks = 0","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n symbolTag = '[object Symbol]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n reLeadingDot = /^\\./,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n splice = arrayProto.splice;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n string = toString(string);\n\n var result = [];\n if (reLeadingDot.test(string)) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result);\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\nfunction result(object, path, defaultValue) {\n path = isKey(path, object) ? [path] : castPath(path);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n object = undefined;\n length = 1;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n}\n\nmodule.exports = result;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.result/index.js\n// module id = 102\n// module chunks = 0","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for comparison styles. */\nvar UNORDERED_COMPARE_FLAG = 1,\n PARTIAL_COMPARE_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n reLeadingDot = /^\\./,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array ? array.length : 0;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\n/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n if (value !== value) {\n return baseFindIndex(array, baseIsNaN, fromIndex);\n }\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a cache value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = isKey(path, object) ? [path] : castPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n * The bitmask may be composed of the following flags:\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = getTag(object);\n objTag = objTag == argsTag ? objectTag : objTag;\n }\n if (!othIsArr) {\n othTag = getTag(other);\n othTag = othTag == argsTag ? objectTag : othTag;\n }\n var objIsObj = objTag == objectTag && !isHostObject(object),\n othIsObj = othTag == objectTag && !isHostObject(other),\n isSameTag = objTag == othTag;\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n }\n if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n}\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n };\n}\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!seen.has(othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n return seen.add(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, customizer, bitmask, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= UNORDERED_COMPARE_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = isKey(path, object) ? [path] : castPath(path);\n\n var result,\n index = -1,\n length = path.length;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result) {\n return result;\n }\n var length = object ? object.length : 0;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\n/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n string = toString(string);\n\n var result = [];\n if (reLeadingDot.test(string)) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity]\n * The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\nfunction uniqBy(array, iteratee) {\n return (array && array.length)\n ? baseUniq(array, baseIteratee(iteratee, 2))\n : [];\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result);\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\n/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = uniqBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.uniqby/index.js\n// module id = 103\n// module chunks = 0","module.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" fill=\\\"#010101\\\" d=\\\"M1.712 1.24h12.6v13.52h-12.6z\\\"></path></svg>\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/icons/03-stop.svg\n// module id = 104\n// module chunks = 0","module.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" fill=\\\"#010101\\\" d=\\\"M11.5 11h-.002v1.502L7.798 10H4.5V6h3.297l3.7-2.502V4.5h.003V11zM11 4.49L7.953 6.5H5v3h2.953L11 11.51V4.49z\\\"></path></svg>\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/icons/04-volume.svg\n// module id = 105\n// module chunks = 0","module.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" fill=\\\"#010101\\\" d=\\\"M9.75 11.51L6.7 9.5H3.75v-3H6.7L9.75 4.49v.664l.497.498V3.498L6.547 6H3.248v4h3.296l3.7 2.502v-2.154l-.497.5v.662zm3-5.165L12.404 6l-1.655 1.653L9.093 6l-.346.345L10.402 8 8.747 9.654l.346.347 1.655-1.653L12.403 10l.348-.346L11.097 8l1.655-1.655z\\\"></path></svg>\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/icons/05-mute.svg\n// module id = 106\n// module chunks = 0","module.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill=\\\"#010101\\\" d=\\\"M7.156 8L4 11.156V8.5H3V13h4.5v-1H4.844L8 8.844 7.156 8zM8.5 3v1h2.657L8 7.157 8.846 8 12 4.844V7.5h1V3H8.5z\\\"></path></svg>\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/icons/06-expand.svg\n// module id = 107\n// module chunks = 0","module.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill=\\\"#010101\\\" d=\\\"M13.5 3.344l-.844-.844L9.5 5.656V3h-1v4.5H13v-1h-2.656L13.5 3.344zM3 9.5h2.656L2.5 12.656l.844.844L6.5 10.344V13h1V8.5H3v1z\\\"></path></svg>\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/icons/07-shrink.svg\n// module id = 108\n// module chunks = 0","module.exports = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\"><path fill=\\\"#010101\\\" d=\\\"M5.375 7.062H2.637V4.26H.502v7.488h2.135V8.9h2.738v2.848h2.133V4.26H5.375v2.802zm5.97-2.81h-2.84v7.496h2.798c2.65 0 4.195-1.607 4.195-3.77v-.022c0-2.162-1.523-3.704-4.154-3.704zm2.06 3.758c0 1.21-.81 1.896-2.03 1.896h-.83V6.093h.83c1.22 0 2.03.696 2.03 1.896v.02z\\\"></path></svg>\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/icons/08-hd.svg\n// module id = 109\n// module chunks = 0","module.exports = __webpack_public_path__ + \"38861cba61c66739c1452c3a71e39852.ttf\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/core/public/Roboto.ttf\n// module id = 110\n// module chunks = 0","module.exports = __webpack_public_path__ + \"4b76590b32dab62bc95c1b7951efae78.swf\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/playbacks/flash/public/Player.swf\n// module id = 111\n// module chunks = 0","module.exports = __webpack_public_path__ + \"809981e5b09d5336c45d72d0869ada2a.swf\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/playbacks/flashls/public/HLSPlayer.swf\n// module id = 112\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file
diff --git a/assets/clapprio/dash-shaka-playback.js b/assets/clapprio/dash-shaka-playback.js
deleted file mode 100644
index 36e555c..0000000
--- a/assets/clapprio/dash-shaka-playback.js
+++ /dev/null
@@ -1,92 +0,0 @@
-(function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("Clappr"));
- else if(typeof define === 'function' && define.amd)
- define(["Clappr"], factory);
- else if(typeof exports === 'object')
- exports["DashShakaPlayback"] = factory(require("Clappr"));
- else
- root["DashShakaPlayback"] = factory(root["Clappr"]);
-})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {
-return /******/ (function(modules) { // webpackBootstrap
-/******/ // The module cache
-/******/ var installedModules = {};
-
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-
-/******/ // Check if module is in cache
-/******/ if(installedModules[moduleId])
-/******/ return installedModules[moduleId].exports;
-
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = installedModules[moduleId] = {
-/******/ exports: {},
-/******/ id: moduleId,
-/******/ loaded: false
-/******/ };
-
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-
-/******/ // Flag the module as loaded
-/******/ module.loaded = true;
-
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-
-
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = modules;
-
-/******/ // expose the module cache
-/******/ __webpack_require__.c = installedModules;
-
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "";
-
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(0);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if('value' in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();var _get=function get(_x2,_x3,_x4){var _again=true;_function: while(_again) {var object=_x2,property=_x3,receiver=_x4;_again = false;if(object === null)object = Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc === undefined){var parent=Object.getPrototypeOf(object);if(parent === null){return undefined;}else {_x2 = parent;_x3 = property;_x4 = receiver;_again = true;desc = parent = undefined;continue _function;}}else if('value' in desc){return desc.value;}else {var getter=desc.get;if(getter === undefined){return undefined;}return getter.call(receiver);}}};function _interopRequireDefault(obj){return obj && obj.__esModule?obj:{'default':obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}}function _inherits(subClass,superClass){if(typeof superClass !== 'function' && superClass !== null){throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__ = superClass;}var _clappr=__webpack_require__(1);var _shakaPlayer=__webpack_require__(2);var _shakaPlayer2=_interopRequireDefault(_shakaPlayer);var SEND_STATS_AT=30 * 1000;var AUTO=-1;var SHAKA_READY='shaka:ready';var DashShakaPlayback=(function(_HTML5Video){_inherits(DashShakaPlayback,_HTML5Video);_createClass(DashShakaPlayback,[{key:'name',get:function get(){return 'dash_shaka_playback';}},{key:'shakaVersion',get:function get(){return _shakaPlayer2['default'].player.Player.version;}},{key:'levels',get:function get(){return this._levels;}},{key:'currentLevel',set:function set(id){var _this=this;this._currentLevelId = id;var isAuto=this._currentLevelId === AUTO;this._player.configure({abr:{enable:!isAuto}});this.trigger(_clappr.Events.PLAYBACK_LEVEL_SWITCH_START);if(!isAuto){this.selectTrack(this.videoTracks.filter(function(t){return t.id === _this._currentLevelId;})[0]);}this.trigger(_clappr.Events.PLAYBACK_LEVEL_SWITCH_END);},get:function get(){return this._currentLevelId || AUTO;}}]);function DashShakaPlayback(options){_classCallCheck(this,DashShakaPlayback);_get(Object.getPrototypeOf(DashShakaPlayback.prototype),'constructor',this).call(this,options);this._levels = [];options.autoPlay && this.play();}_createClass(DashShakaPlayback,[{key:'play',value:function play(){!this._player && this._setup();if(!this.isReady){this.once(SHAKA_READY,this.play);return;}this._src = this.el.src;_get(Object.getPrototypeOf(DashShakaPlayback.prototype),'play',this).call(this);} // skipping setup `setupSrc` on tag video
- },{key:'setupSrc',value:function setupSrc(){} // skipping ready event on video tag in favor of ready on shaka
- },{key:'_ready',value:function _ready(){}},{key:'error', // skipping error handling on video tag in favor of error on shaka
- value:function error(event){_clappr.Log.error('an error was raised by the video tag',event,this.el.error);}},{key:'isHighDefinitionInUse',value:function isHighDefinitionInUse(){return !!this.highDefinition;}},{key:'stop',value:function stop(){var _this2=this;clearInterval(this.sendStatsId);this._sendStats();this._player.unload().then(function(){_get(Object.getPrototypeOf(DashShakaPlayback.prototype),'stop',_this2).call(_this2);_this2._player = null;_this2._isShakaReadyState = false;})['catch'](function(){_clappr.Log.error('shaka could not be unloaded');});}},{key:'getPlaybackType',value:function getPlaybackType(){return (this._player && this._player.isLive()?'live':'vod') || '';}},{key:'selectTrack',value:function selectTrack(track){this._player.selectTrack(track);this._onAdaptation();}},{key:'destroy',value:function destroy(){var _this3=this;clearInterval(this.sendStatsId);if(this._player){this._destroy();}else {this._player.destroy().then(function(){return _this3._destroy();})['catch'](function(){_this3._destroy();_clappr.Log.error('shaka could not be destroyed');});}}},{key:'_setup',value:function _setup(){var _this4=this;this._isShakaReadyState = false;this._player = this._createPlayer();this._options.shakaConfiguration && this._player.configure(this._options.shakaConfiguration);this._options.shakaOnBeforeLoad && this._options.shakaOnBeforeLoad(this._player);var playerLoaded=this._player.load(this._options.src);playerLoaded.then(function(){return _this4._loaded();})['catch'](function(e){return _this4._setupError(e);});}},{key:'_createPlayer',value:function _createPlayer(){var _this5=this;var player=new _shakaPlayer2['default'].Player(this.el);player.addEventListener('error',function(type,shakaError){return _this5._error(type,shakaError);});player.addEventListener('adaptation',function(){return _this5._onAdaptation();});player.addEventListener('buffering',function(e){return _this5._onBuffering(e);});return player;}},{key:'_onBuffering',value:function _onBuffering(e){var event=e.buffering?_clappr.Events.PLAYBACK_BUFFERING:_clappr.Events.PLAYBACK_BUFFERFULL;this.trigger(event);}},{key:'_loaded',value:function _loaded(){this._isShakaReadyState = true;this.trigger(SHAKA_READY);this._shakaReady();this._startToSendStats();this._fillLevels();}},{key:'_fillLevels',value:function _fillLevels(){if(this._levels.length === 0){this._levels = this.videoTracks.map(function(videoTrack){return {id:videoTrack.id,label:videoTrack.height + 'p'};}).reverse();this.trigger(_clappr.Events.PLAYBACK_LEVELS_AVAILABLE,this.levels);}}},{key:'_startToSendStats',value:function _startToSendStats(){var _this6=this;this.sendStatsId = setInterval(function(){return _this6._sendStats();},SEND_STATS_AT);}},{key:'_sendStats',value:function _sendStats(){this.trigger(_clappr.Events.PLAYBACK_STATS_ADD,this._player.getStats());}},{key:'_setupError',value:function _setupError(e){this._error('error',{detail:e.detail});}},{key:'_error',value:function _error(type,shakaError){_clappr.Log.error('an error was raised support=',DashShakaPlayback.support);_clappr.Log.error('an error was raised by shaka player',shakaError.detail);this.trigger(_clappr.Events.PLAYBACK_ERROR,shakaError.detail,this.name);}},{key:'_onAdaptation',value:function _onAdaptation(){var activeVideo=this.videoTracks.filter(function(t){return t.active === true;})[0];this._fillLevels();_clappr.Log.debug('an adaptation has happened:',activeVideo);this.highDefinition = activeVideo.height >= 720;this.trigger(_clappr.Events.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition);this.trigger(_clappr.Events.PLAYBACK_BITRATE,{bandwidth:activeVideo.bandwidth,width:activeVideo.width,height:activeVideo.height,level:activeVideo.id});}},{key:'_destroy',value:function _destroy(){_get(Object.getPrototypeOf(DashShakaPlayback.prototype),'destroy',this).call(this);this._isShakaReadyState = false;_clappr.Log.debug('shaka was destroyed');}},{key:'_shakaReady',value:function _shakaReady(){_get(Object.getPrototypeOf(DashShakaPlayback.prototype),'_ready',this).call(this);}},{key:'isReady',get:function get(){return this._isShakaReadyState;}},{key:'textTracks',get:function get(){return this._player && this._player.getTracks().filter(function(t){return t.type === 'text';});}},{key:'audioTracks',get:function get(){return this._player && this._player.getTracks().filter(function(t){return t.type === 'audio';});}},{key:'videoTracks',get:function get(){return this._player && this._player.getTracks().filter(function(t){return t.type === 'video';});}}]);return DashShakaPlayback;})(_clappr.HTML5Video);exports['default'] = DashShakaPlayback;DashShakaPlayback.canPlay = function(resource){var mimeType=arguments.length <= 1 || arguments[1] === undefined?'':arguments[1];_shakaPlayer2['default'].polyfill.installAll();var browserSupported=_shakaPlayer2['default'].Player.isBrowserSupported();var resourceParts=resource.split('?')[0].match(/.*\.(.*)$/) || [];return browserSupported && ('mpd' === resourceParts[1] || mimeType.indexOf('application/dash+xml') > -1);};module.exports = exports['default'];
-
-/***/ },
-/* 1 */
-/***/ function(module, exports) {
-
- module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
-
-/***/ },
-/* 2 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __WEBPACK_AMD_DEFINE_RESULT__;"use strict";(function(){var g={};(function(window){var k,aa=this;aa.ed = !0;function m(a,b){var c=a.split("."),d=aa;c[0] in d || !d.execScript || d.execScript("var " + c[0]);for(var e;c.length && (e = c.shift());) c.length || void 0 === b?d[e]?d = d[e]:d = d[e] = {}:d[e] = b;}function ba(a){var b=p;function c(){}c.prototype = b.prototype;a.md = b.prototype;a.prototype = new c();a.prototype.constructor = a;a.fd = function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2));};}; /*
-
- Copyright 2016 Google Inc.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */function ca(a){this.c = Math.exp(Math.log(.5) / a);this.b = this.a = 0;}function da(a,b,c){var d=Math.pow(a.c,b);c = c * (1 - d) + d * a.a;isNaN(c) || (a.a = c,a.b += b);}function ea(a){return a.a / (1 - Math.pow(a.c,a.b));};function fa(){this.c = new ca(2);this.f = new ca(5);this.a = 0;this.b = 5E5;}fa.prototype.setDefaultEstimate = function(a){this.b = a;};fa.prototype.getBandwidthEstimate = function(){return 128E3 > this.a?this.b:Math.min(ea(this.c),ea(this.f));};function ga(){}function ha(){};function q(){this.g = null;this.f = !1;this.b = new fa();this.h = {};this.a = {};this.i = !1;this.c = null;}m("shaka.abr.SimpleAbrManager",q);q.prototype.stop = function(){this.g = null;this.f = !1;this.h = {};this.a = {};this.c = null;};q.prototype.stop = q.prototype.stop;q.prototype.init = function(a){this.g = a;};q.prototype.init = q.prototype.init;q.prototype.chooseStreams = function(a){for(var b in a) this.h[b] = a[b];b = {};if("audio" in a){var c=ia(this);c?(b.audio = c,this.a.audio = c):delete this.a.audio;}"video" in a && ((c = ja(this))?(b.video = c,this.a.video = c):delete this.a.video);"text" in a && (b.text = a.text.streams[0]);this.c = Date.now();return b;};q.prototype.chooseStreams = q.prototype.chooseStreams;q.prototype.enable = function(){this.f = !0;};q.prototype.enable = q.prototype.enable;q.prototype.disable = function(){this.f = !1;};q.prototype.disable = q.prototype.disable;q.prototype.segmentDownloaded = function(a,b,c){var d=this.b;b -= a;16E3 > c || (a = 8E3 * c / b,b /= 1E3,d.a += c,da(d.c,b,a),da(d.f,b,a));if(null != this.c && this.f)a: {if(!this.i){if(!(128E3 <= this.b.a))break a;this.i = !0;}else if(8E3 > Date.now() - this.c)break a;c = {};if(d = ia(this))c.audio = d,this.a.audio = d;if(d = ja(this))c.video = d,this.a.video = d;this.c = Date.now();this.b.getBandwidthEstimate();this.g(c);}};q.prototype.segmentDownloaded = q.prototype.segmentDownloaded;q.prototype.getBandwidthEstimate = function(){return this.b.getBandwidthEstimate();};q.prototype.getBandwidthEstimate = q.prototype.getBandwidthEstimate;q.prototype.setDefaultEstimate = function(a){this.b.setDefaultEstimate(a);};q.prototype.setDefaultEstimate = q.prototype.setDefaultEstimate;function ia(a){a = a.h.audio;if(!a)return null;a = ka(a);return a[Math.floor(a.length / 2)];}function ja(a){var b=a.h.video;if(!b)return null;var b=ka(b),c=a.a.audio,c=c && c.bandwidth || 0;a = a.b.getBandwidthEstimate();for(var d=b[0],e=0;e < b.length;++e) {var f=b[e];if(f.bandwidth){var g=((e + 1 < b.length?b[e + 1]:{bandwidth:Infinity}).bandwidth + c) / .85;a >= (f.bandwidth + c) / .95 && a <= g && (d = f);}}return d;}function ka(a){return a.streams.slice(0).filter(function(a){return a.allowedByApplication && a.allowedByKeySystem;}).sort(function(a,c){return a.bandwidth - c.bandwidth;});};function t(a,b){var c=b || {},d;for(d in c) this[d] = c[d];this.defaultPrevented = this.cancelable = this.bubbles = !1;this.timeStamp = window.performance && window.performance.now?window.performance.now():Date.now();this.type = a;this.isTrusted = !1;this.target = this.currentTarget = null;this.a = !1;}t.prototype.preventDefault = function(){};t.prototype.stopImmediatePropagation = function(){this.a = !0;};t.prototype.stopPropagation = function(){};var la="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),ma="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),na=["loop","playbackRate"],oa=["pause","play"],pa="adaptation buffering emsg error loading unloading texttrackvisibility trackschanged".split(" "),qa="drmInfo getConfiguration getManifestUri getPlaybackRate getPlayheadTimeAsDate getTracks getStats isBuffering isInProgress isLive isTextTrackVisible keySystem seekRange".split(" "),ra=[["getConfiguration","configure"]],sa=[["isTextTrackVisible","setTextTrackVisibility"]],ta="addTextTrack cancelTrickPlay configure resetConfiguration selectTrack setTextTrackVisibility trickPlay".split(" "),ua=["load","unload"];function va(a){return JSON.stringify(a,function(a,c){if("manager" != a && "function" != typeof c){if(c instanceof Event || c instanceof t){var b={},e;for(e in c) {var f=c[e];f && "object" == typeof f || e in Event || (b[e] = f);}return b;}if(c instanceof TimeRanges)for(b = {__type__:"TimeRanges",length:c.length,start:[],end:[]},e = 0;e < c.length;++e) b.start.push(c.start(e)),b.end.push(c.end(e));else b = "number" == typeof c?isNaN(c)?"NaN":isFinite(c)?c:0 > c?"-Infinity":"Infinity":c;return b;}});}function wa(a){return JSON.parse(a,function(a,c){return "NaN" == c?NaN:"-Infinity" == c?-Infinity:"Infinity" == c?Infinity:c && "object" == typeof c && "TimeRanges" == c.__type__?xa(c):c;});}function xa(a){return {length:a.length,start:function start(b){return a.start[b];},end:function end(b){return a.end[b];}};};function w(a,b,c){this.category = a;this.code = b;this.data = Array.prototype.slice.call(arguments,2);}m("shaka.util.Error",w);w.prototype.toString = function(){return "shaka.util.Error " + JSON.stringify(this,null," ");};w.Category = {NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9};w.Code = {UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_TTML:2006,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,BUFFER_READ_OUT_OF_BOUNDS:3E3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,LOAD_INTERRUPTED:7E3,CAST_API_UNAVAILABLE:8E3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,INDEXED_DB_NOT_SUPPORTED:9E3,INDEXED_DB_ERROR:9001,OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007};function ya(){}m("shaka.util.IDestroyable",ya);ya.prototype.o = function(){};ya.prototype.destroy = ya.prototype.o;function x(){var a,b,c=new Promise(function(c,e){a = c;b = e;});c.resolve = a;c.reject = b;return c;};function za(a,b,c,d,e){this.C = a;this.l = b;this.w = c;this.A = d;this.s = e;this.f = this.j = this.g = !1;this.v = "";this.a = this.i = null;this.b = {video:{},player:{}};this.m = 0;this.c = {};this.h = null;}k = za.prototype;k.o = function(){Aa(this);this.a && (this.a.stop(function(){},function(){}),this.a = null);this.A = this.w = this.l = null;this.f = this.j = this.g = !1;this.h = this.c = this.b = this.a = this.i = null;return Promise.resolve();};k.N = function(){return this.f;};k.ab = function(){return this.v;};k.init = function(){if(window.chrome && chrome.cast && chrome.cast.isAvailable){delete window.__onGCastApiAvailable;this.g = !0;this.l();var a=new chrome.cast.SessionRequest(this.C),a=new chrome.cast.ApiConfig(a,this.fc.bind(this),this.mc.bind(this),"origin_scoped");chrome.cast.initialize(a,function(){},function(){});}else window.__onGCastApiAvailable = (function(a){a && this.init();}).bind(this);};k.cb = function(a){this.i = a;this.f && Ba(this,{type:"appData",appData:this.i});};k.cast = function(a){if(!this.g)return Promise.reject(new w(8,8E3));if(!this.j)return Promise.reject(new w(8,8001));if(this.f)return Promise.reject(new w(8,8002));this.h = new x();chrome.cast.requestSession(this.Za.bind(this,a),this.qb.bind(this));return this.h;};k.get = function(a,b){if("video" == a){if(0 <= oa.indexOf(b))return this.Bb.bind(this,a,b);}else if("player" == a){if(0 <= ta.indexOf(b))return this.Bb.bind(this,a,b);if(0 <= ua.indexOf(b))return this.Bc.bind(this,a,b);if(0 <= qa.indexOf(b))return this.yb.bind(this,a,b);}return this.yb(a,b);};k.set = function(a,b,c){this.b[a][b] = c;Ba(this,{type:"set",targetName:a,property:b,value:c});};k.Za = function(a,b){this.a = b;this.a.addUpdateListener(this.rb.bind(this));this.a.addMessageListener("urn:x-cast:com.google.shaka.v2",this.gc.bind(this));this.rb();Ba(this,{type:"init",initState:a,appData:this.i});this.h.resolve();};k.qb = function(a){var b=8003;switch(a.code){case "cancel":b = 8004;break;case "timeout":b = 8005;break;case "receiver_unavailable":b = 8006;}this.h.reject(new w(8,b,a));};k.yb = function(a,b){return this.b[a][b];};k.Bb = function(a,b){Ba(this,{type:"call",targetName:a,methodName:b,args:Array.prototype.slice.call(arguments,2)});};k.Bc = function(a,b){var c=Array.prototype.slice.call(arguments,2),d=new x(),e=this.m.toString();this.m++;this.c[e] = d;Ba(this,{type:"asyncCall",targetName:a,methodName:b,args:c,id:e});return d;};k.fc = function(a){var b=this.s();this.h = new x();this.Za(b,a);};k.mc = function(a){this.j = "available" == a;this.l();};k.rb = function(){var a=this.a?"connected" == this.a.status:!1;if(this.f && !a){this.A();for(var b in this.b) this.b[b] = {};Aa(this);}this.v = (this.f = a)?this.a.receiver.friendlyName:"";this.l();};function Aa(a){for(var b in a.c) {var c=a.c[b];delete a.c[b];c.reject(new w(7,7E3));}}k.gc = function(a,b){var c=wa(b);switch(c.type){case "event":var d=c.targetName,e=c.event;this.w(d,new t(e.type,e));break;case "update":e = c.update;for(d in e) {var c=this.b[d] || {},f;for(f in e[d]) c[f] = e[d][f];}break;case "asyncComplete":if((d = c.id,f = c.error,c = this.c[d],delete this.c[d],c))if(f){d = new w(f.category,f.code);for(e in f) d[e] = f[e];c.reject(d);}else c.resolve();}};function Ba(a,b){var c=va(b);a.a.sendMessage("urn:x-cast:com.google.shaka.v2",c,function(){},ga);};function Ca(){this.a = {};}k = Ca.prototype;k.push = function(a,b){this.a.hasOwnProperty(a)?this.a[a].push(b):this.a[a] = [b];};k.set = function(a,b){this.a[a] = b;};k.has = function(a){return this.a.hasOwnProperty(a);};k.get = function(a){return (a = this.a[a])?a.slice():null;};k.remove = function(a,b){var c=this.a[a];if(c)for(var d=0;d < c.length;++d) c[d] == b && (c.splice(d,1),--d);};k.keys = function(){var a=[],b;for(b in this.a) a.push(b);return a;};function y(){this.a = new Ca();}y.prototype.o = function(){Da(this);this.a = null;return Promise.resolve();};function z(a,b,c,d){b = new Ea(b,c,d);a.a.push(c,b);}y.prototype.ja = function(a,b){for(var c=this.a.get(b) || [],d=0;d < c.length;++d) {var e=c[d];e.target == a && (e.ja(),this.a.remove(b,e));}};function Da(a){var b=a.a,c=[],d;for(d in b.a) c.push.apply(c,b.a[d]);for(b = 0;b < c.length;++b) c[b].ja();a.a.a = {};}function Ea(a,b,c){this.target = a;this.type = b;this.a = c;this.target.addEventListener(b,c,!1);}Ea.prototype.ja = function(){this.target && (this.target.removeEventListener(this.type,this.a,!1),this.a = this.target = null);};function p(){this.Ba = new Ca();this.X = this;}m("shaka.util.FakeEventTarget",p);p.prototype.addEventListener = function(a,b){this.Ba.push(a,b);};p.prototype.addEventListener = p.prototype.addEventListener;p.prototype.removeEventListener = function(a,b){this.Ba.remove(a,b);};p.prototype.removeEventListener = p.prototype.removeEventListener;p.prototype.dispatchEvent = function(a){for(var b=this.Ba.get(a.type) || [],c=0;c < b.length;++c) {a.target = this.X;a.currentTarget = this.X;var d=b[c];try{d.handleEvent?d.handleEvent(a):d.call(this,a);}catch(e) {}if(a.a)break;}return a.defaultPrevented;};p.prototype.dispatchEvent = p.prototype.dispatchEvent;function A(a,b,c){p.call(this);this.c = a;this.b = b;this.i = this.f = this.g = this.j = this.l = null;this.a = new za(c,this.Pc.bind(this),this.Qc.bind(this),this.Rc.bind(this),this.nb.bind(this));Fa(this);}ba(A);m("shaka.cast.CastProxy",A);A.prototype.o = function(){var a=[this.i?this.i.o():null,this.b?this.b.o():null,this.a?this.a.o():null];this.a = this.i = this.j = this.l = this.b = this.c = null;return Promise.all(a);};A.prototype.destroy = A.prototype.o;A.prototype.Yb = function(){return this.l;};A.prototype.getVideo = A.prototype.Yb;A.prototype.Wb = function(){return this.j;};A.prototype.getPlayer = A.prototype.Wb;A.prototype.Mb = function(){return this.a?this.a.g && this.a.j:!1;};A.prototype.canCast = A.prototype.Mb;A.prototype.N = function(){return this.a?this.a.N():!1;};A.prototype.isCasting = A.prototype.N;A.prototype.ab = function(){return this.a?this.a.ab():"";};A.prototype.receiverName = A.prototype.ab;A.prototype.cast = function(){var a=this.nb();return this.a.cast(a).then((function(){return this.b.ib();}).bind(this));};A.prototype.cast = A.prototype.cast;A.prototype.cb = function(a){this.a.cb(a);};A.prototype.setAppData = A.prototype.cb;A.prototype.Xc = function(){var a=this.a;if(a.f){var b=a.s();chrome.cast.requestSession(a.Za.bind(a,b),a.qb.bind(a));}};A.prototype.suggestDisconnect = A.prototype.Xc;function Fa(a){a.a.init();a.i = new y();la.forEach((function(a){z(this.i,this.c,a,this.cd.bind(this));}).bind(a));pa.forEach((function(a){z(this.i,this.b,a,this.xc.bind(this));}).bind(a));a.l = {};for(var b in a.c) Object.defineProperty(a.l,b,{configurable:!1,enumerable:!0,get:a.bd.bind(a,b),set:a.dd.bind(a,b)});a.j = {};for(b in a.b) Object.defineProperty(a.j,b,{configurable:!1,enumerable:!0,get:a.wc.bind(a,b)});a.g = new p();a.g.X = a.l;a.f = new p();a.f.X = a.j;}k = A.prototype;k.nb = function(){var a={video:{},player:{},playerAfterLoad:{},manifest:this.b.oa,startTime:null};this.c.pause();na.forEach((function(b){a.video[b] = this.c[b];}).bind(this));this.c.ended || (a.startTime = this.c.currentTime);ra.forEach((function(b){var c=b[1];b = this.b[b[0]]();a.player[c] = b;}).bind(this));sa.forEach((function(b){var c=b[1];b = this.b[b[0]]();a.playerAfterLoad[c] = b;}).bind(this));return a;};k.Pc = function(){this.dispatchEvent(new t("caststatuschanged"));};k.Rc = function(){ra.forEach((function(a){var b=a[1];a = this.a.get("player",a[0])();this.b[b](a);}).bind(this));var a=this.a.get("player","getManifestUri")(),b=this.a.get("video","ended"),c=Promise.resolve(),d=this.c.autoplay,e=null;b || (e = this.a.get("video","currentTime"));a && (this.c.autoplay = !1,c = this.b.load(a,e),c["catch"]((function(a){this.b.dispatchEvent(new t("error",{detail:a}));}).bind(this)));var f={};na.forEach((function(a){f[a] = this.a.get("video",a);}).bind(this));c.then((function(){na.forEach((function(a){this.c[a] = f[a];}).bind(this));sa.forEach((function(a){var b=a[1];a = this.a.get("player",a[0])();this.b[b](a);}).bind(this));this.c.autoplay = d;a && this.c.play();}).bind(this));};k.bd = function(a){if("addEventListener" == a)return this.g.addEventListener.bind(this.g);if("removeEventListener" == a)return this.g.removeEventListener.bind(this.g);if(this.a.N() && !Object.keys(this.a.b.video).length){var b=this.c[a];if("function" != typeof b)return b;}return this.a.N()?this.a.get("video",a):(b = this.c[a],"function" == typeof b && (b = b.bind(this.c)),b);};k.dd = function(a,b){this.a.N()?this.a.set("video",a,b):this.c[a] = b;};k.cd = function(a){this.a.N() || this.g.dispatchEvent(new t(a.type,a));};k.wc = function(a){return "addEventListener" == a?this.f.addEventListener.bind(this.f):"removeEventListener" == a?this.f.removeEventListener.bind(this.f):"getNetworkingEngine" == a?this.b.ob.bind(this.b):this.a.N() && !Object.keys(this.a.b.video).length && 0 <= qa.indexOf(a) || !this.a.N()?(a = this.b[a],a.bind(this.b)):this.a.get("player",a);};k.xc = function(a){this.a.N() || this.f.dispatchEvent(a);};k.Qc = function(a,b){this.a.N() && ("video" == a?this.g.dispatchEvent(b):"player" == a && this.f.dispatchEvent(b));};function B(a,b,c){p.call(this);this.b = a;this.a = b;this.j = {video:a,player:b};this.l = c || function(){};this.i = !1;this.c = !0;this.f = this.g = null;Ga(this);}ba(B);m("shaka.cast.CastReceiver",B);B.prototype.$b = function(){return this.i;};B.prototype.isConnected = B.prototype.$b;B.prototype.ac = function(){return this.c;};B.prototype.isIdle = B.prototype.ac;B.prototype.o = function(){var a=this.a?this.a.o():Promise.resolve();null != this.f && window.clearTimeout(this.f);this.l = this.j = this.a = this.b = null;this.i = !1;this.c = !0;this.f = this.g = null;return a.then(function(){cast.receiver.CastReceiverManager.getInstance().stop();});};B.prototype.destroy = B.prototype.o;function Ga(a){var b=cast.receiver.CastReceiverManager.getInstance();b.onSenderConnected = a.wb.bind(a);b.onSenderDisconnected = a.wb.bind(a);b.onSystemVolumeChanged = a.Tb.bind(a);a.g = b.getCastMessageBus("urn:x-cast:com.google.shaka.v2");a.g.onMessage = a.hc.bind(a);b.start();la.forEach((function(a){this.b.addEventListener(a,this.zb.bind(this,"video"));}).bind(a));pa.forEach((function(a){this.a.addEventListener(a,this.zb.bind(this,"player"));}).bind(a));cast.__platform__ && cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?a.a.eb(3840,2160):a.a.eb(1920,1080);a.a.addEventListener("loading",(function(){this.c = !1;Ha(this);}).bind(a));a.b.addEventListener("playing",(function(){this.c = !1;Ha(this);}).bind(a));a.a.addEventListener("unloading",(function(){this.c = !0;Ha(this);}).bind(a));a.b.addEventListener("ended",(function(){window.setTimeout((function(){this.b && this.b.ended && (this.c = !0,Ha(this));}).bind(this),5E3);}).bind(a));}k = B.prototype;k.wb = function(){this.i = !!cast.receiver.CastReceiverManager.getInstance().getSenders().length;Ha(this);};function Ha(a){Promise.resolve().then((function(){this.dispatchEvent(new t("caststatuschanged"));}).bind(a));}function Ia(a,b,c){for(var d in b.player) a.a[d](b.player[d]);a.l(c);c = Promise.resolve();var e=a.b.autoplay;b.manifest && (a.b.autoplay = !1,c = a.a.load(b.manifest,b.startTime),c["catch"]((function(a){this.a.dispatchEvent(new t("error",{detail:a}));}).bind(a)));c.then((function(){for(var a in b.video) {var c=b.video[a];this.b[a] = c;}for(a in b.playerAfterLoad) c = b.playerAfterLoad[a],this.a[a](c);this.b.autoplay = e;b.manifest && this.b.play();}).bind(a));}k.zb = function(a,b){this.$a();Ja(this,{type:"event",targetName:a,event:b});};k.$a = function(){null != this.f && window.clearTimeout(this.f);this.f = window.setTimeout(this.$a.bind(this),500);var a={video:{},player:{}};ma.forEach((function(b){a.video[b] = this.b[b];}).bind(this));qa.forEach((function(b){a.player[b] = this.a[b]();}).bind(this));var b=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();b && (a.video.volume = b.level,a.video.muted = b.muted);Ja(this,{type:"update",update:a});};k.Tb = function(){var a=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();a && Ja(this,{type:"update",update:{video:{volume:a.level,muted:a.muted}}});Ja(this,{type:"event",targetName:"video",event:{type:"volumechange"}});};k.hc = function(a){var b=wa(a.data);switch(b.type){case "init":Ia(this,b.initState,b.appData);this.$a();break;case "appData":this.l(b.appData);break;case "set":var c=b.targetName,d=b.property,e=b.value;if("video" == c)if((b = cast.receiver.CastReceiverManager.getInstance(),"volume" == d)){b.setSystemVolumeLevel(e);break;}else if("muted" == d){b.setSystemVolumeMuted(e);break;}this.j[c][d] = e;break;case "call":c = b.targetName;d = b.methodName;e = b.args;c = this.j[c];c[d].apply(c,e);break;case "asyncCall":c = b.targetName,d = b.methodName,e = b.args,b = b.id,a = a.senderId,c = this.j[c],c[d].apply(c,e).then(this.Eb.bind(this,a,b,null),this.Eb.bind(this,a,b));}};k.Eb = function(a,b,c){Ja(this,{type:"asyncComplete",id:b,error:c},a);};function Ja(a,b,c){a.i && (b = va(b),c?a.g.getCastChannel(c).send(b):a.g.broadcast(b));};function Ka(a,b){return a.reduce((function(a,b,e){return b["catch"](a.bind(null,e));}).bind(null,b),Promise.reject());}function C(a,b){return a.concat(b);}function D(){}function La(a){return null != a;}function Ma(a){return function(b){return b != a;};};function Na(a){return !a || !Object.keys(a).length;}function F(a){return Object.keys(a).map(function(b){return a[b];});}function Oa(a,b){return Object.keys(a).reduce(function(c,d){c[d] = b(a[d],d);return c;},{});}function Pa(a,b){return Object.keys(a).every(function(c){return b(c,a[c]);});};function Qa(a){return window.btoa(String.fromCharCode.apply(null,a)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=*$/,"");}function Ra(a){a = window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));for(var b=new Uint8Array(a.length),c=0;c < a.length;++c) b[c] = a.charCodeAt(c);return b;}function Sa(a){for(var b=new Uint8Array(a.length / 2),c=0;c < a.length;c += 2) b[c / 2] = window.parseInt(a.substr(c,2),16);return b;}function Ta(a){for(var b="",c=0;c < a.length;++c) {var d=a[c].toString(16);1 == d.length && (d = "0" + d);b += d;}return b;}function Ua(a,b){if(!a && !b)return !0;if(!a || !b || a.length != b.length)return !1;for(var c=0;c < a.length;++c) if(a[c] != b[c])return !1;return !0;};function Va(a,b){var c=G(a,b);return 1 != c.length?null:c[0];}function G(a,b){return Array.prototype.filter.call(a.childNodes,function(a){return a.tagName == b;});}function Wa(a){var b=a.firstChild;return b && b.nodeType == Node.TEXT_NODE?a.textContent.trim():null;}function I(a,b,c,d){var e=null;a = a.getAttribute(b);null != a && (e = c(a));return null == e?void 0 !== d?d:null:e;}function Xa(a){if(!a)return null;a = Date.parse(a);return isNaN(a)?null:Math.floor(a / 1E3);}function J(a){if(!a)return null;a = /^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(a);if(!a)return null;a = 31536E3 * Number(a[1] || null) + 2592E3 * Number(a[2] || null) + 86400 * Number(a[3] || null) + 3600 * Number(a[4] || null) + 60 * Number(a[5] || null) + Number(a[6] || null);return isFinite(a)?a:null;}function Ya(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a = Number(b[1]);if(!isFinite(a))return null;b = Number(b[2]);return isFinite(b)?{start:a,end:b}:null;}function Za(a){a = Number(a);return a % 1?null:a;}function $a(a){a = Number(a);return !(a % 1) && 0 < a?a:null;}function ab(a){a = Number(a);return !(a % 1) && 0 <= a?a:null;}function bb(a){var b;a = (b = a.match(/^(\d+)\/(\d+)$/))?Number(b[1] / b[2]):Number(a);return isNaN(a)?null:a;};var db={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"};function eb(a,b){var c=fb(a),d=null,e=c.filter(function(a){return "urn:mpeg:dash:mp4protection:2011" == a.Db?(d = a.init || d,!1):!0;}),f=c.map(function(a){return a.keyId;}).filter(La),g=null;if(0 < f.length && (g = f[0],f.some(Ma(g))))throw new w(4,4010);f = [];0 < e.length?(f = gb(d,b,e),f.length || (f = [hb("",d)])):0 < c.length && (f = F(db).map(function(a){return hb(a,d);}));return {kb:g,gd:d,drmInfos:f,mb:!0};}function ib(a,b,c){var d=eb(a,b);if(c.mb){a = 1 == c.drmInfos.length && !c.drmInfos[0].keySystem;b = !d.drmInfos.length;if(!c.drmInfos.length || a && !b)c.drmInfos = d.drmInfos;c.mb = !1;}else if(0 < d.drmInfos.length && (c.drmInfos = c.drmInfos.filter(function(a){return d.drmInfos.some(function(b){return b.keySystem == a.keySystem;});}),!c.drmInfos.length))throw new w(4,4008);return d.kb || c.kb;}function hb(a,b){return {keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b || [],keyIds:[]};}function gb(a,b,c){return c.map(function(c){var d=db[c.Db];return d?[hb(d,c.init || a)]:b(c.node) || [];}).reduce(C,[]);}function fb(a){return a.map(function(a){var b=a.getAttribute("schemeIdUri"),d=a.getAttribute("cenc:default_KID"),e=G(a,"cenc:pssh").map(Wa);if(!b)return null;b = b.toLowerCase();if(d && (d = d.replace(/-/g,"").toLowerCase(),0 <= d.indexOf(" ")))throw new w(4,4009);var f=[];try{f = e.map(function(a){return {initDataType:"cenc",initData:Ra(a)};});}catch(g) {throw new w(4,4007);}return {node:a,Db:b,keyId:d,init:0 < f.length?f:null};}).filter(La);};var jb=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function kb(a){var b;a instanceof kb?(lb(this,a.S),this.ka = a.ka,this.U = a.U,mb(this,a.xa),this.O = a.O,nb(this,ob(a.a)),this.ca = a.ca):a && (b = String(a).match(jb))?(lb(this,b[1] || "",!0),this.ka = pb(b[2] || ""),this.U = pb(b[3] || "",!0),mb(this,b[4]),this.O = pb(b[5] || "",!0),nb(this,b[6] || "",!0),this.ca = pb(b[7] || "")):this.a = new qb(null);}k = kb.prototype;k.S = "";k.ka = "";k.U = "";k.xa = null;k.O = "";k.ca = "";k.toString = function(){var a=[],b=this.S;b && a.push(rb(b,sb,!0),":");if(b = this.U){a.push("//");var c=this.ka;c && a.push(rb(c,sb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b = this.xa;null != b && a.push(":",String(b));}if(b = this.O)this.U && "/" != b.charAt(0) && a.push("/"),a.push(rb(b,"/" == b.charAt(0)?tb:ub,!0));(b = this.a.toString()) && a.push("?",b);(b = this.ca) && a.push("#",rb(b,vb));return a.join("");};k.resolve = function(a){var b=new kb(this);"data" === b.S && (b = new kb());var c=!!a.S;c?lb(b,a.S):c = !!a.ka;c?b.ka = a.ka:c = !!a.U;c?b.U = a.U:c = null != a.xa;var d=a.O;if(c)mb(b,a.xa);else if(c = !!a.O){if("/" != d.charAt(0))if(this.U && !this.O)d = "/" + d;else {var e=b.O.lastIndexOf("/");-1 != e && (d = b.O.substr(0,e + 1) + d);}if(".." == d || "." == d)d = "";else if(-1 != d.indexOf("./") || -1 != d.indexOf("/.")){for(var e=!d.lastIndexOf("/",0),d=d.split("/"),f=[],g=0;g < d.length;) {var h=d[g++];"." == h?e && g == d.length && f.push(""):".." == h?((1 < f.length || 1 == f.length && "" != f[0]) && f.pop(),e && g == d.length && f.push("")):(f.push(h),e = !0);}d = f.join("/");}}c?b.O = d:c = "" !== a.a.toString();c?nb(b,ob(a.a)):c = !!a.ca;c && (b.ca = a.ca);return b;};function lb(a,b,c){a.S = c?pb(b,!0):b;a.S && (a.S = a.S.replace(/:$/,""));}function mb(a,b){if(b){b = Number(b);if(isNaN(b) || 0 > b)throw Error("Bad port number " + b);a.xa = b;}else a.xa = null;}function nb(a,b,c){b instanceof qb?a.a = b:(c || (b = rb(b,wb)),a.a = new qb(b));}function pb(a,b){return a?b?decodeURI(a):decodeURIComponent(a):"";}function rb(a,b,c){return "string" == typeof a?(a = encodeURI(a).replace(b,xb),c && (a = a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null;}function xb(a){a = a.charCodeAt(0);return "%" + (a >> 4 & 15).toString(16) + (a & 15).toString(16);}var sb=/[#\/\?@]/g,ub=/[\#\?:]/g,tb=/[\#\?]/g,wb=/[\#\?@]/g,vb=/#/g;function qb(a){this.b = a || null;}qb.prototype.a = null;qb.prototype.c = null;qb.prototype.toString = function(){if(this.b)return this.b;if(!this.a)return "";var a=[],b;for(b in this.a) for(var c=encodeURIComponent(b),d=this.a[b],e=0;e < d.length;e++) {var f=c;"" !== d[e] && (f += "=" + encodeURIComponent(d[e]));a.push(f);}return this.b = a.join("&");};function ob(a){var b=new qb();b.b = a.b;if(a.a){var c={},d;for(d in a.a) c[d] = a.a[d].concat();b.a = c;b.c = a.c;}return b;};function yb(a,b,c){this.a = a;this.L = b;this.D = c;}m("shaka.media.InitSegmentReference",yb);function K(a,b,c,d,e,f){this.position = a;this.startTime = b;this.endTime = c;this.a = d;this.L = e;this.D = f;}m("shaka.media.SegmentReference",K);var zb=1 / 15;function Ab(a,b,c,d,e){null !== e && (e = Math.round(e));var f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};return a.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)d)?\$/g,function(a,b,c){if("$$" == a)return "$";var d=f[b];if(null == d)return a;"RepresentationID" == b && c && (c = void 0);a = d.toString();c = window.parseInt(c,10) || 1;return Array(Math.max(0,c - a.length) + 1).join("0") + a;});}function Bb(a,b,c){if(c.length){var d=c[0];d.startTime <= zb && (c[0] = new K(d.position,0,d.endTime,d.a,d.L,d.D));a || (a = c[c.length - 1],a.startTime > b || (c[c.length - 1] = new K(a.position,a.startTime,b,a.a,a.L,a.D)));}}function L(a,b){if(!b.length)return a;var c=b.map(function(a){return new kb(a);});return a.map(function(a){return new kb(a);}).map(function(a){return c.map(a.resolve.bind(a));}).reduce(C,[]).map(function(a){return a.toString();});}function Cb(a,b){var c=M(a,b,"timescale"),d=1;c && (d = $a(c) || 1);c = M(a,b,"duration");(c = $a(c || "")) && (c /= d);var e=M(a,b,"startNumber"),f=M(a,b,"presentationTimeOffset"),g=ab(e || "");if(null == e || null == g)g = 1;var h=Db(a,b,"SegmentTimeline"),e=null;if(h){for(var e=d,l=Number(f),n=a.H.duration || Infinity,h=G(h,"S"),u=[],r=0,E=0;E < h.length;++E) {var v=h[E],H=I(v,"t",ab),cb=I(v,"d",ab),v=I(v,"r",Za);null != H && (H -= l);if(!cb)break;H = null != H?H:r;v = v || 0;if(0 > v)if(E + 1 < h.length){v = I(h[E + 1],"t",ab);if(null == v)break;else if(H >= v)break;v = Math.ceil((v - H) / cb) - 1;}else {if(Infinity == n)break;else if(H / e >= n)break;v = Math.ceil((n * e - H) / cb) - 1;}0 < u.length && H != r && (u[u.length - 1].end = H / e);for(var Yc=0;Yc <= v;++Yc) r = H + cb,u.push({start:H / e,end:r / e}),H = r;}e = u;}return {Ja:d,F:c,ha:g,presentationTimeOffset:Number(f) / d || 0,B:e};}function M(a,b,c){return [b(a.u),b(a.P),b(a.K)].filter(La).map(function(a){return a.getAttribute(c);}).reduce(function(a,b){return a || b;});}function Db(a,b,c){return [b(a.u),b(a.P),b(a.K)].filter(La).map(function(a){return Va(a,c);}).reduce(function(a,b){return a || b;});};function Eb(a){if(!a)return "";a = new Uint8Array(a);239 == a[0] && 187 == a[1] && 191 == a[2] && (a = a.subarray(3));a = escape(Fb(a));try{return decodeURIComponent(a);}catch(b) {throw new w(2,2004);}}function Gb(a,b){if(!a)return "";if(a.byteLength % 2)throw new w(2,2004);var c;if(a instanceof ArrayBuffer)c = a;else {var d=new Uint8Array(a.byteLength);d.set(new Uint8Array(a));c = d.buffer;}var d=a.byteLength / 2,e=new Uint16Array(d);c = new DataView(c);for(var f=0;f < d;f++) e[f] = c.getUint16(2 * f,b);return Fb(e);}function Hb(a){var b=new Uint8Array(a);if(239 == b[0] && 187 == b[1] && 191 == b[2])return Eb(b);if(254 == b[0] && 255 == b[1])return Gb(b.subarray(2),!1);if(255 == b[0] && 254 == b[1])return Gb(b.subarray(2),!0);var c=(function(a,b){return a.byteLength <= b || 32 <= a[b] && 126 >= a[b];}).bind(null,b);if(b[0] || b[2]){if(!b[1] && !b[3])return Gb(a,!0);if(c(0) && c(1) && c(2) && c(3))return Eb(a);}else return Gb(a,!1);throw new w(2,2003);}function Ib(a){a = unescape(encodeURIComponent(a));for(var b=new Uint8Array(a.length),c=0;c < a.length;++c) b[c] = a.charCodeAt(c);return b.buffer;}function Fb(a){for(var b="",c=0;c < a.length;c += 16E3) b += String.fromCharCode.apply(null,a.subarray(c,c + 16E3));return b;};function Jb(a){this.b = a;this.c = 0 == Kb;this.a = 0;}var Kb=1;function Lb(a){return a.a < a.b.byteLength;}function Mb(a){try{var b=a.b.getUint8(a.a);}catch(c) {Nb();}a.a += 1;return b;}function Ob(a){try{var b=a.b.getUint16(a.a,a.c);}catch(c) {Nb();}a.a += 2;return b;}function N(a){try{var b=a.b.getUint32(a.a,a.c);}catch(c) {Nb();}a.a += 4;return b;}function Pb(a){var b,c;try{a.c?(b = a.b.getUint32(a.a,!0),c = a.b.getUint32(a.a + 4,!0)):(c = a.b.getUint32(a.a,!1),b = a.b.getUint32(a.a + 4,!1));}catch(d) {Nb();}if(2097151 < c)throw new w(3,3001);a.a += 8;return c * Math.pow(2,32) + b;}function Qb(a,b){a.a + b > a.b.byteLength && Nb();var c=a.b.buffer.slice(a.a,a.a + b);a.a += b;return new Uint8Array(c);}function O(a,b){a.a + b > a.b.byteLength && Nb();a.a += b;}function Rb(a){var b=a.a;try{for(;Lb(a) && a.b.getUint8(a.a);) a.a += 1;}catch(c) {Nb();}b = a.b.buffer.slice(b,a.a);a.a += 1;return Eb(b);}function Nb(){throw new w(3,3E3);};function Sb(a,b){for(;Lb(b);) {var c=b.a,d=N(b),e=N(b);1 == d?d = Pb(b):d || (d = b.b.byteLength - c);if(e == a)return d;O(b,d - (b.a - c));}return -1;}function Tb(a,b){for(var c=new Jb(new DataView(a)),d=[[1836019574,0],[1953653099,0],[1835297121,0],[1835626086,0],[1937007212,0],[1937011556,8],[b,0]],e=-1,f=0;f < d.length;f++) {var g=d[f][1],e=Sb(d[f][0],c);if(-1 == e)return -1;O(c,g);}return e;};function Ub(a,b,c,d){var e=[];a = new Jb(new DataView(a));var f=Sb(1936286840,a);if(-1 == f)throw new w(3,3004);var g=Mb(a);O(a,3);O(a,4);var h=N(a);if(!h)throw new w(3,3005);var l,n;g?(l = Pb(a),n = Pb(a)):(l = N(a),n = N(a));O(a,2);g = Ob(a);d = l - d;b = b + f + n;for(f = 0;f < g;f++) {l = N(a);n = (l & 2147483648) >>> 31;l &= 2147483647;var u=N(a);O(a,4);if(1 == n)throw new w(3,3006);e.push(new K(e.length,d / h,(d + u) / h,function(){return c;},b,b + l - 1));d += u;b += l;}return e;};function P(a){this.a = a;}m("shaka.media.SegmentIndex",P);P.prototype.o = function(){this.a = null;return Promise.resolve();};P.prototype.destroy = P.prototype.o;P.prototype.find = function(a){for(var b=this.a.length - 1;0 <= b;--b) {var c=this.a[b];if(a >= c.startTime && a < c.endTime)return c.position;}return null;};P.prototype.find = P.prototype.find;P.prototype.get = function(a){if(!this.a.length)return null;a -= this.a[0].position;return 0 > a || a >= this.a.length?null:this.a[a];};P.prototype.get = P.prototype.get;P.prototype.Xa = function(a){for(var b=[],c=0,d=0;c < this.a.length && d < a.length;) {var e=this.a[c],f=a[d];e.startTime < f.startTime?(b.push(e),c++):(e.startTime > f.startTime || (.1 < Math.abs(e.endTime - f.endTime)?b.push(f):b.push(e),c++),d++);}for(;c < this.a.length;) b.push(this.a[c++]);if(b.length)for(c = b[b.length - 1].position + 1;d < a.length;) f = a[d++],f = new K(c++,f.startTime,f.endTime,f.a,f.L,f.D),b.push(f);else b = a;this.a = b;};P.prototype.merge = P.prototype.Xa;P.prototype.Sa = function(a){for(var b=0;b < this.a.length && !(this.a[b].endTime > a);++b);this.a.splice(0,b);};P.prototype.evict = P.prototype.Sa;function Vb(a){this.b = a;this.a = new Jb(a);Wb || (Wb = [new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])]);}var Wb;function Xb(a){var b;b = Yb(a);if(7 < b.length)throw new w(3,3002);for(var c=0,d=0;d < b.length;d++) c = 256 * c + b[d];b = c;c = Yb(a);a: {for(d = 0;d < Wb.length;d++) if(Ua(c,Wb[d])){d = !0;break a;}d = !1;}if(d)c = a.b.byteLength - a.a.a;else {if(8 == c.length && c[1] & 224)throw new w(3,3001);for(var d=c[0] & (1 << 8 - c.length) - 1,e=1;e < c.length;e++) d = 256 * d + c[e];c = d;}c = a.a.a + c <= a.b.byteLength?c:a.b.byteLength - a.a.a;d = new DataView(a.b.buffer,a.b.byteOffset + a.a.a,c);O(a.a,c);return new Zb(b,d);}function Yb(a){var b=Mb(a.a),c;for(c = 1;8 >= c && !(b & 1 << 8 - c);c++);if(8 < c)throw new w(3,3002);var d=new Uint8Array(c);d[0] = b;for(b = 1;b < c;b++) d[b] = Mb(a.a);return d;}function Zb(a,b){this.id = a;this.a = b;}function $b(a){if(8 < a.a.byteLength)throw new w(3,3002);if(8 == a.a.byteLength && a.a.getUint8(0) & 224)throw new w(3,3001);for(var b=0,c=0;c < a.a.byteLength;c++) var d=a.a.getUint8(c),b=256 * b + d;return b;};function ac(a,b,c,d,e,f){function g(){return e;}var h=[];a = new Vb(a.a);for(var l=-1,n=-1;Lb(a.a);) {var u=Xb(a);if(187 == u.id){var r=bc(u);r && (u = c * (r.ad - f),r = b + r.Ac,0 <= l && h.push(new K(h.length,l,u,g,n,r - 1)),l = u,n = r);}}0 <= l && h.push(new K(h.length,l,d,g,n,null));return h;}function bc(a){var b=new Vb(a.a);a = Xb(b);if(179 != a.id)throw new w(3,3013);a = $b(a);b = Xb(b);if(183 != b.id)throw new w(3,3012);for(var b=new Vb(b.a),c=0;Lb(b.a);) {var d=Xb(b);if(241 == d.id){c = $b(d);break;}}return {ad:a,Ac:c};};function cc(a,b){var c=Db(a,b,"Initialization");if(!c)return null;var d=a.u.M,e=c.getAttribute("sourceURL");e && (d = L(a.u.M,[e]));var e=0,f=null;if(c = I(c,"range",Ya))e = c.start,f = c.end;return new yb(function(){return d;},e,f);}function dc(a,b){var c=M(a,ec,"presentationTimeOffset"),d=cc(a,ec),e;e = Number(c);var f=a.u.contentType,g=a.u.mimeType.split("/")[1];if("text" != f && "mp4" != g && "webm" != g)throw new w(4,4006);if("webm" == g && !d)throw new w(4,4005);var f=Db(a,ec,"RepresentationIndex"),h=M(a,ec,"indexRange"),l=a.u.M,h=Ya(h || "");if(f){var n=f.getAttribute("sourceURL");n && (l = L(a.u.M,[n]));h = I(f,"range",Ya,h);}if(!h)throw new w(4,4002);e = fc(a,b,d,l,h.start,h.end,g,e);return {createSegmentIndex:e.createSegmentIndex,findSegmentPosition:e.findSegmentPosition,getSegmentReference:e.getSegmentReference,initSegmentReference:d,presentationTimeOffset:Number(c) || 0};}function fc(a,b,c,d,e,f,g,h){var l=a.presentationTimeline,n=a.H.start,u=a.H.duration,r=b,E=null;return {createSegmentIndex:function createSegmentIndex(){var b=[r(d,e,f),"webm" == g?r(c.a(),c.L,c.D):null];r = null;return Promise.all(b).then(function(b){var c,f,r=b[0];b = b[1] || null;if("mp4" == g)r = Ub(r,e,d,h);else {b = new Vb(new DataView(b));if(440786851 != Xb(b).id)throw new w(3,3008);f = Xb(b);if(408125543 != f.id)throw new w(3,3009);b = f.a.byteOffset;f = new Vb(f.a);for(c = null;Lb(f.a);) {var v=Xb(f);if(357149030 == v.id){c = v;break;}}if(!c)throw new w(3,3010);c = new Vb(c.a);v = 1E6;for(f = null;Lb(c.a);) {var H=Xb(c);if(2807729 == H.id)v = $b(H);else if(17545 == H.id)if((f = H,4 == f.a.byteLength))f = f.a.getFloat32(0);else if(8 == f.a.byteLength)f = f.a.getFloat64(0);else throw new w(3,3003);}if(null == f)throw new w(3,3011);c = v /= 1E9;f *= v;r = Xb(new Vb(new DataView(r)));if(475249515 != r.id)throw new w(3,3007);r = ac(r,b,c,f,d,h);}Bb(a.Ra,u,r);l.Ga(n,r);E = new P(r);});},findSegmentPosition:function findSegmentPosition(a){return E.find(a);},getSegmentReference:function getSegmentReference(a){return E.get(a);}};}function ec(a){return a.Ha;};function gc(a,b){var c=cc(a,hc),d;d = ic(a);var e=Cb(a,hc),f=e.ha;f || (f = 1);var g=0;e.F?g = e.F * (f - 1) - e.presentationTimeOffset:e.B && 0 < e.B.length && (g = e.B[0].start);d = {F:e.F,startTime:g,ha:f,presentationTimeOffset:e.presentationTimeOffset,B:e.B,va:d};if(!d.F && !d.B && 1 < d.va.length)throw new w(4,4002);if(!d.F && !a.H.duration && !d.B && 1 == d.va.length)throw new w(4,4002);if(d.B && !d.B.length)throw new w(4,4002);f = e = null;a.K.id && a.u.id && (f = a.K.id + "," + a.u.id,e = b[f]);g = jc(a.H.duration,d.ha,a.u.M,d);Bb(a.Ra,a.H.duration,g);e?(e.Xa(g),e.Sa(a.presentationTimeline.ta() - a.H.start)):(a.presentationTimeline.Ga(a.H.start,g),e = new P(g),f && (b[f] = e));return {createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e),initSegmentReference:c,presentationTimeOffset:d.presentationTimeOffset};}function hc(a){return a.Z;}function jc(a,b,c,d){var e=d.va.length;d.B && d.B.length != d.va.length && (e = Math.min(d.B.length,d.va.length));for(var f=[],g=d.startTime,h=0;h < e;h++) {var l=d.va[h],n=L(c,[l.dc]),u;u = null != d.F?g + d.F:d.B?d.B[h].end:g + a;f.push(new K(h + b,g,u,(function(a){return a;}).bind(null,n),l.start,l.end));g = u;}return f;}function ic(a){return [a.u.Z,a.P.Z,a.K.Z].filter(La).map(function(a){return G(a,"SegmentURL");}).reduce(function(a,c){return 0 < a.length?a:c;}).map(function(a){var b=a.getAttribute("media");a = I(a,"mediaRange",Ya,{start:0,end:null});return {dc:b,start:a.start,end:a.end};});};function kc(a,b,c,d){var e=lc(a),f;f = Cb(a,mc);var g=M(a,mc,"media"),h=M(a,mc,"index");f = {F:f.F,Ja:f.Ja,ha:f.ha,presentationTimeOffset:f.presentationTimeOffset,B:f.B,Wa:g,Fa:h};g = 0 + (f.Fa?1:0);g += f.B?1:0;g += f.F?1:0;if(!g)throw new w(4,4002);1 != g && (f.Fa && (f.B = null),f.F = null);if(!f.Fa && !f.Wa)throw new w(4,4002);if(f.Fa){c = a.u.mimeType.split("/")[1];if("mp4" != c && "webm" != c)throw new w(4,4006);if("webm" == c && !e)throw new w(4,4005);d = Ab(f.Fa,a.u.id,null,a.bandwidth || null,null);d = L(a.u.M,[d]);a = fc(a,b,e,d,0,null,c,f.presentationTimeOffset);}else f.F?(d || a.presentationTimeline.Ya(f.F),a = nc(a,f)):(d = b = null,a.K.id && a.u.id && (d = a.K.id + "," + a.u.id,b = c[d]),g = oc(a,f),Bb(a.Ra,a.H.duration,g),b?(b.Xa(g),b.Sa(a.presentationTimeline.ta() - a.H.start)):(a.presentationTimeline.Ga(a.H.start,g),b = new P(g),d && (c[d] = b)),a = {createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:b.find.bind(b),getSegmentReference:b.get.bind(b)});return {createSegmentIndex:a.createSegmentIndex,findSegmentPosition:a.findSegmentPosition,getSegmentReference:a.getSegmentReference,initSegmentReference:e,presentationTimeOffset:f.presentationTimeOffset};}function mc(a){return a.Ia;}function nc(a,b){var c=a.H.duration,d=b.F,e=b.ha,f=b.Ja,g=b.Wa,h=a.bandwidth || null,l=a.u.id,n=a.u.M;return {createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function findSegmentPosition(a){return 0 > a || c && a >= c?null:Math.floor(a / d);},getSegmentReference:function getSegmentReference(a){var b=a * d;return new K(a,b,b + d,function(){var c=Ab(g,l,a + e,h,b * f);return L(n,[c]);},0,null);}};}function oc(a,b){for(var c=[],d=0;d < b.B.length;d++) {var e=b.B[d].start,f=d + b.ha;c.push(new K(f,e,b.B[d].end,(function(a,b,c,d,e,f){a = Ab(a,b,e,c,f);return L(d,[a]).map(function(a){return a.toString();});}).bind(null,b.Wa,a.u.id,a.bandwidth || null,a.u.M,f,(e + b.presentationTimeOffset) * b.Ja),0,null));}return c;}function lc(a){var b=M(a,mc,"initialization");if(!b)return null;var c=a.u.id,d=a.bandwidth || null,e=a.u.M;return new yb(function(){var a=Ab(b,c,null,d,null);return L(e,[a]);},0,null);};function Q(a){this.f = !1;this.a = [];this.b = [];this.c = [];this.g = a || null;}m("shaka.net.NetworkingEngine",Q);Q.RequestType = {MANIFEST:0,SEGMENT:1,LICENSE:2};var pc={};Q.registerScheme = function(a,b){pc[a] = b;};Q.unregisterScheme = function(a){delete pc[a];};Q.prototype.zc = function(a){this.b.push(a);};Q.prototype.registerRequestFilter = Q.prototype.zc;Q.prototype.$c = function(a){var b=this.b;a = b.indexOf(a);0 <= a && b.splice(a,1);};Q.prototype.unregisterRequestFilter = Q.prototype.$c;Q.prototype.Pb = function(){this.b = [];};Q.prototype.clearAllRequestFilters = Q.prototype.Pb;Q.prototype.Ab = function(a){this.c.push(a);};Q.prototype.registerResponseFilter = Q.prototype.Ab;Q.prototype.Jb = function(a){var b=this.c;a = b.indexOf(a);0 <= a && b.splice(a,1);};Q.prototype.unregisterResponseFilter = Q.prototype.Jb;Q.prototype.Qb = function(){this.c = [];};Q.prototype.clearAllResponseFilters = Q.prototype.Qb;function qc(){return {maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0};}function rc(a,b){return {uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b};}Q.prototype.o = function(){this.f = !0;this.b = [];this.c = [];for(var a=[],b=0;b < this.a.length;++b) a.push(this.a[b]["catch"](D));return Promise.all(a);};Q.prototype.destroy = Q.prototype.o;Q.prototype.request = function(a,b){if(this.f)return Promise.reject();for(var c=Date.now(),d=this.b,e=0;e < d.length;e++) try{d[e](a,b);}catch(l) {return Promise.reject(l);}for(var e=b.retryParameters || {},d=e.maxAttempts || 1,f=e.backoffFactor || 2,g=null == e.baseDelay?1E3:e.baseDelay,h=this.h(a,b,0),e=1;e < d;e++) h = h["catch"](this.i.bind(this,a,b,g,e % b.uris.length)),g *= f;this.a.push(h);return h.then((function(b){0 <= this.a.indexOf(h) && this.a.splice(this.a.indexOf(h),1);var d=Date.now();this.g && 1 == a && this.g(c,d,b.data.byteLength);return b;}).bind(this))["catch"]((function(a){0 <= this.a.indexOf(h) && this.a.splice(this.a.indexOf(h),1);return Promise.reject(a);}).bind(this));};Q.prototype.request = Q.prototype.request;Q.prototype.h = function(a,b,c){if(this.f)return Promise.reject();var d=new kb(b.uris[c]),e=d.S;e || (e = location.protocol,e = e.slice(0,-1),lb(d,e),b.uris[c] = d.toString());return (e = pc[e])?e(b.uris[c],b).then((function(b){for(var c=this.c,d=0;d < c.length;d++) c[d](a,b);return b;}).bind(this)):Promise.reject(new w(1,1E3,d));};Q.prototype.i = function(a,b,c,d){var e=new x(),f=b.retryParameters || {};window.setTimeout(e.resolve,c * (1 + (2 * Math.random() - 1) * (null == f.fuzzFactor?.5:f.fuzzFactor)));return e.then(this.h.bind(this,a,b,d));};var sc={},tc={};m("shaka.media.ManifestParser.registerParserByExtension",function(a,b){tc[a] = b;});m("shaka.media.ManifestParser.registerParserByMime",function(a,b){sc[a] = b;});function uc(){var a={},b;for(b in sc) a[b] = !0;for(b in tc) a[b] = !0;["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"].forEach(function(b){a[b] = !!sc[b];});["mpd","m3u8","ism"].forEach(function(b){a[b] = !!tc[b];});return a;}function vc(a,b,c,d){var e=d;e || (d = new kb(a).O.split("/").pop().split("."),1 < d.length && (d = d.pop().toLowerCase(),e = tc[d]));if(e)return Promise.resolve(e);c = rc([a],c);c.method = "HEAD";return b.request(0,c).then(function(b){(b = b.headers["content-type"]) && (b = b.toLowerCase());return (e = sc[b])?e:Promise.reject(new w(4,4E3,a));},function(a){return Promise.reject(a);});};function R(a,b){this.j = a;this.i = b;this.c = this.a = Infinity;this.b = 1;this.g = this.f = 0;this.h = !0;}m("shaka.media.PresentationTimeline",R);R.prototype.da = function(){return this.a;};R.prototype.getDuration = R.prototype.da;R.prototype.Aa = function(a){this.a = a;};R.prototype.setDuration = R.prototype.Aa;R.prototype.Fb = function(a){this.g = a;};R.prototype.setClockOffset = R.prototype.Fb;R.prototype.Hb = function(a){this.h = a;};R.prototype.setStatic = R.prototype.Hb;R.prototype.Xb = function(){return this.c;};R.prototype.getSegmentAvailabilityDuration = R.prototype.Xb;R.prototype.Gb = function(a){this.c = a;};R.prototype.setSegmentAvailabilityDuration = R.prototype.Gb;R.prototype.Ga = function(a,b){b.length && (this.b = b.reduce(function(a,b){return Math.max(a,b.endTime - b.startTime);},this.b),a || (this.f = Math.max(this.f,b[0].startTime)));};R.prototype.notifySegments = R.prototype.Ga;R.prototype.Ya = function(a){this.b = Math.max(this.b,a);};R.prototype.notifyMaxSegmentDuration = R.prototype.Ya;R.prototype.R = function(){return Infinity == this.a && !this.h;};R.prototype.isLive = R.prototype.R;R.prototype.ea = function(){return Infinity != this.a && !this.h;};R.prototype.isInProgress = R.prototype.ea;R.prototype.sa = function(){return Math.max(Math.min(this.f,this.Y()),this.ta());};R.prototype.getEarliestStart = R.prototype.sa;R.prototype.ta = function(){return Infinity == this.c?0:Math.max(0,this.Y() - this.c - this.i);};R.prototype.getSegmentAvailabilityStart = R.prototype.ta;R.prototype.Y = function(){return this.R() || this.ea()?Math.min(Math.max(0,(Date.now() + this.g) / 1E3 - this.b - this.j),this.a):this.a;};R.prototype.getSegmentAvailabilityEnd = R.prototype.Y;R.prototype.Ua = function(){return Math.max(0,this.Y() - (this.R() || this.ea()?this.i:0));};R.prototype.getSeekRangeEnd = R.prototype.Ua;function wc(a,b,c){this.h = S[b];this.c = a;this.g = 0;this.f = Infinity;this.a = this.b = null;this.i = c;}var S={};m("shaka.media.TextEngine.registerParser",function(a,b){S[a] = b;});m("shaka.media.TextEngine.unregisterParser",function(a){delete S[a];});function xc(a,b,c){return a >= b?null:new VTTCue(a,b,c);}m("shaka.media.TextEngine.makeCue",xc);wc.prototype.o = function(){this.c && yc(this,function(){return !0;});this.c = this.h = null;return Promise.resolve();};function zc(a,b,c,d){var e=a.g;return Promise.resolve().then((function(){if(this.c){var a=this.h(b,e,c,d,this.i);if(null != c && null != d){for(var g=0;g < a.length && !(a[g].startTime >= this.f);++g) this.c.addCue(a[g]);null == this.b && (this.b = c);this.a = Math.min(d,this.f);}}}).bind(a));}wc.prototype.remove = function(a,b){return Promise.resolve().then((function(){this.c && (yc(this,function(c){return c.startTime >= b || c.endTime <= a?!1:!0;}),null == this.b || b <= this.b || a >= this.a || (a <= this.b && b >= this.a?this.b = this.a = null:a <= this.b && b < this.a?this.b = b:a > this.b && b >= this.a && (this.a = a)));}).bind(this));};function Ac(a,b){return null == a.a || a.a < b || b < a.b?0:a.a - b;}function yc(a,b){for(var c=a.c.cues,d=[],e=0;e < c.length;++e) b(c[e]) && d.push(c[e]);for(e = 0;e < d.length;++e) a.c.removeCue(d[e]);};function Bc(a,b,c){return c == b || a >= Cc && c == b.split("-")[0] || a >= Dc && c.split("-")[0] == b.split("-")[0]?!0:!1;}var Cc=1,Dc=2;function Ec(a){a = a.toLowerCase().split("-");var b=Fc[a[0]];b && (a[0] = b);return a.join("-");}var Fc={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"};function Gc(a,b,c){for(var d=0;d < a.length;++d) if(c(a[d],b))return d;return -1;};function Hc(a){this.a = null;this.b = (function(){this.a = null;a();}).bind(this);}Hc.prototype.cancel = function(){null != this.a && (clearTimeout(this.a),this.a = null);};function Ic(a){a.cancel();a.a = setTimeout(a.b,100);};function Jc(a,b,c){this.l = this.g = this.s = null;this.A = !1;this.b = null;this.f = new y();this.a = [];this.m = [];this.j = new x();this.G = a;this.i = null;this.h = (function(a){this.j.reject(a);b(a);}).bind(this);this.w = {};this.J = c;this.v = new Hc(this.yc.bind(this));this.C = this.c = !1;this.j["catch"](function(){});}k = Jc.prototype;k.o = function(){this.c = !0;var a=this.a.map(function(a){a.za.close()["catch"](D);return a.za.closed;});this.j.reject();this.f && a.push(this.f.o());this.l && a.push(this.l.setMediaKeys(null)["catch"](D));this.v && this.v.cancel();this.f = this.l = this.g = this.s = this.b = this.v = null;this.a = [];this.m = [];this.h = this.i = this.G = null;return Promise.all(a);};k.configure = function(a){this.i = a;};k.init = function(a,b){var c={},d=[];this.C = b;this.m = a.offlineSessionIds;Kc(this,a,b || 0 < a.offlineSessionIds.length,c,d);return d.length?Lc(this,c,d):(this.A = !0,Promise.resolve());};function Mc(a,b){if(!a.g)return z(a.f,b,"encrypted",(function(){this.f.ja(b,"encrypted");this.h(new w(6,6010));}).bind(a)),Promise.resolve();a.l = b;var c=a.l.setMediaKeys(a.g),c=c["catch"](function(a){return Promise.reject(new w(6,6003,a.message));}),d=null;a.b.serverCertificate && (d = a.g.setServerCertificate(a.b.serverCertificate),d = d["catch"](function(a){return Promise.reject(new w(6,6004,a.message));}));return Promise.all([c,d]).then((function(){if(this.c)return Promise.reject();Nc(this);this.b.initData.length || this.m.length || z(this.f,this.l,"encrypted",this.ec.bind(this));}).bind(a))["catch"]((function(a){return this.c?Promise.resolve():Promise.reject(a);}).bind(a));}function Oc(a,b){return Promise.all(b.map((function(a){return Pc(this,a).then(function(a){if(a)return a.remove();});}).bind(a)));}function Nc(a){var b=a.b?a.b.initData:[];b.forEach((function(a){Qc(this,a.initDataType,a.initData);}).bind(a));a.m.forEach((function(a){Pc(this,a);}).bind(a));b.length || a.m.length || a.j.resolve();return a.j;}k.keySystem = function(){return this.b?this.b.keySystem:"";};function Rc(a){return a.a.map(function(a){return a.za.sessionId;});}function Kc(a,b,c,d,e){var f=Sc(a);b.periods.forEach((function(a){a.streamSets.forEach((function(a){"text" != a.type && (f && (a.drmInfos = [f]),a.drmInfos.forEach((function(b){Tc(this,b);var f=d[b.keySystem];f || (f = {audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:c?"required":"optional",sessionTypes:[c?"persistent-license":"temporary"],label:b.keySystem,drmInfos:[]},d[b.keySystem] = f,e.push(b.keySystem));f.drmInfos.push(b);b.distinctiveIdentifierRequired && (f.distinctiveIdentifier = "required");b.persistentStateRequired && (f.persistentState = "required");var g="video" == a.type?f.videoCapabilities:f.audioCapabilities,h=("video" == a.type?b.videoRobustness:b.audioRobustness) || "";a.streams.forEach((function(a){var c=a.mimeType;a.codecs && (c += '; codecs="' + a.codecs + '"');a.keyId && b.keyIds.push(a.keyId);g.push({robustness:h,contentType:c});}).bind(this));}).bind(this)));}).bind(this));}).bind(a));}function Lc(a,b,c){if(1 == c.length && "" == c[0])return Promise.reject(new w(6,6E3));var d=new x(),e=d;[!0,!1].forEach((function(a){c.forEach((function(c){var d=b[c];d.drmInfos.some(function(a){return !!a.licenseServerUri;}) == a && (d.audioCapabilities.length || delete d.audioCapabilities,d.videoCapabilities.length || delete d.videoCapabilities,e = e["catch"]((function(){return this.c?Promise.reject():navigator.requestMediaKeySystemAccess(c,[d]);}).bind(this)));}).bind(this));}).bind(a));e = e["catch"](function(){return Promise.reject(new w(6,6001));});e = e.then((function(a){if(this.c)return Promise.reject();var c=0 <= navigator.userAgent.indexOf("Edge/"),d=a.getConfiguration();this.s = (d.audioCapabilities || []).concat(d.videoCapabilities || []).map(function(a){return a.contentType;});c && (this.s = null);c = b[a.keySystem];Uc(this,a.keySystem,c,c.drmInfos);return this.b.licenseServerUri?a.createMediaKeys():Promise.reject(new w(6,6012));}).bind(a)).then((function(a){if(this.c)return Promise.reject();this.g = a;this.A = !0;}).bind(a))["catch"]((function(a){if(this.c)return Promise.resolve();this.s = this.b = null;return a instanceof w?Promise.reject(a):Promise.reject(new w(6,6002,a.message));}).bind(a));d.reject();return e;}function Tc(a,b){var c=b.keySystem;if(c){if(!b.licenseServerUri){var d=a.i.servers[c];d && (b.licenseServerUri = d);}b.keyIds || (b.keyIds = []);if(c = a.i.advanced[c])b.distinctiveIdentifierRequired || (b.distinctiveIdentifierRequired = c.distinctiveIdentifierRequired),b.persistentStateRequired || (b.persistentStateRequired = c.persistentStateRequired),b.videoRobustness || (b.videoRobustness = c.videoRobustness),b.audioRobustness || (b.audioRobustness = c.audioRobustness),b.serverCertificate || (b.serverCertificate = c.serverCertificate);}}function Sc(a){if(Na(a.i.clearKeys))return null;var b=[],c=[],d;for(d in a.i.clearKeys) {var e=a.i.clearKeys[d],f=Sa(d),e=Sa(e),f={kty:"oct",kid:Qa(f),k:Qa(e)};b.push(f);c.push(f.kid);}a = JSON.stringify({keys:b});c = JSON.stringify({kids:c});c = [{initData:new Uint8Array(Ib(c)),initDataType:"keyids"}];return {keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64," + window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:c,keyIds:[]};}function Uc(a,b,c,d){var e=[],f=[],g=[],h=[];Vc(d,e,f,g,h);a.b = {keySystem:b,licenseServerUri:e[0],distinctiveIdentifierRequired:"required" == c.distinctiveIdentifier,persistentStateRequired:"required" == c.persistentState,audioRobustness:c.audioCapabilities?c.audioCapabilities[0].robustness:"",videoRobustness:c.videoCapabilities?c.videoCapabilities[0].robustness:"",serverCertificate:f[0],initData:g,keyIds:h};}function Vc(a,b,c,d,e){function f(a,b){return a.initDataType == b.initDataType && Ua(a.initData,b.initData);}a.forEach(function(a){-1 == b.indexOf(a.licenseServerUri) && b.push(a.licenseServerUri);a.serverCertificate && -1 == Gc(c,a.serverCertificate,Ua) && c.push(a.serverCertificate);a.initData && a.initData.forEach(function(a){-1 == Gc(d,a,f) && d.push(a);});if(a.keyIds)for(var g=0;g < a.keyIds.length;++g) -1 == e.indexOf(a.keyIds[g]) && e.push(a.keyIds[g]);});}k.ec = function(a){for(var b=new Uint8Array(a.initData),c=0;c < this.a.length;++c) if(Ua(b,this.a[c].initData))return;Qc(this,a.initDataType,b);};function Pc(a,b){var c;try{c = a.g.createSession("persistent-license");}catch(f) {var d=new w(6,6005,f.message);a.h(d);return Promise.reject(d);}z(a.f,c,"message",a.xb.bind(a));z(a.f,c,"keystatuseschange",a.sb.bind(a));var e={initData:null,za:c,loaded:!1};a.a.push(e);return c.load(b).then((function(a){if(!this.c){if(a)return e.loaded = !0,this.a.every(function(a){return a.loaded;}) && this.j.resolve(),c;this.a.splice(this.a.indexOf(e),1);this.h(new w(6,6013));}}).bind(a),(function(a){this.c || (this.a.splice(this.a.indexOf(e),1),this.h(new w(6,6005,a.message)));}).bind(a));}function Qc(a,b,c){var d;try{d = a.C?a.g.createSession("persistent-license"):a.g.createSession();}catch(e) {a.h(new w(6,6005,e.message));return;}z(a.f,d,"message",a.xb.bind(a));z(a.f,d,"keystatuseschange",a.sb.bind(a));a.a.push({initData:c,za:d,loaded:!1});d.generateRequest(b,c.buffer)["catch"]((function(a){if(!this.c){for(var b=0;b < this.a.length;++b) if(this.a[b].za == d){this.a.splice(b,1);break;}this.h(new w(6,6006,a.message));}}).bind(a));}k.xb = function(a){var b=a.target,c=rc([this.b.licenseServerUri],this.i.retryParameters);c.body = a.message;c.method = "POST";"com.microsoft.playready" == this.b.keySystem && Wc(c);this.G.request(2,c).then((function(a){return this.c?Promise.reject():b.update(a.data);}).bind(this),(function(a){if(this.c)return Promise.resolve();this.h(new w(6,6007,a));}).bind(this))["catch"]((function(a){if(this.c)return Promise.resolve();this.h(new w(6,6008,a.message));}).bind(this));};function Wc(a){for(var b=Gb(a.body,!0),b=new DOMParser().parseFromString(b,"application/xml"),c=b.getElementsByTagName("HttpHeader"),d=0;d < c.length;++d) a.headers[c[d].querySelector("name").textContent] = c[d].querySelector("value").textContent;a.body = Ra(b.querySelector("Challenge").textContent).buffer;}k.sb = function(a){a = a.target;var b;for(b = 0;b < this.a.length && this.a[b].za != a;++b);if(b != this.a.length){var c=a.keyStatuses,d=!1;c.forEach || (c = []);c.forEach((function(a,c){if("string" == typeof c){var e=c;c = a;a = e;}if("com.microsoft.playready" == this.b.keySystem && 16 == c.byteLength){var e=new DataView(c),f=e.getUint32(0,!0),l=e.getUint16(4,!0),n=e.getUint16(6,!0);e.setUint32(0,f,!1);e.setUint16(4,l,!1);e.setUint16(6,n,!1);}"com.microsoft.playready" == this.b.keySystem && "status-pending" == a && (a = "usable");"status-pending" != a && (this.a[b].loaded = !0,this.a.every(function(a){return a.loaded;}) && this.j.resolve());"expired" == a && (d = !0);e = Ta(new Uint8Array(c));this.w[e] = a;}).bind(this));c = a.expiration - Date.now();if(0 > c || d && 1E3 > c)this.a.splice(b,1),a.close();Ic(this.v);}};k.yc = function(){Pa(this.w,function(a,b){return "expired" == b;}) && this.h(new w(6,6014));this.J(this.w);};function Xc(){var a=[],b=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],c=[{videoCapabilities:b,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:b}],d={};"org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").forEach(function(b){var e=navigator.requestMediaKeySystemAccess(b,c).then(function(a){return a.createMediaKeys();}).then(function(a){var c=!1;try{a.createSession("persistent-license"),c = !0;}catch(l) {}d[b] = {persistentState:c};},function(){d[b] = null;});a.push(e);});return Promise.all(a).then(function(){return d;});};function Zc(a){return !a || 1 == a.length && 1E-6 > a.end(0) - a.start(0)?null:a.length?a.end(a.length - 1):null;}function $c(a,b){var c=0;if(!a || 1 == a.length && 1E-6 > a.end(0) - a.start(0))return c;var d=!1,e=1E-4;b || (e = .25);for(var f=0;f < a.length;++f) if(b + e >= a.start(f) && b < a.end(f))c += a.end(f) - b,d = !0;else if(d && .04 >= a.start(f) - a.end(f - 1))c += a.end(f) - a.start(f),c += a.start(f) - a.end(f - 1);else if(0 < f && b + e < a.start(f) && b + e >= a.end(f - 1))if(.04 >= a.start(f) - b)c += a.end(f) - b,d = !0;else break;else d = !1;return c;};function ad(a,b,c){this.f = a;this.h = b;this.j = c;this.c = {};this.b = null;this.a = {};this.g = new y();this.i = !1;}function bd(){var a={};'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hvc1.1.6.L93.90",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="av1",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",video/mp2t; codecs="mp4a.40.2",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(b){a[b] = !!S[b] || MediaSource.isTypeSupported(b);var c=b.split(";")[0];a[c] = a[c] || a[b];});return a;}k = ad.prototype;k.o = function(){this.i = !0;var a=[],b;for(b in this.a) {var c=this.a[b],d=c[0];this.a[b] = c.slice(0,1);d && a.push(d.p["catch"](D));for(d = 1;d < c.length;++d) c[d].p["catch"](D),c[d].p.reject();}this.b && a.push(this.b.o());return Promise.all(a).then((function(){this.g.o();this.b = this.j = this.h = this.f = this.g = null;this.c = {};this.a = {};}).bind(this));};k.init = function(a,b){for(var c in a) {var d=a[c];"text" == c?this.b = new wc(this.j,d,b):(d = this.h.addSourceBuffer(d),z(this.g,d,"error",this.Uc.bind(this,c)),z(this.g,d,"updateend",this.wa.bind(this,c)),this.c[c] = d,this.a[c] = []);}};function cd(a,b){var c;"text" == b?c = a.b.b:(c = dd(a,b),c = !c || 1 == c.length && 1E-6 > c.end(0) - c.start(0)?null:1 == c.length && 0 > c.start(0)?0:c.length?c.start(0):null);return c;}function fd(a,b,c){"text" == b?(b = Ac(a.b,c),b || (b = Ac(a.b,c + .1)) && (b += .1)):(a = dd(a,b),b = $c(a,c),b || (b = $c(a,c + .1)) && (b += .1));return b;}function dd(a,b){try{return a.c[b].buffered;}catch(c) {return null;}}function gd(a,b,c,d,e){return "text" == b?zc(a.b,c,d,e):hd(a,b,a.Tc.bind(a,b,c));}k.remove = function(a,b,c){return "text" == a?this.b.remove(b,c):hd(this,a,this.Cb.bind(this,a,b,c));};function id(a,b){return "text" == b?a.b.remove(0,Infinity):hd(a,b,a.Cb.bind(a,b,0,a.h.duration));}function jd(a,b,c){return "text" == b?(a.b.g = c,Promise.resolve()):hd(a,b,a.Jc.bind(a,b,c));}function kd(a,b,c){return "text" == b?(a.b.f = c,Promise.resolve()):Promise.all([hd(a,b,a.Lb.bind(a,b)),hd(a,b,a.Hc.bind(a,b,c))]);}k.endOfStream = function(a){return ld(this,(function(){a?this.h.endOfStream(a):this.h.endOfStream();}).bind(this));};k.Aa = function(a){return ld(this,(function(){this.h.duration = a;}).bind(this));};k.da = function(){return this.h.duration;};k.Tc = function(a,b){this.c[a].appendBuffer(b);};k.Cb = function(a,b,c){c <= b?this.wa(a):this.c[a].remove(b,c);};k.Lb = function(a){var b=this.c[a].appendWindowEnd;this.c[a].abort();this.c[a].appendWindowEnd = b;this.wa(a);};k.Ub = function(a){this.f.currentTime -= .001;this.wa(a);};k.Jc = function(a,b){this.c[a].timestampOffset = b;this.wa(a);};k.Hc = function(a,b){this.c[a].appendWindowEnd = b + .04;this.wa(a);};k.Uc = function(a){this.a[a][0].p.reject(new w(3,3014,this.f.error?this.f.error.code:0));};k.wa = function(a){var b=this.a[a][0];b && (b.p.resolve(),md(this,a));};function hd(a,b,c){if(a.i)return Promise.reject();c = {start:c,p:new x()};a.a[b].push(c);if(1 == a.a[b].length)try{c.start();}catch(d) {"QuotaExceededError" == d.name?c.p.reject(new w(3,3017,b)):c.p.reject(new w(3,3015,d)),md(a,b);}return c.p;}function ld(a,b){if(a.i)return Promise.reject();var c=[],d;for(d in a.c) {var e=new x(),f={start:(function(a){a.resolve();}).bind(null,e),p:e};a.a[d].push(f);c.push(e);1 == a.a[d].length && f.start();}return Promise.all(c).then((function(){var a,c;try{b();}catch(l) {c = Promise.reject(new w(3,3015,l));}for(a in this.c) md(this,a);return c;}).bind(a),(function(){return Promise.reject();}).bind(a));}function md(a,b){a.a[b].shift();var c=a.a[b][0];if(c)try{c.start();}catch(d) {c.p.reject(new w(3,3015,d)),md(a,b);}};function nd(a,b,c){var d=!1;a.streamSets.forEach(function(a){a.streams.forEach(function(e){var f=e.allowedByApplication;e.allowedByApplication = !0;if("video" == a.type){if(e.width < b.minWidth || e.width > b.maxWidth || e.width > c.width || e.height < b.minHeight || e.height > b.maxHeight || e.height > c.height || e.width * e.height < b.minPixels || e.width * e.height > b.maxPixels || e.bandwidth < b.minVideoBandwidth || e.bandwidth > b.maxVideoBandwidth)e.allowedByApplication = !1;}else "audio" == a.type && (e.bandwidth < b.minAudioBandwidth || e.bandwidth > b.maxAudioBandwidth) && (e.allowedByApplication = !1);f != e.allowedByApplication && (d = !0);});});return d;}function od(a,b,c){var d="",e=null;a && a.A && (d = a.keySystem(),e = a.s);for(a = 0;a < c.streamSets.length;++a) {var f=c.streamSets[a];if(d && f.drmInfos.length && !f.drmInfos.some(function(a){return a.keySystem == d;}))c.streamSets.splice(a,1),--a;else {for(var g=b[f.type],h=0;h < f.streams.length;++h) {var l=f.streams[h],n=pd(l.mimeType,l.codecs);S[n] || MediaSource.isTypeSupported(n)?e && l.encrypted && 0 > e.indexOf(n)?(f.streams.splice(h,1),--h):!g || l.mimeType == g.mimeType && l.codecs.split(".")[0] == g.codecs.split(".")[0] || (f.streams.splice(h,1),--h):(f.streams.splice(h,1),--h);}f.streams.length || (c.streamSets.splice(a,1),--a);}}}function qd(a,b){return a.streamSets.map(function(a){var c=b?b[a.type]:null;return a.streams.filter(function(a){return a.allowedByApplication && a.allowedByKeySystem;}).map(function(b){return {id:b.id,active:c == b,type:a.type,bandwidth:b.bandwidth,language:a.language,kind:b.kind || null,width:b.width || null,height:b.height || null,frameRate:b.frameRate || void 0,codecs:b.codecs || null};});}).reduce(C,[]);}function rd(a,b){for(var c=0;c < a.streamSets.length;c++) for(var d=a.streamSets[c],e=0;e < d.streams.length;e++) {var f=d.streams[e];if(f.id == b.id)return {stream:f,Wc:d};}return null;}function sd(a){return a.streams.some(function(a){return a.allowedByApplication && a.allowedByKeySystem;});}function td(a,b,c){var d={};a.streamSets.forEach(function(a){!sd(a) || a.type in d || (d[a.type] = a);});var e=0;a.streamSets.forEach(function(a){if(sd(a) && "video" == a.type){var b=ud(a);b > e?(e = b,d.video = a):b == e && vd(a) < vd(d.video) && (d.video = a);}});a.streamSets.forEach(function(a){sd(a) && a.primary && (d[a.type].primary?vd(a) < vd(d[a.type]) && (d[a.type] = a):d[a.type] = a);});[Dc,Cc,0].forEach(function(e){a.streamSets.forEach(function(a){if(sd(a)){var f;"audio" == a.type?f = b.preferredAudioLanguage:"text" == a.type && (f = b.preferredTextLanguage);if(f){f = Ec(f);var g=Ec(a.language);Bc(e,f,g) && (a.language == d[a.type].language?vd(a) < vd(d[a.type]) && (d[a.type] = a):d[a.type] = a,c && (c[a.type] = !0));}}});});return d;}function vd(a){var b=0;if(!a || 1 > a.streams.length)return b;a.streams.forEach(function(a){b += a.bandwidth;});return b / a.streams.length;}function ud(a){var b=0;if(!a)return b;a.streams.forEach(function(a){a.height > b && (b = a.height);});return b;}function pd(a,b){var c=a;b && (c += '; codecs="' + b + '"');return c;};function wd(){this.m = this.l = this.j = this.c = this.a = null;this.h = [];this.b = null;this.g = [];this.v = 1;this.i = {};this.s = 0;this.f = null;this.La = this.La.bind(this);}m("shaka.dash.DashParser",wd);k = wd.prototype;k.configure = function(a){this.c = a;};k.start = function(a,b,c,d,e){this.h = [a];this.a = b;this.j = c;this.l = d;this.m = e;return xd(this).then((function(){this.a && yd(this,0);return this.b;}).bind(this));};k.stop = function(){this.a && this.a.Jb(this.La);this.c = this.m = this.l = this.j = this.a = null;this.h = [];this.b = null;this.g = [];this.i = {};null != this.f && (window.clearTimeout(this.f),this.f = null);return Promise.resolve();};function xd(a){return a.a.request(0,rc(a.h,a.c.retryParameters)).then((function(a){if(this.a)return zd(this,a.data,a.uri);}).bind(a));}function zd(a,b,c){var d=Eb(b),e=new DOMParser(),f=null;b = null;try{f = e.parseFromString(d,"text/xml");}catch(E) {}f && "MPD" == f.documentElement.tagName && (b = f.documentElement);if(!b)throw new w(4,4001);c = [c];d = G(b,"Location").map(Wa).filter(La);0 < d.length && (c = a.h = d);d = G(b,"BaseURL").map(Wa);c = L(c,d);var g=I(b,"minBufferTime",J);a.s = I(b,"minimumUpdatePeriod",J,-1);var h=I(b,"availabilityStartTime",Xa),d=I(b,"timeShiftBufferDepth",J),l=I(b,"suggestedPresentationDelay",J),e=I(b,"maxSegmentDuration",J),f=b.getAttribute("type") || "static",n;if(a.b)n = a.b.presentationTimeline;else {var u=Math.max(10,1.5 * g);n = new R(h,null != l?l:u);}var h=Ad(a,{Ra:"static" != f,presentationTimeline:n,K:null,H:null,P:null,u:null,bandwidth:void 0},c,b),l=h.duration,r=h.periods;n.Hb("static" == f);n.Aa(l || Infinity);n.Gb(null != d?d:Infinity);n.Ya(e || 1);if(a.b)return Promise.resolve();b = G(b,"UTCTiming");d = n.R();h.ba && a.a.Ab(a.La);return Bd(a,c,b,d).then((function(a){this.a && (n.Fb(a),this.b = {presentationTimeline:n,periods:r,offlineSessionIds:[],minBufferTime:g || 0});}).bind(a));}function Ad(a,b,c,d){var e=I(d,"mediaPresentationDuration",J),f=!1,g=[],h=0;d = G(d,"Period");for(var l=0;l < d.length;l++) {var n=d[l],h=I(n,"start",J,h),u=I(n,"duration",J);if(null == u)if(l + 1 != d.length){var r=I(d[l + 1],"start",J);null != r && (u = r - h);}else null != e && (u = e - h);var n={start:h,duration:u,node:n,ba:!1},E=a,v=b,r=n;v.K = Cd(r.node,null,c);v.H = r;v.K.id || (v.K.id = "__shaka_period_" + r.start);E = G(r.node,"AdaptationSet").map(E.uc.bind(E,v)).filter(La);if(!E.length)throw new w(4,4004);for(v = 0;v < E.length;v++) E[v].ba && (r.ba = !0);E = Dd(E);r = {startTime:r.start,streamSets:E};g.push(r);f = f || n.ba;n = b.K.id;a.g.every(Ma(n)) && (a.j(r),a.g.push(n),a.b && a.b.periods.push(r));if(null == u){h = null;break;}h += u;}return null != e?{periods:g,duration:e,ba:f}:{periods:g,duration:h,ba:f};}k.uc = function(a,b){a.P = Cd(b,a.K,null);var c=!1,d=G(b,"Role"),e=void 0;"text" == a.P.contentType && (e = "subtitle");for(var f=0;f < d.length;f++) {var g=d[f].getAttribute("schemeIdUri");if(null == g || "urn:mpeg:dash:role:2011" == g)switch((g = d[f].getAttribute("value"),g)){case "main":c = !0;break;case "caption":case "subtitle":e = g;}}var d=!!Va(b,"InbandEventStream"),h=[];G(b,"SupplementalProperty").forEach(function(a){var b=a.getAttribute("schemeIdUri");("urn:mpeg:dash:adaptation-set-switching:2016" == b || "http://dashif.org/guidelines/AdaptationSetSwitching" == b || "http://dashif.org/descriptor/AdaptationSetSwitching" == b) && (a = a.getAttribute("value")) && h.push.apply(h,a.split(","));});var l=null,n=!1;G(b,"EssentialProperty").forEach(function(a){"http://dashif.org/guidelines/trickmode" == a.getAttribute("schemeIdUri")?l = a.getAttribute("value"):n = !0;});if(null != l || n)return null;f = G(b,"ContentProtection");f = eb(f,this.c.dash.customScheme);g = Ec(b.getAttribute("lang") || "und");e = G(b,"Representation").map(this.vc.bind(this,a,f,e,g)).filter(function(a){return !!a;});if(!e.length)throw new w(4,4003);a.P.contentType || (a.P.contentType = Ed(e[0].mimeType,e[0].codecs));return {id:a.P.id || "__fake__" + this.v++,contentType:a.P.contentType,language:g,cc:c,streams:e,drmInfos:f.drmInfos,Yc:h,ba:d};};k.vc = function(a,b,c,d,e){a.u = Cd(e,a.P,null);if(!Fd(a.u))return null;a.bandwidth = I(e,"bandwidth",$a) || void 0;var f;f = this.Cc.bind(this);if(a.u.Ha)f = dc(a,f);else if(a.u.Z)f = gc(a,this.i);else if(a.u.Ia)f = kc(a,f,this.i,!!this.b);else {var g=a.u.M,h=a.H.duration || 0;f = {createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function findSegmentPosition(a){return 0 <= a && a < h?1:null;},getSegmentReference:function getSegmentReference(a){return 1 != a?null:new K(1,0,h,function(){return g;},0,null);},initSegmentReference:null,presentationTimeOffset:0};}e = G(e,"ContentProtection");e = ib(e,this.c.dash.customScheme,b);return {id:this.v++,createSegmentIndex:f.createSegmentIndex,findSegmentPosition:f.findSegmentPosition,getSegmentReference:f.getSegmentReference,initSegmentReference:f.initSegmentReference,presentationTimeOffset:f.presentationTimeOffset,mimeType:a.u.mimeType,codecs:a.u.codecs,frameRate:a.u.frameRate,bandwidth:a.bandwidth,width:a.u.width,height:a.u.height,kind:c,encrypted:0 < b.drmInfos.length,keyId:e,language:d,allowedByApplication:!0,allowedByKeySystem:!0};};k.Sc = function(){this.f = null;var a=Date.now();xd(this).then((function(){this.a && yd(this,(Date.now() - a) / 1E3);}).bind(this))["catch"]((function(a){this.l(a);this.a && yd(this,0);}).bind(this));};function yd(a,b){0 > a.s || (a.f = window.setTimeout(a.Sc.bind(a),1E3 * Math.max(Math.max(3,a.s) - b,0)));}function Cd(a,b,c){b = b || {contentType:"",mimeType:"",codecs:"",frameRate:void 0};c = c || b.M;var d=G(a,"BaseURL").map(Wa),e=a.getAttribute("contentType") || b.contentType,f=a.getAttribute("mimeType") || b.mimeType,g=a.getAttribute("codecs") || b.codecs,h=I(a,"frameRate",bb) || b.frameRate;e || (e = Ed(f,g));return {M:L(c,d),Ha:Va(a,"SegmentBase") || b.Ha,Z:Va(a,"SegmentList") || b.Z,Ia:Va(a,"SegmentTemplate") || b.Ia,width:I(a,"width",ab) || b.width,height:I(a,"height",ab) || b.height,contentType:e,mimeType:f,codecs:g,frameRate:h,id:a.getAttribute("id")};}function Dd(a){var b={};a.forEach(function(a){b[a.id] = [a];});a.forEach(function(a){var c=b[a.id];a.Yc.forEach(function(a){(a = b[a]) && a != c && (c.push.apply(c,a),a.forEach(function(a){b[a.id] = c;}));});});var c=[],d=[];F(b).forEach(function(a){if(!(0 <= d.indexOf(a))){d.push(a);var b=new Ca();a.forEach(function(a){b.push(a.contentType || "",a);});b.keys().forEach(function(a){var d=new Ca();b.get(a).forEach(function(a){d.push(a.language,a);});d.keys().forEach(function(b){var e=d.get(b);b = {language:b,type:a,primary:e.some(function(a){return a.cc;}),drmInfos:e.map(function(a){return a.drmInfos;}).reduce(C,[]),streams:e.map(function(a){return a.streams;}).reduce(C,[])};c.push(b);});});}});return c;}function Fd(a){var b;b = 0 + (a.Ha?1:0);b += a.Z?1:0;b += a.Ia?1:0;if(!b)return "text" == a.contentType || "application" == a.contentType?!0:!1;1 != b && (a.Ha && (a.Z = null),a.Ia = null);return !0;}function Gd(a,b,c,d){b = L(b,[c]);b = rc(b,a.c.retryParameters);b.method = d;return a.a.request(0,b).then(function(a){if("HEAD" == d){if(!a.headers || !a.headers.date)return 0;a = a.headers.date;}else a = Eb(a.data);a = Date.parse(a);return isNaN(a)?0:a - Date.now();});}function Bd(a,b,c,d){c = c.map(function(a){return {scheme:a.getAttribute("schemeIdUri"),value:a.getAttribute("value")};});var e=a.c.dash.clockSyncUri;d && !c.length && e && c.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:e});return Ka(c,(function(a){var c=a.value;switch(a.scheme){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return Gd(this,b,c,"HEAD");case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return Gd(this,b,c,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return a = Date.parse(c),isNaN(a)?0:a - Date.now();case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":return Promise.reject();default:return Promise.reject();}}).bind(a))["catch"](function(){return 0;});}k.Cc = function(a,b,c){a = rc(a,this.c.retryParameters);null != b && (a.headers.Range = "bytes=" + b + "-" + (null != c?c:""));return this.a.request(1,a).then(function(a){return a.data;});};k.La = function(a,b){if(1 == a){var c=new Jb(new DataView(b.data)),d=Sb(1701671783,c);if(-1 != d){var e=c.a - 8 + d;O(c,4);d = Rb(c);if("urn:mpeg:dash:event:2012" == d)xd(this);else {var f=Rb(c),g=N(c),h=N(c),l=N(c),n=N(c),c=Qb(c,e - c.a);this.m(new t("emsg",{detail:{ld:d,value:f,Ja:g,kd:h,hd:l,id:n,jd:c}}));}}}};function Ed(a,b){return S[pd(a,b)]?"text":a.split("/")[0];}tc.mpd = wd;sc["application/dash+xml"] = wd;function T(a,b){var c=Eb(a),d=[],e=new DOMParser(),f=null;try{f = e.parseFromString(c,"text/xml");}catch(n) {throw new w(2,2005);}if(f){var g,h;if(c = f.getElementsByTagName("tt")[0])e = c.getAttribute("ttp:frameRate"),f = c.getAttribute("ttp:subFrameRate"),g = c.getAttribute("ttp:frameRateMultiplier"),h = c.getAttribute("ttp:tickRate");else throw new w(2,2006);e = new Hd(e,f,g,h);f = T.b(c.getElementsByTagName("styling")[0]);g = T.b(c.getElementsByTagName("layout")[0]);c = T.b(c.getElementsByTagName("body")[0]);for(h = 0;h < c.length;h++) {var l=T.c(c[h],b,e,f,g);l && d.push(l);}}return d;}m("shaka.media.TtmlTextParser",T);T.m = /^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/;T.v = /^(?:(\d{2,}):)?(\d{2}):(\d{2})$/;T.s = /^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/;T.w = /^(\d*\.?\d*)f$/;T.C = /^(\d*\.?\d*)t$/;T.A = /^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;T.l = /^(\d{1,2}|100)% (\d{1,2}|100)%$/;T.Da = {left:"start",center:"center",right:"end",start:"start",end:"end"};T.Ka = {left:"line-left",center:"center",right:"line-right"};T.b = function(a){var b=[];if(!a)return b;for(var c=a.childNodes,d=0;d < c.length;d++) {var e="span" == c[d].nodeName && "p" == a.nodeName;c[d].nodeType != Node.ELEMENT_NODE || "br" == c[d].nodeName || e || (e = T.b(c[d]),b = b.concat(e));}b.length || b.push(a);return b;};T.g = function(a){a = a.childNodes;for(var b=0;b < a.length;b++) "br" == a[b].nodeName && 0 < b?a[b - 1].textContent += "\n":0 < a[b].childNodes.length && T.g(a[b]);};T.c = function(a,b,c,d,e){if(!a.hasAttribute("begin") && !a.hasAttribute("end") && /^\s*$/.test(a.textContent))return null;T.g(a);var f=T.a(a.getAttribute("begin"),c),g=T.a(a.getAttribute("end"),c);c = T.a(a.getAttribute("dur"),c);var h=a.textContent;null == g && null != c && (g = f + c);if(null == f || null == g)throw new w(2,2001);b = xc(f + b,g + b,h);if(!b)return null;e = T.i(a,"region",e);T.oa(b,a,e,d);return b;};T.oa = function(a,b,c,d){var e,f=T.f(b,c,d,"tts:extent");f && (e = T.l.exec(f)) && (a.size = Number(e[1]));e = T.f(b,c,d,"tts:writingMode");f = !0;"tb" == e || "tblr" == e?a.vertical = "lr":"tbrl" == e?a.vertical = "rl":f = !1;if(e = T.f(b,c,d,"tts:origin"))if(e = T.l.exec(e))f?(a.position = Number(e[2]),a.line = Number(e[1])):(a.position = Number(e[1]),a.line = Number(e[2])),a.snapToLines = !1;if(b = T.f(b,c,d,"tts:textAlign"))a.align = b,"center" == b && ("center" != a.align && (a.align = "middle"),a.position = "auto"),a.positionAlign = T.Ka[b],a.lineAlign = T.Da[b];};T.f = function(a,b,c,d){for(var e=T.b(b),f=0;f < e.length;f++) {var g=e[f].getAttribute(d);if(g)return g;}e = T.i;return (a = e(b,"style",c) || e(a,"style",c))?a.getAttribute(d):null;};T.i = function(a,b,c){if(!a || 1 > c.length)return null;var d=null;if(a = T.pa(a,b))for(b = 0;b < c.length;b++) if(c[b].getAttribute("xml:id") == a){d = c[b];break;}return d;};T.pa = function(a,b){for(var c=null;a && !(c = a.getAttribute(b));) {var d=a.parentNode;if(d instanceof Element)a = d;else break;}return c;};T.a = function(a,b){var c=null;T.m.test(a)?c = T.qa(b,a):T.v.test(a)?c = T.h(T.v,a):T.s.test(a)?c = T.h(T.s,a):T.w.test(a)?c = T.Ba(b,a):T.C.test(a)?c = T.Ca(b,a):T.A.test(a) && (c = T.h(T.A,a));return c;};T.Ba = function(a,b){var c=T.w.exec(b);return Number(c[1]) / a.frameRate;};T.Ca = function(a,b){var c=T.C.exec(b);return Number(c[1]) / a.a;};T.qa = function(a,b){var c=T.m.exec(b),d=Number(c[1]),e=Number(c[2]),f=Number(c[3]),g=Number(c[4]),g=g + (Number(c[5]) || 0) / a.b,f=f + g / a.frameRate;return f + 60 * e + 3600 * d;};T.h = function(a,b){var c=a.exec(b);return c && "" != c[0]?(Number(c[4]) || 0) / 1E3 + (Number(c[3]) || 0) + 60 * (Number(c[2]) || 0) + 3600 * (Number(c[1]) || 0):null;};function Hd(a,b,c,d){this.frameRate = Number(a) || 30;this.b = Number(b) || 1;this.a = Number(d);this.a || (this.a = a?this.frameRate * this.b:1);c && (a = /^(\d+) (\d+)$/g.exec(c)) && (this.frameRate *= a[1] / a[2]);}S["application/ttml+xml"] = T;function Id(a,b){var c=new Jb(new DataView(a)),d=Sb(1835295092,c);if(-1 != d)return T(Qb(c,d - 8).buffer,b);if(-1 != Tb(a,Id.T))return [];throw new w(2,2007);}m("shaka.media.Mp4TtmlParser",Id);Id.T = 1937010800;S['application/mp4; codecs="stpp"'] = Id;function Jd(a){this.b = a;this.a = 0;}function Kd(a,b){var c;b.lastIndex = a.a;c = (c = b.exec(a.b))?{position:c.index,length:c[0].length,Ec:c}:null;if(a.a == a.b.length || !c || c.position != a.a)return null;a.a += c.length;return c.Ec;}function Ld(a){return a.a == a.b.length?null:(a = Kd(a,/[^ \t\n]*/gm))?a[0]:null;};function U(a,b,c,d,e){a = Eb(a);a = a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");a = a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(a[0]))throw new w(2,2E3);d = [];for(var f=1;f < a.length;f++) {var g=a[f].split("\n");(g = U.c(g,b,c,e)) && d.push(g);}return d;}m("shaka.media.VttTextParser",U);U.c = function(a,b,c,d){if(1 == a.length && !a[0] || /^NOTE($|[ \t])/.test(a[0]))return null;var e=null;0 > a[0].indexOf("--\x3e") && (e = a[0],a.splice(0,1));var f=new Jd(a[0]),g=U.a(f),h=Kd(f,/[ \t]+--\x3e[ \t]+/g),l=U.a(f);if(null == g || !h || null == l)throw new w(2,2001);g += b;l += b;d && (g += c,l += c);a = xc(g,l,a.slice(1).join("\n").trim());if(!a)return null;Kd(f,/[ \t]+/gm);for(b = Ld(f);b;) U.j(a,b),Kd(f,/[ \t]+/gm),b = Ld(f);null != e && (a.id = e);return a;};U.j = function(a,b){var c;if(c = /^align:(start|middle|center|end|left|right)$/.exec(b))a.align = c[1],"center" == c[1] && "center" != a.align && (a.position = "auto",a.align = "middle");else if(c = /^vertical:(lr|rl)$/.exec(b))a.vertical = c[1];else if(c = /^size:(\d{1,2}|100)%$/.exec(b))a.size = Number(c[1]);else if(c = /^position:(\d{1,2}|100)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position = Number(c[1]),c[2] && (a.positionAlign = c[2]);else if(c = /^line:(\d{1,2}|100)%(?:,(start|end|center))?$/.exec(b))a.snapToLines = !1,a.line = Number(c[1]),c[2] && (a.lineAlign = c[2]);else if(c = /^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.snapToLines = !0,a.line = Number(c[1]),c[2] && (a.lineAlign = c[2]);};U.a = function(a){a = Kd(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g);if(!a)return null;var b=Number(a[2]),c=Number(a[3]);return 59 < b || 59 < c?null:Number(a[4]) / 1E3 + c + 60 * b + 3600 * (Number(a[1]) || 0);};S["text/vtt"] = U;S['text/vtt; codecs="vtt"'] = U;function V(a,b,c,d){var e=new Jb(new DataView(a)),f=Sb(1835295092,e);if(-1 != f)return V.ra(Qb(e,f - 8).buffer,b,c,d);if(-1 != Tb(a,V.na))return [];throw new w(2,2008);}m("shaka.media.Mp4VttParser",V);V.ra = function(a,b,c,d){a = new Jb(new DataView(a));c += b;d += b;for(b = [];Lb(a);) {var e=Sb(V.ma,a);if(-1 == e)break;(e = V.c(Qb(a,e - 8).buffer,c,d)) && b.push(e);}return b;};V.c = function(a,b,c){a = new Jb(new DataView(a));for(var d,e,f;Lb(a);) {var g=N(a),h=N(a),l=Eb(Qb(a,g - 8).buffer);1 == g && Pb(a);switch(h){case V.J:d = l;break;case V.G:f = l;break;case V.X:e = l;}}if(!d)throw new w(2,2008);b = xc(b,c,d);if(!b)return null;f && (b.id = f);if(e)for(e = new Jd(e),f = Ld(e);f;) U.j(b,f),Kd(e,/[ \t]+/gm),f = Ld(e);return b;};V.na = 2004251764;V.ma = 1987343459;V.J = 1885436268;V.G = 1768187247;V.X = 1937011815;S['application/mp4; codecs="wvtt"'] = V;function Md(a,b,c,d,e,f){this.a = a;this.c = b;this.j = c;this.s = d;this.l = e;this.m = f;this.b = new y();this.h = !1;this.g = 1;this.i = this.f = null;0 < a.readyState?this.tb():z(this.b,a,"loadedmetadata",this.tb.bind(this));z(this.b,a,"ratechange",this.lc.bind(this));Nd(this);}k = Md.prototype;k.o = function(){var a=this.b.o();this.b = null;Od(this);null != this.f && (window.clearInterval(this.f),this.f = null);this.m = this.l = this.c = this.a = null;return a;};function Pd(a){return 0 < a.a.readyState?Qd(a,a.a.currentTime):Rd(a);}function Rd(a){return a.s?Qd(a,a.s):Infinity > a.c.da()?a.c.sa():Math.max(a.c.Ua(),a.c.sa());}function Sd(a,b){b != a.h && (a.h = b,Td(a,a.g),a.l(b));}function Nd(a){Od(a);a.i = window.setTimeout(a.pc.bind(a),250);}function Od(a){a.i && (window.clearTimeout(a.i),a.i = null);}k.pc = function(){this.i = null;Nd(this);var a=$c(this.a.buffered,this.a.currentTime),b=Zc(this.a.buffered) >= (this.c.R()?this.c.Y() - .1:this.a.duration - .1) || this.a.ended;this.h?(b || a >= this.j) && Sd(this,!1):!b && .5 > a && Sd(this,!0);};k.Ta = function(){return this.g;};function Td(a,b){null != a.f && (window.clearInterval(a.f),a.f = null);a.g = b;a.a.playbackRate = a.h || 0 > b?0:b;!a.h && 0 > b && (a.f = window.setInterval((function(){this.a.currentTime += b / 4;}).bind(a),250));}k.lc = function(){this.a.playbackRate != (this.h || 0 > this.g?0:this.g) && Td(this,this.a.playbackRate);};k.tb = function(){this.b.ja(this.a,"loadedmetadata");var a=Rd(this);.001 > Math.abs(this.a.currentTime - a)?(z(this.b,this.a,"seeking",this.vb.bind(this)),z(this.b,this.a,"playing",this.ub.bind(this))):(z(this.b,this.a,"seeking",this.nc.bind(this)),this.a.currentTime = a);};k.nc = function(){this.b.ja(this.a,"seeking");z(this.b,this.a,"seeking",this.vb.bind(this));z(this.b,this.a,"playing",this.ub.bind(this));};k.vb = function(){var a=this.a.currentTime,b=Ud(this,a);.001 < Math.abs(b - a)?Vd(this,a,b):this.m();};k.ub = function(){var a=this.a.currentTime,b=Ud(this,a);.001 < Math.abs(b - a) && Vd(this,a,b);};function Ud(a,b){var c=a.c,d=c.sa(),e=c.Y();if(!c.R() || Infinity == c.c)return b < d?d:b > e?e:b;c = d + 1;d = c + a.j;return b >= d && b <= e || $c(a.a.buffered,b) && b >= c && b <= e?b:b > e?e:e < d && b >= c && b <= e?b:Math.min(d + 2,e);}function Vd(a,b,c){a.a.currentTime = c;var d=0,e=(function(){!this.a || 10 <= d++ || this.a.currentTime != b || (this.a.currentTime = c,setTimeout(e,100));}).bind(a);setTimeout(e,100);}function Qd(a,b){var c=a.c.sa();if(b < c)return c;c = a.c.Y();return b > c?c:b;};function Wd(a,b,c,d,e,f,g,h,l){this.m = a;this.f = b;this.T = c;this.a = d;this.G = e;this.v = f;this.j = g;this.w = h || null;this.A = l || null;this.h = null;this.i = 1;this.C = Promise.resolve();this.g = [];this.l = {};this.b = {};this.c = this.s = this.J = !1;}Wd.prototype.o = function(){for(var a in this.b) Xd(this.b[a]);this.h = this.b = this.l = this.g = this.A = this.w = this.j = this.v = this.G = this.C = this.a = this.T = this.f = this.m = null;this.c = !0;return Promise.resolve();};Wd.prototype.configure = function(a){this.h = a;this.m.j = this.i * Math.max(this.a.minBufferTime || 0,this.h.rebufferingGoal);};Wd.prototype.init = function(){var a=this.G(this.a.periods[Yd(this,Pd(this.m))]);return Na(a)?Promise.reject(new w(5,5005)):Zd(this,a).then((function(){this.w && this.w();}).bind(this));};function $d(a){return a.a.periods[Yd(a,Pd(a.m))];}function ae(a){return Oa(a.b,function(a){return a.stream;});}function be(a,b){var c={};c.text = b;return Zd(a,c);}function ce(a,b,c,d){var e=a.b[b];!e && "text" == b && a.h.ignoreTextStreamFailures?be(a,c):e && (b = a.g[de(a,c)]) && b.ya && (b = a.l[c.id]) && b.ya && e.stream != c && (e.stream = c,e.Ma = !0,d && (e.aa?e.Qa = !0:e.fa?(e.la = !0,e.Qa = !0):(Xd(e),ee(a,e,!0))));}function Zd(a,b){var c=Yd(a,Pd(a.m)),d=Oa(b,function(a){return pd(a.mimeType,a.codecs);});a.f.init(d,a.h.useRelativeCueTimestamps);fe(a);d = F(b);return ge(a,d).then((function(){if(!this.c)for(var a in b) {var d=b[a];this.b[a] || (this.b[a] = {stream:d,type:a,ua:null,V:null,Ma:!0,Na:c,endOfStream:!1,fa:!1,$:null,la:!1,Qa:!1,aa:!1,bb:!1},he(this,this.b[a],0));}}).bind(a));}function ie(a,b){var c=a.g[b];if(c)return c.I;c = {I:new x(),ya:!1};a.g[b] = c;var d=a.a.periods[b].streamSets.map(function(a){return a.streams;}).reduce(C,[]);a.C = a.C.then((function(){if(!this.c)return ge(this,d);}).bind(a)).then((function(){this.c || (this.g[b].I.resolve(),this.g[b].ya = !0);}).bind(a))["catch"]((function(a){this.c || (this.g[b].I.reject(),delete this.g[b],this.j(a));}).bind(a));return c.I;}function ge(a,b){for(var c=[],d=0;d < b.length;++d) {var e=b[d],f=a.l[e.id];f?c.push(f.I):(a.l[e.id] = {I:new x(),ya:!1},c.push(e.createSegmentIndex()));}return Promise.all(c).then((function(){if(!this.c)for(var a=0;a < b.length;++a) {var c=this.l[b[a].id];c.ya || (c.I.resolve(),c.ya = !0);}}).bind(a))["catch"]((function(a){if(!this.c)return this.l[e.id].I.reject(),delete this.l[e.id],Promise.reject(a);}).bind(a));}function fe(a){var b=a.a.presentationTimeline.da();Infinity > b?a.f.Aa(b):a.f.Aa(Math.pow(2,32));}Wd.prototype.X = function(a){if(!this.c && !a.fa && null != a.$ && !a.aa)if((a.$ = null,a.la))ee(this,a,a.Qa);else {try{var b=je(this,a);null != b && he(this,a,b);}catch(c) {this.j(c);return;}b = F(this.b);ke(this,a);b.every(function(a){return a.endOfStream;}) && this.f.endOfStream();}};function je(a,b){var c=Pd(a.m),d,e;e = a.f;var f=b.type;e = "text" == f?e.b.a:Zc(dd(e,f));var f=b.ua && b.V?a.a.periods[de(a,b.ua)].startTime + b.V.endTime:c,g=de(a,b.stream),h=Yd(a,f),l=a.a.periods[h];g != h?d = null:d = le(a,b,c,e,h);if((d?l.startTime + d.startTime - c:fd(a.f,b.type,c)) >= Math.max(a.i * Math.max(a.a.minBufferTime || 0,a.h.rebufferingGoal),a.i * a.h.bufferingGoal))return .5;if(f >= a.a.presentationTimeline.da())return b.endOfStream = !0,null;b.endOfStream = !1;if(h != g)return b.Na = h,null;d = le(a,b,c,e,g);if(!d)return 1;me(a,b,c,g,d);return null;}function le(a,b,c,d,e){if(b.V && b.stream == b.ua)return c = b.V.position + 1,ne(a,b,e,c);c = b.V?b.stream.findSegmentPosition(Math.max(0,a.a.periods[de(a,b.ua)].startTime + b.V.endTime - a.a.periods[e].startTime)):b.stream.findSegmentPosition(Math.max(0,(d || c) - a.a.periods[e].startTime));if(null == c)return null;var f=null;null == d && (f = ne(a,b,e,Math.max(0,c - 1)));return f || ne(a,b,e,c);}function ne(a,b,c,d){c = a.a.periods[c];b = b.stream.getSegmentReference(d);if(!b)return null;a = a.a.presentationTimeline;d = a.Y();return c.startTime + b.endTime < a.ta() || c.startTime + b.startTime > d?null:b;}function me(a,b,c,d,e){var f=a.a.periods[d],g=b.stream,h=a.a.periods[d + 1],l=null,l=h?h.startTime:a.a.presentationTimeline.da();d = oe(a,b,d,l);b.fa = !0;b.Ma = !1;h = pe(a,e);Promise.all([d,h]).then((function(a){if(!this.c && !this.s)return qe(this,b,c,f,g,e,a[1]);}).bind(a)).then((function(){this.c || this.s || (b.fa = !1,b.bb = !1,he(this,b,0),re(this,g));}).bind(a))["catch"]((function(a){this.c || this.s || (b.fa = !1,1001 == a.code || 1002 == a.code || 1003 == a.code?"text" == b.type && this.h.ignoreTextStreamFailures && 1001 == a.code?delete this.b.text:(this.j(a),he(this,b,4)):3017 == a.code?se(this,b,a):"text" == b.type && this.h.ignoreTextStreamFailures?delete this.b.text:this.j(a));}).bind(a));}function se(a,b,c){if(!F(a.b).some(function(a){return a != b && a.bb;})){var d=Math.round(100 * a.i);if(20 < d)a.i -= .2;else if(4 < d)a.i -= .04;else {a.s = !0;a.j(c);return;}b.bb = !0;}he(a,b,4);}function oe(a,b,c,d){if(!b.Ma)return Promise.resolve();c = jd(a.f,b.type,a.a.periods[c].startTime - b.stream.presentationTimeOffset);d = null != d?kd(a.f,b.type,d):Promise.resolve();if(!b.stream.initSegmentReference)return Promise.all([c,d]);a = pe(a,b.stream.initSegmentReference).then((function(a){if(!this.c)return gd(this.f,b.type,a,null,null);}).bind(a))["catch"](function(a){b.Ma = !0;return Promise.reject(a);});return Promise.all([c,d,a]);}function qe(a,b,c,d,e,f,g){return te(a,b,c).then((function(){if(!this.c)return gd(this.f,b.type,g,f.startTime + d.startTime,f.endTime + d.startTime);}).bind(a)).then((function(){if(!this.c)return b.ua = e,b.V = f,Promise.resolve();}).bind(a));}function te(a,b,c){var d=cd(a.f,b.type);if(null == d)return Promise.resolve();c = c - d - a.h.bufferBehind;return 0 >= c?Promise.resolve():a.f.remove(b.type,d,d + c).then((function(){}).bind(a));}function re(a,b){if(!a.J && (a.J = F(a.b).every(function(a){return "text" == a.type?!0:!a.la && !a.aa && a.V;}),a.J)){var c=de(a,b);a.g[c] || ie(a,c).then((function(){this.v();}).bind(a))["catch"](D);for(c = 0;c < a.a.periods.length;++c) ie(a,c)["catch"](D);a.A && a.A();}}function ke(a,b){if(b.Na != de(a,b.stream)){var c=b.Na,d=F(a.b);d.every(function(a){return a.Na == c;}) && d.every(ue) && ie(a,c).then((function(){if(!this.c){var a=this.G(this.a.periods[c]),b;for(b in this.b) if(!a[b]){this.j(new w(5,5005));return;}for(b in a) if(!(this.b[b] || "text" == b && this.h.ignoreTextStreamFailures)){this.j(new w(5,5005));return;}for(b in this.b) {ce(this,b,a[b],!1);var d=this.b[b];ue(d) && he(this,d,0);}this.v();}}).bind(a))["catch"](D);}}function ue(a){return !a.fa && null == a.$ && !a.la && !a.aa;}function Yd(a,b){for(var c=a.a.periods.length - 1;0 < c;--c) if(b >= a.a.periods[c].startTime)return c;return 0;}function de(a,b){for(var c=0;c < a.a.periods.length;++c) for(var d=a.a.periods[c],e=0;e < d.streamSets.length;++e) if(0 <= d.streamSets[e].streams.indexOf(b))return c;return -1;}function pe(a,b){var c=rc(b.a(),a.h.retryParameters);if(b.L || null != b.D){var d="bytes=" + b.L + "-";null != b.D && (d += b.D);c.headers.Range = d;}return a.T.request(1,c).then(function(a){return a.data;});}function ee(a,b,c){b.la = !1;b.Qa = !1;b.aa = !0;id(a.f,b.type).then((function(){if(!this.c && c){var a=this.f,e=b.type;return "text" == e?Promise.resolve():hd(a,e,a.Ub.bind(a,e));}}).bind(a)).then((function(){this.c || (b.ua = null,b.V = null,b.aa = !1,he(this,b,0));}).bind(a));}function he(a,b,c){b.$ = window.setTimeout(a.X.bind(a,b),1E3 * c);}function Xd(a){null != a.$ && (window.clearTimeout(a.$),a.$ = null);};function ve(a){return new Promise(function(b){var c=a.split(":");if(2 > c.length || "data" != c[0])throw new w(1,1004,a);c = c.slice(1).join(":").split(",");if(2 > c.length)throw new w(1,1004,a);var d=c[0],c=window.decodeURIComponent(c.slice(1).join(",")),d=d.split(";"),e=null;1 < d.length && (e = d[1]);if("base64" == e)c = Ra(c).buffer;else {if(e)throw new w(1,1005,a);c = Ib(c);}b({uri:a,data:c,headers:{"content-type":d[0]}});});}m("shaka.net.DataUriPlugin",ve);pc.data = ve;function we(a,b){return new Promise(function(c,d){var e=new XMLHttpRequest();e.open(b.method,a,!0);e.responseType = "arraybuffer";e.timeout = b.retryParameters.timeout;e.withCredentials = b.allowCrossSiteCredentials;e.onload = function(b){b = b.target;if(200 <= b.status && 299 >= b.status && 202 != b.status){var e=b.getAllResponseHeaders().split("\r\n").reduce(function(a,b){var c=b.split(": ");a[c[0].toLowerCase()] = c.slice(1).join(": ");return a;},{});b.responseURL && (a = b.responseURL);c({uri:a,data:b.response,headers:e});}else {e = null;try{e = Hb(b.response);}catch(l) {}d(new w(1,1001,a,b.status,e));}};e.onerror = function(){d(new w(1,1002,a));};e.ontimeout = function(){d(new w(1,1003,a));};for(var f in b.headers) e.setRequestHeader(f,b.headers[f]);e.send(b.body);});}m("shaka.net.HttpPlugin",we);pc.http = we;pc.https = we;function xe(){this.a = null;this.c = [];this.b = {};}k = xe.prototype;k.init = function(a){if(!window.indexedDB)return Promise.reject(new w(9,9E3));var b=window.indexedDB.open("shaka_offline_db",1),c=new x();b.onupgradeneeded = function(b){b = b.target.result;for(var c in a) b.createObjectStore(c,{keyPath:a[c]});};b.onsuccess = (function(a){this.a = a.target.result;c.resolve();}).bind(this);b.onerror = ye.bind(null,b,c);return c.then((function(){var b=Object.keys(a);return Promise.all(b.map((function(a){return ze(this,a).then((function(b){this.b[a] = b;}).bind(this));}).bind(this)));}).bind(this));};k.o = function(){return Promise.all(this.c.map(function(a){try{a.transaction.abort();}catch(b) {}return a.I["catch"](D);})).then((function(){this.a && (this.a.close(),this.a = null);}).bind(this));};k.get = function(a,b){return Ae(this,a,"readonly",function(a){return a.get(b);});};k.forEach = function(a,b){return Ae(this,a,"readonly",function(a){return a.openCursor();},function(a){a && (b(a.value),a["continue"]());});};function Be(a,b,c){return Ae(a,b,"readwrite",function(a){return a.put(c);});}k.remove = function(a,b){return Ae(this,a,"readwrite",function(a){return a["delete"](b);});};function Ce(a,b){var c=[];return Ae(a,"segment","readwrite",function(a){return a.openCursor();},function(a){if(a){if(b(a.value)){var d=a["delete"](),f=new x();d.onsuccess = f.resolve;d.onerror = ye.bind(null,d,f);c.push(f);}a["continue"]();}}).then(function(){return Promise.all(c);}).then(function(){return c.length;});}function ze(a,b){var c=0;return Ae(a,b,"readonly",function(a){return a.openCursor(null,"prev");},function(a){a && (c = a.key + 1);}).then(function(){return c;});}function Ae(a,b,c,d,e){c = a.a.transaction([b],c);var f=d(c.objectStore(b)),g=new x();e && (f.onsuccess = function(a){e(a.target.result);});f.onerror = ye.bind(null,f,g);var h={transaction:c,I:g};a.c.push(h);var l=(function(){this.c.splice(this.c.indexOf(h),1);}).bind(a);c.oncomplete = function(){l();g.resolve(f.result);};c.onerror = function(a){l();ye(f,g,a);};return g;}function ye(a,b,c){"AbortError" == a.error.name?b.reject(new w(9,9002)):b.reject(new w(9,9001,a.error));c.preventDefault();};var De={manifest:"key",segment:"key"};function Ee(a){return {offlineUri:"offline:" + a.key,originalManifestUri:a.originalManifestUri,duration:a.duration,size:a.size,tracks:a.periods[0].streams.map(function(a){return {id:a.id,active:!1,type:a.contentType,bandwidth:0,language:a.language,kind:a.kind || null,width:a.width,height:a.height,frameRate:a.frameRate,codecs:a.codecs};}),appMetadata:a.appMetadata};};function Fe(a,b,c){this.b = {};this.i = c;this.m = a;this.l = b;this.j = this.a = null;this.f = this.h = this.g = this.c = 0;}Fe.prototype.o = function(){var a=this.j || Promise.resolve();this.b = {};this.j = this.a = this.l = this.m = this.i = null;return a;};function Ge(a,b,c,d,e){a.b[b] = a.b[b] || [];a.b[b].push({uris:c.a(),L:c.L,D:c.D,jb:d,Ea:e});}function He(a,b){a.c = 0;a.g = 0;a.h = 0;a.f = 0;F(a.b).forEach((function(a){a.forEach((function(a){null != a.D?this.c += a.D - a.L + 1:this.h += a.jb;}).bind(this));}).bind(a));a.a = b;a.a.size = a.c;var c=F(a.b).map((function(a){var b=0,c=(function(){if(!this.i)return Promise.reject(new w(9,9002));if(b >= a.length)return Promise.resolve();var d=a[b++];return Ie(this,d).then(c);}).bind(this);return c();}).bind(a));a.b = {};return a.j = Promise.all(c);}function Ie(a,b){var c=rc(b.uris,a.l);if(b.L || null != b.D)c.headers.Range = "bytes=" + b.L + "-" + (null == b.D?"":b.D);var d;return a.m.request(1,c).then((function(a){if(!this.a)return Promise.reject(new w(9,9002));d = a.data.byteLength;return b.Ea(a.data);}).bind(a)).then((function(){if(!this.a)return Promise.reject(new w(9,9002));null == b.D?(this.a.size += d,this.f += b.jb):this.g += d;var a=(this.g + this.f) / (this.c + this.h),c=Ee(this.a);this.i.progressCallback(c,a);}).bind(a));};function Je(){}m("shaka.offline.OfflineManifestParser",Je);Je.prototype.configure = function(){};Je.prototype.start = function(a){var b=/^offline:([0-9]+)$/.exec(a);if(!b)return Promise.reject(new w(1,9004,a));var c=Number(b[1]),d=new xe();return d.init(De).then(function(){return d.get("manifest",c);}).then(function(a){if(!a)throw new w(9,9003,c);return Ke(a);}).then(function(a){return d.o().then(function(){return a;});},function(a){return d.o().then(function(){throw a;});});};Je.prototype.stop = function(){return Promise.resolve();};function Ke(a){var b=new R(null,0);b.Aa(a.duration);var c=a.drmInfo?[a.drmInfo]:[];return {presentationTimeline:b,minBufferTime:10,offlineSessionIds:a.sessionIds,periods:a.periods.map(function(a){return {startTime:a.startTime,streamSets:a.streams.map(function(d){var e=d.segments.map(function(a,b){return new K(b,a.startTime,a.endTime,function(){return [a.uri];},0,null);});b.Ga(a.startTime,e);e = new P(e);return {language:d.language,type:d.contentType,primary:d.primary,drmInfos:c,streams:[{id:d.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e),initSegmentReference:d.initSegmentUri?new yb(function(){return [d.initSegmentUri];},0,null):null,presentationTimeOffset:d.presentationTimeOffset,mimeType:d.mimeType,codecs:d.codecs,bandwidth:0,width:d.width || void 0,height:d.height || void 0,kind:d.kind,encrypted:d.encrypted,keyId:d.keyId,allowedByApplication:!0,allowedByKeySystem:!0}]};})};})};}sc["application/x-offline-manifest"] = Je;function Le(a){if(/^offline:([0-9]+)$/.exec(a)){var b={uri:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return Promise.resolve(b);}if(b = /^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a)){var c=Number(b[1]),d=new xe();return d.init(De).then(function(){return d.get("segment",c);}).then(function(b){return d.o().then(function(){if(!b)throw new w(9,9003,c);return {uri:a,data:b.data,headers:{}};});});}return Promise.reject(new w(1,9004,a));}m("shaka.offline.OfflineScheme",Le);pc.offline = Le;function Me(){this.a = Promise.resolve();this.c = this.b = this.f = !1;this.h = new Promise((function(a){this.g = a;}).bind(this));}Me.prototype.then = function(a){this.a = this.a.then(a).then((function(a){return this.c?(this.g(),Promise.reject(this.i)):Promise.resolve(a);}).bind(this));return this;};function Ne(a){a.f || (a.a = a.a.then((function(a){this.b = !0;return Promise.resolve(a);}).bind(a),(function(a){this.b = !0;return Promise.reject(a);}).bind(a)));a.f = !0;return a.a;}Me.prototype.cancel = function(a){if(this.b)return Promise.resolve();this.c = !0;this.i = a;return this.h;};function Oe(a,b,c,d,e){var f=(e in d),g;for(g in b) {var h=e + "." + g,l=f?d[e]:c[g],n=!!({".abr.manager":!0})[h];if(f || g in a)void 0 === b[g]?void 0 === l || f?delete a[g]:a[g] = l:n?a[g] = b[g]:"object" == typeof a[g] && "object" == typeof b[g]?Oe(a[g],b[g],l,d,h):typeof b[g] == typeof l && (a[g] = b[g]);}};function W(a,b){p.call(this);this.A = !1;this.f = a;this.s = null;this.w = new y();this.Ka = new q();this.oa = this.c = this.m = this.b = this.j = this.pa = this.G = this.h = this.g = this.i = null;this.Kb = 1E9;this.na = [];this.Da = !1;this.ra = !0;this.J = this.l = null;this.v = {};this.a = Pe(this);this.Ca = {width:Infinity,height:Infinity};this.C = [];this.ma = this.T = this.qa = 0;b && b(this);this.i = new Q(this.Oc.bind(this));this.pa = Qe(this);for(var c=0;c < this.f.textTracks.length;++c) {var d=this.f.textTracks[c];d.mode = "disabled";"Shaka Player TextTrack" == d.label && (this.s = d);}this.s || (this.s = this.f.addTextTrack("subtitles","Shaka Player TextTrack"));this.s.mode = "hidden";z(this.w,this.f,"error",this.oc.bind(this));}ba(W);m("shaka.Player",W);W.prototype.o = function(){this.A = !0;var a=Promise.resolve();this.l && (a = this.l.cancel(new w(7,7E3)));return a.then((function(){var a=Promise.all([this.J,Re(this),this.w?this.w.o():null,this.i?this.i.o():null]);this.a = this.i = this.Ka = this.w = this.s = this.f = null;return a;}).bind(this));};W.prototype.destroy = W.prototype.o;W.version = "v2.0.3-16-g91ba1f3";var Se={};W.registerSupportPlugin = function(a,b){Se[a] = b;};W.isBrowserSupported = function(){return !!window.Promise && !!window.Uint8Array && !!Array.prototype.forEach && !!window.MediaSource && !!window.MediaKeys && !!window.navigator && !!window.navigator.requestMediaKeySystemAccess && !!window.MediaKeySystemAccess && !!window.MediaKeySystemAccess.prototype.getConfiguration;};W.probeSupport = function(){return Xc().then(function(a){var b=uc(),c=bd();a = {manifest:b,media:c,drm:a};for(var d in Se) a[d] = Se[d]();return a;});};W.prototype.load = function(a,b,c){var d=this.ib(),e=new Me();this.l = e;this.dispatchEvent(new t("loading"));return Ne(e.then(function(){return d;}).then((function(){return vc(a,this.i,this.a.manifest.retryParameters,c);}).bind(this)).then((function(b){this.m = new b();this.m.configure(this.a.manifest);return this.m.start(a,this.i,this.Oa.bind(this),this.ga.bind(this),this.Lc.bind(this));}).bind(this)).then((function(b){if(0 == b.periods.length)throw new w(4,4014);this.c = b;this.oa = a;this.g = new Jc(this.i,this.ga.bind(this),this.Mc.bind(this));this.g.configure(this.a.drm);return this.g.init(b,!1);}).bind(this)).then((function(){this.c.periods.forEach(this.Oa.bind(this));this.ma = Date.now() / 1E3;return Promise.all([Mc(this.g,this.f),this.pa]);}).bind(this)).then((function(){this.j = new Md(this.f,this.c.presentationTimeline,1 * Math.max(this.c.minBufferTime || 0,this.a.streaming.rebufferingGoal),b || null,this.Ib.bind(this),this.Nc.bind(this));this.G = new ad(this.f,this.h,this.s);this.b = new Wd(this.j,this.G,this.i,this.c,this.Kc.bind(this),this.Nb.bind(this),this.ga.bind(this));this.b.configure(this.a.streaming);return this.b.init();}).bind(this)).then((function(){this.c.periods.forEach(this.Oa.bind(this));Te(this);Ue(this);this.a.abr.manager.init(this.gb.bind(this));this.l = null;}).bind(this)))["catch"]((function(a){this.l == e && (this.l = null,this.dispatchEvent(new t("unloading")));return Promise.reject(a);}).bind(this));};W.prototype.load = W.prototype.load;function Qe(a){a.h = new MediaSource();var b=new x();z(a.w,a.h,"sourceopen",b.resolve);a.f.src = window.URL.createObjectURL(a.h);return b;}W.prototype.configure = function(a){a.abr && a.abr.manager && a.abr.manager != this.a.abr.manager && (this.a.abr.manager.stop(),a.abr.manager.init(this.gb.bind(this)));Oe(this.a,a,Pe(this),Ve(),"");We(this);};W.prototype.configure = W.prototype.configure;function We(a){a.m && a.m.configure(a.a.manifest);a.g && a.g.configure(a.a.drm);if(a.b){a.b.configure(a.a.streaming);try{a.c.periods.forEach(a.Oa.bind(a));}catch(b) {a.ga(b);}Xe(a,$d(a.b));}a.a.abr.enabled && !a.ra?a.a.abr.manager.enable():a.a.abr.manager.disable();a.a.abr.manager.setDefaultEstimate(a.a.abr.defaultBandwidthEstimate);}W.prototype.getConfiguration = function(){var a=Pe(this);Oe(a,this.a,Pe(this),Ve(),"");return a;};W.prototype.getConfiguration = W.prototype.getConfiguration;W.prototype.Dc = function(){var a=Pe(this);a.abr && a.abr.manager && a.abr.manager != this.a.abr.manager && (this.a.abr.manager.stop(),a.abr.manager.init(this.gb.bind(this)));this.a = Pe(this);We(this);};W.prototype.resetConfiguration = W.prototype.Dc;W.prototype.ob = function(){return this.i;};W.prototype.getNetworkingEngine = W.prototype.ob;W.prototype.Vb = function(){return this.oa;};W.prototype.getManifestUri = W.prototype.Vb;W.prototype.R = function(){return this.c?this.c.presentationTimeline.R():!1;};W.prototype.isLive = W.prototype.R;W.prototype.ea = function(){return this.c?this.c.presentationTimeline.ea():!1;};W.prototype.isInProgress = W.prototype.ea;W.prototype.Fc = function(){var a=0,b=0;this.c && (b = this.c.presentationTimeline,a = b.ta(),b = b.Ua());return {start:a,end:b};};W.prototype.seekRange = W.prototype.Fc;W.prototype.keySystem = function(){return this.g?this.g.keySystem():"";};W.prototype.keySystem = W.prototype.keySystem;W.prototype.drmInfo = function(){return this.g?this.g.b:null;};W.prototype.drmInfo = W.prototype.drmInfo;W.prototype.Zb = function(){return this.Da;};W.prototype.isBuffering = W.prototype.Zb;W.prototype.ib = function(){if(this.A)return Promise.resolve();this.dispatchEvent(new t("unloading"));var a=Promise.resolve();this.l && (a = new w(7,7E3),a = this.l.cancel(a));return a.then((function(){this.J || (this.J = Ye(this).then((function(){this.J = null;}).bind(this)));return this.J;}).bind(this));};W.prototype.unload = W.prototype.ib;W.prototype.Ta = function(){return this.j?this.j.Ta():0;};W.prototype.getPlaybackRate = W.prototype.Ta;W.prototype.Zc = function(a){this.j && Td(this.j,a);};W.prototype.trickPlay = W.prototype.Zc;W.prototype.Ob = function(){this.j && Td(this.j,1);};W.prototype.cancelTrickPlay = W.prototype.Ob;W.prototype.getTracks = function(){if(!this.b)return [];var a=ae(this.b);return qd($d(this.b),a).filter((function(a){return 0 > this.na.indexOf(a.id);}).bind(this));};W.prototype.getTracks = W.prototype.getTracks;W.prototype.Gc = function(a,b){if(this.b){var c=rd($d(this.b),a);if(c){var d=c.stream;d.allowedByApplication && d.allowedByKeySystem && (this.C.push({timestamp:Date.now() / 1E3,id:d.id,type:a.type,fromAdaptation:!1}),c = {},c[a.type] = d,"text" != a.type && (d = ae(this.b).text,this.configure({abr:{enabled:!1}}),d && (c.text = d)),Ze(this,c,b));}}};W.prototype.selectTrack = W.prototype.Gc;W.prototype.bc = function(){return "showing" == this.s.mode;};W.prototype.isTextTrackVisible = W.prototype.bc;W.prototype.Ic = function(a){this.s.mode = a?"showing":"hidden";$e(this);};W.prototype.setTextTrackVisibility = W.prototype.Ic;W.prototype.getStats = function(){af(this);var a={},b={},c=this.f && this.f.getVideoPlaybackQuality?this.f.getVideoPlaybackQuality():{};this.b && (b = ae(this.b),a = b.video || {},b = b.audio || {});return {width:a.width || 0,height:a.height || 0,streamBandwidth:a.bandwidth + b.bandwidth || 0,decodedFrames:Number(c.totalVideoFrames),droppedFrames:Number(c.droppedVideoFrames),estimatedBandwidth:this.a.abr.manager.getBandwidthEstimate(),playTime:this.qa,bufferingTime:this.T,switchHistory:this.C.slice(0)};};W.prototype.getStats = W.prototype.getStats;W.prototype.addTextTrack = function(a,b,c,d,e){if(!this.b)return Promise.reject();for(var f=$d(this.b),g,h=0;h < this.c.periods.length;h++) if(this.c.periods[h] == f){if(h == this.c.periods.length - 1){if((g = this.c.presentationTimeline.da() - f.startTime,Infinity == g))return Promise.reject();}else g = this.c.periods[h + 1].startTime - f.startTime;break;}var l={id:this.Kb++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function findSegmentPosition(){return 1;},getSegmentReference:function getSegmentReference(b){return 1 != b?null:new K(1,0,g,function(){return [a];},0,null);},initSegmentReference:null,presentationTimeOffset:0,mimeType:d,codecs:e || "",bandwidth:0,kind:c,encrypted:!1,keyId:null,language:b,allowedByApplication:!0,allowedByKeySystem:!0};d = {language:b,type:"text",primary:!1,drmInfos:[],streams:[l]};this.na.push(l.id);f.streamSets.push(d);return be(this.b,l).then((function(){if(!this.A)return this.na.splice(this.na.indexOf(l.id),1),Xe(this,f),Te(this),{id:l.id,active:!1,type:"text",bandwidth:0,language:b,kind:c,width:null,height:null};}).bind(this));};W.prototype.addTextTrack = W.prototype.addTextTrack;W.prototype.eb = function(a,b){this.Ca.width = a;this.Ca.height = b;};W.prototype.setMaxHardwareResolution = W.prototype.eb;function Re(a){a.w && a.w.ja(a.h,"sourceopen");a.f && (a.f.removeAttribute("src"),a.f.load());var b=Promise.all([a.a?a.a.abr.manager.stop():null,a.g?a.g.o():null,a.G?a.G.o():null,a.j?a.j.o():null,a.b?a.b.o():null,a.m?a.m.stop():null]);a.g = null;a.G = null;a.j = null;a.b = null;a.m = null;a.c = null;a.oa = null;a.pa = null;a.h = null;a.v = {};a.C = [];a.qa = 0;a.T = 0;return b;}function Ye(a){return a.m?Re(a).then((function(){this.A || (this.Ib(!1),this.pa = Qe(this));}).bind(a)):Promise.resolve();}function Ve(){return {".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:null}};}function Pe(a){return {drm:{retryParameters:qc(),servers:{},clearKeys:{},advanced:{}},manifest:{retryParameters:qc(),dash:{customScheme:function customScheme(a){if(a)return null;},clockSyncUri:""}},streaming:{retryParameters:qc(),rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,useRelativeCueTimestamps:!1},abr:{manager:a.Ka,enabled:!0,defaultBandwidthEstimate:5E5},preferredAudioLanguage:"",preferredTextLanguage:"",restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minAudioBandwidth:0,maxAudioBandwidth:Infinity,minVideoBandwidth:0,maxVideoBandwidth:Infinity}};}k = W.prototype;k.Oa = function(a){var b=this.b?ae(this.b):{};od(this.g,b,a);b = a.streamSets.some(sd);nd(a,this.a.restrictions,this.Ca) && !this.l && Te(this);a = !a.streamSets.some(sd);if(!b)throw new w(4,4011);if(a)throw new w(4,4012);};function Ze(a,b,c){for(var d in b) {var e=b[d],f=c || !1;"text" == d && (f = !0);a.ra?a.v[d] = {stream:e,Rb:f}:ce(a.b,d,e,f);}}function af(a){if(a.c){var b=Date.now() / 1E3;a.Da?a.T += b - a.ma:a.qa += b - a.ma;a.ma = b;}}k.Oc = function(a,b,c){this.a.abr.manager.segmentDownloaded(a,b,c);};k.Ib = function(a){af(this);this.Da = a;this.dispatchEvent(new t("buffering",{buffering:a}));};k.Nc = function(){if(this.b){var a=this.b,b;for(b in a.b) {var c=a.b[b];c.aa || 0 < fd(a.f,b,Pd(a.m)) || c.la || (c.fa?c.la = !0:null == cd(a.f,b)?null == c.$ && he(a,c,0):(Xd(c),ee(a,c,!1)));}}};function bf(a,b,c){if(!F(b).some(sd))return a.ga(new w(4,4012)),{};var d={};if(c)["video","audio","text"].forEach(function(a){a in b && (d[a] = b[a]);});else {c = ae(a.b);for(var e in c) {var f=c[e];f.allowedByApplication && f.allowedByKeySystem && b[e].language == f.language || (d[e] = b[e]);}}if(Na(d))return {};ha(Object.keys(d));var g=a.a.abr.manager.chooseStreams(d);return Pa(d,function(a){return !!g[a];})?g:(a.ga(new w(4,4012)),{});}function Xe(a,b){var c={audio:!1,text:!1},d=td(b,a.a,c),e=bf(a,d),f;for(f in e) a.C.push({timestamp:Date.now() / 1E3,id:e[f].id,type:f,fromAdaptation:!0});Ze(a,e,!0);Ue(a);d.text && d.audio && c.text && d.text.language != d.audio.language && (a.s.mode = "showing",$e(a));}k.Kc = function(a){this.ra = !0;this.a.abr.manager.disable();a = td(a,this.a);a = bf(this,a,!0);for(var b in this.v) a[b] = this.v[b].stream;this.v = {};for(b in a) this.C.push({timestamp:Date.now() / 1E3,id:a[b].id,type:b,fromAdaptation:!0});this.l || Te(this);return a;};k.Nb = function(){this.ra = !1;this.a.abr.enabled && this.a.abr.manager.enable();for(var a in this.v) {var b=this.v[a];ce(this.b,a,b.stream,b.Rb);}this.v = {};};k.gb = function(a,b){var c=ae(this.b),d;for(d in a) {var e=a[d];c[d] != e?this.C.push({timestamp:Date.now() / 1E3,id:e.id,type:d,fromAdaptation:!0}):delete a[d];}if(!Na(a) && this.b){for(d in a) ce(this.b,d,a[d],b || !1);Ue(this);}};function Ue(a){Promise.resolve().then((function(){this.A || this.dispatchEvent(new t("adaptation"));}).bind(a));}function Te(a){Promise.resolve().then((function(){this.A || this.dispatchEvent(new t("trackschanged"));}).bind(a));}function $e(a){a.dispatchEvent(new t("texttrackvisibility"));}k.ga = function(a){this.dispatchEvent(new t("error",{detail:a}));};k.Lc = function(a){this.dispatchEvent(a);};k.oc = function(){if(this.f.error){var a=this.f.error.code;if(1 != a){var b=this.f.error.msExtendedCode;b && (0 > b && (b += Math.pow(2,32)),b = b.toString(16));this.ga(new w(3,3016,a,b));}}};k.Mc = function(a){var b=["output-restricted","internal-error"],c=$d(this.b),d=!1;c.streamSets.forEach(function(c){c.streams.forEach(function(c){var e=c.allowedByKeySystem;c.keyId && c.keyId in a && (c.allowedByKeySystem = 0 > b.indexOf(a[c.keyId]));e != c.allowedByKeySystem && (d = !0);});});Xe(this,c);d && Te(this);};function X(a){this.a = new xe();this.c = a;this.j = cf(this);this.h = null;this.v = !1;this.i = null;this.l = [];this.f = -1;this.m = 0;this.b = null;this.g = new Fe(a.i,a.getConfiguration().streaming.retryParameters,this.j);}m("shaka.offline.Storage",X);function df(){return !!window.indexedDB;}X.support = df;X.prototype.o = function(){var a=this.l,b=this.a,c=this.g?this.g.o()["catch"](function(){}).then(function(){return Promise.all(a.map(function(a){return b.remove("segment",a);}));}).then(function(){return b.o();}):Promise.resolve();this.j = this.c = this.g = this.a = null;return c;};X.prototype.destroy = X.prototype.o;X.prototype.configure = function(a){Oe(this.j,a,cf(this),{},"");};X.prototype.configure = X.prototype.configure;X.prototype.Vc = function(a,b,c){function d(a){f = a;}if(this.v)return Promise.reject(new w(9,9006));this.v = !0;var e,f=null;return ef(this).then((function(){Y(this);return ff(this,a,d,c);}).bind(this)).then((function(c){Y(this);this.b = c.manifest;this.h = c.Sb;if(this.b.presentationTimeline.R() || this.b.presentationTimeline.ea())throw new w(9,9005,a);this.b.periods.forEach(this.s.bind(this));this.f = this.a.b.manifest++;this.m = 0;c = this.b.periods.map(this.w.bind(this));var d=this.h.b,f=Rc(this.h);if(d){if(!f.length)throw new w(9,9007,a);d.initData = [];}e = {key:this.f,originalManifestUri:a,duration:this.m,size:0,periods:c,sessionIds:f,drmInfo:d,appMetadata:b};return He(this.g,e);}).bind(this)).then((function(){Y(this);if(f)throw f;return Be(this.a,"manifest",e);}).bind(this)).then((function(){return gf(this);}).bind(this)).then((function(){return Ee(e);}).bind(this))["catch"]((function(a){return gf(this)["catch"](D).then(function(){throw a;});}).bind(this));};X.prototype.store = X.prototype.Vc;X.prototype.remove = function(a){function b(a){6013 != a.code && (e = a);}var c=a.offlineUri,d=/^offline:([0-9]+)$/.exec(c);if(!d)return Promise.reject(new w(9,9004,c));var e=null,f,g,h=Number(d[1]);return ef(this).then((function(){Y(this);return this.a.get("manifest",h);}).bind(this)).then((function(a){Y(this);if(!a)throw new w(9,9003,c);f = a;a = Ke(f);g = new Jc(this.c.i,b,function(){});g.configure(this.c.getConfiguration().drm);return g.init(a,!0);}).bind(this)).then((function(){return Oc(g,f.sessionIds);}).bind(this)).then((function(){return g.o();}).bind(this)).then((function(){Y(this);if(e)throw e;var b=f.periods.map(function(a){return a.streams.map(function(a){var b=a.segments.map(function(a){a = /^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a.uri);return Number(a[1]);});a.initSegmentUri && (a = /^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a.initSegmentUri),b.push(Number(a[1])));return b;}).reduce(C,[]);}).reduce(C,[]),c=0,d=b.length,g=this.j.progressCallback;return Ce(this.a,(function(e){e = b.indexOf(e.key);0 <= e && (g(a,c / d),c++);return 0 <= e;}).bind(this));}).bind(this)).then((function(){Y(this);this.j.progressCallback(a,1);return this.a.remove("manifest",h);}).bind(this));};X.prototype.remove = X.prototype.remove;X.prototype.list = function(){var a=[];return ef(this).then((function(){Y(this);return this.a.forEach("manifest",function(b){a.push(Ee(b));});}).bind(this)).then(function(){return a;});};X.prototype.list = X.prototype.list;function ff(a,b,c,d){function e(){}var f=a.c.i,g=a.c.getConfiguration(),h,l,n;return vc(b,f,g.manifest.retryParameters,d).then((function(a){Y(this);n = new a();n.configure(g.manifest);return n.start(b,f,this.s.bind(this),c);}).bind(a)).then((function(a){Y(this);h = a;l = new Jc(f,c,e);l.configure(g.drm);return l.init(h,!0);}).bind(a)).then((function(){Y(this);return hf(h);}).bind(a)).then((function(){Y(this);return Nc(l);}).bind(a)).then((function(){Y(this);return n.stop();}).bind(a)).then((function(){Y(this);return {manifest:h,Sb:l};}).bind(a))["catch"](function(a){if(n)return n.stop().then(function(){throw a;});throw a;});}X.prototype.A = function(a){var b=[],c=a.filter(function(a){return "video" == a.type && 480 >= a.height;});c.sort(function(a,b){return b.bandwidth - a.bandwidth;});c.length && b.push(c[0]);for(var d=Ec(this.c.getConfiguration().preferredAudioLanguage),c=[0,Cc,Dc],e=a.filter(function(a){return "audio" == a.type;}),c=c.map(function(a){return e.filter(function(b){b = Ec(b.language);return Bc(a,d,b);});}),f=e,g=0;g < c.length;g++) c[g].length && (f = c[g]);f.sort(function(a,b){return a.bandwidth - b.bandwidth;});f.length && b.push(f[Math.floor(f.length / 2)]);var c=Ec(this.c.getConfiguration().preferredTextLanguage),h=Bc.bind(null,Dc,c);b.push.apply(b,a.filter(function(a){var b=Ec(a.language);return "text" == a.type && h(b);}));return b;};function cf(a){return {trackSelectionCallback:a.A.bind(a),progressCallback:function progressCallback(a,c){if(a || c)return null;}};}function ef(a){return a.a.a?Promise.resolve():a.a.init(De);}X.prototype.s = function(a){function b(a,b,c){b = b.filter(function(a){return a.type == c;});return 0 == b.length?null:rd(a,b[0]).stream;}var c={};this.i && (c = {video:b(this.b.periods[0],this.i,"video"),audio:b(this.b.periods[0],this.i,"audio")});od(this.h,c,a);nd(a,this.c.getConfiguration().restrictions,{width:Infinity,height:Infinity});};function gf(a){var b=a.h?a.h.o():Promise.resolve();a.h = null;a.b = null;a.v = !1;a.i = null;a.l = [];a.f = -1;return b;}function hf(a){a = a.periods.map(function(a){return a.streamSets;}).reduce(C,[]).map(function(a){return a.streams;}).reduce(C,[]);return Promise.all(a.map(function(a){return a.createSegmentIndex();}));}X.prototype.w = function(a){var b=qd(a,null),b=this.j.trackSelectionCallback(b);this.i || (this.i = b,this.b.periods.forEach(this.s.bind(this)));for(var c=b.length - 1;0 < c;--c) {for(var d=!1,e=c - 1;0 <= e;--e) if(b[c].type == b[e].type && b[c].kind == b[e].kind && b[c].language == b[e].language){d = !0;break;}if(d)break;}b = b.map((function(b){b = rd(a,b);return jf(this,a,b.Wc,b.stream);}).bind(this));return {startTime:a.startTime,streams:b};};function jf(a,b,c,d){for(var e=[],f=a.b.presentationTimeline.sa(),g=f,h=d.findSegmentPosition(f),l=null != h?d.getSegmentReference(h):null;l;) {var n=a.a.b.segment++;Ge(a.g,c.type,l,(l.endTime - l.startTime) * d.bandwidth / 8,(function(a,b,c,d){b = {key:a,data:d,manifestKey:this.f,streamNumber:c,segmentNumber:b};this.l.push(a);return Be(this.a,"segment",b);}).bind(a,n,l.position,d.id));e.push({startTime:l.startTime,endTime:l.endTime,uri:"offline:" + a.f + "/" + d.id + "/" + n});g = l.endTime + b.startTime;l = d.getSegmentReference(++h);}a.m = Math.max(a.m,g - f);b = null;d.initSegmentReference && (n = a.a.b.segment++,b = "offline:" + a.f + "/" + d.id + "/" + n,Ge(a.g,c.type,d.initSegmentReference,0,(function(a,b){var c={key:n,data:b,manifestKey:this.f,streamNumber:a,segmentNumber:-1};this.l.push(n);return Be(this.a,"segment",c);}).bind(a,d.id)));return {id:d.id,primary:c.primary,presentationTimeOffset:d.presentationTimeOffset || 0,contentType:c.type,mimeType:d.mimeType,codecs:d.codecs,frameRate:d.frameRate,kind:d.kind,language:c.language,width:d.width || null,height:d.height || null,initSegmentUri:b,encrypted:d.encrypted,keyId:d.keyId,segments:e};}function Y(a){if(!a.c)throw new w(9,9002);}Se.offline = df;m("shaka.polyfill.installAll",function(){for(var a=0;a < kf.length;++a) kf[a]();});var kf=[];function lf(a){kf.push(a);}m("shaka.polyfill.register",lf);function mf(a){var b=a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),b=new Event(b,a);a.target.dispatchEvent(b);}lf(function(){if(window.Document){var a=Element.prototype;a.requestFullscreen = a.requestFullscreen || a.mozRequestFullScreen || a.msRequestFullscreen || a.webkitRequestFullscreen;a = Document.prototype;a.exitFullscreen = a.exitFullscreen || a.mozCancelFullScreen || a.msExitFullscreen || a.webkitExitFullscreen;"fullscreenElement" in document || Object.defineProperty(document,"fullscreenElement",{get:function get(){return document.mozFullScreenElement || document.msFullscreenElement || document.webkitFullscreenElement;}});document.addEventListener("webkitfullscreenchange",mf);document.addEventListener("webkitfullscreenerror",mf);document.addEventListener("mozfullscreenchange",mf);document.addEventListener("mozfullscreenerror",mf);document.addEventListener("MSFullscreenChange",mf);document.addEventListener("MSFullscreenError",mf);}});function nf(a){this.c = [];this.b = [];this.a = [];for(a = new Jb(new DataView(a.buffer));Lb(a);) {var b=Sb(1886614376,a);if(-1 == b)break;var c=a.a - 8,d=Mb(a);if(1 < d)O(a,b - (a.a - c));else {O(a,3);var e=Ta(Qb(a,16)),f=[];if(0 < d)for(var d=N(a),g=0;g < d;++g) {var h=Ta(Qb(a,16));f.push(h);}d = N(a);O(a,d);this.b.push.apply(this.b,f);this.c.push(e);this.a.push({start:c,end:a.a - 1});a.a != c + b && O(a,b - (a.a - c));}}};function of(a,b){try{var c=new pf(a,b);return Promise.resolve(c);}catch(d) {return Promise.reject(d);}}function pf(a,b){this.keySystem = a;for(var c=!1,d=0;d < b.length;++d) {var e=b[d],f={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:e.initDataTypes,sessionTypes:["temporary"],label:e.label},g=!1;if(e.audioCapabilities)for(var h=0;h < e.audioCapabilities.length;++h) {var l=e.audioCapabilities[h];if(l.contentType){var g=!0,n=l.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,n) && (f.audioCapabilities.push(l),c = !0);}}if(e.videoCapabilities)for(h = 0;h < e.videoCapabilities.length;++h) l = e.videoCapabilities[h],l.contentType && (g = !0,n = l.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,n) && (f.videoCapabilities.push(l),c = !0));g || (c = MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));"required" == e.persistentState && (f.persistentState = "required",f.sessionTypes = ["persistent-license"]);if(c){this.a = f;return;}}c = Error("Unsupported keySystem");c.name = "NotSupportedError";c.code = DOMException.NOT_SUPPORTED_ERR;throw c;}pf.prototype.createMediaKeys = function(){var a=new qf(this.keySystem);return Promise.resolve(a);};pf.prototype.getConfiguration = function(){return this.a;};function rf(a){var b=this.mediaKeys;b && b != a && sf(b,null);delete this.mediaKeys;return (this.mediaKeys = a)?sf(a,this):Promise.resolve();}function qf(a){this.a = new MSMediaKeys(a);this.b = new y();}qf.prototype.createSession = function(a){if("temporary" != (a || "temporary"))throw new TypeError("Session type " + a + " is unsupported on this platform.");return new tf(this.a);};qf.prototype.setServerCertificate = function(){return Promise.reject(Error("setServerCertificate not supported on this platform."));};function sf(a,b){function c(){b.msSetMediaKeys(d.a);b.removeEventListener("loadedmetadata",c);}Da(a.b);if(!b)return Promise.resolve();z(a.b,b,"msneedkey",uf);var d=a;try{return 1 <= b.readyState?b.msSetMediaKeys(a.a):b.addEventListener("loadedmetadata",c),Promise.resolve();}catch(e) {return Promise.reject(e);}}function tf(a){p.call(this);this.c = null;this.g = a;this.b = this.a = null;this.f = new y();this.sessionId = "";this.expiration = NaN;this.closed = new x();this.keyStatuses = new vf();}ba(tf);k = tf.prototype;k.generateRequest = function(a,b){this.a = new x();try{this.c = this.g.createSession("video/mp4",new Uint8Array(b),null),z(this.f,this.c,"mskeymessage",this.kc.bind(this)),z(this.f,this.c,"mskeyadded",this.ic.bind(this)),z(this.f,this.c,"mskeyerror",this.jc.bind(this)),wf(this,"status-pending");}catch(c) {this.a.reject(c);}return this.a;};k.load = function(){return Promise.reject(Error("MediaKeySession.load not yet supported"));};k.update = function(a){this.b = new x();try{this.c.update(new Uint8Array(a));}catch(b) {this.b.reject(b);}return this.b;};k.close = function(){try{this.c.close(),this.closed.resolve(),Da(this.f);}catch(a) {this.closed.reject(a);}return this.closed;};k.remove = function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"));};function uf(a){var b=document.createEvent("CustomEvent");b.initCustomEvent("encrypted",!1,!1,null);b.initDataType = "cenc";if(a = a.initData){var c=new nf(a);if(!(1 >= c.a.length)){for(var d=[],e=0;e < c.a.length;e++) d.push(a.subarray(c.a[e].start,c.a[e].end + 1));e = xf;a = [];for(c = 0;c < d.length;++c) {for(var f=!1,g=0;g < a.length && !(f = e?e(d[c],a[g]):d[c] === a[g]);++g);f || a.push(d[c]);}for(e = d = 0;e < a.length;e++) d += a[e].length;d = new Uint8Array(d);for(e = c = 0;e < a.length;e++) d.set(a[e],c),c += a[e].length;a = d;}}b.initData = a;this.dispatchEvent(b);}function xf(a,b){return Ua(a,b);}k.kc = function(a){this.a && (this.a.resolve(),this.a = null);this.dispatchEvent(new t("message",{messageType:void 0 == this.keyStatuses.Va()?"licenserequest":"licenserenewal",message:a.message.buffer}));};k.ic = function(){this.a?(wf(this,"usable"),this.a.resolve(),this.a = null):this.b && (wf(this,"usable"),this.b.resolve(),this.b = null);};k.jc = function(){var a=Error("EME PatchedMediaKeysMs key error");a.errorCode = this.c.error;if(this.a)this.a.reject(a),this.a = null;else if(this.b)this.b.reject(a),this.b = null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:wf(this,"output-not-allowed");default:wf(this,"internal-error");}};function wf(a,b){a.keyStatuses.fb(b);a.dispatchEvent(new t("keystatuseschange"));}function vf(){this.size = 0;this.a = void 0;}var yf;k = vf.prototype;k.fb = function(a){this.size = void 0 == a?0:1;this.a = a;};k.Va = function(){return this.a;};k.forEach = function(a){this.a && a(this.a,yf);};k.get = function(a){if(this.has(a))return this.a;};k.has = function(a){var b=yf;return this.a && Ua(new Uint8Array(a),new Uint8Array(b))?!0:!1;};k.keys = function(){};function zf(){return Promise.reject(Error("The key system specified is not supported."));}function Af(a){return a?Promise.reject(Error("MediaKeys not supported.")):Promise.resolve();}function Bf(){throw new TypeError("Illegal constructor.");}Bf.prototype.createSession = function(){};Bf.prototype.setServerCertificate = function(){};function Cf(){throw new TypeError("Illegal constructor.");}Cf.prototype.getConfiguration = function(){};Cf.prototype.createMediaKeys = function(){};var Df="";function Ef(a){Df = a;Ff = new Uint8Array([0]).buffer;navigator.requestMediaKeySystemAccess = Gf;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys = null;HTMLMediaElement.prototype.setMediaKeys = Hf;window.MediaKeys = If;window.MediaKeySystemAccess = Jf;}function Kf(a){var b=Df;return b?b + a.charAt(0).toUpperCase() + a.slice(1):a;}function Gf(a,b){try{var c=new Jf(a,b);return Promise.resolve(c);}catch(d) {return Promise.reject(d);}}function Hf(a){var b=this.mediaKeys;b && b != a && Lf(b,null);delete this.mediaKeys;(this.mediaKeys = a) && Lf(a,this);return Promise.resolve();}function Jf(a,b){this.a = this.keySystem = a;var c=!0;"org.w3.clearkey" == a && (this.a = "webkit-org.w3.clearkey",c = !1);var d=!1,e;e = document.getElementsByTagName("video");e = e.length?e[0]:document.createElement("video");for(var f=0;f < b.length;++f) {var g=b[f],h={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:g.initDataTypes,sessionTypes:["temporary"],label:g.label},l=!1;if(g.audioCapabilities)for(var n=0;n < g.audioCapabilities.length;++n) {var u=g.audioCapabilities[n];if(u.contentType){var l=!0,r=u.contentType.split(";")[0];e.canPlayType(r,this.a) && (h.audioCapabilities.push(u),d = !0);}}if(g.videoCapabilities)for(n = 0;n < g.videoCapabilities.length;++n) u = g.videoCapabilities[n],u.contentType && (l = !0,e.canPlayType(u.contentType,this.a) && (h.videoCapabilities.push(u),d = !0));l || (d = e.canPlayType("video/mp4",this.a) || e.canPlayType("video/webm",this.a));"required" == g.persistentState && (c?(h.persistentState = "required",h.sessionTypes = ["persistent-license"]):d = !1);if(d){this.b = h;return;}}c = "Unsupported keySystem";if("org.w3.clearkey" == a || "com.widevine.alpha" == a)c = "None of the requested configurations were supported.";c = Error(c);c.name = "NotSupportedError";c.code = DOMException.NOT_SUPPORTED_ERR;throw c;}Jf.prototype.createMediaKeys = function(){var a=new If(this.a);return Promise.resolve(a);};Jf.prototype.getConfiguration = function(){return this.b;};function If(a){this.h = a;this.b = null;this.a = new y();this.c = [];this.f = {};}function Lf(a,b){a.b = b;Da(a.a);var c=Df;b && (z(a.a,b,c + "needkey",a.tc.bind(a)),z(a.a,b,c + "keymessage",a.sc.bind(a)),z(a.a,b,c + "keyadded",a.qc.bind(a)),z(a.a,b,c + "keyerror",a.rc.bind(a)));}k = If.prototype;k.createSession = function(a){var b=a || "temporary";if("temporary" != b && "persistent-license" != b)throw new TypeError("Session type " + a + " is unsupported on this platform.");a = this.b || document.createElement("video");a.src || (a.src = "about:blank");b = new Mf(a,this.h,b);this.c.push(b);return b;};k.setServerCertificate = function(){return Promise.reject(Error("setServerCertificate not supported on this platform."));};k.tc = function(a){var b=document.createEvent("CustomEvent");b.initCustomEvent("encrypted",!1,!1,null);b.initDataType = "webm";b.initData = a.initData;this.b.dispatchEvent(b);};k.sc = function(a){var b=Nf(this,a.sessionId);b && (a = new t("message",{messageType:void 0 == b.keyStatuses.Va()?"licenserequest":"licenserenewal",message:a.message}),b.b && (b.b.resolve(),b.b = null),b.dispatchEvent(a));};k.qc = function(a){if(a = Nf(this,a.sessionId))Of(a,"usable"),a.a && a.a.resolve(),a.a = null;};k.rc = function(a){var b=Nf(this,a.sessionId);if(b){var c=Error("EME v0.1b key error");c.errorCode = a.errorCode;c.errorCode.systemCode = a.systemCode;!a.sessionId && b.b?(c.method = "generateRequest",45 == a.systemCode && (c.message = "Unsupported session type."),b.b.reject(c),b.b = null):a.sessionId && b.a?(c.method = "update",b.a.reject(c),b.a = null):(c = a.systemCode,a.errorCode.code == MediaKeyError.MEDIA_KEYERR_OUTPUT?Of(b,"output-restricted"):1 == c?Of(b,"expired"):Of(b,"internal-error"));}};function Nf(a,b){var c=a.f[b];return c?c:(c = a.c.shift())?(c.sessionId = b,a.f[b] = c):null;}function Mf(a,b,c){p.call(this);this.f = a;this.i = !1;this.a = this.b = null;this.c = b;this.g = c;this.sessionId = "";this.expiration = NaN;this.closed = new x();this.keyStatuses = new Pf();}ba(Mf);function Qf(a,b,c){if(a.i)return Promise.reject(Error("The session is already initialized."));a.i = !0;var d;try{if("persistent-license" == a.g)if(c)d = new Uint8Array(Ib("LOAD_SESSION|" + c));else {var e=Ib("PERSISTENT|"),f=new Uint8Array(e.byteLength + b.byteLength);f.set(new Uint8Array(e),0);f.set(new Uint8Array(b),e.byteLength);d = f;}else d = new Uint8Array(b);}catch(h) {return Promise.reject(h);}a.b = new x();var g=Kf("generateKeyRequest");try{a.f[g](a.c,d);}catch(h) {if("InvalidStateError" != h.name)return a.b = null,Promise.reject(h);setTimeout((function(){try{this.f[g](this.c,d);}catch(l) {this.b.reject(l),this.b = null;}}).bind(a),10);}return a.b;}k = Mf.prototype;k.hb = function(a,b){if(this.a)this.a.then(this.hb.bind(this,a,b))["catch"](this.hb.bind(this,a,b));else {this.a = a;var c,d;"webkit-org.w3.clearkey" == this.c?(c = Eb(b),d = JSON.parse(c),"oct" != d.keys[0].kty && (this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a = null),c = Ra(d.keys[0].k),d = Ra(d.keys[0].kid)):(c = new Uint8Array(b),d = null);var e=Kf("addKey");try{this.f[e](this.c,c,d,this.sessionId);}catch(f) {this.a.reject(f),this.a = null;}}};function Of(a,b){a.keyStatuses.fb(b);a.dispatchEvent(new t("keystatuseschange"));}k.generateRequest = function(a,b){return Qf(this,b,null);};k.load = function(a){return "persistent-license" == this.g?Qf(this,null,a):Promise.reject(Error("Not a persistent session."));};k.update = function(a){var b=new x();this.hb(b,a);return b;};k.close = function(){if("persistent-license" != this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var a=Kf("cancelKeyRequest");try{this.f[a](this.c,this.sessionId);}catch(b) {}}this.closed.resolve();return this.closed;};k.remove = function(){return "persistent-license" != this.g?Promise.reject(Error("Not a persistent session.")):this.close();};function Pf(){this.size = 0;this.a = void 0;}var Ff;k = Pf.prototype;k.fb = function(a){this.size = void 0 == a?0:1;this.a = a;};k.Va = function(){return this.a;};k.forEach = function(a){this.a && a(this.a,Ff);};k.get = function(a){if(this.has(a))return this.a;};k.has = function(a){var b=Ff;return this.a && Ua(new Uint8Array(a),new Uint8Array(b))?!0:!1;};k.keys = function(){};lf(function(){!window.HTMLVideoElement || navigator.requestMediaKeySystemAccess && MediaKeySystemAccess.prototype.getConfiguration || (HTMLMediaElement.prototype.webkitGenerateKeyRequest?Ef("webkit"):HTMLMediaElement.prototype.generateKeyRequest?Ef(""):window.MSMediaKeys?(yf = new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys = null,HTMLMediaElement.prototype.setMediaKeys = rf,window.MediaKeys = qf,window.MediaKeySystemAccess = pf,navigator.requestMediaKeySystemAccess = of):(navigator.requestMediaKeySystemAccess = zf,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys = null,HTMLMediaElement.prototype.setMediaKeys = Af,window.MediaKeys = Bf,window.MediaKeySystemAccess = Cf));});function Rf(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer = function(){var b=a.apply(this,arguments);b.abort = function(){};return b;};}function Sf(){var a=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream = function(){for(var b=0,d=0;d < this.sourceBuffers.length;++d) var e=this.sourceBuffers[d],e=e.buffered.end(e.buffered.length - 1),b=Math.max(b,e);if(!isNaN(this.duration) && b < this.duration)for(this.pb = !0,d = 0;d < this.sourceBuffers.length;++d) e = this.sourceBuffers[d],e.lb = !1;return a.apply(this,arguments);};var b=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer = function(){var a=b.apply(this,arguments);a.h = this;a.addEventListener("updateend",Tf,!1);this.a || (this.addEventListener("sourceclose",Uf,!1),this.a = !0);return a;};}function Tf(a){var b=a.target,c=b.h;if(c.pb){a.preventDefault();a.stopPropagation();a.stopImmediatePropagation();b.lb = !0;for(a = 0;a < c.sourceBuffers.length;++a) if(0 == c.sourceBuffers[a].lb)return;c.pb = !1;}}function Uf(a){a = a.target;for(var b=0;b < a.sourceBuffers.length;++b) a.sourceBuffers[b].removeEventListener("updateend",Tf,!1);a.removeEventListener("sourceclose",Uf,!1);}lf(function(){if(window.MediaSource){var a=navigator.vendor,b=navigator.appVersion;!a || !b || 0 > a.indexOf("Apple") || (0 <= b.indexOf("Version/8")?window.MediaSource = null:0 <= b.indexOf("Version/9")?Rf():0 <= b.indexOf("Version/10") && (Rf(),Sf()));}});function Z(a){this.c = [];this.b = [];this.ia = Vf;if(a)try{a(this.W.bind(this),this.a.bind(this));}catch(b) {this.a(b);}}var Vf=0;function Wf(a){var b=new Z();b.W(void 0);return b.then(function(){return a;});}function Xf(a){var b=new Z();b.a(a);return b;}function Yf(a){function b(a,b,c){a.ia == Vf && (e[b] = c,d++,d == e.length && a.W(e));}var c=new Z();if(!a.length)return c.W([]),c;for(var d=0,e=Array(a.length),f=c.a.bind(c),g=0;g < a.length;++g) a[g] && a[g].then?a[g].then(b.bind(null,c,g),f):b(c,g,a[g]);return c;}function Zf(a){for(var b=new Z(),c=b.W.bind(b),d=b.a.bind(b),e=0;e < a.length;++e) a[e] && a[e].then?a[e].then(c,d):c(a[e]);return b;}Z.prototype.then = function(a,b){var c=new Z();switch(this.ia){case 1:$f(this,c,a);break;case 2:$f(this,c,b);break;case Vf:this.c.push({I:c,Ea:a}),this.b.push({I:c,Ea:b});}return c;};Z.prototype["catch"] = function(a){return this.then(void 0,a);};Z.prototype.W = function(a){if(this.ia == Vf){this.Pa = a;this.ia = 1;for(a = 0;a < this.c.length;++a) $f(this,this.c[a].I,this.c[a].Ea);this.c = [];this.b = [];}};Z.prototype.a = function(a){if(this.ia == Vf){this.Pa = a;this.ia = 2;for(a = 0;a < this.b.length;++a) $f(this,this.b[a].I,this.b[a].Ea);this.c = [];this.b = [];}};function $f(a,b,c){ag.push((function(){if(c && "function" == typeof c){try{var a=c(this.Pa);}catch(f) {b.a(f);return;}var e;try{e = a && a.then;}catch(f) {b.a(f);return;}a instanceof Z?a == b?b.a(new TypeError("Chaining cycle detected")):a.then(b.W.bind(b),b.a.bind(b)):e?bg(a,e,b):b.W(a);}else 1 == this.ia?b.W(this.Pa):b.a(this.Pa);}).bind(a));null == cg && (cg = dg(eg));}function bg(a,b,c){try{var d=!1;b.call(a,function(a){if(!d){d = !0;var b;try{b = a && a.then;}catch(g) {c.a(g);return;}b?bg(a,b,c):c.W(a);}},c.a.bind(c));}catch(e) {c.a(e);}}function eg(){for(;ag.length;) {null != cg && (fg(cg),cg = null);var a=ag;ag = [];for(var b=0;b < a.length;++b) a[b]();}}function dg(){return 0;}function fg(){}var cg=null,ag=[];lf(function(a){window.setImmediate?(dg = function(a){return window.setImmediate(a);},fg = function(a){return window.clearImmediate(a);}):(dg = function(a){return window.setTimeout(a,0);},fg = function(a){return window.clearTimeout(a);});if(!window.Promise || a)window.Promise = Z,window.Promise.resolve = Wf,window.Promise.reject = Xf,window.Promise.all = Yf,window.Promise.race = Zf,window.Promise.prototype.then = Z.prototype.then,window.Promise.prototype["catch"] = Z.prototype["catch"];});function gg(){return {droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0};}lf(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality && "webkitDroppedFrameCount" in a && (a.getVideoPlaybackQuality = gg);}});function hg(a,b,c){return new window.TextTrackCue(a,b,c);}function ig(a,b,c){return new window.TextTrackCue(a + "-" + b + "-" + c,a,b,c);}lf(function(){if(!window.VTTCue && window.TextTrackCue){var a=TextTrackCue.length;if(3 == a)window.VTTCue = hg;else if(6 == a)window.VTTCue = ig;else {var b;try{b = !!hg(1,2,"");}catch(c) {b = !1;}b && (window.VTTCue = hg);}}});}).call(g,this);if(typeof module != "undefined" && module.exports)module.exports = g.shaka;else if(true)!(__WEBPACK_AMD_DEFINE_RESULT__ = function(){return g.shaka;}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else this.shaka = g.shaka;})();
-
-/***/ }
-/******/ ])
-});
-; \ No newline at end of file
diff --git a/assets/clapprio/dash-shaka-playback.min.js b/assets/clapprio/dash-shaka-playback.min.js
new file mode 100644
index 0000000..3d47aae
--- /dev/null
+++ b/assets/clapprio/dash-shaka-playback.min.js
@@ -0,0 +1,2 @@
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("clappr")):"function"==typeof define&&define.amd?define(["clappr"],e):"object"==typeof exports?exports.DashShakaPlayback=e(require("clappr")):t.DashShakaPlayback=e(t.Clappr)}("undefined"!=typeof self?self:this,function(t){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="dist/",e(e.s=0)}([function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function t(e,i,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,i);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in r)return r.value;var s=r.get;if(void 0!==s)return s.call(n)},o=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),u=i(1),h=i(2),c=function(t){return t&&t.__esModule?t:{default:t}}(h),l=function(t){function e(t){n(this,e);var i=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i._levels=[],i._pendingAdaptationEvent=!1,i._isShakaReadyState=!1,t.autoPlay&&i.play(),i}return a(e,t),o(e,[{key:"name",get:function(){return"dash_shaka_playback"}},{key:"shakaVersion",get:function(){return c.default.player.Player.version}},{key:"shakaPlayerInstance",get:function(){return this._player}},{key:"levels",get:function(){return this._levels}},{key:"currentLevel",set:function(t){var e=this;this._currentLevelId=t;var i=-1===this._currentLevelId;this.trigger(u.Events.PLAYBACK_LEVEL_SWITCH_START),i?(this._player.configure({abr:{enabled:!0}}),this.trigger(u.Events.PLAYBACK_LEVEL_SWITCH_END)):(this._player.configure({abr:{enabled:!1}}),this._pendingAdaptationEvent=!0,this.selectTrack(this.videoTracks.filter(function(t){return t.id===e._currentLevelId})[0]))},get:function(){return this._currentLevelId||-1}}],[{key:"canPlay",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";c.default.polyfill.installAll();var i=c.default.Player.isBrowserSupported(),n=t.split("?")[0].match(/.*\.(.*)$/)||[];return i&&("mpd"===n[1]||e.indexOf("application/dash+xml")>-1)}},{key:"Events",get:function(){return{SHAKA_READY:"shaka:ready"}}}]),o(e,[{key:"play",value:function(){if(this._player||this._setup(),!this.isReady)return void this.once(e.Events.SHAKA_READY,this.play);this._stopped=!1,this._src=this.el.src,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"play",this).call(this)}},{key:"setupSrc",value:function(){}},{key:"_ready",value:function(){}},{key:"_onShakaReady",value:function(){this._isShakaReadyState=!0,this.trigger(e.Events.SHAKA_READY),this.trigger(u.Events.PLAYBACK_READY,this.name)}},{key:"error",value:function(t){u.Log.error("an error was raised by the video tag",t,this.el.error)}},{key:"isHighDefinitionInUse",value:function(){return!1}},{key:"stop",value:function(){var t=this;clearInterval(this.sendStatsId),this._stopped=!0,this._player?(this._sendStats(),this._player.unload().then(function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",t).call(t),t._player=null,t._isShakaReadyState=!1}).catch(function(){u.Log.error("shaka could not be unloaded")})):s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",this).call(this)}},{key:"getPlaybackType",value:function(){return(this.isReady&&this._player.isLive()?"live":"vod")||""}},{key:"selectAudioLanguage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._player.selectAudioLanguage(t,e)}},{key:"selectTrack",value:function(t){if("text"===t.type)this._player.selectTextTrack(t);else{if("variant"!==t.type)throw new Error("Unhandled track type:",t.type);this._player.selectVariantTrack(t),t.mimeType.startsWith("video/")&&this._onAdaptation()}}},{key:"_enableShakaTextTrack",value:function(t){this.el.textTracks&&(this._shakaTTVisible=t,Array.from(this.el.textTracks).filter(function(t){return"subtitles"===t.kind}).forEach(function(e){return e.mode=!0===t?"showing":"hidden"}))}},{key:"_checkForClosedCaptions",value:function(){if(!this._ccIsSetup){if(this.hasClosedCaptionsTracks){this.trigger(u.Events.PLAYBACK_SUBTITLE_AVAILABLE);var t=this.closedCaptionsTrackId;this.closedCaptionsTrackId=t}this._ccIsSetup=!0}}},{key:"destroy",value:function(){var t=this;clearInterval(this.sendStatsId),this._player?this._player.destroy().then(function(){return t._destroy()}).catch(function(){t._destroy(),u.Log.error("shaka could not be destroyed")}):this._destroy()}},{key:"_setup",value:function(){var t=this;this._isShakaReadyState=!1,this._ccIsSetup=!1,this._player=this._createPlayer(),this._options.shakaConfiguration&&this._player.configure(this._options.shakaConfiguration),this._options.shakaOnBeforeLoad&&this._options.shakaOnBeforeLoad(this._player),this._player.load(this._options.src).then(function(){return t._loaded()}).catch(function(e){return t._setupError(e)})}},{key:"_createPlayer",value:function(){var t=new c.default.Player(this.el);return t.addEventListener("error",this._onError.bind(this)),t.addEventListener("adaptation",this._onAdaptation.bind(this)),t.addEventListener("buffering",this._onBuffering.bind(this)),t}},{key:"_onBuffering",value:function(t){if(!this._stopped){var e=t.buffering?u.Events.PLAYBACK_BUFFERING:u.Events.PLAYBACK_BUFFERFULL;this.trigger(e)}}},{key:"_loaded",value:function(){this._onShakaReady(),this._startToSendStats(),this._fillLevels(),this._checkForClosedCaptions()}},{key:"_fillLevels",value:function(){0===this._levels.length&&(this._levels=this.videoTracks.slice(0).reverse(),this.trigger(u.Events.PLAYBACK_LEVELS_AVAILABLE,this.levels))}},{key:"_startToSendStats",value:function(){var t=this,e=this._options.shakaSendStatsInterval||3e4;this.sendStatsId=setInterval(function(){return t._sendStats()},e)}},{key:"_sendStats",value:function(){this.trigger(u.Events.PLAYBACK_STATS_ADD,this._player.getStats())}},{key:"_setupError",value:function(t){this._onError(t)}},{key:"_onError",value:function(t){u.Log.error("Shaka error event:",t),this.trigger(u.Events.PLAYBACK_ERROR,t,this.name)}},{key:"_onAdaptation",value:function(){var t=this.videoTracks.filter(function(t){return!0===t.active})[0];this._fillLevels(),this._sendStats(),this._pendingAdaptationEvent_&&(this.trigger(u.Events.PLAYBACK_LEVEL_SWITCH_END),this._pendingAdaptationEvent=!1),u.Log.debug("an adaptation has happened:",t),this.trigger(u.Events.PLAYBACK_BITRATE,{bandwidth:t.bandwidth,language:t.language,width:t.width,height:t.height,level:t.id})}},{key:"_destroy",value:function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this),this._isShakaReadyState=!1,u.Log.debug("shaka was destroyed")}},{key:"isReady",get:function(){return this._isShakaReadyState}},{key:"textTracks",get:function(){return this.isReady&&this._player.getTextTracks()}},{key:"audioLanguages",get:function(){return this.isReady&&this._player.getAudioLanguages()}},{key:"audioTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("audio/")})}},{key:"videoTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("video/")})}},{key:"closedCaptionsTracks",get:function(){var t=0,e=function(){return t++};return(this.textTracks||[]).filter(function(t){return"subtitle"===t.kind}).map(function(t){return{id:e(),name:t.label||t.language,track:t}})}},{key:"closedCaptionsTrackId",get:function(){return s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"closedCaptionsTrackId",this)},set:function(t){if(this._player){var e=this.closedCaptionsTracks,i=void 0;if(-1!==t){if(!(i=e.find(function(e){return e.id===t})))return void u.Log.warn('Track id "'+t+'" not found');if(this._shakaTTVisible&&!0===i.track.active)return void u.Log.info('Track id "'+t+'" already showing')}i?(this._player.selectTextTrack(i.track),this._enableShakaTextTrack(!0)):this._enableShakaTextTrack(!1),this._ccTrackId=t,this.trigger(u.Events.PLAYBACK_SUBTITLE_CHANGED,{id:t})}}}]),e}(u.HTML5Video);e.default=l,t.exports=e.default},function(e,i){e.exports=t},function(t,e,i){var n;!function(){var r={};(function(t){function e(t,e){var i=t.split("."),n=$s;i[0]in n||!n.execScript||n.execScript("var "+i[0]);for(var r;i.length&&(r=i.shift());)i.length||void 0===e?n=n[r]?n[r]:n[r]={}:n[r]=e}function i(t){function e(){}var i=Se;e.prototype=i.prototype,t.Te=i.prototype,t.prototype=new e,t.prototype.constructor=t,t.Re=function(t,e,n){return i.prototype[e].apply(t,Array.prototype.slice.call(arguments,2))}}function n(t){this.c=Math.exp(Math.log(.5)/t),this.b=this.a=0}function r(t,e,i){var n=Math.pow(t.c,e);i=i*(1-n)+n*t.a,isNaN(i)||(t.a=i,t.b+=e)}function a(t){return t.a/(1-Math.pow(t.c,t.b))}function s(){this.b=new n(2),this.c=new n(5),this.a=0}function o(){}function u(){}function h(t,e,i,n){this.severity=t,this.category=e,this.code=i,this.data=Array.prototype.slice.call(arguments,3),this.handled=!1}function c(t){var e;t instanceof c?(l(this,t.ea),this.Aa=t.Aa,this.ja=t.ja,f(this,t.Ia),this.ba=t.ba,d(this,b(t.a)),this.ta=t.ta):t&&(e=String(t).match(Ws))?(l(this,e[1]||"",!0),this.Aa=p(e[2]||""),this.ja=p(e[3]||"",!0),f(this,e[4]),this.ba=p(e[5]||"",!0),d(this,e[6]||"",!0),this.ta=p(e[7]||"")):this.a=new g(null)}function l(t,e,i){t.ea=i?p(e,!0):e,t.ea&&(t.ea=t.ea.replace(/:$/,""))}function f(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.Ia=e}else t.Ia=null}function d(t,e,i){e instanceof g?t.a=e:(i||(e=m(e,to)),t.a=new g(e))}function p(t,e){return t?e?decodeURI(t):decodeURIComponent(t):""}function m(t,e,i){return"string"==typeof t?(t=encodeURI(t).replace(e,v),i&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function v(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}function g(t){this.b=t||null}function b(t){var e=new g;if(e.b=t.b,t.a){var i,n={};for(i in t.a)n[i]=t.a[i].concat();e.a=n,e.c=t.c}return e}function y(){var t,e,i=new Promise(function(i,n){t=i,e=n});return i.resolve=t,i.reject=e,i}function T(t,e,i){var n=E();this.j=null==t.maxAttempts?n.maxAttempts:t.maxAttempts,this.f=null==t.baseDelay?n.baseDelay:t.baseDelay,this.i=null==t.fuzzFactor?n.fuzzFactor:t.fuzzFactor,this.h=null==t.backoffFactor?n.backoffFactor:t.backoffFactor,this.a=0,this.b=this.f,this.c=e||!1,this.g=i||null,this.c&&(this.a=1)}function w(t){if(t.a>=t.j){if(!t.c)return Promise.reject();t.a=1,t.b=t.f}var e=new y;return t.a?(S(t,e.resolve,t.b*(1+(2*Math.random()-1)*t.i)),t.b*=t.h):e.resolve(),t.a++,e}function E(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function S(t,e,i){if(t.g)if(t.g()||!i)e();else{var n=Math.min(200,i);A(function(){S(this,e,i-n)}.bind(t),n)}else A(e,i)}function A(e,i){t.setTimeout(e,i)}function k(t,e,i,n,r){var a,s=r in n;for(a in e){var o=r+"."+a,u=s?n[r]:i[a];(s||a in t)&&(void 0===e[a]?void 0===u||s?delete t[a]:t[a]=u:u.constructor==Object&&e[a]&&e[a].constructor==Object?(t[a]||(t[a]=u),k(t[a],e[a],u,n,o)):typeof e[a]==typeof u&&null!=e[a]&&e[a].constructor==u.constructor&&(t[a]=e[a]))}}function I(t){function e(t){switch(typeof t){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return t;default:if(!t)return t;if(0<=i.indexOf(t))return null;var n=t.constructor==Array;if(t.constructor!=Object&&!n)return null;i.push(t);var r,a=n?[]:{};for(r in t)a[r]=e(t[r]);return n&&(a.length=t.length),a}}var i=[];return e(t)}function P(t,e){return t.reduce(function(t,e,i){return e.catch(t.bind(null,i))}.bind(null,e),Promise.reject())}function _(t,e){return t.concat(e)}function x(){}function R(t){return null!=t}function N(t,e,i){return i.indexOf(t)==e}function D(t){this.f=!1,this.a=[],this.b=[],this.c=[],this.g=t||null}function L(t,e){return{uris:t,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:e}}function C(t,e,i,n,r,a,s){if(t.f||s())return Promise.reject();var o=new c(i.uris[r]),u=o.ea;if(u||(u=location.protocol,u=u.slice(0,-1),l(o,u),i.uris[r]=o.toString()),!(u=io[u]))return Promise.reject(new h(2,1,1e3,o));var f=Date.now();return u(i.uris[r],i,e).then(function(t){void 0==t.timeMs&&(t.timeMs=Date.now()-f);var i=Date.now(),n=Promise.resolve();return this.c.forEach(function(i){n=n.then(function(){return Promise.resolve(i(e,t))}.bind(this))}.bind(this)),n=n.catch(function(t){var e=2;throw t instanceof h&&(e=t.severity),new h(e,1,1007,t)}),n.then(function(){return t.timeMs+=Date.now()-i,t.timeMs+=a,t})}.bind(t)).catch(function(t){if(t&&1==t.severity)return r=(r+1)%i.uris.length,s()?Promise.reject():w(n).then(function(){return C(this,e,i,n,r,a,s)}.bind(this),function(){throw t});throw t}.bind(t))}function M(t,e){for(var i=[],n=0;n<t.length;++n){for(var r=!1,a=0;a<i.length&&!(r=e?e(t[n],i[a]):t[n]===i[a]);++a);r||i.push(t[n])}return i}function O(t,e,i){for(var n=0;n<t.length;++n)if(i(t[n],e))return n;return-1}function U(t,e){var i=t.indexOf(e);-1<i&&t.splice(i,1)}function j(){this.a={}}function B(){this.a=new j}function F(t,e,i,n){t.a&&(e=new K(e,i,n),t.a.push(i,e))}function V(t,e,i,n){F(t,e,i,function(t){this.ha(e,i),n(t)}.bind(t))}function H(t){if(t.a){var e,i=t.a,n=[];for(e in i.a)n.push.apply(n,i.a[e]);for(i=0;i<n.length;++i)n[i].ha();t.a.a={}}}function K(t,e,i){this.target=t,this.type=e,this.a=i,this.target.addEventListener(e,i,!1)}function G(e,i){var n,r=i||{};for(n in r)this[n]=r[n];this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=t.performance&&t.performance.now?t.performance.now():Date.now(),this.type=e,this.isTrusted=!1,this.target=this.currentTarget=null,this.a=!1}function q(t,e){if(!e.length)return t;var i=e.map(function(t){return new c(t)});return t.map(function(t){return new c(t)}).map(function(t){return i.map(t.resolve.bind(t))}).reduce(_,[]).map(function(t){return t.toString()})}function X(t,e){return{keySystem:t,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:e||[],keyIds:[]}}function Y(t){return!t||!Object.keys(t).length}function z(t){return Object.keys(t).map(function(e){return t[e]})}function $(t,e){return Object.keys(t).reduce(function(i,n){return i[n]=e(t[n],n),i},{})}function W(t,e){return Object.keys(t).every(function(i){return e(i,t[i])})}function J(t,e){Object.keys(t).forEach(function(i){e(i,t[i])})}function Q(t,e){var i=t;return e&&(i+='; codecs="'+e+'"'),i}function Z(t){if(!t)return"";t=new Uint8Array(t),239==t[0]&&187==t[1]&&191==t[2]&&(t=t.subarray(3)),t=escape(nt(t));try{return decodeURIComponent(t)}catch(t){throw new h(2,2,2004)}}function tt(t,e,i){if(!t)return"";if(!i&&t.byteLength%2)throw new h(2,2,2004);if(t instanceof ArrayBuffer)var n=t;else i=new Uint8Array(t.byteLength),i.set(new Uint8Array(t)),n=i.buffer;t=Math.floor(t.byteLength/2),i=new Uint16Array(t),n=new DataView(n);for(var r=0;r<t;r++)i[r]=n.getUint16(2*r,e);return nt(i)}function et(t){var e=new Uint8Array(t);if(239==e[0]&&187==e[1]&&191==e[2])return Z(e);if(254==e[0]&&255==e[1])return tt(e.subarray(2),!1);if(255==e[0]&&254==e[1])return tt(e.subarray(2),!0);var i=function(t,e){return t.byteLength<=e||32<=t[e]&&126>=t[e]}.bind(null,e);if(!e[0]&&!e[2])return tt(t,!1);if(!e[1]&&!e[3])return tt(t,!0);if(i(0)&&i(1)&&i(2)&&i(3))return Z(t);throw new h(2,2,2003)}function it(t){t=unescape(encodeURIComponent(t));for(var e=new Uint8Array(t.length),i=0;i<t.length;++i)e[i]=t.charCodeAt(i);return e.buffer}function nt(t){for(var e="",i=0;i<t.length;i+=16e3)e+=String.fromCharCode.apply(null,t.subarray(i,i+16e3));return e}function rt(t){this.a=null,this.b=function(){this.a=null,t()}.bind(this)}function at(t,e){t.cancel(),t.a=setTimeout(t.b,1e3*e)}function st(t,e){t.cancel();var i=function(){this.b(),this.a=setTimeout(i,1e3*e)}.bind(t);t.a=setTimeout(i,1e3*e)}function ot(e,i){var n=void 0==i||i,r=t.btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_");return n?r:r.replace(/=*$/,"")}function ut(e){e=t.atob(e.replace(/-/g,"+").replace(/_/g,"/"));for(var i=new Uint8Array(e.length),n=0;n<e.length;++n)i[n]=e.charCodeAt(n);return i}function ht(e){for(var i=new Uint8Array(e.length/2),n=0;n<e.length;n+=2)i[n/2]=t.parseInt(e.substr(n,2),16);return i}function ct(t){for(var e="",i=0;i<t.length;++i){var n=t[i].toString(16);1==n.length&&(n="0"+n),e+=n}return e}function lt(t,e){if(!t&&!e)return!0;if(!t||!e||t.length!=e.length)return!1;for(var i=0;i<t.length;++i)if(t[i]!=e[i])return!1;return!0}function ft(t){this.s=t,this.l=this.j=this.w=null,this.L=!1,this.b=null,this.f=new B,this.a=[],this.m=[],this.i=new y,this.h=null,this.g=function(e){this.i.reject(e),t.onError(e)}.bind(this),this.C={},this.D=new rt(this.$d.bind(this)),this.ia=this.c=!1,this.J=[],this.X=!1,this.B=new rt(this.Zd.bind(this)),st(this.B,1),this.i.catch(function(){})}function dt(t,e){if(!t.j)return V(t.f,e,"encrypted",function(){this.g(new h(2,6,6010))}.bind(t)),Promise.resolve();t.l=e,V(t.f,t.l,"play",t.Gd.bind(t));var i=t.l.setMediaKeys(t.j),i=i.catch(function(t){return Promise.reject(new h(2,6,6003,t.message))}),n=null;return t.b.serverCertificate&&t.b.serverCertificate.length&&(n=t.j.setServerCertificate(t.b.serverCertificate).then(function(){}).catch(function(t){return Promise.reject(new h(2,6,6004,t.message))})),Promise.all([i,n]).then(function(){if(this.c)return Promise.reject();mt(this),this.b.initData.length||this.m.length||F(this.f,this.l,"encrypted",this.vd.bind(this))}.bind(t)).catch(function(t){return this.c?Promise.resolve():Promise.reject(t)}.bind(t))}function pt(t,e){return Promise.all(e.map(function(t){return St(this,t).then(function(t){if(t){for(var e=new y,i=0;i<this.a.length;i++)if(this.a[i].fa==t){this.a[i].na=e;break}return Promise.all([t.remove(),e])}}.bind(this))}.bind(t)))}function mt(t){var e=t.b?t.b.initData:[];return e.forEach(function(t){At(this,t.initDataType,t.initData)}.bind(t)),t.m.forEach(function(t){St(this,t)}.bind(t)),e.length||t.m.length||t.i.resolve(),t.i}function vt(t){return t.a.map(function(t){return t.fa.sessionId})}function gt(e,i,n,r,a){var s=Tt(e);i.periods.forEach(function(e){e.variants.forEach(function(e){s&&(e.drmInfos=[s]),e.drmInfos.forEach(function(i){yt(this,i),t.cast&&t.cast.__platform__&&"com.microsoft.playready"==i.keySystem&&(i.keySystem="com.chromecast.playready");var s=r[i.keySystem];s||(s={audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:n?"required":"optional",sessionTypes:[n?"persistent-license":"temporary"],label:i.keySystem,drmInfos:[]},r[i.keySystem]=s,a.push(i.keySystem)),s.drmInfos.push(i),i.distinctiveIdentifierRequired&&(s.distinctiveIdentifier="required"),i.persistentStateRequired&&(s.persistentState="required");var o=[];e.video&&o.push(e.video),e.audio&&o.push(e.audio),o.forEach(function(t){("video"==t.type?s.videoCapabilities:s.audioCapabilities).push({robustness:("video"==t.type?i.videoRobustness:i.audioRobustness)||"",contentType:Q(t.mimeType,t.codecs)})}.bind(this))}.bind(this))}.bind(this))}.bind(e))}function bt(t,e,i){if(1==i.length&&""==i[0])return Promise.reject(new h(2,6,6e3));var n=new y,r=n;return[!0,!1].forEach(function(t){i.forEach(function(i){var n=e[i];n.drmInfos.some(function(t){return!!t.licenseServerUri})==t&&(n.audioCapabilities.length||delete n.audioCapabilities,n.videoCapabilities.length||delete n.videoCapabilities,r=r.catch(function(){return this.c?Promise.reject():navigator.requestMediaKeySystemAccess(i,[n])}.bind(this)))}.bind(this))}.bind(t)),r=r.catch(function(){return Promise.reject(new h(2,6,6001))}),r=r.then(function(t){if(this.c)return Promise.reject();var i=0<=navigator.userAgent.indexOf("Edge/"),n=t.getConfiguration();return this.w=(n.audioCapabilities||[]).concat(n.videoCapabilities||[]).map(function(t){return t.contentType}),i&&(this.w=null),i=e[t.keySystem],wt(this,t.keySystem,i,i.drmInfos),this.b.licenseServerUri?t.createMediaKeys():Promise.reject(new h(2,6,6012))}.bind(t)).then(function(t){if(this.c)return Promise.reject();this.j=t,this.L=!0}.bind(t)).catch(function(t){return this.c?Promise.resolve():(this.w=this.b=null,t instanceof h?Promise.reject(t):Promise.reject(new h(2,6,6002,t.message)))}.bind(t)),n.reject(),r}function yt(t,e){var i=e.keySystem;if(i){if(!e.licenseServerUri){var n=t.h.servers[i];n&&(e.licenseServerUri=n)}e.keyIds||(e.keyIds=[]),(i=t.h.advanced[i])&&(e.distinctiveIdentifierRequired||(e.distinctiveIdentifierRequired=i.distinctiveIdentifierRequired),e.persistentStateRequired||(e.persistentStateRequired=i.persistentStateRequired),e.videoRobustness||(e.videoRobustness=i.videoRobustness),e.audioRobustness||(e.audioRobustness=i.audioRobustness),e.serverCertificate||(e.serverCertificate=i.serverCertificate))}}function Tt(e){if(Y(e.h.clearKeys))return null;var i,n=[],r=[];for(i in e.h.clearKeys){var a=e.h.clearKeys[i],s=ht(i),a=ht(a),s={kty:"oct",kid:ot(s,!1),k:ot(a,!1)};n.push(s),r.push(s.kid)}return e=JSON.stringify({keys:n}),r=JSON.stringify({kids:r}),r=[{initData:new Uint8Array(it(r)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+t.btoa(e),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:r,keyIds:[]}}function wt(t,e,i,n){var r=[],a=[],s=[],o=[];Et(n,r,a,s,o),t.b={keySystem:e,licenseServerUri:r[0],distinctiveIdentifierRequired:"required"==i.distinctiveIdentifier,persistentStateRequired:"required"==i.persistentState,audioRobustness:i.audioCapabilities?i.audioCapabilities[0].robustness:"",videoRobustness:i.videoCapabilities?i.videoCapabilities[0].robustness:"",serverCertificate:a[0],initData:s,keyIds:o}}function Et(t,e,i,n,r){function a(t,e){return!(!t.keyId||t.keyId!=e.keyId)||t.initDataType==e.initDataType&&lt(t.initData,e.initData)}t.forEach(function(t){if(-1==e.indexOf(t.licenseServerUri)&&e.push(t.licenseServerUri),t.serverCertificate&&-1==O(i,t.serverCertificate,lt)&&i.push(t.serverCertificate),t.initData&&t.initData.forEach(function(t){-1==O(n,t,a)&&n.push(t)}),t.keyIds)for(var s=0;s<t.keyIds.length;++s)-1==r.indexOf(t.keyIds[s])&&r.push(t.keyIds[s])})}function St(t,e){try{var i=t.j.createSession("persistent-license")}catch(e){var n=new h(2,6,6005,e.message);return t.g(n),Promise.reject(n)}F(t.f,i,"message",t.uc.bind(t)),F(t.f,i,"keystatuseschange",t.oc.bind(t));var r={initData:null,fa:i,loaded:!1,Gb:1/0,na:null};return t.a.push(r),i.load(e).then(function(t){if(!this.c){if(t)return r.loaded=!0,this.a.every(function(t){return t.loaded})&&this.i.resolve(),i;this.a.splice(this.a.indexOf(r),1),this.g(new h(2,6,6013))}}.bind(t),function(t){this.c||(this.a.splice(this.a.indexOf(r),1),this.g(new h(2,6,6005,t.message)))}.bind(t))}function At(t,e,i){try{var n=t.ia?t.j.createSession("persistent-license"):t.j.createSession()}catch(e){return void t.g(new h(2,6,6005,e.message))}F(t.f,n,"message",t.uc.bind(t)),F(t.f,n,"keystatuseschange",t.oc.bind(t)),t.a.push({initData:i,fa:n,loaded:!1,Gb:1/0,na:null}),n.generateRequest(e,i.buffer).catch(function(t){if(!this.c){for(var e=0;e<this.a.length;++e)if(this.a[e].fa==n){this.a.splice(e,1);break}this.g(new h(2,6,6006,t.message))}}.bind(t))}function kt(t,e){for(var i,n=e.target,r=0;r<t.a.length;r++)if(t.a[r].fa==n){i=t.a[r];break}r=L([t.b.licenseServerUri],t.h.retryParameters),r.body=e.message,r.method="POST","com.microsoft.playready"!=t.b.keySystem&&"com.chromecast.playready"!=t.b.keySystem||It(r),t.s.Sa.request(2,r).then(function(t){return this.c?Promise.reject():n.update(t.data).then(function(){this.s.onEvent(new G("drmsessionupdate")),i&&(i.na&&i.na.resolve(),setTimeout(function(){i.loaded=!0,this.a.every(function(t){return t.loaded})&&this.i.resolve()}.bind(this),5e3))}.bind(this))}.bind(t),function(t){if(this.c)return Promise.resolve();t=new h(2,6,6007,t),this.g(t),i&&i.na&&i.na.reject(t)}.bind(t)).catch(function(t){if(this.c)return Promise.resolve();t=new h(2,6,6008,t.message),this.g(t),i&&i.na&&i.na.reject(t)}.bind(t))}function It(t){var e=tt(t.body,!0,!0);if(-1==e.indexOf("PlayReadyKeyMessage"))t.headers["Content-Type"]="text/xml; charset=utf-8";else{for(var e=(new DOMParser).parseFromString(e,"application/xml"),i=e.getElementsByTagName("HttpHeader"),n=0;n<i.length;++n)t.headers[i[n].querySelector("name").textContent]=i[n].querySelector("value").textContent;t.body=ut(e.querySelector("Challenge").textContent).buffer}}function Pt(){var t=[],e=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],i=[{videoCapabilities:e,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:e}],n={};return"org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").forEach(function(e){var r=navigator.requestMediaKeySystemAccess(e,i).then(function(t){var i=t.getConfiguration().sessionTypes,i=!!i&&0<=i.indexOf("persistent-license");return 0<=navigator.userAgent.indexOf("Tizen 3")&&(i=!1),n[e]={persistentState:i},t.createMediaKeys()}).catch(function(){n[e]=null});t.push(r)}),Promise.all(t).then(function(){return n})}function _t(t,e){var i=t.keySystem();return!e.drmInfos.length||e.drmInfos.some(function(t){return t.keySystem==i})}function xt(t,e){if(!t.length)return e;if(!e.length)return t;for(var i=[],n=0;n<t.length;n++)for(var r=0;r<e.length;r++)if(t[n].keySystem==e[r].keySystem){var a=t[n],r=e[r],s=[],s=s.concat(a.initData||[]),s=s.concat(r.initData||[]),o=[],o=o.concat(a.keyIds),o=o.concat(r.keyIds);i.push({keySystem:a.keySystem,licenseServerUri:a.licenseServerUri||r.licenseServerUri,distinctiveIdentifierRequired:a.distinctiveIdentifierRequired||r.distinctiveIdentifierRequired,persistentStateRequired:a.persistentStateRequired||r.persistentStateRequired,videoRobustness:a.videoRobustness||r.videoRobustness,audioRobustness:a.audioRobustness||r.audioRobustness,serverCertificate:a.serverCertificate||r.serverCertificate,initData:s,keyIds:o});break}return i}function Rt(t){return!t||1==t.length&&1e-6>t.end(0)-t.start(0)?null:t.length?t.end(t.length-1):null}function Nt(t,e){return!(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0))&&(e>=t.start(0)&&e<=t.end(t.length-1))}function Dt(t,e){if(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0))return 0;for(var i=0,n=t.length-1;0<=n&&t.end(n)>e;--n)i+=t.end(n)-Math.max(t.start(n),e);return i}function Lt(t){if(!t)return[];for(var e=[],i=0;i<t.length;i++)e.push({start:t.start(i),end:t.end(i)});return e}function Ct(t){this.f=null,this.c=t,this.h=this.i=0,this.g=1/0,this.b=this.a=null}function Mt(t,e){e.length?(o("The use of stateless text parsers is deprecated."),ao[t]=Ut.bind(null,e)):ao[t]=e}function Ot(t,e,i,n){return Promise.resolve().then(function(){if(this.f&&this.c)if(null==i||null==n)this.f.parseInit(e);else{var t=this.f.parseMedia(e,{periodStart:this.i,segmentStart:i,segmentEnd:n}).filter(function(t){return t.startTime>=this.h&&t.startTime<this.g}.bind(this));this.c.append(t),null==this.a&&(this.a=Math.max(i,this.h)),this.b=Math.min(n,this.g)}}.bind(t))}function Ut(t){this.Ta=t}function jt(t,e,i){this.g=t,this.f=e,this.j=i,this.b={},this.a=null,this.c={},this.h=new B,this.i=!1}function Bt(){var t={};return'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="av1",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",video/mp2t; codecs="mp4a.40.2",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(e){t[e]=!!ao[e]||MediaSource.isTypeSupported(e);var i=e.split(";")[0];t[i]=t[i]||t[e]}),t}function Ft(t,e){t.a||(t.a=new Ct(t.j)),t.a.f=new ao[e]}function Vt(t,e){if("text"==e)var i=t.a.a;else i=Ht(t,e),i=!i||1==i.length&&1e-6>i.end(0)-i.start(0)?null:1==i.length&&0>i.start(0)?0:i.length?i.start(0):null;return i}function Ht(t,e){try{return t.b[e].buffered}catch(t){return null}}function Kt(t,e,i,n,r){return"text"==e?Ot(t.a,i,n,r):Xt(t,e,t.Ae.bind(t,e,i))}function Gt(t,e){return"text"==e?t.a.remove(0,1/0):Xt(t,e,t.Ac.bind(t,e,0,t.f.duration))}function qt(t,e,i,n,r){return"text"==e?(t.a.i=i,t=t.a,t.h=n,t.g=r,Promise.resolve()):Promise.all([Xt(t,e,t.Pc.bind(t,e)),Xt(t,e,t.re.bind(t,e,i)),Xt(t,e,t.oe.bind(t,e,n,r))])}function Xt(t,e,i){if(t.i)return Promise.reject();if(i={start:i,p:new y},t.c[e].push(i),1==t.c[e].length)try{i.start()}catch(n){"QuotaExceededError"==n.name?i.p.reject(new h(2,3,3017,e)):i.p.reject(new h(2,3,3015,n)),zt(t,e)}return i.p}function Yt(t,e){if(t.i)return Promise.reject();var i,n=[];for(i in t.b){var r=new y,a={start:function(t){t.resolve()}.bind(null,r),p:r};t.c[i].push(a),n.push(r),1==t.c[i].length&&a.start()}return Promise.all(n).then(function(){var t;try{e()}catch(t){var i=Promise.reject(new h(2,3,3015,t))}for(t in this.b)zt(this,t);return i}.bind(t),function(){return Promise.reject()}.bind(t))}function zt(t,e){t.c[e].shift();var i=t.c[e][0];if(i)try{i.start()}catch(n){i.p.reject(new h(2,3,3015,n)),zt(t,e)}}function $t(t,e,i){return i==e||t>=so&&i==e.split("-")[0]||t>=oo&&i.split("-")[0]==e.split("-")[0]}function Wt(t){t=t.toLowerCase().split("-");var e=uo[t[0]];return e&&(t[0]=e),t.join("-")}function Jt(t,e,i){var n=t.video;return!(n&&(n.width<e.minWidth||n.width>e.maxWidth||n.width>i.width||n.height<e.minHeight||n.height>e.maxHeight||n.height>i.height||n.width*n.height<e.minPixels||n.width*n.height>e.maxPixels)||t.bandwidth<e.minBandwidth||t.bandwidth>e.maxBandwidth)}function Qt(t,e,i){var n=!1;return t.variants.forEach(function(t){var r=t.allowedByApplication;t.allowedByApplication=Jt(t,e,i),r!=t.allowedByApplication&&(n=!0)}),n}function Zt(t,e,i){var n=e.video,r=e.audio;for(e=0;e<i.variants.length;++e){var a=i.variants[e],s=t,o=r,u=n;(s&&s.L&&!_t(s,a)?0:te(a.audio,s,o)&&te(a.video,s,u))||(i.variants.splice(e,1),--e)}for(e=0;e<i.textStreams.length;++e)t=i.textStreams[e],ao[Q(t.mimeType,t.codecs)]||(i.textStreams.splice(e,1),--e)}function te(t,e,i){if(!t)return!0;var n=null;e&&e.L&&(n=e.w),e=Q(t.mimeType,t.codecs);var r,a=t.mimeType;for(r in ro){var s=t[r],o=ro[r];s&&(a+="; "+o+'="'+s+'"')}return!(!ao[Q(t.mimeType,t.codecs)]&&!MediaSource.isTypeSupported(a)||n&&t.encrypted&&0>n.indexOf(e)||i&&(t.mimeType!=i.mimeType||t.codecs.split(".")[0]!=i.codecs.split(".")[0]))}function ee(t,e,i){var n=null;return ae(t.variants).map(function(t){var r;r=t.video&&t.audio?i==t.video.id&&e==t.audio.id:t.video&&i==t.video.id||t.audio&&e==t.audio.id;var a="";t.video&&(a+=t.video.codecs),t.audio&&(""!=a&&(a+=", "),a+=t.audio.codecs,n=t.audio.label);var s=t.audio?t.audio.codecs:null,o=t.video?t.video.codecs:null,u=null;t.video?u=t.video.mimeType:t.audio&&(u=t.audio.mimeType);var h=null;t.audio?h=t.audio.kind:t.video&&(h=t.video.kind);var c=M((t.audio?t.audio.roles:[]).concat(t.video?t.video.roles:[]));return{id:t.id,active:r,type:"variant",bandwidth:t.bandwidth,language:t.language,label:n,kind:h||null,width:t.video?t.video.width:null,height:t.video?t.video.height:null,frameRate:t.video?t.video.frameRate:void 0,mimeType:u,codecs:a,audioCodec:s,videoCodec:o,primary:t.primary,roles:c,videoId:t.video?t.video.id:null,audioId:t.audio?t.audio.id:null,channelsCount:t.audio?t.audio.channelsCount:null,audioBandwidth:t.audio&&t.audio.bandwidth?t.audio.bandwidth:null,videoBandwidth:t.video&&t.video.bandwidth?t.video.bandwidth:null}})}function ie(t,e){return t.textStreams.map(function(t){return{id:t.id,active:e==t.id,type:"text",language:t.language,label:t.label,kind:t.kind,mimeType:t.mimeType,codecs:t.codecs||null,audioCodec:null,videoCodec:null,primary:t.primary,roles:t.roles,channelsCount:null,audioBandwidth:null,videoBandwidth:null}})}function ne(t,e){for(var i=0;i<t.variants.length;i++)if(t.variants[i].id==e.id)return t.variants[i];return null}function re(t,e){for(var i=0;i<t.textStreams.length;i++)if(t.textStreams[i].id==e.id)return t.textStreams[i];return null}function ae(t){return t.filter(function(t){return t.allowedByApplication&&t.allowedByKeySystem})}function se(t,e,i,n){var r=ae(t.variants),a=r.filter(function(t){return t.primary});a.length||(a=r);var s=a.length?a[0].language:"",a=a.filter(function(t){return t.language==s});if(e){var o=Wt(e);[oo,so,0].forEach(function(t){var e=!1;r.forEach(function(i){o=Wt(o);var r=Wt(i.language);$t(t,o,r)&&(e?a.push(i):(a=[i],e=!0),n&&(n.audio=!0))})})}return i&&(t=ue(a,i),t.length)?t:(t=a.map(function(t){return(t.audio?t.audio.roles:[]).concat(t.video?t.video.roles:[])}).reduce(_,[]),t.length?ue(a,t[0]):a)}function oe(t,e,i,n){var r=t.textStreams,a=r.filter(function(t){return t.primary});a.length||(a=r);var s=a.length?a[0].language:"",a=a.filter(function(t){return t.language==s});if(e){var o=Wt(e);[oo,so,0].forEach(function(t){var e=!1;r.forEach(function(i){var r=Wt(i.language);$t(t,o,r)&&(e?a.push(i):(a=[i],e=!0),n&&(n.text=!0))})})}return i&&(t=he(a,i),t.length)?t:(t=a.map(function(t){return t.roles}).reduce(_,[]),t.length?he(a,t[0]):a)}function ue(t,e){return t.filter(function(t){return t.audio&&0<=t.audio.roles.indexOf(e)||t.video&&0<=t.video.roles.indexOf(e)})}function he(t,e){return t.filter(function(t){return 0<=t.roles.indexOf(e)})}function ce(t,e,i){for(var n=0;n<i.length;n++)if(i[n].audio==t&&i[n].video==e)return i[n];return null}function le(t,e,i){function n(t,e){return null==t?null==e:e.id==t}for(var r=0;r<i.length;r++)if(n(t,i[r].audio)&&n(e,i[r].video))return i[r];return null}function fe(t,e){for(var i=t.periods.length-1;0<i;--i)if(e+no>=t.periods[i].startTime)return i;return 0}function de(t,e){for(var i=0;i<t.periods.length;++i){var n=t.periods[i];if("text"==e.type){for(var r=0;r<n.textStreams.length;++r)if(n.textStreams[r]==e)return i}else for(r=0;r<n.variants.length;++r){var a=n.variants[r];if(a.audio==e||a.video==e||a.video&&a.video.trickModeVideo==e)return i}}return-1}function pe(){this.h=null,this.c=!1,this.b=new s,this.g=[],this.i=!1,this.a=this.f=null}function me(t,e){return e.filter(function(e){return Jt(e,t,{width:1/0,height:1/0})}).sort(function(t,e){return t.bandwidth-e.bandwidth})}function ve(t){return JSON.stringify(t,function(t,e){if("manager"!=t&&"function"!=typeof e){if(e instanceof Event||e instanceof G){var i,n={};for(i in e){var r=e[i];r&&"object"==typeof r?"detail"==i&&(n[i]=r):i in Event||(n[i]=r)}return n}if(e instanceof TimeRanges)for(n={__type__:"TimeRanges",length:e.length,start:[],end:[]},i=0;i<e.length;++i)n.start.push(e.start(i)),n.end.push(e.end(i));else n="number"==typeof e?isNaN(e)?"NaN":isFinite(e)?e:0>e?"-Infinity":"Infinity":e;return n}})}function ge(t){return JSON.parse(t,function(t,e){return"NaN"==e?NaN:"-Infinity"==e?-1/0:"Infinity"==e?1/0:e&&"object"==typeof e&&"TimeRanges"==e.__type__?be(e):e})}function be(t){return{length:t.length,start:function(e){return t.start[e]},end:function(e){return t.end[e]}}}function ye(t,e,i,n,r,a){this.J=t,this.g=e,this.L=i,this.j=!1,this.C=n,this.D=r,this.w=a,this.b=this.h=!1,this.B="",this.i=null,this.l=this.mc.bind(this),this.m=this.Cd.bind(this),this.a={video:{},player:{}},this.s=0,this.c={},this.f=null}function Te(t){var e=Eo;e.removeUpdateListener(t.l),e.removeMessageListener("urn:x-cast:com.google.shaka.v2",t.m)}function we(t){for(var e in t.c){var i=t.c[e];delete t.c[e],i.reject(new h(1,7,7e3))}}function Ee(t){t=ve(t),Eo.sendMessage("urn:x-cast:com.google.shaka.v2",t,function(){},u)}function Se(){this.vb=new j,this.bb=this}function Ae(t,e,i){Se.call(this),this.c=t,this.b=e,this.i=this.g=this.f=this.j=this.h=null,this.a=new ye(i,this.ve.bind(this),this.we.bind(this),this.xe.bind(this),this.ye.bind(this),this.fc.bind(this)),ke(this)}function ke(t){t.a.init(),t.i=new B,ho.forEach(function(t){F(this.i,this.c,t,this.Me.bind(this))}.bind(t)),po.forEach(function(t){F(this.i,this.b,t,this.Yd.bind(this))}.bind(t)),t.h={};for(var e in t.c)Object.defineProperty(t.h,e,{configurable:!1,enumerable:!0,get:t.Le.bind(t,e),set:t.Ne.bind(t,e)});t.j={};for(e in t.b)Object.defineProperty(t.j,e,{configurable:!1,enumerable:!0,get:t.Xd.bind(t,e)});t.f=new Se,t.f.bb=t.h,t.g=new Se,t.g.bb=t.j}function Ie(t,e,i,n){Se.call(this),this.a=t,this.b=e,this.j={video:t,player:e},this.l=i||function(){},this.m=n||function(t){return t},this.i=!1,this.f=!0,this.h=this.g=this.c=null,Pe(this)}function Pe(e){var i=cast.receiver.CastReceiverManager.getInstance();i.onSenderConnected=e.tc.bind(e),i.onSenderDisconnected=e.tc.bind(e),i.onSystemVolumeChanged=e.Xc.bind(e),e.g=i.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.g.onMessage=e.xd.bind(e),e.c=i.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.c.onMessage=e.Ld.bind(e),i.start(),ho.forEach(function(t){this.a.addEventListener(t,this.wc.bind(this,"video"))}.bind(e)),po.forEach(function(t){this.b.addEventListener(t,this.wc.bind(this,"player"))}.bind(e)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.b.Sb(3840,2160):e.b.Sb(1920,1080),e.b.addEventListener("loading",function(){this.f=!1,_e(this)}.bind(e)),e.a.addEventListener("playing",function(){this.f=!1,_e(this)}.bind(e)),e.a.addEventListener("pause",function(){_e(this)}.bind(e)),e.b.addEventListener("unloading",function(){this.f=!0,_e(this)}.bind(e)),e.a.addEventListener("ended",function(){t.setTimeout(function(){this.a&&this.a.ended&&(this.f=!0,_e(this))}.bind(this),5e3)}.bind(e))}function _e(t){Promise.resolve().then(function(){this.dispatchEvent(new G("caststatuschanged")),Ne(this,0)}.bind(t))}function xe(t,e,i){for(var n in e.player)t.b[n](e.player[n]);t.l(i),i=Promise.resolve();var r=t.a.autoplay;e.manifest&&(t.a.autoplay=!1,i=t.b.load(e.manifest,e.startTime),i.catch(function(t){this.b.dispatchEvent(new G("error",{detail:t}))}.bind(t))),i.then(function(){var t;for(t in e.video){var i=e.video[t];this.a[t]=i}for(t in e.playerAfterLoad)i=e.playerAfterLoad[t],this.b[t](i);this.a.autoplay=r,e.manifest&&(this.a.play(),Ne(this,0))}.bind(t))}function Re(t,e,i,n){t.i&&(t=ve(e),n?i.getCastChannel(n).send(t):i.broadcast(t))}function Ne(t,e,i){var n=So,n={mediaSessionId:0,playbackRate:t.a.playbackRate,playerState:t.f?n.IDLE:t.b.Oa?n.Lc:t.a.paused?n.Mc:n.Nc,currentTime:t.a.currentTime,supportedMediaCommands:15,volume:{level:t.a.volume,muted:t.a.muted}};i&&(n.media=i),Re(t,{requestId:e,type:"MEDIA_STATUS",status:[n]},t.g)}function De(t,e){var i=Le(t,e);return 1!=i.length?null:i[0]}function Le(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return t.tagName==e})}function Ce(t){var e=t.firstChild;return e&&e.nodeType==Node.TEXT_NODE?t.textContent.trim():null}function Me(t,e,i,n){var r=null;return t=t.getAttribute(e),null!=t&&(r=i(t)),null==r?void 0!=n?n:null:r}function Oe(t){return t?(/^\d+\-\d+\-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),t=Date.parse(t),isNaN(t)?null:Math.floor(t/1e3)):null}function Ue(t){return t&&(t=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(t))?(t=31536e3*Number(t[1]||null)+2592e3*Number(t[2]||null)+86400*Number(t[3]||null)+3600*Number(t[4]||null)+60*Number(t[5]||null)+Number(t[6]||null),isFinite(t)?t:null):null}function je(t){var e=/([0-9]+)-([0-9]+)/.exec(t);return e?(t=Number(e[1]),isFinite(t)?(e=Number(e[2]),isFinite(e)?{start:t,end:e}:null):null):null}function Be(t){return t=Number(t),t%1?null:t}function Fe(t){return t=Number(t),!(t%1)&&0<t?t:null}function Ve(t){return t=Number(t),!(t%1)&&0<=t?t:null}function He(t){var e;return t=(e=t.match(/^(\d+)\/(\d+)$/))?Number(e[1]/e[2]):Number(t),isNaN(t)?null:t}function Ke(t,e,i){t=Xe(t);var n=null,r=[],a=[],s=t.map(function(t){return t.keyId}).filter(R);if(s.length&&1<s.filter(N).length)throw new h(2,4,4010);i||(a=t.filter(function(t){return"urn:mpeg:dash:mp4protection:2011"!=t.Dc||(n=t.init||n,!1)}),a.length&&(r=qe(n,e,a),r.length||(r=[X("",n)]))),!t.length||!i&&a.length||(r=z(Ao).map(function(t){return X(t,n)}));var o=s[0]||null;return o&&r.forEach(function(t){t.initData.forEach(function(t){t.keyId=o})}),{ac:o,Se:n,drmInfos:r,dc:!0}}function Ge(t,e,i,n){var r=Ke(t,e,n);if(i.dc)t=1==i.drmInfos.length&&!i.drmInfos[0].keySystem,e=!r.drmInfos.length,(!i.drmInfos.length||t&&!e)&&(i.drmInfos=r.drmInfos),i.dc=!1;else if(0<r.drmInfos.length&&(i.drmInfos=i.drmInfos.filter(function(t){return r.drmInfos.some(function(e){return e.keySystem==t.keySystem})}),!i.drmInfos.length))throw new h(2,4,4008);return r.ac||i.ac}function qe(t,e,i){return i.map(function(i){var n=Ao[i.Dc];return n?[X(n,i.init||t)]:e(i.node)||[]}).reduce(_,[])}function Xe(t){return t.map(function(t){var e=t.getAttribute("schemeIdUri"),i=t.getAttribute("cenc:default_KID"),n=Le(t,"cenc:pssh").map(Ce);if(!e)return null;if(e=e.toLowerCase(),i&&(i=i.replace(/-/g,"").toLowerCase(),0<=i.indexOf(" ")))throw new h(2,4,4009);var r=[];try{r=n.map(function(t){return{initDataType:"cenc",initData:ut(t),keyId:null}})}catch(t){throw new h(2,4,4007)}return{node:t,Dc:e,keyId:i,init:0<r.length?r:null}}).filter(R)}function Ye(e,i,n,r,a){null!=a&&(a=Math.round(a));var s={RepresentationID:i,Number:n,Bandwidth:r,Time:a};return e.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)d)?\$/g,function(e,i,n){if("$$"==e)return"$";var r=s[i];return null==r?e:("RepresentationID"==i&&n&&(n=void 0),e=r.toString(),n=t.parseInt(n,10)||1,Array(Math.max(0,n-e.length)+1).join("0")+e)})}function ze(t,e){var i=$e(t,e,"timescale"),n=1;i&&(n=Fe(i)||1),i=$e(t,e,"duration"),(i=Fe(i||""))&&(i/=n);var r=$e(t,e,"startNumber"),a=Number($e(t,e,"presentationTimeOffset"))||0,s=Ve(r||"");null!=r&&null!=s||(s=1);var o=We(t,e,"SegmentTimeline"),r=null;if(o){for(var r=n,u=t.S.duration||1/0,o=Le(o,"S"),h=[],c=0,l=0;l<o.length;++l){var f=o[l],d=Me(f,"t",Ve),p=Me(f,"d",Ve),f=Me(f,"r",Be);if(null!=d&&(d-=a),!p)break;if(d=null!=d?d:c,0>(f=f||0))if(l+1<o.length){if(null==(f=Me(o[l+1],"t",Ve)))break;if(d>=f)break;f=Math.ceil((f-d)/p)-1}else{if(1/0==u)break;if(d/r>=u)break;f=Math.ceil((u*r-d)/p)-1}0<h.length&&d!=c&&(h[h.length-1].end=d/r);for(var m=0;m<=f;++m)c=d+p,h.push({start:d/r,end:c/r,Je:d}),d=c}r=h}return{timescale:n,P:i,ya:s,Z:a/n||0,Xb:a,H:r}}function $e(t,e,i){return[e(t.A),e(t.V),e(t.Y)].filter(R).map(function(t){return t.getAttribute(i)}).reduce(function(t,e){return t||e})}function We(t,e,i){return[e(t.A),e(t.V),e(t.Y)].filter(R).map(function(t){return De(t,i)}).reduce(function(t,e){return t||e})}function Je(t,e){var i=new DOMParser;try{var n=Z(t),r=i.parseFromString(n,"text/xml")}catch(t){}if(r&&r.documentElement.tagName==e)var a=r.documentElement;return a&&0<a.getElementsByTagName("parsererror").length?null:a}function Qe(t,e,i,n,r,a){for(var s=t.getAttribute("xlink:href"),o=t.getAttribute("xlink:actuate")||"onRequest",u=0;u<t.attributes.length;u++){var c=t.attributes[u].nodeName;-1!=c.indexOf("xlink:")&&(t.removeAttribute(c),--u)}if(5<=a)return Promise.reject(new h(2,4,4028));if("onLoad"!=o)return Promise.reject(new h(2,4,4027));var l=q([n],[s]);return r.request(0,L(l,e)).then(function(n){if(!(n=Je(n.data,t.tagName)))return Promise.reject(new h(2,4,4001,s));for(;t.childNodes.length;)t.removeChild(t.childNodes[0]);for(;n.childNodes.length;){var o=n.childNodes[0];n.removeChild(o),t.appendChild(o)}for(o=0;o<n.attributes.length;o++){var u=n.attributes[o].nodeName,c=n.getAttribute(u);t.setAttribute(u,c)}return Ze(t,e,i,l[0],r,a+1)}.bind(t))}function Ze(t,e,i,n,r,a){if(a=a||0,t.getAttribute("xlink:href")){var s=Qe(t,e,i,n,r,a);return i&&(s=s.catch(function(){return Ze(t,e,i,n,r,a)})),s}for(s=0;s<t.childNodes.length;s++){var o=t.childNodes[s];o instanceof Element&&"urn:mpeg:dash:resolve-to-zero:2013"==o.getAttribute("xlink:href")&&(t.removeChild(o),--s)}for(var u=[],s=0;s<t.childNodes.length;s++)o=t.childNodes[s],o.nodeType==Node.ELEMENT_NODE&&(o=Ze(o,e,i,n,r,a),u.push(o));return Promise.all(u).then(function(){return t})}function ti(t,e,i){this.a=t,this.T=e,this.K=i}function ei(t,e,i,n,r,a){this.position=t,this.startTime=e,this.endTime=i,this.a=n,this.T=r,this.K=a}function ii(t,e){this.O=t,this.a=e==ko,this.v=0}function ni(){throw new h(2,3,3e3)}function ri(t,e,i){var n=new Uint8Array(i-e);return n.set(new Uint8Array(t.O.buffer,e,i-e)),n.buffer}function ai(){this.b=[],this.a=[]}function si(t){for(;t.u.da();)t.Ta.qb(t.start,t.u)}function oi(t){for(var e=t.u.F();0<e;--e)t.Ta.qb(t.start,t.u)}function ui(t){return function(e){t(e.u.Ja(e.u.O.byteLength-e.u.v))}}function hi(t){for(var e=0,i=0;i<t.length;i++)e=e<<8|t.charCodeAt(i);return e}function ci(t,e,i,n){var r,a=(new ai).ca("sidx",function(t){r=li(e,n,i,t)});if(t&&a.parse(t),r)return r;throw new h(2,3,3004)}function li(t,e,i,n){var r=[];n.u.I(4);var a=n.u.F();if(!a)throw new h(2,3,3005);if(n.version)var s=n.u.Va(),o=n.u.Va();else s=n.u.F(),o=n.u.F();n.u.I(2);var u=n.u.yc();for(t=t+n.size+o,o=0;o<u;o++){var c=n.u.F(),l=(2147483648&c)>>>31,c=2147483647&c,f=n.u.F();if(n.u.I(4),1==l)throw new h(2,3,3006);r.push(new ei(r.length,s/a-e,(s+f)/a-e,function(){return i},t,t+c-1)),s+=f,t+=c}return r}function fi(t){this.a=t}function di(t,e){for(var i;t.a.length&&(i=t.a[t.a.length-1],i.startTime>=e);)t.a.pop();for(;t.a.length&&(i=t.a[0],0>=i.endTime);)t.a.shift();t.a.length&&(i=t.a[0],i.startTime<no&&(t.a[0]=new ei(i.position,0,i.endTime,i.a,i.T,i.K)),i=t.a[t.a.length-1],t.a[t.a.length-1]=new ei(i.position,i.startTime,e,i.a,i.T,i.K))}function pi(t){this.b=t,this.a=new ii(t,0),Io||(Io=[new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])])}function mi(t){var e=vi(t);if(7<e.length)throw new h(2,3,3002);for(var i=0,n=0;n<e.length;n++)i=256*i+e[n];e=i,i=vi(t);t:{for(n=0;n<Io.length;n++)if(lt(i,Io[n])){n=!0;break t}n=!1}if(n)i=t.b.byteLength-t.a.v;else{if(8==i.length&&224&i[1])throw new h(2,3,3001);for(var n=i[0]&(1<<8-i.length)-1,r=1;r<i.length;r++)n=256*n+i[r];i=n}return i=t.a.v+i<=t.b.byteLength?i:t.b.byteLength-t.a.v,n=new DataView(t.b.buffer,t.b.byteOffset+t.a.v,i),t.a.I(i),new gi(e,n)}function vi(t){var e,i=t.a.Mb();for(e=1;8>=e&&!(i&1<<8-e);e++);if(8<e)throw new h(2,3,3002);var n=new Uint8Array(e);for(n[0]=i,i=1;i<e;i++)n[i]=t.a.Mb();return n}function gi(t,e){this.id=t,this.a=e}function bi(t){if(8<t.a.byteLength)throw new h(2,3,3002);if(8==t.a.byteLength&&224&t.a.getUint8(0))throw new h(2,3,3001);for(var e=0,i=0;i<t.a.byteLength;i++)var n=t.a.getUint8(i),e=256*e+n;return e}function yi(){}function Ti(t,e,i,n,r,a){function s(){return r}var o=[];t=new pi(t.a);for(var u=null,h=null;t.da();){var c=mi(t);if(187==c.id){var l=wi(c);l&&(c=i*l.Ke,l=e+l.ce,null!=u&&o.push(new ei(o.length,u-a,c-a,s,h,l-1)),u=c,h=l)}}return null!=u&&o.push(new ei(o.length,u-a,n-a,s,h,null)),o}function wi(t){var e=new pi(t.a);if(t=mi(e),179!=t.id)throw new h(2,3,3013);if(t=bi(t),e=mi(e),183!=e.id)throw new h(2,3,3012);for(var e=new pi(e.a),i=0;e.da();){var n=mi(e);if(241==n.id){i=bi(n);break}}return{Ke:t,ce:i}}function Ei(t,e){var i=We(t,e,"Initialization");if(!i)return null;var n=t.A.$,r=i.getAttribute("sourceURL");r&&(n=q(t.A.$,[r]));var r=0,a=null;return(i=Me(i,"range",je))&&(r=i.start,a=i.end),new ti(function(){return n},r,a)}function Si(t,e){var i=Number($e(t,ki,"presentationTimeOffset"))||0,n=$e(t,ki,"timescale"),r=1;n&&(r=Fe(n)||1);var i=i/r||0,n=Ei(t,ki),a=t.A.contentType,r=t.A.mimeType.split("/")[1];if("text"!=a&&"mp4"!=r&&"webm"!=r)throw new h(2,4,4006);if("webm"==r&&!n)throw new h(2,4,4005);var a=We(t,ki,"RepresentationIndex"),s=$e(t,ki,"indexRange"),o=t.A.$,s=je(s||"");if(a){var u=a.getAttribute("sourceURL");u&&(o=q(t.A.$,[u])),s=Me(a,"range",je,s)}if(!s)throw new h(2,4,4002);return r=Ai(t,e,n,o,s.start,s.end,r,i),{createSegmentIndex:r.createSegmentIndex,findSegmentPosition:r.findSegmentPosition,getSegmentReference:r.getSegmentReference,initSegmentReference:n,Z:i}}function Ai(t,e,i,n,r,a,s,o){var u=t.presentationTimeline,h=!t.Ca||!t.S.Ab,c=t.S.duration,l=e,f=null;return{createSegmentIndex:function(){var t=[l(n,r,a),"webm"==s?l(i.a(),i.T,i.K):null];return l=null,Promise.all(t).then(function(t){var e=t[0];t=t[1]||null,e="mp4"==s?ci(e,r,n,o):(new yi).parse(e,t,n,o),u.Ga(0,e),f=new fi(e),h&&di(f,c)})},findSegmentPosition:function(t){return f.find(t)},getSegmentReference:function(t){return f.get(t)}}}function ki(t){return t.Wa}function Ii(t,e){var i=Ei(t,Pi),n=xi(t),r=ze(t,Pi),a=r.ya;a||(a=1);var s=0;if(r.P?s=r.P*(a-1):r.H&&0<r.H.length&&(s=r.H[0].start),n={P:r.P,startTime:s,ya:a,Z:r.Z,H:r.H,Fa:n},!n.P&&!n.H&&1<n.Fa.length)throw new h(2,4,4002);if(!n.P&&!t.S.duration&&!n.H&&1==n.Fa.length)throw new h(2,4,4002);if(n.H&&!n.H.length)throw new h(2,4,4002);return a=r=null,t.Y.id&&t.A.id&&(a=t.Y.id+","+t.A.id,r=e[a]),s=_i(t.S.duration,n.ya,t.A.$,n),r?(r.ob(s),r.xb(t.presentationTimeline.ka()-t.S.start)):(t.presentationTimeline.Ga(0,s),r=new fi(s),a&&t.Ca&&(e[a]=r)),t.Ca&&t.S.Ab||di(r,t.S.duration),{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:r.find.bind(r),getSegmentReference:r.get.bind(r),initSegmentReference:i,Z:n.Z}}function Pi(t){return t.pa}function _i(t,e,i,n){var r=n.Fa.length;n.H&&n.H.length!=n.Fa.length&&(r=Math.min(n.H.length,n.Fa.length));for(var a=[],s=n.startTime,o=0;o<r;o++){var u=n.Fa[o],h=q(i,[u.sd]),c=null!=n.P?s+n.P:n.H?n.H[o].end:s+t;a.push(new ei(o+e,s,c,function(t){return t}.bind(null,h),u.start,u.end)),s=c}return a}function xi(t){return[t.A.pa,t.V.pa,t.Y.pa].filter(R).map(function(t){return Le(t,"SegmentURL")}).reduce(function(t,e){return 0<t.length?t:e}).map(function(e){e.getAttribute("indexRange")&&!t.ic&&(t.ic=!0);var i=e.getAttribute("media");return e=Me(e,"mediaRange",je,{start:0,end:null}),{sd:i,start:e.start,end:e.end}})}function Ri(t,e,i,n){var r=Ci(t),a=ze(t,Ni),s=$e(t,Ni,"media"),o=$e(t,Ni,"index");if(a={P:a.P,timescale:a.timescale,ya:a.ya,Z:a.Z,Xb:a.Xb,H:a.H,Db:s,Ra:o},s=0+(a.Ra?1:0),s+=a.H?1:0,!(s+=a.P?1:0))throw new h(2,4,4002);if(1!=s&&(a.Ra&&(a.H=null),a.P=null),!a.Ra&&!a.Db)throw new h(2,4,4002);if(a.Ra){if("mp4"!=(i=t.A.mimeType.split("/")[1])&&"webm"!=i)throw new h(2,4,4006);if("webm"==i&&!r)throw new h(2,4,4005);n=Ye(a.Ra,t.A.id,null,t.bandwidth||null,null),n=q(t.A.$,[n]),t=Ai(t,e,r,n,0,null,i,a.Z)}else a.P?(n||t.presentationTimeline.Eb(a.P),t=Di(t,a)):(n=e=null,t.Y.id&&t.A.id&&(n=t.Y.id+","+t.A.id,e=i[n]),s=Li(t,a),e?(e.ob(s),e.xb(t.presentationTimeline.ka()-t.S.start)):(t.presentationTimeline.Ga(0,s),e=new fi(s),n&&t.Ca&&(i[n]=e)),t.Ca&&t.S.Ab||di(e,t.S.duration),t={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e)});return{createSegmentIndex:t.createSegmentIndex,findSegmentPosition:t.findSegmentPosition,getSegmentReference:t.getSegmentReference,initSegmentReference:r,Z:a.Z}}function Ni(t){return t.Xa}function Di(t,e){var i=t.S.duration,n=e.P,r=e.ya,a=e.timescale,s=e.Db,o=t.bandwidth||null,u=t.A.id,h=t.A.$;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(t){return 0>t||i&&t>=i?null:Math.floor(t/n)},getSegmentReference:function(t){var e=t*n;return 0>e||i&&e>=i?null:new ei(t,e,e+n,function(){var i=Ye(s,u,t+r,o,e*a);return q(h,[i])},0,null)}}}function Li(t,e){for(var i=[],n=0;n<e.H.length;n++){var r=n+e.ya;i.push(new ei(r,e.H[n].start,e.H[n].end,function(t,e,i,n,r,a){return t=Ye(t,e,r,i,a),q(n,[t]).map(function(t){return t.toString()})}.bind(null,e.Db,t.A.id,t.bandwidth||null,t.A.$,r,e.H[n].Je+e.Xb),0,null))}return i}function Ci(t){var e=$e(t,Ni,"initialization");if(!e)return null;var i=t.A.id,n=t.bandwidth||null,r=t.A.$;return new ti(function(){var t=Ye(e,i,null,n,null);return q(r,[t])},0,null)}function Mi(){var t,e={};for(t in Po)e[t]=!0;for(t in _o)e[t]=!0;return["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"].forEach(function(t){e[t]=!!Po[t]}),["mpd","m3u8","ism"].forEach(function(t){e[t]=!!_o[t]}),e}function Oi(t,e,i,n){var r=n;return r||(n=new c(t).ba.split("/").pop().split("."),1<n.length&&(n=n.pop().toLowerCase(),r=_o[n])),r?Promise.resolve(r):(i=L([t],i),i.method="HEAD",e.request(0,i).then(function(e){return(e=e.headers["content-type"])&&(e=e.toLowerCase()),(r=Po[e])?r:Promise.reject(new h(2,4,4e3,t))},function(t){return t.severity=2,Promise.reject(t)}))}function Ui(t,e){this.c=t,this.j=e,this.f=this.a=1/0,this.b=1,this.i=0,this.h=!0,this.g=0}function ji(){this.a=this.b=null,this.g=[],this.c=null,this.i=[],this.h=1,this.j={},this.l=0,this.f=null}function Bi(t){return t.a.networkingEngine.request(0,L(t.g,t.b.retryParameters),function(){return!this.a}.bind(t)).then(function(t){if(this.a)return Fi(this,t.data,t.uri)}.bind(t))}function Fi(t,e,i){if(!(e=Je(e,"MPD")))throw new h(2,4,4001,i);return Ze(e,t.b.retryParameters,t.b.dash.xlinkFailGracefully,i,t.a.networkingEngine).then(function(t){return Vi(this,t,i)}.bind(t))}function Vi(t,e,i){i=[i];var n=Le(e,"Location").map(Ce).filter(R);0<n.length&&(i=t.g=n),n=Le(e,"BaseURL").map(Ce),i=q(i,n);var r=Me(e,"minBufferTime",Ue);t.l=Me(e,"minimumUpdatePeriod",Ue,-1);var a=Me(e,"availabilityStartTime",Oe),n=Me(e,"timeShiftBufferDepth",Ue),s=Me(e,"suggestedPresentationDelay",Ue),o=Me(e,"maxSegmentDuration",Ue),u=e.getAttribute("type")||"static";if(t.c)var h=t.c.presentationTimeline;else{var c=Math.max(10,1.5*r);h=new Ui(a,null!=s?s:c)}var a=Hi(t,{Ca:"static"!=u,presentationTimeline:h,Y:null,S:null,V:null,A:null,bandwidth:0,ic:!1},i,e),s=a.duration,l=a.periods;return h.rb("static"==u),"static"!=u&&a.bc||h.ga(s||1/0),h.Ic(null!=n?n:1/0),h.Eb(o||1),t.c?Promise.resolve():(e=Le(e,"UTCTiming"),Ji(t,i,e,h.R()).then(function(t){this.a&&(h.Gc(t),this.c={presentationTimeline:h,periods:l,offlineSessionIds:[],minBufferTime:r||0})}.bind(t)))}function Hi(t,e,i,n){var r=Me(n,"mediaPresentationDuration",Ue),a=[],s=0;n=Le(n,"Period");for(var o=0;o<n.length;o++){var u=n[o],s=Me(u,"start",Ue,s),h=Me(u,"duration",Ue),c=null;if(o!=n.length-1){var l=Me(n[o+1],"start",Ue);null!=l&&(c=l-s)}else null!=r&&(c=r-s);if(null==c&&(c=h),u=Ki(t,e,i,{start:s,duration:c,node:u,Ab:null==c||o==n.length-1}),a.push(u),h=e.Y.id,-1==t.i.indexOf(h)&&(t.i.push(h),t.c&&(t.a.filterNewPeriod(u),t.c.periods.push(u))),null==c){s=null;break}s+=c}return t.c||t.a.filterAllPeriods(a),null!=r?{periods:a,duration:r,bc:!1}:{periods:a,duration:s,bc:!0}}function Ki(t,e,i,n){e.Y=Yi(n.node,null,i),e.S=n,e.Y.id||(e.Y.id="__shaka_period_"+n.start),Le(n.node,"EventStream").forEach(t.Vd.bind(t,n.start,n.duration)),i=Le(n.node,"AdaptationSet").map(t.Td.bind(t,e)).filter(R);var r=i.map(function(t){return t.ee}).reduce(_,[]),a=r.filter(N);if(e.Ca&&r.length!=a.length)throw new h(2,4,4018);var s=i.filter(function(t){return!t.Wb});if(i.filter(function(t){return t.Wb}).forEach(function(t){var e=t.streams[0],i=t.Wb;s.forEach(function(t){t.id==i&&t.streams.forEach(function(t){t.trickModeVideo=e})})}),r=Gi(s,"video"),a=Gi(s,"audio"),!r.length&&!a.length)throw new h(2,4,4004);for(a.length||(a=[null]),r.length||(r=[null]),e=[],i=0;i<a.length;i++)for(var o=0;o<r.length;o++)qi(t,a[i],r[o],e);for(t=Gi(s,"text"),r=[],i=0;i<t.length;i++)r.push.apply(r,t[i].streams);return{startTime:n.start,textStreams:r,variants:e}}function Gi(t,e){return t.filter(function(t){return t.contentType==e})}function qi(t,e,i,n){if(e||i)if(e&&i){var r=e.drmInfos,a=i.drmInfos;if(r.length&&a.length?0<xt(r,a).length:1)for(var s=xt(e.drmInfos,i.drmInfos),r=0;r<e.streams.length;r++)for(var o=0;o<i.streams.length;o++)a=(i.streams[o].bandwidth||0)+(e.streams[r].bandwidth||0),a={id:t.h++,language:e.language,primary:e.Cb||i.Cb,audio:e.streams[r],video:i.streams[o],bandwidth:a,drmInfos:s,allowedByApplication:!0,allowedByKeySystem:!0},n.push(a)}else for(s=e||i,r=0;r<s.streams.length;r++)a=s.streams[r].bandwidth||0,a={id:t.h++,language:s.language||"und",primary:s.Cb,audio:e?s.streams[r]:null,video:i?s.streams[r]:null,bandwidth:a,drmInfos:s.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},n.push(a)}function Xi(e,i){0>e.l||(e.f=t.setTimeout(e.ze.bind(e),1e3*Math.max(Math.max(3,e.l)-i,0)))}function Yi(t,e,i){e=e||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0,Fb:null},i=i||e.$;var n=Le(t,"BaseURL").map(Ce),r=t.getAttribute("contentType")||e.contentType,a=t.getAttribute("mimeType")||e.mimeType,s=t.getAttribute("codecs")||e.codecs,o=Me(t,"frameRate",He)||e.frameRate,u=!!Le(t,"InbandEventStream").length,h=Le(t,"AudioChannelConfiguration"),h=zi(h)||e.Fb;return r||(r=Qi(a,s)),{$:q(i,n),Wa:De(t,"SegmentBase")||e.Wa,pa:De(t,"SegmentList")||e.pa,Xa:De(t,"SegmentTemplate")||e.Xa,width:Me(t,"width",Ve)||e.width,height:Me(t,"height",Ve)||e.height,contentType:r,mimeType:a,codecs:s,frameRate:o,containsEmsgBoxes:u||e.containsEmsgBoxes,id:t.getAttribute("id"),Fb:h}}function zi(t){for(var e=0;e<t.length;++e){var i=t[e],n=i.getAttribute("schemeIdUri");if(n&&(i=i.getAttribute("value")))switch(n){case"urn:mpeg:dash:outputChannelPositionList:2012":return i.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(!(n=parseInt(i,10)))continue;return n;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(n=parseInt(i,16)){for(t=0;n;)1&n&&++t,n>>=1;return t}}}return null}function $i(t){var e=0+(t.Wa?1:0);return e+=t.pa?1:0,(e+=t.Xa?1:0)?(1!=e&&(t.Wa&&(t.pa=null),t.Xa=null),!0):"text"==t.contentType||"application"==t.contentType}function Wi(t,e,i,n){return e=q(e,[i]),e=L(e,t.b.retryParameters),e.method=n,t.a.networkingEngine.request(0,e).then(function(t){if("HEAD"==n){if(!t.headers||!t.headers.date)return 0;t=t.headers.date}else t=Z(t.data);return t=Date.parse(t),isNaN(t)?0:t-Date.now()})}function Ji(t,e,i,n){i=i.map(function(t){return{scheme:t.getAttribute("schemeIdUri"),value:t.getAttribute("value")}});var r=t.b.dash.clockSyncUri;return n&&!i.length&&r&&i.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),P(i,function(t){var i=t.value;switch(t.scheme){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return Wi(this,e,i,"HEAD");case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":return Wi(this,e,i,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return t=Date.parse(i),isNaN(t)?0:t-Date.now();case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:return Promise.reject()}}.bind(t)).catch(function(){return 0})}function Qi(t,e){return ao[Q(t,e)]?"text":t.split("/")[0]}function Zi(t,e,i,n){this.uri=t,this.type=e,this.U=i,this.segments=n||null}function tn(t,e,i,n){this.id=t,this.name=e,this.a=i,this.value=n||null}function en(t,e){this.name=t,this.value=e}function nn(t,e,i){return i=i||null,(t=t.getAttribute(e))?t.value:i}function rn(t,e){this.U=e,this.uri=t}function an(t,e){return t.filter(function(t){return t.name==e})}function sn(t,e){var i=an(t,e);return i.length?i[0]:null}function on(t,e,i){return t.filter(function(t){var n=t.getAttribute("TYPE");return t=t.getAttribute("GROUP-ID"),n.value==e&&t.value==i})}function un(t){this.b=t,this.a=0}function hn(t,e){e.lastIndex=t.a;var i=(i=e.exec(t.b))?{position:i.index,length:i[0].length,he:i}:null;return t.a!=t.b.length&&i&&i.position==t.a?(t.a+=i.length,i.he):null}function cn(t){return t.a==t.b.length?null:(t=hn(t,/[^ \t\n]*/gm))?t[0]:null}function ln(){this.a=0}function fn(t,e,i){e=Z(e),e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var n=e.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(n[0]))throw new h(2,4,4015);e=0;for(var r=[],a=1;a<n.length;)if(/^#(?!EXT)/m.test(n[a]))a+=1;else{var s=n[a];if(s=pn(t.a++,s),0<=xo.indexOf(s.name))e=1;else if(0<=Ro.indexOf(s.name)){if(1!=e)throw new h(2,4,4017);return n=n.splice(a,n.length-a),t=dn(t,n,r),new Zi(i,e,r,t)}r.push(s),a+=1,"EXT-X-STREAM-INF"==s.name&&(s.a.push(new en("URI",n[a])),a+=1)}return new Zi(i,e,r)}function dn(t,e,i){var n=[],r=[];return e.forEach(function(t){/^(#EXT)/.test(t)?(t=pn(this.a++,t),0<=xo.indexOf(t.name)?i.push(t):r.push(t)):/^#(?!EXT)/m.test(t)||(n.push(new rn(t.trim(),r)),r=[])}.bind(t)),n}function pn(t,e){var i=e.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!i)throw new h(2,4,4016);var n=i[1],r=i[2],i=[];if(r&&0<=r.indexOf("="))for(var a,r=new un(r),s=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;a=hn(r,s);)i.push(new en(a[1],a[2]||a[3]));else if(r)return new tn(t,n,i,r);return new tn(t,n,i)}function mn(t){return new Promise(function(e){var i=mn.parse(t);e({uri:t,data:i.data,headers:{"content-type":i.contentType}})})}function vn(){this.h=this.b=null,this.D=1,this.g={},this.C={},this.j={},this.s={},this.a=null,this.m="",this.w=new ln,this.i=this.c=null,this.f=!1,this.B=null,this.l=0}function gn(t,e,i){Bn(t,i).then(function(t){if(t=fn(this.w,t.data,t.uri),1!=t.type)throw new h(2,4,4017);for(var i=sn(t.U,"EXT-X-MEDIA-SEQUENCE"),i=Nn(this,t,i?Number(i.value):0),n=e.Bb,r=[],a=n.endTime,s=0;s<i.length;s++){var o=i[s];if(o.position>n.position){var u=o.endTime-o.startTime,c=a,l=a+u,a=a+u;r.push(new ei(o.position,c,l,o.a,o.T,o.K))}}i=r,e.je.ob(i),i.length&&(e.Bb=i[i.length-1]),sn(t.U,"EXT-X-ENDLIST")&&(t=e.Bb.endTime,Vn(this,!1),this.a.ga(t))}.bind(t))}function bn(t,e,i){if(e=fn(t.w,e,i),0!=e.type)throw new h(2,4,4022);return yn(t,e).then(function(t){this.b.filterAllPeriods([t]),this.f&&this.a.Hc(3*this.l),this.B={presentationTimeline:this.a,periods:[t],offlineSessionIds:[],minBufferTime:0}}.bind(t))}function yn(t,e){var i=e.U,n=an(e.U,"EXT-X-MEDIA").filter(function(t){return"SUBTITLES"==Un(t,"TYPE")}.bind(t)).map(function(t){return Sn(this,t,e)}.bind(t));return Promise.all(n).then(function(t){var n=an(i,"EXT-X-STREAM-INF").map(function(t){return Tn(this,t,e)}.bind(this));return Promise.all(n).then(function(e){return e=e.reduce(_,[]),this.f||Dn(this,e),{startTime:0,variants:e,textStreams:t}}.bind(this))}.bind(t))}function Tn(t,e,i){var n=nn(e,"CODECS","avc1.42E01E,mp4a.40.2").split(","),r=e.getAttribute("RESOLUTION"),a=null,s=null,o=nn(e,"FRAME-RATE"),u=Number(Un(e,"BANDWIDTH"));if(r)var h=r.value.split("x"),a=h[0],s=h[1];var c=On(t,i);i=an(i.U,"EXT-X-MEDIA");var l=nn(e,"AUDIO"),f=nn(e,"VIDEO");if(l?i=on(i,"AUDIO",l):f&&(i=on(i,"VIDEO",f)),h=Ln("text",n)){var d=nn(e,"SUBTITLES");d&&(d=on(i,"SUBTITLES",d),d.length&&(t.g[d[0].id].stream.codecs=h)),n.splice(n.indexOf(h),1)}i=i.map(function(t){return An(this,t,n,c)}.bind(t));var p=[],m=[];return Promise.all(i).then(function(t){if(l?p=t:f&&(m=t),p.length||m.length)if(p.length)if(Un(e,"URI")==p[0].Pb){t="audio";var i=!0}else t="video";else t="audio";else i=!1,1==n.length?(t=Ln("video",n),t=r||o||t?"video":"audio"):(t="video",n=[n.join(",")]);return i?Promise.resolve():In(this,e,n,t,c)}.bind(t)).then(function(t){return t&&("audio"==t.stream.type?p=[t]:m=[t]),wn(this,p,m,u,a,s,o)}.bind(t))}function wn(t,e,i,n,r,a,s){i.forEach(function(t){(t=t.stream)&&(t.width=Number(r)||void 0,t.height=Number(a)||void 0,t.frameRate=Number(s)||void 0)}.bind(t)),e.length||(e=[null]),i.length||(i=[null]);for(var o=[],u=0;u<e.length;u++)for(var h=0;h<i.length;h++){var c=e[u]?e[u].stream:null,l=i[h]?i[h].stream:null,f=e[u]?e[u].drmInfos:null,d=i[h]?i[h].drmInfos:null;if(c&&l){if(!(f.length&&d.length?0<xt(f,d).length:1))continue;var p=xt(f,d)}else c?p=f:l&&(p=d);f=(i[u]?i[u].Pb:"")+" - "+(e[u]?e[u].Pb:""),t.C[f]||(c=En(t,c,l,n,p),o.push(c),t.C[f]=c)}return o}function En(t,e,i,n,r){return{id:t.D++,language:e?e.language:"und",primary:!!e&&e.primary||!!i&&i.primary,audio:e,video:i,bandwidth:n,drmInfos:r,allowedByApplication:!0,allowedByKeySystem:!0}}function Sn(t,e,i){return Un(e,"TYPE"),i=On(t,i),An(t,e,[],i).then(function(t){return t.stream})}function An(t,e,i,n){if(t.g[e.id])return Promise.resolve().then(function(){return this.g[e.id]}.bind(t));var r=Un(e,"TYPE").toLowerCase();"subtitles"==r&&(r="text");var a=Wt(nn(e,"LANGUAGE","und")),s=nn(e,"NAME"),o=e.getAttribute("DEFAULT"),u=e.getAttribute("AUTOSELECT"),h=nn(e,"CHANNELS"),h="audio"==r?kn(h):null,c=Un(e,"URI"),c=q([t.m],[c])[0];return Pn(t,c,i,r,n,a,!!o||!!u,s,h).then(function(t){return this.g[e.id]=t,this.s[c]=t}.bind(t))}function kn(t){return t?(t=t.split("/")[0],parseInt(t,10)):null}function In(t,e,i,n,r){var a=Un(e,"URI"),a=q([t.m],[a])[0];return Pn(t,a,i,n,r,"und",!1,null,null).then(function(t){return this.s[a]=t}.bind(t))}function Pn(t,e,i,n,r,a,s,o,u){var c=e;return e=q([t.m],[e])[0],Bn(t,e).then(function(t){if(t=fn(this.w,t.data,t.uri),1!=t.type)throw new h(2,4,4017);var e=sn(t.U,"EXT-X-MEDIA-SEQUENCE"),l=Nn(this,t,e?Number(e.value):0),f=new fi(l);_n(this,t),this.a||xn(this,l[l.length-1].endTime),r=On(this,t)||r;var d=null;if("text"!=n&&(d=Rn(t)),this.a.Ga(0,l),!this.f){var e=l[l.length-1].endTime-l[0].startTime,p=this.a.W();(1/0==p||p<e)&&this.a.ga(e)}var m=Cn(n,i),v=void 0;"text"==n&&(v="subtitle");var g=[];t.segments.forEach(function(t){t=an(t.U,"EXT-X-KEY"),g.push.apply(g,t)});var b=!1,y=[],T=null;if(g.forEach(function(t){if("NONE"!=Un(t,"METHOD")){b=!0;var e=Un(t,"KEYFORMAT");(t=(e=Lo[e])?e(t):null)&&(t.keyIds.length&&(T=t.keyIds[0]),y.push(t))}}),b&&!y.length)throw new h(2,4,4026);return Mn(this,n,m,l[0].a()[0]).then(function(t){return t={id:this.D++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:f.find.bind(f),getSegmentReference:f.get.bind(f),initSegmentReference:d,presentationTimeOffset:r||0,mimeType:t,codecs:m,kind:v,encrypted:b,keyId:T,language:a,label:o||null,type:n,primary:s,trickModeVideo:null,containsEmsgBoxes:!1,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:u},this.j[t.id]=f,{stream:t,je:f,drmInfos:y,Pb:c,Bb:l[l.length-1]}}.bind(this))}.bind(t))}function _n(t,e){var i=sn(e.U,"EXT-X-PLAYLIST-TYPE");if(sn(e.U,"EXT-X-ENDLIST")||i&&"VOD"==i.value)Vn(t,!1);else{if(!i)throw new h(2,4,4029);i=jn(e.U,"EXT-X-TARGETDURATION"),i=Number(i.value),t.c?t.c>i&&(t.c=i):(Vn(t,!0),t.c=i),t.l=Math.max(i,t.l)}}function xn(t,e){var i=null,n=0;t.f&&(i=Date.now()/1e3-e,n=3*t.l),t.a=new Ui(i,n),t.a.rb(!t.f)}function Rn(t){var e=an(t.U,"EXT-X-MAP");if(!e.length)return null;if(1<e.length)throw new h(2,4,4020);var e=e[0],i=Un(e,"URI"),n=q([t.uri],[i])[0];return t=0,i=null,(e=nn(e,"BYTERANGE"))&&(t=e.split("@"),e=Number(t[0]),t=Number(t[1]),i=t+e-1),new ti(function(){return[n]},t,i)}function Nn(t,e,i){var n=e.segments,r=[];return n.forEach(function(t){var a,s=t.U,o=q([e.uri],[t.uri])[0],u=jn(s,"EXTINF").value.split(","),u=Number(u[0]);a=(t=n.indexOf(t))?r[t-1].endTime:0;var u=a+u,h=0,c=null;(s=sn(s,"EXT-X-BYTERANGE"))&&(s=s.value.split("@"),c=Number(s[0]),h=s[1]?Number(s[1]):r[t-1].K+1,c=h+c-1,t==n.length-1&&(c=null)),r.push(new ei(i+t,a,u,function(){return[o]},h,c))}.bind(t)),r}function Dn(t,e){e.forEach(function(t){var e=this.a.W(),i=t.video;t=t.audio,i&&this.j[i.id]&&di(this.j[i.id],e),t&&this.j[t.id]&&di(this.j[t.id],e)}.bind(t))}function Ln(t,e){for(var i=No[t],n=0;n<i.length;n++)for(var r=0;r<e.length;r++)if(i[n].test(e[r].trim()))return e[r].trim();return"text"==t?"":null}function Cn(t,e){if(1==e.length)return e[0];var i=Ln(t,e);if(null!=i)return i;throw new h(2,4,4025,e)}function Mn(t,e,i,n){var r=n.split("."),a=r[r.length-1];return(r=Do[e][a])?Promise.resolve(r):"text"==e?i&&"vtt"!=i?Promise.resolve("application/mp4"):Promise.resolve("text/vtt"):(e=L([n],t.h.retryParameters),e.method="HEAD",t.b.networkingEngine.request(1,e).then(function(t){if(!(t=t.headers["content-type"]))throw new h(2,4,4021,a);return t.split(";")[0]}))}function On(t,e){var i=sn(e.U,"EXT-X-START");return i?Number(Un(i,"TIME-OFFSET")):t.h.hls.defaultTimeOffset}function Un(t,e){var i=t.getAttribute(e);if(!i)throw new h(2,4,4023,e);return i.value}function jn(t,e){var i=sn(t,e);if(!i)throw new h(2,4,4024,e);return i}function Bn(t,e){return t.b.networkingEngine.request(0,L([e],t.h.retryParameters),function(){return!this.b}.bind(t))}function Fn(e,i){null!=e.c&&null!=i&&(e.i=t.setTimeout(e.J.bind(e),1e3*i))}function Vn(e,i){e.f=i,e.a&&e.a.rb(!i),i||null==e.i||(t.clearTimeout(e.i),e.i=null,e.c=null)}function Hn(t,e,i,n,r,a){this.a=t,this.c=e,this.l=i,this.m=null==n?null:Gn(this,n),this.L=r,this.J=a,this.b=new B,this.j=!1,this.i=1,this.h=this.f=null,this.g=new rt(this.ud.bind(this)),this.D=t.readyState,this.s=!1,this.C=this.X=-1,this.w=this.B=!1,0<t.readyState?this.pc():(V(this.b,t,"loadedmetadata",this.pc.bind(this)),F(this.b,t,"timeupdate",function(){at(this.g,.1)}.bind(this))),e=this.rc.bind(this),F(this.b,t,"ratechange",this.Hd.bind(this)),F(this.b,t,"waiting",e),this.h=new rt(e),st(this.h,.25)}function Kn(t,e){0<t.a.readyState?t.a.currentTime=Wn(t,e):t.m=e}function Gn(t,e){var i=t.c.presentationTimeline.W();return e>=i?i-t.l.durationBackoff:e}function qn(t){return 0<t.a.readyState?t.a.paused?t.a.currentTime:Wn(t,t.a.currentTime):Xn(t)}function Xn(t){if(null!=t.m)return Wn(t,t.m);var e=t.c.presentationTimeline;return e=1/0>e.W()?e.ka():e.nb(),t.m=Gn(t,e),e}function Yn(t,e){t.f&&(t.f.cancel(),t.f=null),t.i=e,t.a.playbackRate=t.j||0>e?0:e,!t.j&&0>e&&(t.f=new rt(function(){this.a.currentTime+=e/4}.bind(t)),st(t.f,.25))}function zn(t,e){var i=Nt.bind(null,t.a.buffered),n=1*Math.max(t.c.minBufferTime||0,t.l.rebufferingGoal),r=t.c.presentationTimeline,a=r.ua(),s=r.Da(n),o=r.Da(5),n=r.Da(n+5);return e>=r.W()?Gn(t,e):e>a?a:e<r.Da(0)?i(o)?o:n:e>=s||i(e)?e:n}function $n(t,e,i){t.a.currentTime=i;var n=0,r=function(){!this.a||10<=n++||this.a.currentTime!=e||(this.a.currentTime=i,setTimeout(r,100))}.bind(t);setTimeout(r,100)}function Wn(t,e){var i=t.c.presentationTimeline.ka();return e<i?i:(i=t.c.presentationTimeline.ua(),e>i?i:e)}function Jn(t,e,i,n,r,a,s){this.a=t,this.B=e,this.g=i,this.w=n,this.l=r,this.h=a,this.C=s,this.c=[],this.j=new B,this.b=!1,this.i=-1,this.f=null,Zn(this)}function Qn(t){var e=I(t);return e.eventElement=t.eventElement,e}function Zn(e){tr(e),e.f=t.setTimeout(e.D.bind(e),250)}function tr(e){e.f&&(t.clearTimeout(e.f),e.f=null)}function er(t,e){this.a=e,this.b=t,this.h=null,this.i=1,this.m=Promise.resolve(),this.g=[],this.j={},this.c={},this.s=!1,this.w=null,this.f=this.l=!1}function ir(t){var e=qn(t.a.Ua);return t.b.periods[fe(t.b,e)]}function nr(t){var e=t.c.video||t.c.audio;return e?t.b.periods[e.wa]:null}function rr(t){return $(t.c,function(t){return t.oa||t.stream})}function ar(t,e){var i=t.c.video;if(i){var n=i.stream;if(n)if(e){var r=n.trickModeVideo;if(r){var a=i.oa;a||(or(t,r,!1),i.oa=n)}}else(a=i.oa)&&(i.oa=null,or(t,a,!0))}}function sr(t,e,i){e.video&&or(t,e.video,i),e.audio&&or(t,e.audio,i)}function or(t,e,i){var n=t.c[e.type];if(!n&&"text"==e.type&&t.h.ignoreTextStreamFailures)cr(t,{text:e});else if(n){var r=de(t.b,e);i&&r!=n.wa?hr(t):(n.oa&&(e.trickModeVideo?(n.oa=e,e=e.trickModeVideo):n.oa=null),(r=t.g[r])&&r.Ka&&(r=t.j[e.id])&&r.Ka&&n.stream!=e&&("text"==e.type&&Ft(t.a.M,Q(e.mimeType,e.codecs)),n.stream=e,n.pb=!0,i&&(n.sa?n.tb=!0:n.xa?(n.ra=!0,n.tb=!0):(Pr(n),kr(t,n,!0)))))}}function ur(t){var e=qn(t.a.Ua);Object.keys(t.c).every(function(t){var i=this.a.M;return"text"==t?(t=i.a,t=e>=t.a&&e<t.b):(t=Ht(i,t),t=Nt(t,e)),t}.bind(t))||hr(t)}function hr(t){for(var e in t.c){var i=t.c[e];i.sa||i.ra||(i.xa?i.ra=!0:null==Vt(t.a.M,e)?null==i.qa&&Ir(t,i,0):(Pr(i),kr(t,i,!1)))}}function cr(t,e,i){var n=qn(t.a.Ua),r=fe(t.b,n),a={},n=[];return e.variant&&e.variant.audio&&(a.audio=e.variant.audio,n.push(e.variant.audio)),e.variant&&e.variant.video&&(a.video=e.variant.video,n.push(e.variant.video)),e.text&&(a.text=e.text,n.push(e.text)),t.a.M.init(a),dr(t),fr(t,n).then(function(){if(!this.f)for(var t in a){var e=a[t];this.c[t]||(this.c[t]={stream:e,type:t,Ea:null,la:null,oa:null,pb:!0,wa:r,endOfStream:!1,xa:!1,qa:null,ra:!1,tb:!1,sa:!1,Ob:!1,Qa:!1,Bc:i||0},Ir(this,this.c[t],0))}}.bind(t))}function lr(t,e){var i=t.g[e];if(i)return i.N;i={N:new y,Ka:!1},t.g[e]=i;var n=t.b.periods[e].variants.map(function(t){var e=[];return t.audio&&e.push(t.audio),t.video&&e.push(t.video),t.video&&t.video.trickModeVideo&&e.push(t.video.trickModeVideo),e}).reduce(_,[]).filter(N);return n.push.apply(n,t.b.periods[e].textStreams),t.m=t.m.then(function(){if(!this.f)return fr(this,n)}.bind(t)).then(function(){this.f||(this.g[e].N.resolve(),this.g[e].Ka=!0)}.bind(t)).catch(function(t){this.f||(this.g[e].N.reject(),delete this.g[e],this.a.onError(t))}.bind(t)),i.N}function fr(t,e){e.map(function(t){return t.id}).filter(N);for(var i=[],n=0;n<e.length;++n){var r=e[n],a=t.j[r.id];a?i.push(a.N):(t.j[r.id]={N:new y,Ka:!1},i.push(r.createSegmentIndex()))}return Promise.all(i).then(function(){if(!this.f)for(var t=0;t<e.length;++t){var i=this.j[e[t].id];i.Ka||(i.N.resolve(),i.Ka=!0)}}.bind(t)).catch(function(t){if(!this.f)return this.j[r.id].N.reject(),delete this.j[r.id],Promise.reject(t)}.bind(t))}function dr(t){var e=t.b.presentationTimeline.W();1/0>e?t.a.M.ga(e):t.a.M.ga(Math.pow(2,32))}function pr(t,e){var i=qn(t.a.Ua),n=e.Ea&&e.la?t.b.periods[de(t.b,e.Ea)].startTime+e.la.endTime:Math.max(i,e.Bc),r=de(t.b,e.stream),a=fe(t.b,n),s=t.a.M,o=e.type;return"text"==o?(s=s.a,s=null==s.b||s.b<i?0:s.b-Math.max(i,s.a)):(s=Ht(s,o),s=Dt(s,i)),o=Math.max(t.i*Math.max(t.b.minBufferTime||0,t.h.rebufferingGoal),t.i*t.h.bufferingGoal),n>=t.b.presentationTimeline.W()?(e.endOfStream=!0,null):(e.endOfStream=!1,e.wa=a,a!=r?null:s>=o?.5:(n=t.a.M,a=e.type,n="text"==a?n.a.b:Rt(Ht(n,a)),e.la&&e.stream==e.Ea?(a=e.la.position+1,n=mr(t,e,r,a)):(a=e.la?e.stream.findSegmentPosition(Math.max(0,t.b.periods[de(t.b,e.Ea)].startTime+e.la.endTime-t.b.periods[r].startTime)):e.stream.findSegmentPosition(Math.max(0,(n||i)-t.b.periods[r].startTime)),null==a?n=null:(s=null,null==n&&(s=mr(t,e,r,Math.max(0,a-1))),n=s||mr(t,e,r,a))),n?(e.Bc=0,vr(t,e,i,r,n),null):1))}function mr(t,e,i,n){return i=t.b.periods[i],(e=e.stream.getSegmentReference(n))?(t=t.b.presentationTimeline,n=t.ua(),i.startTime+e.endTime<t.ka()||i.startTime+e.startTime>n?null:e):null}function vr(t,e,i,n,r){var a=t.b.periods[n],s=e.stream,o=t.b.presentationTimeline.W(),u=t.b.periods[n+1];n=br(t,e,n,a.startTime,u?u.startTime:o),e.xa=!0,e.pb=!1,o=Ar(t,r),Promise.all([n,o]).then(function(t){if(!this.f&&!this.l)return yr(this,e,i,a,s,r,t[1])}.bind(t)).then(function(){this.f||this.l||(e.xa=!1,e.Ob=!1,e.ra||this.a.Ib(),Ir(this,e,0),wr(this,s))}.bind(t)).catch(function(t){this.f||this.l||(e.xa=!1,"text"==e.type&&this.h.ignoreTextStreamFailures?delete this.c.text:3017==t.code?gr(this,e,t):(e.Qa=!0,t.severity=2,_r(this,t)))}.bind(t))}function gr(t,e,i){if(!z(t.c).some(function(t){return t!=e&&t.Ob})){var n=Math.round(100*t.i);if(20<n)t.i-=.2;else{if(!(4<n))return e.Qa=!0,t.l=!0,void t.a.onError(i);t.i-=.04}e.Ob=!0}Ir(t,e,4)}function br(t,e,i,n,r){return e.pb?(i=qt(t.a.M,e.type,t.b.periods[i].startTime-e.stream.presentationTimeOffset,n,r),e.stream.initSegmentReference?(t=Ar(t,e.stream.initSegmentReference).then(function(t){if(!this.f)return Kt(this.a.M,e.type,t,null,null)}.bind(t)).catch(function(t){return e.pb=!0,Promise.reject(t)}),Promise.all([i,t])):i):Promise.resolve()}function yr(t,e,i,n,r,a,s){return r.containsEmsgBoxes&&(new ai).ca("emsg",t.Ud.bind(t,n,a)).parse(s),Tr(t,e,i).then(function(){if(!this.f)return Kt(this.a.M,e.type,s,a.startTime+n.startTime,a.endTime+n.startTime)}.bind(t)).then(function(){if(!this.f)return e.Ea=r,e.la=a,Promise.resolve()}.bind(t))}function Tr(t,e,i){var n=Vt(t.a.M,e.type);return null==n?Promise.resolve():(i=i-n-t.h.bufferBehind,0>=i?Promise.resolve():t.a.M.remove(e.type,n,n+i).then(function(){}.bind(t)))}function wr(t,e){if(!t.s&&(t.s=z(t.c).every(function(t){return"text"==t.type||!t.ra&&!t.sa&&t.la}),t.s)){var i=de(t.b,e);for(t.g[i]||lr(t,i).then(function(){this.a.jc()}.bind(t)).catch(x),i=0;i<t.b.periods.length;++i)lr(t,i).catch(x);t.a.Md&&t.a.Md()}}function Er(t,e){if(e.wa!=de(t.b,e.stream)){var i=e.wa,n=z(t.c);n.every(function(t){return t.wa==i})&&n.every(Sr)&&lr(t,i).then(function(){if(!this.f&&n.every(function(t){var e=de(this.b,t.stream);return Sr(t)&&t.wa==i&&e!=i}.bind(this))){var t=this.b.periods[i],e=this.a.kc(t),r={};e.variant&&e.variant.video&&(r.video=e.variant.video),e.variant&&e.variant.audio&&(r.audio=e.variant.audio),e.text&&(r.text=e.text);for(var a in this.c)if(!r[a]&&"text"!=a)return void this.a.onError(new h(2,5,5005));for(a in r)if(!this.c[a]){if("text"!=a)return void this.a.onError(new h(2,5,5005));cr(this,{text:r.text},t.startTime),delete r[a]}for(a in this.c)(t=r[a])?(or(this,t,!1),Ir(this,this.c[a],0)):delete this.c[a];this.a.jc()}}.bind(t)).catch(x)}}function Sr(t){return!t.xa&&null==t.qa&&!t.ra&&!t.sa}function Ar(t,e){var i=L(e.a(),t.h.retryParameters);if(e.T||null!=e.K){var n="bytes="+e.T+"-";null!=e.K&&(n+=e.K),i.headers.Range=n}return t.a.Sa.request(1,i).then(function(t){return t.data})}function kr(t,e,i){e.ra=!1,e.tb=!1,e.sa=!0,Gt(t.a.M,e.type).then(function(){if(!this.f&&i){var t=this.a.M,n=e.type;return"text"==n?Promise.resolve():Xt(t,n,t.Yc.bind(t,n))}}.bind(t)).then(function(){this.f||(e.Ea=null,e.la=null,e.sa=!1,e.endOfStream=!1,Ir(this,e,0))}.bind(t))}function Ir(e,i,n){i.qa=t.setTimeout(e.Ce.bind(e,i),1e3*n)}function Pr(e){null!=e.qa&&(t.clearTimeout(e.qa),e.qa=null)}function _r(t,e){w(t.w).then(function(){this.a.onError(e),e.handled||this.h.failureCallback(e)}.bind(t))}function xr(t,e){return new Promise(function(i,n){var r=new XMLHttpRequest;r.open(e.method,t,!0),r.responseType="arraybuffer",r.timeout=e.retryParameters.timeout,r.withCredentials=e.allowCrossSiteCredentials,r.onload=function(e){e=e.target;var r=e.getAllResponseHeaders().split("\r\n").reduce(function(t,e){var i=e.split(": ");return t[i[0].toLowerCase()]=i.slice(1).join(": "),t},{});if(200<=e.status&&299>=e.status&&202!=e.status)e.responseURL&&(t=e.responseURL),i({uri:t,data:e.response,headers:r,fromCache:!!r["x-shaka-from-cache"]});else{var a=null;try{a=et(e.response)}catch(t){}n(new h(401==e.status||403==e.status?2:1,1,1001,t,e.status,a,r))}},r.onerror=function(){n(new h(1,1,1002,t))},r.ontimeout=function(){n(new h(1,1,1003,t))};for(var a in e.headers)r.setRequestHeader(a,e.headers[a]);r.send(e.body)})}function Rr(){this.a=null,this.b=[],this.c={}}function Nr(t,e,i){return Cr(t,e,"readwrite",function(t){t.put(i)})}function Dr(t,e,i){return Cr(t,"segment","readwrite",function(t){for(var n=0;n<e.length;n++)t.delete(e[n]).onsuccess=i||function(){}})}function Lr(t,e){var i=0;return Cr(t,e,"readonly",function(t){t.openCursor(null,"prev").onsuccess=function(t){(t=t.target.result)&&(i=t.key+1)}}).then(function(){return i})}function Cr(t,e,i,n){var r={transaction:t.a.transaction([e],i),N:new y};return r.transaction.oncomplete=function(){this.b.splice(this.b.indexOf(r),1),r.N.resolve()}.bind(t),r.transaction.onabort=function(t){this.b.splice(this.b.indexOf(r),1),Or(r.transaction,r.N,t)}.bind(t),r.transaction.onerror=function(t){t.preventDefault()}.bind(t),e=r.transaction.objectStore(e),n(e),t.b.push(r),r.N}function Mr(e,i,n){var r=t.indexedDB.open("shaka_offline_db",1),a=!1,s=new y;return r.onupgradeneeded=function(t){a=!0,t=t.target.result;for(var e in i)t.createObjectStore(e,{keyPath:i[e]})},r.onsuccess=function(t){n&&!a?(t.target.result.close(),setTimeout(function(){Mr(this,i,n-1).then(s.resolve,s.reject)}.bind(this),1e3)):(this.a=t.target.result,s.resolve())}.bind(e),r.onerror=Or.bind(null,r,s),s}function Or(t,e,i){t.error?e.reject(new h(2,9,9001,t.error)):e.reject(new h(2,9,9002)),i.preventDefault()}function Ur(t){var e=jr(t.periods[0],[],new Ui(null,0)),i=ee(e,null,null),e=ie(e,null);return i.push.apply(i,e),{offlineUri:"offline:"+t.key,originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:void 0==t.expiration?1/0:t.expiration,tracks:i,appMetadata:t.appMetadata}}function jr(t,e,i){var n=t.streams.filter(function(t){return"text"==t.contentType});return e=Fr(t.streams.filter(function(t){return"audio"==t.contentType}),t.streams.filter(function(t){return"video"==t.contentType}),e),n=n.map(Hr),t.streams.forEach(function(t){t=Br(t),i.Ga(0,t)}),{startTime:t.startTime,variants:e,textStreams:n}}function Br(t){return t.segments.map(function(t,e){return new ei(e,t.startTime,t.endTime,function(){return[t.uri]},0,null)})}function Fr(t,e,i){var n=[];if(!t.length&&!e.length)return n;t.length?e.length||(e=[null]):t=[null];for(var r=0,a=0;a<t.length;a++)for(var s=0;s<e.length;s++)if(Vr(t[a],e[s])){var o=t[a],u=e[s],h=i;o={id:r++,language:o?o.language:"",primary:!!o&&o.primary||!!u&&u.primary,audio:Hr(o),video:Hr(u),bandwidth:0,drmInfos:h,allowedByApplication:!0,allowedByKeySystem:!0},n.push(o)}return n}function Vr(t,e){if(!(t&&e&&t.variantIds&&e.variantIds))return!0;for(var i=0;i<t.variantIds.length;i++)if(e.variantIds.some(function(e){return e==t.variantIds[i]}))return!0;return!1}function Hr(t){if(!t)return null;var e=Br(t),e=new fi(e);return{id:t.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e),initSegmentReference:t.initSegmentUri?new ti(function(){return[t.initSegmentUri]},0,null):null,presentationTimeOffset:t.presentationTimeOffset,mimeType:t.mimeType,codecs:t.codecs,width:t.width||void 0,height:t.height||void 0,frameRate:t.frameRate||void 0,kind:t.kind,encrypted:t.encrypted,keyId:t.keyId,language:t.language,label:t.label||null,type:t.contentType,primary:t.primary,trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null}}function Kr(){return t.indexedDB?new Rr:null}function Gr(t,e,i,n){this.b={},this.l=[],this.m=n,this.j=t,this.s=e,this.w=i,this.i=this.a=null,this.f=this.g=this.h=this.c=0}function qr(t,e,i,n,r){t.b[e]=t.b[e]||[],t.b[e].push({uris:i.a(),T:i.T,K:i.K,$b:n,Qb:r})}function Xr(t,e){t.c=0,t.h=0,t.g=0,t.f=0,z(t.b).forEach(function(t){t.forEach(function(t){null!=t.K?this.c+=t.K-t.T+1:this.g+=t.$b}.bind(this))}.bind(t)),t.a=e,t.a.size=t.c;var i=z(t.b).map(function(t){var e=0,i=function(){return this.m?e>=t.length?Promise.resolve():Yr(this,t[e++]).then(i):Promise.reject(new h(2,9,9002))}.bind(this);return i()}.bind(t));return t.b={},t.i=Promise.all(i).then(function(){return Nr(this.j,"manifest",e)}.bind(t)).then(function(){this.l=[]}.bind(t)),t.i}function Yr(t,e){var i=L(e.uris,t.w);(e.T||null!=e.K)&&(i.headers.Range="bytes="+e.T+"-"+(null==e.K?"":e.K));var n;return t.s.request(1,i).then(function(t){return this.a?(n=t.data.byteLength,this.l.push(e.Qb.key),e.Qb.data=t.data,Nr(this.j,"segment",e.Qb)):Promise.reject(new h(2,9,9002))}.bind(t)).then(function(){if(!this.a)return Promise.reject(new h(2,9,9002));null==e.K?(this.a.size+=n,this.f+=e.$b):this.h+=n;var t=(this.h+this.f)/(this.c+this.g),i=Ur(this.a);this.m.progressCallback(i,t)}.bind(t))}function zr(){this.a=-1}function $r(t){var e=new Ui(null,0);e.ga(t.duration);var i=t.drmInfo?[t.drmInfo]:[];return{presentationTimeline:e,minBufferTime:10,offlineSessionIds:t.sessionIds,periods:t.periods.map(function(t){return jr(t,i,e)})}}function Wr(t){if(/^offline:([0-9]+)$/.exec(t)){var e={uri:t,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return Promise.resolve(e)}if(e=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t)){var i=Number(e[1]),n=Kr();return n?n.init(Co).then(function(){return n.get("segment",i)}).then(function(e){return n.o().then(function(){if(!e)throw new h(2,9,9003,i);return{uri:t,data:e.data,headers:{}}})}):Promise.reject(new h(2,9,9e3))}return Promise.reject(new h(2,1,9004,t))}function Jr(t){this.a=null;for(var e=0;e<t.textTracks.length;++e){var i=t.textTracks[e];i.mode="disabled","Shaka Player TextTrack"==i.label&&(this.a=i)}this.a||(this.a=t.addTextTrack("subtitles","Shaka Player TextTrack")),this.a.mode="hidden",this.b=this.a.cues}function Qr(e){if(e.startTime>=e.endTime)return null;var i=new VTTCue(e.startTime,e.endTime,e.payload);i.lineAlign=e.lineAlign,i.positionAlign=e.positionAlign,i.size=e.size;try{i.align=e.textAlign}catch(t){}if("center"==e.textAlign&&"center"!=i.align&&(i.align="middle"),e.writingDirection==Wo?i.vertical="lr":e.writingDirection==Jo&&(i.vertical="rl"),e.lineInterpretation==Zo&&(i.snapToLines=!1),null!=e.line&&(i.line=e.line),null!=e.position&&(i.position=e.position),t.VTTRegion&&e.region){var n=new VTTRegion;n.viewportAnchorX=e.region.x,n.viewportAnchorY=e.region.y,n.width=e.region.width,n.height=e.region.height,i.region=n}return i}function Zr(t,e){for(var i=t.b,n=[],r=0;r<i.length;++r)e(i[r])&&n.push(i[r]);for(r=0;r<n.length;++r)t.a.removeCue(n[r])}function ta(){this.a=Promise.resolve(),this.b=this.c=this.f=!1,this.i=new Promise(function(t){this.g=t}.bind(this))}function ea(t){return t.f||(t.a=t.a.then(function(t){return this.c=!0,Promise.resolve(t)}.bind(t),function(t){return this.c=!0,this.b?(this.g(),Promise.reject(this.h)):Promise.reject(t)}.bind(t))),t.f=!0,t.a}function ia(t,e){Se.call(this),this.D=!1,this.f=t,this.jb=!1,this.w=null,this.m=new B,this.g=this.ib=this.b=this.i=this.a=this.B=this.h=this.gb=this.J=this.L=this.l=this.s=null,this.Oc=1e9,this.eb=[],this.Oa=!1,this.Ba=!0,this.Na=this.Pa=this.ia=null,this.Yb=!1,this.X=null,this.hb=[],this.C={},this.c=pa(this),this.fb={width:1/0,height:1/0},this.j=ma(),this.cb=0,this.Ma=this.c.preferredAudioLanguage,this.$a=this.c.preferredTextLanguage,this.ub=this.ab="",this.Zb=!0,e&&e(this),this.s=new D(this.ue.bind(this)),this.gb=aa(this),F(this.m,this.f,"error",this.Od.bind(this))}function na(t){if(!t.ia)return Promise.resolve();var e=Promise.resolve();return t.i&&(e=t.i.stop(),t.i=null),t=t.ia.cancel(new h(2,7,7e3)),Promise.all([e,t])}function ra(t){function e(t){return(t.video?t.video.codecs.split(".")[0]:"")+"-"+(t.audio?t.audio.codecs.split(".")[0]:"")}var i={};t.b.periods.forEach(function(t){t.variants.forEach(function(t){var n=e(t);n in i||(i[n]=[]),i[n].push(t)})});var n=null,r=1/0;J(i,function(t,e){var i=0,a=0;e.forEach(function(t){i+=t.bandwidth||0,++a});var s=i/a;s<r&&(n=t,r=s)}),t.b.periods.forEach(function(t){t.variants=t.variants.filter(function(t){return e(t)==n})})}function aa(e){e.L=new MediaSource;var i=new y;return F(e.m,e.L,"sourceopen",i.resolve),e.f.src=t.URL.createObjectURL(e.L),i}function sa(t){if(t.i&&t.i.configure(t.c.manifest),t.l&&t.l.configure(t.c.drm),t.a){t.a.configure(t.c.streaming);try{t.b.periods.forEach(t.kb.bind(t))}catch(e){t.La(e)}var e=rr(t.a),i=e.audio,n=e.video,e=ir(t.a);(i=ce(i,n,e.variants))&&i.allowedByApplication&&i.allowedByKeySystem||Ta(t,e)}t.g&&(oa(t),t.c.abr.enabled&&!t.Ba?t.g.enable():t.g.disable())}function oa(t){t.g.configure?t.g.configure(t.c.abr):(o("AbrManager API has changed. AbrManager.setDefaultEstimate() and AbrManager.setRestrictions() are deprecated. AbrManager.configure() is used instead. Please upgrade to the new API. The old API will be removed in v2.3."),t.g.setDefaultEstimate(t.c.abr.defaultBandwidthEstimate),t.g.setRestrictions(t.c.abr.restrictions))}function ua(t,e,i){e.video&&ca(t,e.video),e.audio&&ca(t,e.audio);var n=nr(t.a),r=rr(t.a);e!=ce(r.audio,r.video,n?n.variants:[])&&t.j.switchHistory.push({timestamp:Date.now()/1e3,id:e.id,type:"variant",fromAdaptation:i,bandwidth:e.bandwidth})}function ha(t,e,i){ca(t,e),t.j.switchHistory.push({timestamp:Date.now()/1e3,id:e.id,type:"text",fromAdaptation:i,bandwidth:null})}function ca(t,e){var i=de(t.b,e);t.C[i]||(t.C[i]={}),t.C[i][e.type]=e.id}function la(t){t.m&&(t.m.ha(t.L,"sourceopen"),t.m.ha(t.f,"loadeddata"),t.m.ha(t.f,"playing"),t.m.ha(t.f,"pause"),t.m.ha(t.f,"ended")),t.f&&(t.f.removeAttribute("src"),t.f.load());var e=Promise.all([t.g?t.g.stop():null,t.l?t.l.o():null,t.J?t.J.o():null,t.h?t.h.o():null,t.B?t.B.o():null,t.a?t.a.o():null,t.i?t.i.stop():null,t.w?t.w.o():null]);return t.l=null,t.J=null,t.h=null,t.B=null,t.a=null,t.i=null,t.w=null,t.b=null,t.ib=null,t.gb=null,t.L=null,t.hb=[],t.C={},t.j=ma(),e}function fa(t){return t.i?la(t).then(function(){this.D||(this.Jc(!1),this.gb=aa(this))}.bind(t)):Promise.resolve()}function da(){return{".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:new Uint8Array(0)}}}function pa(t){return{drm:{retryParameters:E(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1},manifest:{retryParameters:E(),dash:{customScheme:function(t){if(t)return null},clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1},hls:{defaultTimeOffset:0}},streaming:{retryParameters:E(),failureCallback:t.Vc.bind(t),rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1},abrFactory:pe,textDisplayFactory:function(t){return new Jr(t)}.bind(null,t.f),abr:{enabled:!0,defaultBandwidthEstimate:5e5,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minBandwidth:0,maxBandwidth:1/0}},preferredAudioLanguage:"",preferredTextLanguage:"",restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minBandwidth:0,maxBandwidth:1/0},playRangeStart:0,playRangeEnd:1/0}}function ma(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:0,bufferingTime:0,switchHistory:[],stateHistory:[]}}function va(t,e,i){t.Ba?(t.Na=e,t.Yb=i||!1):sr(t.a,e,i||!1)}function ga(t){if(t.b){var e=Date.now()/1e3;t.Oa?t.j.bufferingTime+=e-t.cb:t.j.playTime+=e-t.cb,t.cb=e}}function ba(t,e){function i(t,e){if(!t)return null;var i=t.findSegmentPosition(e-r.startTime);return null==i?null:(i=t.getSegmentReference(i))?i.startTime+r.startTime:null}var n=rr(t.a),r=ir(t.a),a=i(n.video,e),n=i(n.audio,e);return null!=a&&null!=n?Math.max(a,n):null!=a?a:null!=n?n:e}function ya(t,e){if(!e||!e.length)return t.La(new h(2,4,4012)),null;if(t.g.setVariants(e),t.g.chooseStreams){o("AbrManager API has changed. AbrManager.chooseStreams() is deprecated. Please implement AbrManager.chooseVariant() to upgrade. The old API will be removed in v2.3.");var i=t.g.chooseStreams(["video","audio"]);return ce(i.audio,i.video,e)}return t.g.chooseVariant()}function Ta(t,e){var i=se(e,t.Ma,t.ab),n=oe(e,t.$a,t.ub);(i=ya(t,i))&&(ua(t,i,!0),va(t,i,!0)),(n=n[0])&&(ha(t,n,!0),t.Ba?t.X=n:or(t.a,n,!0)),wa(t)}function wa(t){Promise.resolve().then(function(){this.D||this.dispatchEvent(new G("adaptation"))}.bind(t))}function Ea(t){Promise.resolve().then(function(){this.D||this.dispatchEvent(new G("trackschanged"))}.bind(t))}function Sa(t){t.dispatchEvent(new G("texttrackvisibility"))}function Aa(t){if(!t||t.constructor!=ia)throw new h(2,9,9008);this.a=Kr(),this.g=t,this.b=Pa(this),this.c=null,this.s=!1,this.j=null,this.h=-1,this.l=0,this.f=null,this.i=new Gr(this.a,t.s,t.getConfiguration().streaming.retryParameters,this.b)}function ka(){return!!t.indexedDB}function Ia(t,e,i,n){function r(){}var a,s,o,u=t.g.s,h=t.g.getConfiguration();return Oi(e,u,h.manifest.retryParameters,n).then(function(t){return Da(this),o=new t,o.configure(h.manifest),o.start(e,{networkingEngine:u,filterAllPeriods:this.m.bind(this),filterNewPeriod:this.w.bind(this),onTimelineRegionAdded:function(){},onEvent:function(){},onError:i})}.bind(t)).then(function(t){return Da(this),a=t,s=new ft({Sa:u,onError:i,Hb:r,onExpirationUpdated:function(){},onEvent:function(){}}),s.configure(h.drm),s.init(a,this.b.usePersistentLicense||!1)}.bind(t)).then(function(){return Da(this),Ra(a)}.bind(t)).then(function(){return Da(this),mt(s)}.bind(t)).then(function(){return Da(this),o.stop()}.bind(t)).then(function(){return Da(this),{manifest:a,Wc:s}}.bind(t)).catch(function(t){if(o)return o.stop().then(function(){throw t});throw t})}function Pa(t){return{trackSelectionCallback:t.B.bind(t),progressCallback:function(t,e){if(t||e)return null},usePersistentLicense:!0}}function _a(t){return t.a?t.a.a?Promise.resolve():t.a.init(Co):Promise.reject(new h(2,9,9e3))}function xa(t){var e=t.c?t.c.o():Promise.resolve();return t.c=null,t.f=null,t.s=!1,t.j=null,t.h=-1,e}function Ra(t){var e=t.periods.map(function(t){return t.variants}).reduce(_,[]).map(function(t){var e=[];return t.audio&&e.push(t.audio),t.video&&e.push(t.video),e}).reduce(_,[]).filter(N);return t=t.periods.map(function(t){return t.textStreams}).reduce(_,[]),e.push.apply(e,t),Promise.all(e.map(function(t){return t.createSegmentIndex()}))}function Na(t,e,i,n,r){for(var a=[],s=t.f.presentationTimeline.ka(),o=s,u=i.findSegmentPosition(s),h=null!=u?i.getSegmentReference(u):null;h;)o=t.a.c.segment++,qr(t.i,i.type,h,(h.endTime-h.startTime)*n/8,{key:o,data:null,manifestKey:t.h,streamNumber:i.id,segmentNumber:o}),a.push({startTime:h.startTime,endTime:h.endTime,uri:"offline:"+t.h+"/"+i.id+"/"+o}),o=h.endTime+e.startTime,h=i.getSegmentReference(++u);return t.l=Math.max(t.l,o-s),e=null,i.initSegmentReference&&(o=t.a.c.segment++,e="offline:"+t.h+"/"+i.id+"/"+o,qr(t.i,i.contentType,i.initSegmentReference,0,{key:o,data:null,manifestKey:t.h,streamNumber:i.id,segmentNumber:-1})),t=[],null!=r&&t.push(r),{id:i.id,primary:i.primary,presentationTimeOffset:i.presentationTimeOffset||0,contentType:i.type,mimeType:i.mimeType,codecs:i.codecs,frameRate:i.frameRate,kind:i.kind,language:i.language,label:i.label,width:i.width||null,height:i.height||null,initSegmentUri:e,encrypted:i.encrypted,keyId:i.keyId,segments:a,variantIds:t}}function Da(t){if(!t.g)throw new h(2,9,9002)}function La(t){Oo.push(t)}function Ca(t){var e=t.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();if("function"==typeof Event)var i=new Event(e,t);else i=document.createEvent("Event"),i.initEvent(e,t.bubbles,t.cancelable);t.target.dispatchEvent(i)}function Ma(t,e,i){if("input"==t)switch(this.type){case"range":t="change"}Uo.call(this,t,e,i)}function Oa(t){this.f=[],this.b=[],this.a=[],(new ai).ca("pssh",this.c.bind(this)).parse(t.buffer)}function Ua(t,e){try{var i=new ja(t,e);return Promise.resolve(i)}catch(t){return Promise.reject(t)}}function ja(t,e){this.keySystem=t;for(var i=!1,n=0;n<e.length;++n){var r=e[n],a={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:r.initDataTypes,sessionTypes:["temporary"],label:r.label},s=!1;if(r.audioCapabilities)for(var o=0;o<r.audioCapabilities.length;++o){var u=r.audioCapabilities[o];if(u.contentType){s=!0;var h=u.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,h)&&(a.audioCapabilities.push(u),i=!0)}}if(r.videoCapabilities)for(o=0;o<r.videoCapabilities.length;++o)u=r.videoCapabilities[o],u.contentType&&(s=!0,h=u.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,h)&&(a.videoCapabilities.push(u),i=!0));if(s||(i=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),"required"==r.persistentState&&(i=!1),i)return void(this.a=a)}throw r=Error("Unsupported keySystem"),r.name="NotSupportedError",r.code=DOMException.NOT_SUPPORTED_ERR,r}function Ba(t){var e=this.mediaKeys;return e&&e!=t&&Va(e,null),delete this.mediaKeys,(this.mediaKeys=t)?Va(t,this):Promise.resolve()}function Fa(t){this.a=new MSMediaKeys(t),this.b=new B}function Va(t,e){function i(){e.msSetMediaKeys(n.a),e.removeEventListener("loadedmetadata",i)}if(H(t.b),!e)return Promise.resolve();F(t.b,e,"msneedkey",Ka);var n=t;try{return 1<=e.readyState?e.msSetMediaKeys(t.a):e.addEventListener("loadedmetadata",i),Promise.resolve()}catch(t){return Promise.reject(t)}}function Ha(t){Se.call(this),this.c=null,this.g=t,this.b=this.a=null,this.f=new B,this.sessionId="",this.expiration=NaN,this.closed=new y,this.keyStatuses=new Xa}function Ka(t){var e=document.createEvent("CustomEvent");e.initCustomEvent("encrypted",!1,!1,null),e.initDataType="cenc";var i=t.initData;if(i){var n=new Oa(i);if(1>=n.a.length)t=i;else{var r=[];for(t=0;t<n.a.length;t++)r.push(i.subarray(n.a[t].start,n.a[t].end+1));for(i=M(r,Ga),t=n=0;t<i.length;t++)n+=i[t].length;for(n=new Uint8Array(n),t=r=0;t<i.length;t++)n.set(i[t],r),r+=i[t].length;t=n}}else t=i;e.initData=t,this.dispatchEvent(e)}function Ga(t,e){return lt(t,e)}function qa(t,e){var i=t.keyStatuses;i.size=void 0==e?0:1,i.a=e,t.dispatchEvent(new G("keystatuseschange"))}function Xa(){this.size=0,this.a=void 0}function Ya(){return Promise.reject(Error("The key system specified is not supported."))}function za(t){return t?Promise.reject(Error("MediaKeys not supported.")):Promise.resolve()}function $a(){throw new TypeError("Illegal constructor.")}function Wa(){throw new TypeError("Illegal constructor.")}function Ja(e){Bo=e,Fo=new Uint8Array([0]).buffer,navigator.requestMediaKeySystemAccess=Za,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=ts,t.MediaKeys=is,t.MediaKeySystemAccess=es}function Qa(t){var e=Bo;return e?e+t.charAt(0).toUpperCase()+t.slice(1):t}function Za(t,e){try{var i=new es(t,e);return Promise.resolve(i)}catch(t){return Promise.reject(t)}}function ts(t){var e=this.mediaKeys;return e&&e!=t&&ns(e,null),delete this.mediaKeys,(this.mediaKeys=t)&&ns(t,this),Promise.resolve()}function es(t,e){this.a=this.keySystem=t;var i=!1;"org.w3.clearkey"==t&&(this.a="webkit-org.w3.clearkey",i=!1);for(var n=!1,r=document.getElementsByTagName("video"),a=r.length?r[0]:document.createElement("video"),s=0;s<e.length;++s){r=e[s];var o={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:r.initDataTypes,sessionTypes:["temporary"],label:r.label},u=!1;if(r.audioCapabilities)for(var h=0;h<r.audioCapabilities.length;++h){var c=r.audioCapabilities[h];if(c.contentType){var u=!0,l=c.contentType.split(";")[0];a.canPlayType(l,this.a)&&(o.audioCapabilities.push(c),n=!0)}}if(r.videoCapabilities)for(h=0;h<r.videoCapabilities.length;++h)c=r.videoCapabilities[h],c.contentType&&(u=!0,a.canPlayType(c.contentType,this.a)&&(o.videoCapabilities.push(c),n=!0));if(u||(n=a.canPlayType("video/mp4",this.a)||a.canPlayType("video/webm",this.a)),"required"==r.persistentState&&(i?(o.persistentState="required",o.sessionTypes=["persistent-license"]):n=!1),n)return void(this.b=o)}throw i="Unsupported keySystem","org.w3.clearkey"!=t&&"com.widevine.alpha"!=t||(i="None of the requested configurations were supported."),i=Error(i),i.name="NotSupportedError",i.code=DOMException.NOT_SUPPORTED_ERR,i}function is(t){this.g=t,this.b=null,this.a=new B,this.c=[],this.f={}}function ns(t,e){t.b=e,H(t.a);var i=Bo;e&&(F(t.a,e,i+"needkey",t.Sd.bind(t)),F(t.a,e,i+"keymessage",t.Rd.bind(t)),F(t.a,e,i+"keyadded",t.Pd.bind(t)),F(t.a,e,i+"keyerror",t.Qd.bind(t)))}function rs(t,e){var i=t.f[e];return i||((i=t.c.shift())?(i.sessionId=e,t.f[e]=i):null)}function as(t,e,i){Se.call(this),this.f=t,this.h=!1,this.a=this.b=null,this.c=e,this.g=i,this.sessionId="",this.expiration=NaN,this.closed=new y,this.keyStatuses=new us}function ss(t,e,i){if(t.h)return Promise.reject(Error("The session is already initialized."));t.h=!0;try{if("persistent-license"==t.g)if(i)var n=new Uint8Array(it("LOAD_SESSION|"+i));else{var r=it("PERSISTENT|"),a=new Uint8Array(r.byteLength+e.byteLength);a.set(new Uint8Array(r),0),a.set(new Uint8Array(e),r.byteLength),n=a}else n=new Uint8Array(e)}catch(t){return Promise.reject(t)}t.b=new y;var s=Qa("generateKeyRequest");try{t.f[s](t.c,n)}catch(e){if("InvalidStateError"!=e.name)return t.b=null,Promise.reject(e);setTimeout(function(){try{this.f[s](this.c,n)}catch(t){this.b.reject(t),this.b=null}}.bind(t),10)}return t.b}function os(t,e){var i=t.keyStatuses;i.size=void 0==e?0:1,i.a=e,t.dispatchEvent(new G("keystatuseschange"))}function us(){this.size=0,this.a=void 0}function hs(){var t=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var e=t.apply(this,arguments);return e.abort=function(){},e}}function cs(){var t=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(e,i){return t.call(this,e,i-.001)}}function ls(){var t=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream=function(){for(var e,i=0,n=0;n<this.sourceBuffers.length;++n)e=this.sourceBuffers[n],e=e.buffered.end(e.buffered.length-1),i=Math.max(i,e);if(!isNaN(this.duration)&&i<this.duration)for(this.hc=!0,n=0;n<this.sourceBuffers.length;++n)e=this.sourceBuffers[n],e.cc=!1;return t.apply(this,arguments)};var e=!1,i=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=i.apply(this,arguments);return t.mediaSource_=this,t.addEventListener("updateend",fs,!1),e||(this.addEventListener("sourceclose",ds,!1),e=!0),t}}function fs(t){var e=t.target,i=e.mediaSource_;if(i.hc){for(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.cc=!0,t=0;t<i.sourceBuffers.length;++t)if(0==i.sourceBuffers[t].cc)return;i.hc=!1}}function ds(t){t=t.target;for(var e=0;e<t.sourceBuffers.length;++e)t.sourceBuffers[e].removeEventListener("updateend",fs,!1);t.removeEventListener("sourceclose",ds,!1)}function ps(){var t=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(e){return"mp2t"!=e.split(/ *; */)[0].split("/")[1]&&t(e)}}function ms(){var t=MediaSource.isTypeSupported,e=/^dv(?:he|av)\./;MediaSource.isTypeSupported=function(i){for(var n,r,a=i.split(/ *; */),s=a[0],o={},u=1;u<a.length;++u)n=a[u].split("="),r=n[0],n=n[1].replace(/"(.*)"/,"$1"),o[r]=n;if(!(n=o.codecs))return t(i);var h=!1,c=!1;i=n.split(",").filter(function(t){return e.test(t)?(c=!0,!1):(/^(hev|hvc)1\.2/.test(t)&&(h=!0),!0)}),c&&(h=!1),o.codecs=i.join(","),h&&(o.eotf="smpte2084");for(r in o)n=o[r],s+="; "+r+'="'+n+'"';return cast.__platform__.canDisplayType(s)}}function vs(t){if(this.c=[],this.b=[],this.za=Vo,t)try{t(this.ma.bind(this),this.a.bind(this))}catch(t){this.a(t)}}function gs(t){var e=new vs;return e.ma(void 0),e.then(function(){return t})}function bs(t){var e=new vs;return e.a(t),e}function ys(t){function e(t,e,i){t.za==Vo&&(r[e]=i,++n==r.length&&t.ma(r))}var i=new vs;if(!t.length)return i.ma([]),i;for(var n=0,r=Array(t.length),a=i.a.bind(i),s=0;s<t.length;++s)t[s]&&t[s].then?t[s].then(e.bind(null,i,s),a):e(i,s,t[s]);return i}function Ts(t){for(var e=new vs,i=e.ma.bind(e),n=e.a.bind(e),r=0;r<t.length;++r)t[r]&&t[r].then?t[r].then(i,n):i(t[r]);return e}function ws(t,e,i){Ko.push(function(){if(i&&"function"==typeof i){try{var t=i(this.f)}catch(t){return void e.a(t)}try{var n=t&&t.then}catch(t){return void e.a(t)}t instanceof vs?t==e?e.a(new TypeError("Chaining cycle detected")):t.then(e.ma.bind(e),e.a.bind(e)):n?Es(t,n,e):e.ma(t)}else 1==this.za?e.ma(this.f):e.a(this.f)}.bind(t)),null==Ho&&(Ho=As(Ss))}function Es(t,e,i){try{var n=!1;e.call(t,function(t){if(!n){n=!0;try{var e=t&&t.then}catch(t){return void i.a(t)}e?Es(t,e,i):i.ma(t)}},i.a.bind(i))}catch(t){i.a(t)}}function Ss(){for(;Ko.length;){null!=Ho&&(ks(Ho),Ho=null);var t=Ko;Ko=[];for(var e=0;e<t.length;++e)t[e]()}}function As(){return 0}function ks(){}function Is(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function Ps(e,i,n){return new t.TextTrackCue(e,i,n)}function _s(e,i,n){return new t.TextTrackCue(e+"-"+i+"-"+n,e,i,n)}function xs(t,e,i){this.startTime=t,this.endTime=e,this.payload=i,this.region={x:0,y:0,width:100,height:100},this.position=null,this.positionAlign=Go,this.size=100,this.textAlign=qo,this.writingDirection=$o,this.lineInterpretation=Qo,this.line=null,this.lineHeight="",this.lineAlign=tu,this.displayAlign=Yo,this.fontSize=this.backgroundColor=this.color="",this.fontWeight=iu,this.fontStyle=nu,this.fontFamily="",this.textDecoration=[],this.wrapLine=!0,this.id=""}function Rs(){}function Ns(t){var e=[];if(!t)return e;for(var i=t.childNodes,n=0;n<i.length;n++){var r="span"==i[n].nodeName&&"p"==t.nodeName;i[n].nodeType!=Node.ELEMENT_NODE||"br"==i[n].nodeName||r||(r=Ns(i[n]),e=e.concat(r))}return e.length||e.push(t),e}function Ds(t,e){for(var i=t.childNodes,n=0;n<i.length;n++)if("br"==i[n].nodeName&&0<n)i[n-1].textContent+="\n";else if(0<i[n].childNodes.length)Ds(i[n],e);else if(e){var r=i[n].textContent.trim(),r=r.replace(/\s+/g," ");i[n].textContent=r}}function Ls(t,e){for(var i=e.split(" "),n=0;n<i.length;n++)switch(i[n]){case"underline":0>t.textDecoration.indexOf("underline")&&t.textDecoration.push("underline");break;case"noUnderline":0<=t.textDecoration.indexOf("underline")&&U(t.textDecoration,"underline");break;case"lineThrough":0>t.textDecoration.indexOf("lineThrough")&&t.textDecoration.push("lineThrough");break;case"noLineThrough":0<=t.textDecoration.indexOf("lineThrough")&&U(t.textDecoration,"lineThrough");break;case"overline":0>t.textDecoration.indexOf("overline")&&t.textDecoration.push("overline");break;case"noOverline":0<=t.textDecoration.indexOf("overline")&&U(t.textDecoration,"overline")}}function Cs(t,e,i,n){return(t=Os(t,i,n))?t:Ms(e,i,n)}function Ms(t,e,i){for(var n=Ns(t),r=0;r<n.length;r++){var a=n[r].getAttribute(i);if(a)return a}return(t=Us(t,"style",e))?t.getAttribute(i):null}function Os(t,e,i){return(t=Us(t,"style",e))?t.getAttribute(i):null}function Us(t,e,i){if(!t||1>i.length)return null;var n=null,r=t;for(t=null;r&&!(t=r.getAttribute(e))&&(r=r.parentNode)instanceof Element;);if(e=t)for(t=0;t<i.length;t++)if(i[t].getAttribute("xml:id")==e){n=i[t];break}return n}function js(t,e){var i=null;if(au.test(t))var i=au.exec(t),n=Number(i[1]),r=Number(i[2]),a=Number(i[3]),s=Number(i[4]),s=s+(Number(i[5])||0)/e.b,a=a+s/e.frameRate,i=a+60*r+3600*n;else su.test(t)?i=Bs(su,t):ou.test(t)?i=Bs(ou,t):uu.test(t)?(i=uu.exec(t),i=Number(i[1])/e.frameRate):hu.test(t)?(i=hu.exec(t),i=Number(i[1])/e.a):cu.test(t)&&(i=Bs(cu,t));return i}function Bs(t,e){var i=t.exec(e);return i&&""!=i[0]?(Number(i[4])||0)/1e3+(Number(i[3])||0)+60*(Number(i[2])||0)+3600*(Number(i[1])||0):null}function Fs(t,e,i,n){this.frameRate=Number(t)||30,this.b=Number(e)||1,this.a=Number(n),this.a||(this.a=t?this.frameRate*this.b:1),i&&(t=/^(\d+) (\d+)$/g.exec(i))&&(this.frameRate*=t[1]/t[2])}function Vs(){this.a=new Rs}function Hs(){}function Ks(t,e){var i;(i=/^align:(start|middle|center|end|left|right)$/.exec(e))?(i=i[1],t.textAlign="middle"==i?qo:Xo[i.toUpperCase()]):(i=/^vertical:(lr|rl)$/.exec(e))?t.writingDirection="lr"==i[1]?Wo:Jo:(i=/^size:([\d\.]+)%$/.exec(e))?t.size=Number(i[1]):(i=/^position:([\d\.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(e))?(t.position=Number(i[1]),i[2]&&(i=i[2],t.positionAlign="line-left"==i||"start"==i?"line-left":"line-right"==i||"end"==i?"line-right":"center")):(i=/^line:([\d\.]+)%(?:,(start|end|center))?$/.exec(e))?(t.lineInterpretation=Zo,t.line=Number(i[1]),i[2]&&(t.lineAlign=eu[i[2].toUpperCase()])):(i=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(e))&&(t.lineInterpretation=Qo,t.line=Number(i[1]),i[2]&&(t.lineAlign=eu[i[2].toUpperCase()]))}function Gs(t){if(!(t=hn(t,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g)))return null;var e=Number(t[2]),i=Number(t[3]);return 59<e||59<i?null:Number(t[4])/1e3+i+60*e+3600*(Number(t[1])||0)}function qs(){this.a=null}function Xs(t,e,i){var n,r,a;return(new ai).G("payl",ui(function(t){n=Z(t)})).G("iden",ui(function(t){r=Z(t)})).G("sttg",ui(function(t){a=Z(t)})).parse(t),n?Ys(n,r,a,e,i):null}function Ys(t,e,i,n,r){if(t=new xs(n,r,t),e&&(t.id=e),i)for(e=new un(i),i=cn(e);i;)Ks(t,i),hn(e,/[ \t]+/gm),i=cn(e);return t}var zs,$s=this;$s.Pe=!0,s.prototype.getBandwidthEstimate=function(t){return 128e3>this.a?t:Math.min(a(this.b),a(this.c))},t.console&&t.console.log.bind&&(o=console.warn.bind(console)),e("shaka.util.Error",h),h.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},h.Severity={RECOVERABLE:1,CRITICAL:2},h.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},h.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_LIVE_CONTENT_NOT_SUPPORTED:4029,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,LOAD_INTERRUPTED:7e3,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,CONTENT_UNSUPPORTED_BY_BROWSER:9009};var Ws=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;zs=c.prototype,zs.ea="",zs.Aa="",zs.ja="",zs.Ia=null,zs.ba="",zs.ta="",zs.toString=function(){var t=[],e=this.ea;if(e&&t.push(m(e,Js,!0),":"),e=this.ja){t.push("//");var i=this.Aa;i&&t.push(m(i,Js,!0),"@"),t.push(encodeURIComponent(e).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e=this.Ia,null!=e&&t.push(":",String(e))}return(e=this.ba)&&(this.ja&&"/"!=e.charAt(0)&&t.push("/"),t.push(m(e,"/"==e.charAt(0)?Zs:Qs,!0))),(e=this.a.toString())&&t.push("?",e),(e=this.ta)&&t.push("#",m(e,eo)),t.join("")},zs.resolve=function(t){var e=new c(this);"data"===e.ea&&(e=new c);var i=!!t.ea;i?l(e,t.ea):i=!!t.Aa,i?e.Aa=t.Aa:i=!!t.ja,i?e.ja=t.ja:i=null!=t.Ia;var n=t.ba;if(i)f(e,t.Ia);else if(i=!!t.ba){if("/"!=n.charAt(0))if(this.ja&&!this.ba)n="/"+n;else{var r=e.ba.lastIndexOf("/");-1!=r&&(n=e.ba.substr(0,r+1)+n)}if(".."==n||"."==n)n="";else if(-1!=n.indexOf("./")||-1!=n.indexOf("/.")){for(var r=!n.lastIndexOf("/",0),n=n.split("/"),a=[],s=0;s<n.length;){var o=n[s++];"."==o?r&&s==n.length&&a.push(""):".."==o?((1<a.length||1==a.length&&""!=a[0])&&a.pop(),r&&s==n.length&&a.push("")):(a.push(o),r=!0)}n=a.join("/")}}return i?e.ba=n:i=""!==t.a.toString(),i?d(e,b(t.a)):i=!!t.ta,i&&(e.ta=t.ta),e};var Js=/[#\/\?@]/g,Qs=/[\#\?:]/g,Zs=/[\#\?]/g,to=/[\#\?@]/g,eo=/#/g;g.prototype.a=null,g.prototype.c=null,g.prototype.toString=function(){if(this.b)return this.b;if(!this.a)return"";var t,e=[];for(t in this.a)for(var i=encodeURIComponent(t),n=this.a[t],r=0;r<n.length;r++){var a=i;""!==n[r]&&(a+="="+encodeURIComponent(n[r])),e.push(a)}return this.b=e.join("&")},e("shaka.net.NetworkingEngine",D),D.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3};var io={};D.registerScheme=function(t,e){io[t]=e},D.unregisterScheme=function(t){delete io[t]},D.prototype.ae=function(t){this.b.push(t)},D.prototype.registerRequestFilter=D.prototype.ae,D.prototype.He=function(t){var e=this.b;0<=(t=e.indexOf(t))&&e.splice(t,1)},D.prototype.unregisterRequestFilter=D.prototype.He,D.prototype.Tc=function(){this.b=[]},D.prototype.clearAllRequestFilters=D.prototype.Tc,D.prototype.be=function(t){this.c.push(t)},D.prototype.registerResponseFilter=D.prototype.be,D.prototype.Ie=function(t){var e=this.c;0<=(t=e.indexOf(t))&&e.splice(t,1)},D.prototype.unregisterResponseFilter=D.prototype.Ie,D.prototype.Uc=function(){this.c=[]},D.prototype.clearAllResponseFilters=D.prototype.Uc,D.prototype.o=function(){this.f=!0,this.b=[],this.c=[];for(var t=[],e=0;e<this.a.length;++e)t.push(this.a[e].catch(x));return Promise.all(t)},D.prototype.destroy=D.prototype.o,D.prototype.request=function(t,e,i){var n=i||function(){return!1};if(this.f)return Promise.reject();e.method=e.method||"GET",e.headers=e.headers||{},e.retryParameters=e.retryParameters?I(e.retryParameters):E(),e.uris=I(e.uris);var r=Date.now(),a=Promise.resolve();return this.b.forEach(function(i){a=a.then(i.bind(null,t,e))}),a=a.catch(function(t){throw new h(2,1,1006,t)}),a=a.then(function(){var a=Date.now()-r,s=new T(e.retryParameters,!1,i);return w(s).then(function(){return C(this,t,e,s,0,a,n)}.bind(this))}.bind(this)),this.a.push(a),a.then(function(e){return 0<=this.a.indexOf(a)&&this.a.splice(this.a.indexOf(a),1),this.g&&!e.fromCache&&1==t&&this.g(e.timeMs,e.data.byteLength),e}.bind(this)).catch(function(t){return t&&(t.severity=2),0<=this.a.indexOf(a)&&this.a.splice(this.a.indexOf(a),1),Promise.reject(t)}.bind(this))},D.prototype.request=D.prototype.request,j.prototype.push=function(t,e){this.a.hasOwnProperty(t)?this.a[t].push(e):this.a[t]=[e]},j.prototype.get=function(t){return(t=this.a[t])?t.slice():null},j.prototype.remove=function(t,e){var i=this.a[t];if(i)for(var n=0;n<i.length;++n)i[n]==e&&(i.splice(n,1),--n)},B.prototype.o=function(){return H(this),this.a=null,Promise.resolve()},B.prototype.ha=function(t,e){if(this.a)for(var i=this.a.get(e)||[],n=0;n<i.length;++n){var r=i[n];r.target==t&&(r.ha(),this.a.remove(e,r))}},K.prototype.ha=function(){this.target.removeEventListener(this.type,this.a,!1),this.a=this.target=null},G.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},G.prototype.stopImmediatePropagation=function(){this.a=!0},G.prototype.stopPropagation=function(){};var no=1/15,ro={codecs:"codecs",frameRate:"framerate",bandwidth:"bitrate",width:"width",height:"height",channelsCount:"channels"};e("shaka.util.StringUtils.fromUTF8",Z),e("shaka.util.StringUtils.fromUTF16",tt),e("shaka.util.StringUtils.fromBytesAutoDetect",et),e("shaka.util.StringUtils.toUTF8",it),rt.prototype.cancel=function(){null!=this.a&&(clearTimeout(this.a),this.a=null)},e("shaka.util.Uint8ArrayUtils.toBase64",ot),e("shaka.util.Uint8ArrayUtils.fromBase64",ut),e("shaka.util.Uint8ArrayUtils.fromHex",ht),e("shaka.util.Uint8ArrayUtils.toHex",ct),e("shaka.util.Uint8ArrayUtils.equal",lt),e("shaka.util.Uint8ArrayUtils.concat",function(t){for(var e=0,i=0;i<arguments.length;++i)e+=arguments[i].length;for(var e=new Uint8Array(e),n=0,i=0;i<arguments.length;++i)e.set(arguments[i],n),n+=arguments[i].length;return e}),zs=ft.prototype,zs.o=function(){this.c=!0;var t=[];return this.a.forEach(function(e){e=e.fa.close().catch(x);var i=new Promise(function(t){setTimeout(t,1e3)});t.push(Promise.race([e,i]))}),this.i.reject(),this.f&&t.push(this.f.o()),this.l&&t.push(this.l.setMediaKeys(null).catch(x)),this.B&&(this.B.cancel(),this.B=null),this.D&&(this.D.cancel(),this.D=null),this.f=this.l=this.j=this.w=this.b=null,this.a=[],this.m=[],this.s=this.g=this.h=null,Promise.all(t)},zs.configure=function(t){this.h=t},zs.init=function(t,e){var i={},n=[];return this.ia=e,this.m=t.offlineSessionIds,gt(this,t,e||0<t.offlineSessionIds.length,i,n),n.length?bt(this,i,n):(this.L=!0,Promise.resolve())},zs.keySystem=function(){return this.b?this.b.keySystem:""},zs.mb=function(){var t=this.a.map(function(t){return t=t.fa.expiration,isNaN(t)?1/0:t});return Math.min.apply(Math,t)},zs.vd=function(t){for(var e=new Uint8Array(t.initData),i=0;i<this.a.length;++i)if(lt(e,this.a[i].initData))return;At(this,t.initDataType,e)},zs.uc=function(t){this.h.delayLicenseRequestUntilPlayed&&this.l.paused&&!this.X?this.J.push(t):kt(this,t)},zs.oc=function(t){t=t.target;var e;for(e=0;e<this.a.length&&this.a[e].fa!=t;++e);if(e!=this.a.length){var i=!1;t.keyStatuses.forEach(function(t,n){if("string"==typeof n){var r=n;n=t,t=r}if("com.microsoft.playready"==this.b.keySystem&&16==n.byteLength){var r=new DataView(n),a=r.getUint32(0,!0),s=r.getUint16(4,!0),o=r.getUint16(6,!0);r.setUint32(0,a,!1),r.setUint16(4,s,!1),r.setUint16(6,o,!1)}"com.microsoft.playready"==this.b.keySystem&&"status-pending"==t&&(t="usable"),"status-pending"!=t&&(this.a[e].loaded=!0,this.a.every(function(t){return t.loaded})&&this.i.resolve()),"expired"==t&&(i=!0),r=ct(new Uint8Array(n)),this.C[r]=t}.bind(this));var n=t.expiration-Date.now();(0>n||i&&1e3>n)&&!this.a[e].na&&(this.a.splice(e,1),t.close()),at(this.D,.5)}},zs.$d=function(){function t(t,e){return"expired"==e}!Y(this.C)&&W(this.C,t)&&this.g(new h(2,6,6014)),this.s.Hb(this.C)},zs.Gd=function(){for(var t=0;t<this.J.length;t++)kt(this,this.J[t]);this.X=!0,this.J=[]},zs.Zd=function(){this.a.forEach(function(t){var e=t.Gb,i=t.fa.expiration;isNaN(i)&&(i=1/0),i!=e&&(this.s.onExpirationUpdated(t.fa.sessionId,i),t.Gb=i)}.bind(this))};var ao={};e("shaka.text.TextEngine.registerParser",Mt),e("shaka.text.TextEngine.unregisterParser",function(t){delete ao[t]}),Ct.prototype.o=function(){return this.c=this.f=null,Promise.resolve()},Ct.prototype.pe=function(t){this.c=t},Ct.prototype.setDisplayer=Ct.prototype.pe,Ct.prototype.remove=function(t,e){return Promise.resolve().then(function(){!this.c||!this.c.remove(t,e)||null==this.a||e<=this.a||t>=this.b||(t<=this.a&&e>=this.b?this.a=this.b=null:t<=this.a&&e<this.b?this.a=e:t>this.a&&e>=this.b&&(this.b=t))}.bind(this))},Ut.prototype.parseInit=function(t){this.Ta(t,0,null,null)},Ut.prototype.parseMedia=function(t,e){return this.Ta(t,e.periodStart,e.segmentStart,e.segmentEnd)},zs=jt.prototype,zs.o=function(){this.i=!0;var t,e=[];for(t in this.c){var i=this.c[t],n=i[0];for(this.c[t]=i.slice(0,1),n&&e.push(n.p.catch(x)),n=1;n<i.length;++n)i[n].p.catch(x),i[n].p.reject()}return this.a&&e.push(this.a.o()),Promise.all(e).then(function(){this.h.o(),this.j=this.a=this.f=this.g=this.h=null,this.b={},this.c={}}.bind(this))},zs.init=function(t){for(var e in t){var i=t[e],i=Q(i.mimeType,i.codecs);"text"==e?Ft(this,i):(i=this.f.addSourceBuffer(i),F(this.h,i,"error",this.Be.bind(this,e)),F(this.h,i,"updateend",this.Ha.bind(this,e)),this.b[e]=i,this.c[e]=[])}},zs.yb=function(){var t=this.a&&null!=this.a.a?[{start:this.a.a,end:this.a.b}]:[];return{total:Lt(this.g.buffered),audio:Lt(Ht(this,"audio")),video:Lt(Ht(this,"video")),text:t}},zs.remove=function(t,e,i){return"text"==t?this.a.remove(e,i):Xt(this,t,this.Ac.bind(this,t,e,i))},zs.endOfStream=function(t){return Yt(this,function(){t?this.f.endOfStream(t):this.f.endOfStream()}.bind(this))},zs.ga=function(t){return Yt(this,function(){this.f.duration=t}.bind(this))},zs.W=function(){return this.f.duration},zs.Ae=function(t,e){this.b[t].appendBuffer(e)},zs.Ac=function(t,e,i){i<=e?this.Ha(t):this.b[t].remove(e,i)},zs.Pc=function(t){var e=this.b[t].appendWindowStart,i=this.b[t].appendWindowEnd;this.b[t].abort(),this.b[t].appendWindowStart=e,this.b[t].appendWindowEnd=i,this.Ha(t)},zs.Yc=function(t){this.g.currentTime-=.001,this.Ha(t)},zs.re=function(t,e){this.b[t].timestampOffset=e,this.Ha(t)},zs.oe=function(t,e,i){this.b[t].appendWindowStart=0,this.b[t].appendWindowEnd=i,this.b[t].appendWindowStart=e,this.Ha(t)},zs.Be=function(t){this.c[t][0].p.reject(new h(2,3,3014,this.g.error?this.g.error.code:0))},zs.Ha=function(t){var e=this.c[t][0];e&&(e.p.resolve(),zt(this,t))};var so=1,oo=2,uo={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"};e("shaka.abr.SimpleAbrManager",pe),pe.prototype.stop=function(){this.h=null,this.c=!1,this.g=[],this.f=null},pe.prototype.stop=pe.prototype.stop,pe.prototype.init=function(t){this.h=t},pe.prototype.init=pe.prototype.init,pe.prototype.chooseVariant=function(){var t=me(this.a.restrictions,this.g),e=this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate);if(this.g.length&&!t.length)throw new h(2,4,4012);for(var i=t[0]||null,n=0;n<t.length;++n){var r=t[n],a=(t[n+1]||{bandwidth:1/0}).bandwidth/this.a.bandwidthUpgradeTarget;e>=r.bandwidth/this.a.bandwidthDowngradeTarget&&e<=a&&(i=r)}return this.f=Date.now(),i},pe.prototype.chooseVariant=pe.prototype.chooseVariant,pe.prototype.enable=function(){this.c=!0},pe.prototype.enable=pe.prototype.enable,pe.prototype.disable=function(){this.c=!1},pe.prototype.disable=pe.prototype.disable,pe.prototype.segmentDownloaded=function(t,e){var i=this.b;if(!(16e3>e)){var n=8e3*e/t,a=t/1e3;i.a+=e,r(i.b,a,n),r(i.c,a,n)}if(null!=this.f&&this.c)t:{if(this.i){if(Date.now()-this.f<1e3*this.a.switchInterval)break t}else{if(!(128e3<=this.b.a))break t;this.i=!0}i=this.chooseVariant(),this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate),this.h(i)}},pe.prototype.segmentDownloaded=pe.prototype.segmentDownloaded,pe.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate)},pe.prototype.getBandwidthEstimate=pe.prototype.getBandwidthEstimate,pe.prototype.setVariants=function(t){this.g=t},pe.prototype.setVariants=pe.prototype.setVariants,pe.prototype.configure=function(t){this.a=t},pe.prototype.configure=pe.prototype.configure;var ho="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),co="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),lo=["loop","playbackRate"],fo=["pause","play"],po="adaptation buffering emsg error loading streaming texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading".split(" "),mo="drmInfo getAudioLanguages getBufferedInfo getConfiguration getExpiration getManifest getManifestUri getPlaybackRate getTextLanguages getTextTracks getStats getVariantTracks isAudioOnly isBuffering isInProgress isLive isTextTrackVisible keySystem seekRange".split(" "),vo=["getPlayheadTimeAsDate","getPresentationStartTimeAsDate"],go=[["getConfiguration","configure"]],bo=[["isTextTrackVisible","setTextTrackVisibility"]],yo="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "),To=["load","unload"],wo=!1,Eo=null;zs=ye.prototype,zs.o=function(){return we(this),Eo&&Te(this),this.D=this.C=this.g=null,this.b=this.h=!1,this.m=this.l=this.f=this.c=this.a=this.i=null,Promise.resolve()},zs.aa=function(){return this.b},zs.Nb=function(){return this.B},zs.init=function(){if(t.chrome&&chrome.cast&&chrome.cast.isAvailable){delete t.__onGCastApiAvailable,this.h=!0,this.g();var e=new chrome.cast.SessionRequest(this.J),e=new chrome.cast.ApiConfig(e,this.nc.bind(this),this.Id.bind(this),"origin_scoped");chrome.cast.initialize(e,function(){},function(){}),wo&&setTimeout(this.g.bind(this),20),(e=Eo)&&e.status!=chrome.cast.SessionStatus.STOPPED?this.nc(e):Eo=null}else t.__onGCastApiAvailable=function(t){t&&this.init()}.bind(this)},zs.Rb=function(t){this.i=t,this.b&&Ee({type:"appData",appData:this.i})},zs.cast=function(t){return this.h?wo?this.b?Promise.reject(new h(1,8,8002)):(this.f=new y,chrome.cast.requestSession(this.Jb.bind(this,t),this.lc.bind(this)),this.f):Promise.reject(new h(1,8,8001)):Promise.reject(new h(1,8,8e3))},zs.lb=function(){this.b&&(we(this),Eo&&(Te(this),Eo.stop(function(){},function(){}),Eo=null))},zs.get=function(t,e){if("video"==t){if(0<=fo.indexOf(e))return this.zc.bind(this,t,e)}else if("player"==t){if(0<=vo.indexOf(e)&&!this.get("player","isLive")())return function(){};if(0<=yo.indexOf(e))return this.zc.bind(this,t,e);if(0<=To.indexOf(e))return this.de.bind(this,t,e);if(0<=mo.indexOf(e))return this.vc.bind(this,t,e)}return this.vc(t,e)},zs.set=function(t,e,i){this.a[t][e]=i,Ee({type:"set",targetName:t,property:e,value:i})},zs.Jb=function(t,e){Eo=e,e.addUpdateListener(this.l),e.addMessageListener("urn:x-cast:com.google.shaka.v2",this.m),this.mc(),Ee({type:"init",initState:t,appData:this.i}),this.f.resolve()},zs.lc=function(t){var e=8003;switch(t.code){case"cancel":e=8004;break;case"timeout":e=8005;break;case"receiver_unavailable":e=8006}this.f.reject(new h(2,8,e,t))},zs.vc=function(t,e){return this.a[t][e]},zs.zc=function(t,e){Ee({type:"call",targetName:t,methodName:e,args:Array.prototype.slice.call(arguments,2)})},zs.de=function(t,e){var i=Array.prototype.slice.call(arguments,2),n=new y,r=this.s.toString();return this.s++,this.c[r]=n,Ee({type:"asyncCall",targetName:t,methodName:e,args:i,id:r}),n},zs.nc=function(t){var e=this.w();this.f=new y,this.j=!0,this.Jb(e,t)},zs.Id=function(t){wo="available"==t,this.g()},zs.mc=function(){var t=!!Eo&&"connected"==Eo.status;if(this.b&&!t){this.D();for(var e in this.a)this.a[e]={};we(this)}this.B=(this.b=t)?Eo.receiver.friendlyName:"",this.g()},zs.Cd=function(t,e){var i=ge(e);switch(i.type){case"event":var n=i.targetName,r=i.event;this.C(n,new G(r.type,r));break;case"update":r=i.update;for(n in r){var i=this.a[n]||{};for(a in r[n])i[a]=r[n][a]}this.j&&(this.L(),this.j=!1);break;case"asyncComplete":n=i.id;var a=i.error;if(i=this.c[n],delete this.c[n],i)if(a){n=new h(a.severity,a.category,a.code);for(r in a)n[r]=a[r];i.reject(n)}else i.resolve()}},Se.prototype.addEventListener=function(t,e){this.vb.push(t,e)},Se.prototype.removeEventListener=function(t,e){this.vb.remove(t,e)},Se.prototype.dispatchEvent=function(t){for(var e=this.vb.get(t.type)||[],i=0;i<e.length;++i){t.target=this.bb,t.currentTarget=this.bb;var n=e[i];try{n.handleEvent?n.handleEvent(t):n.call(this,t)}catch(t){}if(t.a)break}return t.defaultPrevented},i(Ae),e("shaka.cast.CastProxy",Ae),Ae.prototype.o=function(t){return t&&this.a&&this.a.lb(),t=[this.i?this.i.o():null,this.b?this.b.o():null,this.a?this.a.o():null],this.a=this.i=this.j=this.h=this.b=this.c=null,Promise.all(t)},Ae.prototype.destroy=Ae.prototype.o,Ae.prototype.nd=function(){return this.h},Ae.prototype.getVideo=Ae.prototype.nd,Ae.prototype.dd=function(){return this.j},Ae.prototype.getPlayer=Ae.prototype.dd,Ae.prototype.Qc=function(){return!!this.a&&(this.a.h&&wo)},Ae.prototype.canCast=Ae.prototype.Qc,Ae.prototype.aa=function(){return!!this.a&&this.a.aa()},Ae.prototype.isCasting=Ae.prototype.aa,Ae.prototype.Nb=function(){return this.a?this.a.Nb():""},Ae.prototype.receiverName=Ae.prototype.Nb,Ae.prototype.cast=function(){var t=this.fc();return this.a.cast(t).then(function(){return this.b.sb()}.bind(this))},Ae.prototype.cast=Ae.prototype.cast,Ae.prototype.Rb=function(t){this.a.Rb(t)},Ae.prototype.setAppData=Ae.prototype.Rb,Ae.prototype.Ee=function(){var t=this.a;if(t.b){var e=t.w();chrome.cast.requestSession(t.Jb.bind(t,e),t.lc.bind(t))}},Ae.prototype.suggestDisconnect=Ae.prototype.Ee,Ae.prototype.lb=function(){this.a.lb()},Ae.prototype.forceDisconnect=Ae.prototype.lb,zs=Ae.prototype,zs.fc=function(){var t={video:{},player:{},playerAfterLoad:{},manifest:this.b.ib,startTime:null};return this.c.pause(),lo.forEach(function(e){t.video[e]=this.c[e]}.bind(this)),this.c.ended||(t.startTime=this.c.currentTime),go.forEach(function(e){var i=e[1];e=this.b[e[0]](),t.player[i]=e}.bind(this)),bo.forEach(function(e){var i=e[1];e=this.b[e[0]](),t.playerAfterLoad[i]=e}.bind(this)),t},zs.ve=function(){this.dispatchEvent(new G("caststatuschanged"))},zs.we=function(){this.f.dispatchEvent(new G(this.h.paused?"pause":"play"))},zs.ye=function(){go.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(this));var t=this.a.get("player","getManifestUri")(),e=this.a.get("video","ended"),i=Promise.resolve(),n=this.c.autoplay,r=null;e||(r=this.a.get("video","currentTime")),t&&(this.c.autoplay=!1,i=this.b.load(t,r),i.catch(function(t){this.b.dispatchEvent(new G("error",{detail:t}))}.bind(this)));var a={};lo.forEach(function(t){a[t]=this.a.get("video",t)}.bind(this)),i.then(function(){lo.forEach(function(t){this.c[t]=a[t]}.bind(this)),bo.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(this)),this.c.autoplay=n,t&&this.c.play()}.bind(this))},zs.Le=function(t){if("addEventListener"==t)return this.f.addEventListener.bind(this.f);if("removeEventListener"==t)return this.f.removeEventListener.bind(this.f);if(this.a.aa()&&!Object.keys(this.a.a.video).length){var e=this.c[t];if("function"!=typeof e)return e}return this.a.aa()?this.a.get("video",t):(e=this.c[t],"function"==typeof e&&(e=e.bind(this.c)),e)},zs.Ne=function(t,e){this.a.aa()?this.a.set("video",t,e):this.c[t]=e},zs.Me=function(t){this.a.aa()||this.f.dispatchEvent(new G(t.type,t))},zs.Xd=function(t){return"addEventListener"==t?this.g.addEventListener.bind(this.g):"removeEventListener"==t?this.g.removeEventListener.bind(this.g):"getMediaElement"==t?function(){return this.h}.bind(this):"getNetworkingEngine"==t?this.b.gc.bind(this.b):this.a.aa()&&!Object.keys(this.a.a.video).length&&0<=mo.indexOf(t)||!this.a.aa()?(t=this.b[t],t.bind(this.b)):this.a.get("player",t)},zs.Yd=function(t){this.a.aa()||this.g.dispatchEvent(t)},zs.xe=function(t,e){this.a.aa()&&("video"==t?this.f.dispatchEvent(e):"player"==t&&this.g.dispatchEvent(e))},i(Ie),e("shaka.cast.CastReceiver",Ie),Ie.prototype.isConnected=function(){return this.i},Ie.prototype.isConnected=Ie.prototype.isConnected,Ie.prototype.qd=function(){return this.f},Ie.prototype.isIdle=Ie.prototype.qd,Ie.prototype.o=function(){var e=this.b?this.b.o():Promise.resolve();return null!=this.h&&t.clearTimeout(this.h),this.l=this.j=this.b=this.a=null,this.i=!1,this.f=!0,this.h=this.g=this.c=null,e.then(function(){cast.receiver.CastReceiverManager.getInstance().stop()})},Ie.prototype.destroy=Ie.prototype.o,zs=Ie.prototype,zs.tc=function(){this.i=!!cast.receiver.CastReceiverManager.getInstance().getSenders().length,_e(this)},zs.wc=function(t,e){this.b&&(this.Kb(),Re(this,{type:"event",targetName:t,event:e},this.c))},zs.Kb=function(){null!=this.h&&t.clearTimeout(this.h),this.h=t.setTimeout(this.Kb.bind(this),500);var e={video:{},player:{}};co.forEach(function(t){e.video[t]=this.a[t]}.bind(this));var i=mo;this.b.R()&&(i=i.concat(vo)),i.forEach(function(t){e.player[t]=this.b[t]()}.bind(this)),(i=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(e.video.volume=i.level,e.video.muted=i.muted),Re(this,{type:"update",update:e},this.c)},zs.Xc=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&Re(this,{type:"update",update:{video:{volume:t.level,muted:t.muted}}},this.c),Re(this,{type:"event",targetName:"video",event:{type:"volumechange"}},this.c)},zs.Ld=function(t){var e=ge(t.data);switch(e.type){case"init":xe(this,e.initState,e.appData),this.Kb();break;case"appData":this.l(e.appData);break;case"set":var i=e.targetName,n=e.property,r=e.value;if("video"==i){if(e=cast.receiver.CastReceiverManager.getInstance(),"volume"==n){e.setSystemVolumeLevel(r);break}if("muted"==n){e.setSystemVolumeMuted(r);break}}this.j[i][n]=r;break;case"call":i=e.targetName,n=e.methodName,r=e.args,i=this.j[i],i[n].apply(i,r);break;case"asyncCall":i=e.targetName,n=e.methodName,r=e.args,e=e.id,t=t.senderId,i=this.j[i],i[n].apply(i,r).then(this.Ec.bind(this,t,e,null),this.Ec.bind(this,t,e))}},zs.xd=function(t){var e=ge(t.data);switch(e.type){case"PLAY":this.a.play(),Ne(this,0);break;case"PAUSE":this.a.pause(),Ne(this,0);break;case"SEEK":t=e.currentTime;var i=e.resumeState;null!=t&&(this.a.currentTime=Number(t)),i&&"PLAYBACK_START"==i?(this.a.play(),Ne(this,0)):i&&"PLAYBACK_PAUSE"==i&&(this.a.pause(),Ne(this,0));break;case"STOP":this.b.sb().then(function(){Ne(this,0)}.bind(this));break;case"GET_STATUS":Ne(this,Number(e.requestId));break;case"VOLUME":i=e.volume,t=i.level;var i=i.muted,n=this.a.volume,r=this.a.muted;null!=t&&(this.a.volume=Number(t)),null!=i&&(this.a.muted=i),n==this.a.volume&&r==this.a.muted||Ne(this,0);break;case"LOAD":i=e.media.contentId,t=e.currentTime;var a=this.m(i);this.a.autoplay=!0,this.b.load(a,t).then(function(){Ne(this,0,{contentId:a,streamType:this.b.R()?"LIVE":"BUFFERED",contentType:""})}.bind(this)).catch(function(t){var i="LOAD_FAILED";7==t.category&&7e3==t.code&&(i="LOAD_CANCELLED"),Re(this,{requestId:Number(e.requestId),type:i},this.g)}.bind(this));break;default:Re(this,{requestId:Number(e.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},this.g)}},zs.Ec=function(t,e,i){Re(this,{type:"asyncComplete",id:e,error:i},this.c,t)};var So={IDLE:"IDLE",Nc:"PLAYING",Lc:"BUFFERING",Mc:"PAUSED"},Ao={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"};e("shaka.media.InitSegmentReference",ti),e("shaka.media.SegmentReference",ei),e("shaka.util.DataViewReader",ii);var ko=1;ii.Endianness={Oe:0,Qe:ko},ii.prototype.da=function(){return this.v<this.O.byteLength},ii.prototype.hasMoreData=ii.prototype.da,ii.prototype.fd=function(){return this.v},ii.prototype.getPosition=ii.prototype.fd,ii.prototype.$c=function(){return this.O.byteLength},ii.prototype.getLength=ii.prototype.$c,ii.prototype.Mb=function(){try{var t=this.O.getUint8(this.v)}catch(t){ni()}return this.v+=1,t},ii.prototype.readUint8=ii.prototype.Mb,ii.prototype.yc=function(){try{var t=this.O.getUint16(this.v,this.a)}catch(t){ni()}return this.v+=2,t},ii.prototype.readUint16=ii.prototype.yc,ii.prototype.F=function(){try{var t=this.O.getUint32(this.v,this.a)}catch(t){ni()}return this.v+=4,t},ii.prototype.readUint32=ii.prototype.F,ii.prototype.xc=function(){try{var t=this.O.getInt32(this.v,this.a)}catch(t){ni()}return this.v+=4,t},ii.prototype.readInt32=ii.prototype.xc,ii.prototype.Va=function(){try{if(this.a)var t=this.O.getUint32(this.v,!0),e=this.O.getUint32(this.v+4,!0);else e=this.O.getUint32(this.v,!1),t=this.O.getUint32(this.v+4,!1)}catch(t){ni()}if(2097151<e)throw new h(2,3,3001);return this.v+=8,e*Math.pow(2,32)+t},ii.prototype.readUint64=ii.prototype.Va,ii.prototype.Ja=function(t){this.v+t>this.O.byteLength&&ni();var e=ri(this,this.v,this.v+t);return this.v+=t,new Uint8Array(e)},ii.prototype.readBytes=ii.prototype.Ja,ii.prototype.I=function(t){this.v+t>this.O.byteLength&&ni(),this.v+=t},ii.prototype.skip=ii.prototype.I,ii.prototype.Lb=function(){for(var t=this.v;this.da()&&this.O.getUint8(this.v);)this.v+=1;return t=ri(this,t,this.v),this.v+=1,Z(t)},ii.prototype.readTerminatedString=ii.prototype.Lb,e("shaka.util.Mp4Parser",ai),ai.prototype.G=function(t,e){var i=hi(t);return this.b[i]=0,this.a[i]=e,this},ai.prototype.box=ai.prototype.G,ai.prototype.ca=function(t,e){var i=hi(t);return this.b[i]=1,this.a[i]=e,this},ai.prototype.fullBox=ai.prototype.ca,ai.prototype.parse=function(t){for(t=new ii(new DataView(t),0);t.da();)this.qb(0,t)},ai.prototype.parse=ai.prototype.parse,ai.prototype.qb=function(t,e){var i=e.v,n=e.F(),r=e.F();switch(n){case 0:n=e.O.byteLength-i;break;case 1:n=e.Va()}var a=this.a[r];if(a){var s=null,o=null;1==this.b[r]&&(o=e.F(),s=o>>>24,o&=16777215),r=i+n-e.v,r=0<r?e.Ja(r).buffer:new ArrayBuffer(0),r=new ii(new DataView(r),0),a({Ta:this,version:s,ec:o,u:r,size:n,start:i+t})}else e.I(i+n-e.v)},ai.prototype.parseNext=ai.prototype.qb,ai.children=si,ai.sampleDescription=oi,ai.allData=ui,e("shaka.media.SegmentIndex",fi),fi.prototype.o=function(){return this.a=null,Promise.resolve()},fi.prototype.destroy=fi.prototype.o,fi.prototype.find=function(t){for(var e=this.a.length-1;0<=e;--e){var i=this.a[e];if(t>=i.startTime&&t<i.endTime)return i.position}return this.a.length&&t<this.a[0].startTime?this.a[0].position:null},fi.prototype.find=fi.prototype.find,fi.prototype.get=function(t){return this.a.length?(t-=this.a[0].position,0>t||t>=this.a.length?null:this.a[t]):null},fi.prototype.get=fi.prototype.get,fi.prototype.ob=function(t){for(var e,i,n,r=[],a=e=0;e<this.a.length&&a<t.length;)i=this.a[e],n=t[a],i.startTime<n.startTime?(r.push(i),e++):(i.startTime>n.startTime?e||r.push(n):(.1<Math.abs(i.endTime-n.endTime)?(n=new ei(i.position,n.startTime,n.endTime,n.a,n.T,n.K),r.push(n)):r.push(i),e++),a++);for(;e<this.a.length;)r.push(this.a[e++]);if(r.length)for(e=r[r.length-1].position+1;a<t.length;)n=t[a++],n=new ei(e++,n.startTime,n.endTime,n.a,n.T,n.K),r.push(n);else r=t;this.a=r},fi.prototype.merge=fi.prototype.ob,fi.prototype.xb=function(t){for(var e=0;e<this.a.length&&!(this.a[e].endTime>t);++e);this.a.splice(0,e)},fi.prototype.evict=fi.prototype.xb;var Io;pi.prototype.da=function(){return this.a.da()},yi.prototype.parse=function(t,e,i,n){var r;if(e=new pi(new DataView(e)),440786851!=mi(e).id)throw new h(2,3,3008);var a=mi(e);if(408125543!=a.id)throw new h(2,3,3009);for(e=a.a.byteOffset,a=new pi(a.a),r=null;a.da();){var s=mi(a);if(357149030==s.id){r=s;break}}if(!r)throw new h(2,3,3010);for(a=new pi(r.a),r=1e6,s=null;a.da();){var o=mi(a);if(2807729==o.id)r=bi(o);else if(17545==o.id)if(s=o,4==s.a.byteLength)s=s.a.getFloat32(0);else{if(8!=s.a.byteLength)throw new h(2,3,3003);s=s.a.getFloat64(0)}}if(null==s)throw new h(2,3,3011);if(a=r/1e9,r=s*a,t=mi(new pi(new DataView(t))),475249515!=t.id)throw new h(2,3,3007);return Ti(t,e,a,r,i,n)};var Po={},_o={};e("shaka.media.ManifestParser.registerParserByExtension",function(t,e){_o[t]=e}),e("shaka.media.ManifestParser.registerParserByMime",function(t,e){Po[t]=e}),e("shaka.media.PresentationTimeline",Ui),Ui.prototype.W=function(){return this.a},Ui.prototype.getDuration=Ui.prototype.W,Ui.prototype.ga=function(t){this.a=t},Ui.prototype.setDuration=Ui.prototype.ga,Ui.prototype.gd=function(){return this.c},Ui.prototype.getPresentationStartTime=Ui.prototype.gd,Ui.prototype.Gc=function(t){this.i=t},Ui.prototype.setClockOffset=Ui.prototype.Gc,Ui.prototype.rb=function(t){this.h=t},Ui.prototype.setStatic=Ui.prototype.rb,Ui.prototype.jd=function(){return this.f},Ui.prototype.getSegmentAvailabilityDuration=Ui.prototype.jd,Ui.prototype.Ic=function(t){this.f=t},Ui.prototype.setSegmentAvailabilityDuration=Ui.prototype.Ic,Ui.prototype.Hc=function(t){this.j=t},Ui.prototype.setDelay=Ui.prototype.Hc,Ui.prototype.Ga=function(t,e){e.length&&(this.b=e.reduce(function(t,e){return Math.max(t,e.endTime-e.startTime)},this.b))},Ui.prototype.notifySegments=Ui.prototype.Ga,Ui.prototype.Eb=function(t){this.b=Math.max(this.b,t)},Ui.prototype.notifyMaxSegmentDuration=Ui.prototype.Eb,Ui.prototype.R=function(){return 1/0==this.a&&!this.h},Ui.prototype.isLive=Ui.prototype.R,Ui.prototype.va=function(){return 1/0!=this.a&&!this.h},Ui.prototype.isInProgress=Ui.prototype.va,Ui.prototype.ka=function(){return this.Da(0)},Ui.prototype.getSegmentAvailabilityStart=Ui.prototype.ka,Ui.prototype.Da=function(t){if(1/0==this.f)return this.g;var e=this.ua();return Math.max(this.g,Math.min(e-this.f+t,e))},Ui.prototype.getSafeAvailabilityStart=Ui.prototype.Da,Ui.prototype.Fc=function(t){this.g=t},Ui.prototype.setAvailabilityStart=Ui.prototype.Fc,Ui.prototype.ua=function(){return this.R()||this.va()?Math.min(Math.max(0,(Date.now()+this.i)/1e3-this.b-this.c),this.a):this.a},Ui.prototype.getSegmentAvailabilityEnd=Ui.prototype.ua,Ui.prototype.nb=function(){return Math.max(0,this.ua()-(this.R()||this.va()?this.j:0))},Ui.prototype.getSeekRangeEnd=Ui.prototype.nb,e("shaka.dash.DashParser",ji),zs=ji.prototype,zs.configure=function(t){this.b=t},zs.start=function(t,e){return this.g=[t],this.a=e,Bi(this).then(function(){return this.a&&Xi(this,0),this.c}.bind(this))},zs.stop=function(){return this.b=this.a=null,this.g=[],this.c=null,this.i=[],this.j={},null!=this.f&&(t.clearTimeout(this.f),this.f=null),Promise.resolve()},zs.update=function(){Bi(this).catch(function(t){this.a&&this.a.onError(t)}.bind(this))},zs.onExpirationUpdated=function(){},zs.Td=function(t,e){t.V=Yi(e,t.Y,null);var i=!1,n=Le(e,"Role"),r=n.map(function(t){return t.getAttribute("value")}).filter(R),a=void 0;"text"==t.V.contentType&&(a="subtitle");for(var s=0;s<n.length;s++){var o=n[s].getAttribute("schemeIdUri");if(null==o||"urn:mpeg:dash:role:2011"==o)switch(o=n[s].getAttribute("value")){case"main":i=!0;break;case"caption":case"subtitle":a=o}}var u=null,c=!1;if(Le(e,"EssentialProperty").forEach(function(t){"http://dashif.org/guidelines/trickmode"==t.getAttribute("schemeIdUri")?u=t.getAttribute("value"):c=!0}),c)return null;var n=Le(e,"ContentProtection"),l=Ke(n,this.b.dash.customScheme,this.b.dash.ignoreDrmInfo),n=Wt(e.getAttribute("lang")||"und"),o=e.getAttribute("label"),s=Le(e,"Representation"),r=s.map(this.Wd.bind(this,t,l,a,n,o,i,r)).filter(function(t){return!!t});if(!r.length)throw new h(2,4,4003);return t.V.contentType&&"application"!=t.V.contentType||(t.V.contentType=Qi(r[0].mimeType,r[0].codecs),r.forEach(function(e){e.type=t.V.contentType})),r.forEach(function(t){l.drmInfos.forEach(function(e){t.keyId&&e.keyIds.push(t.keyId)})}),a=s.map(function(t){return t.getAttribute("id")}).filter(R),{id:t.V.id||"__fake__"+this.h++,contentType:t.V.contentType,language:n,Cb:i,streams:r,drmInfos:l.drmInfos,Wb:u,ee:a}},zs.Wd=function(t,e,i,n,r,a,s,o){if(t.A=Yi(o,t.V,null),!$i(t.A))return null;t.bandwidth=Me(o,"bandwidth",Fe)||0;var u=this.fe.bind(this);if(t.A.Wa)u=Si(t,u);else if(t.A.pa)u=Ii(t,this.j);else if(t.A.Xa)u=Ri(t,u,this.j,!!this.c);else{var h=t.A.$,c=t.S.duration||0;u={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(t){return 0<=t&&t<c?1:null},getSegmentReference:function(t){return 1!=t?null:new ei(1,0,c,function(){return h},0,null)},initSegmentReference:null,Z:0}}return o=Le(o,"ContentProtection"),o=Ge(o,this.b.dash.customScheme,e,this.b.dash.ignoreDrmInfo),{id:this.h++,createSegmentIndex:u.createSegmentIndex,findSegmentPosition:u.findSegmentPosition,getSegmentReference:u.getSegmentReference,initSegmentReference:u.initSegmentReference,presentationTimeOffset:u.Z,mimeType:t.A.mimeType,codecs:t.A.codecs,frameRate:t.A.frameRate,bandwidth:t.bandwidth,width:t.A.width,height:t.A.height,kind:i,encrypted:0<e.drmInfos.length,keyId:o,language:n,label:r,type:t.V.contentType,primary:a,trickModeVideo:null,containsEmsgBoxes:t.A.containsEmsgBoxes,roles:s,channelsCount:t.A.Fb}},zs.ze=function(){this.f=null;var t=Date.now();Bi(this).then(function(){this.a&&Xi(this,(Date.now()-t)/1e3)}.bind(this)).catch(function(t){this.a&&(t.severity=1,this.a.onError(t),Xi(this,0))}.bind(this))},zs.Vd=function(t,e,i){var n=i.getAttribute("schemeIdUri")||"",r=i.getAttribute("value")||"",a=Me(i,"timescale",Ve)||1;Le(i,"Event").forEach(function(i){var s=Me(i,"presentationTime",Ve)||0,o=Me(i,"duration",Ve)||0,s=s/a+t,o=s+o/a;null!=e&&(s=Math.min(s,t+e),o=Math.min(o,t+e)),i={schemeIdUri:n,value:r,startTime:s,endTime:o,id:i.getAttribute("id")||"",eventElement:i},this.a.onTimelineRegionAdded(i)}.bind(this))},zs.fe=function(t,e,i){return t=L(t,this.b.retryParameters),null!=e&&(t.headers.Range="bytes="+e+"-"+(null!=i?i:"")),this.a.networkingEngine.request(1,t).then(function(t){return t.data})},_o.mpd=ji,Po["application/dash+xml"]=ji,tn.prototype.toString=function(){function t(t){return t.name+'="'+t.value+'"'}return this.value?"#"+this.name+":"+this.value:0<this.a.length?"#"+this.name+":"+this.a.map(t).join(","):"#"+this.name},tn.prototype.getAttribute=function(t){var e=this.a.filter(function(e){return e.name==t});return e.length?e[0]:null};var xo="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST".split(" "),Ro="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE".split(" ");e("shaka.net.DataUriPlugin",mn),mn.parse=function(e){var i=e.split(":");if(2>i.length||"data"!=i[0])throw new h(2,1,1004,e);if(i=i.slice(1).join(":").split(","),2>i.length)throw new h(2,1,1004,e);var n=i[0],i=t.decodeURIComponent(i.slice(1).join(",")),n=n.split(";"),r=null;if(1<n.length&&(r=n[1]),"base64"==r)e=ut(i).buffer;else{if(r)throw new h(2,1,1005,e);e=it(i)}return{data:e,contentType:n[0]}},io.data=mn,e("shaka.hls.HlsParser",vn),zs=vn.prototype,zs.configure=function(t){this.h=t},zs.start=function(t,e){return this.b=e,this.m=t,Bn(this,t).then(function(e){return bn(this,e.data,t).then(function(){return Fn(this,this.c),this.B}.bind(this))}.bind(this))},zs.stop=function(){return this.h=this.b=null,this.g={},this.C={},this.B=null,Promise.resolve()},zs.update=function(){if(this.f){for(var t=[],e=Object.keys(this.s),i=0;i<e.length;i++){var n=e[i];t.push(gn(this,this.s[n],n))}return Promise.all(t)}},zs.onExpirationUpdated=function(){};var No={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]},Do={audio:{mp4:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",ts:"video/mp2t"},video:{mp4:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",ts:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",vtt:"text/vtt",ttml:"application/ttml+xml"}};vn.prototype.J=function(){this.b&&(this.i=null,this.update().then(function(){Fn(this,this.c)}.bind(this)).catch(function(t){this.b&&(t.severity=1,this.b.onError(t),Fn(this,0))}.bind(this)))};var Lo={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(t){if("SAMPLE-AES-CENC"!=Un(t,"METHOD"))return null;var e=Un(t,"URI"),e=mn.parse(e),e=new Uint8Array(e.data),e=X("com.widevine.alpha",[{initDataType:"cenc",initData:e}]);return(t=nn(t,"KEYID"))&&(e.keyIds=[t.substr(2).toLowerCase()]),e}};_o.m3u8=vn,Po["application/x-mpegurl"]=vn,Po["application/vnd.apple.mpegurl"]=vn,zs=Hn.prototype,zs.o=function(){var t=this.b.o();return this.b=null,this.f&&(this.f.cancel(),this.f=null),this.h&&(this.h.cancel(),this.h=null),this.g&&(this.g.cancel(),this.g=null),this.J=this.L=this.l=this.c=this.a=null,t},zs.zb=function(){return this.i},zs.Ib=function(){this.w=!0,this.rc()},zs.Hd=function(){var t=this.j||0>this.i?0:this.i;this.a.playbackRate&&this.a.playbackRate!=t&&Yn(this,this.a.playbackRate)},zs.pc=function(){var t=Xn(this);this.b.ha(this.a,"timeupdate"),this.g.cancel(),.001>Math.abs(this.a.currentTime-t)?(F(this.b,this.a,"seeking",this.sc.bind(this)),F(this.b,this.a,"playing",this.qc.bind(this))):(V(this.b,this.a,"seeking",this.Jd.bind(this)),this.a.currentTime=t)},zs.Jd=function(){F(this.b,this.a,"seeking",this.sc.bind(this)),F(this.b,this.a,"playing",this.qc.bind(this))},zs.rc=function(){if(this.a.readyState&&!this.a.paused){this.a.readyState!=this.D&&(this.s=!1,this.D=this.a.readyState);var t=this.l.smallGapLimit,e=this.a.currentTime,i=this.a.buffered;if(e<this.c.presentationTimeline.ka())i=zn(this,e),$n(this,e,i);else{t:{if(i&&i.length&&!(1==i.length&&1e-6>i.end(0)-i.start(0))){var n=.1;/(Edge\/|Trident\/|Tizen)/.test(navigator.userAgent)&&(n=.5);for(var r=0;r<i.length;r++)if(i.start(r)>e&&(!r||i.end(r-1)-e<=n)){n=r;break t}}n=null}if(null==n){if(3>this.a.readyState&&0<this.a.playbackRate)if(this.C!=e)this.C=e,this.X=Date.now(),this.B=!1;else if(!this.B&&this.X<Date.now()-1e3)for(n=0;n<i.length;n++)if(e>=i.start(n)&&e<i.end(n)-.5){this.a.currentTime+=.1,this.C=this.a.currentTime,this.B=!0;break}}else if((n||this.w)&&!((r=i.start(n))>=this.c.presentationTimeline.nb())){var a=r-e,t=a<=t,s=!1;t||this.s||(this.s=!0,a=new G("largegap",{currentTime:e,gapSize:a}),a.cancelable=!0,this.J(a),this.l.jumpLargeGaps&&!a.defaultPrevented&&(s=!0)),(t||s)&&(n&&i.end(n-1),$n(this,e,r))}}}},zs.ud=function(){this.m=zn(this,this.a.currentTime)},zs.sc=function(){this.w=!1;var t=this.a.currentTime,e=zn(this,t);.001<Math.abs(e-t)?$n(this,t,e):(this.s=!1,this.L())},zs.qc=function(){var t=this.a.currentTime,e=zn(this,t);.001<Math.abs(e-t)&&$n(this,t,e)},Jn.prototype.o=function(){var t=this.j?this.j.o():Promise.resolve();return this.j=null,tr(this),this.C=this.h=this.l=this.w=this.g=this.B=this.a=null,this.c=[],t},Jn.prototype.s=function(t){if(!this.c.some(function(e){return e.info.schemeIdUri==t.schemeIdUri&&e.info.startTime==t.startTime&&e.info.endTime==t.endTime})){var e={info:t,status:1};this.c.push(e);var i=new G("timelineregionadded",{detail:Qn(t)});this.h(i),this.m(!0,e)}},Jn.prototype.m=function(t,e){var i=e.info.startTime>this.a.currentTime?1:e.info.endTime<this.a.currentTime?3:2,n=2==e.status,r=2==i;i!=e.status&&((!t||n||r)&&(n||this.h(new G("timelineregionenter",{detail:Qn(e.info)})),r||this.h(new G("timelineregionexit",{detail:Qn(e.info)}))),e.status=i)},Jn.prototype.D=function(){this.f=null,Zn(this);var t=fe(this.g,this.a.currentTime);t!=this.i&&(-1!=this.i&&this.C(),this.i=t);var t=Dt(this.a.buffered,this.a.currentTime),e=Rt(this.a.buffered),i=this.g.presentationTimeline,n=i.ua(),r="ended"==this.B.readyState,e=i.R()&&e>=n||this.a.ended||r;this.b?(i=1*Math.max(this.g.minBufferTime||0,this.w.rebufferingGoal),(e||t>=i)&&0!=this.b&&(this.b=!1,this.l(!1))):!e&&.5>t&&1!=this.b&&(this.b=!0,this.l(!0)),this.c.forEach(this.m.bind(this,!1))},zs=er.prototype,zs.o=function(){for(var t in this.c)Pr(this.c[t]);return this.h=this.c=this.j=this.g=this.m=this.b=this.a=null,this.f=!0,Promise.resolve()},zs.configure=function(t){this.h=t,this.w=new T({maxAttempts:Math.max(t.retryParameters.maxAttempts,2),baseDelay:t.retryParameters.baseDelay,backoffFactor:t.retryParameters.backoffFactor,fuzzFactor:t.retryParameters.fuzzFactor,timeout:0},!0)},zs.init=function(){var t=qn(this.a.Ua),t=this.a.kc(this.b.periods[fe(this.b,t)]);return t.variant||t.text?cr(this,t).then(function(){this.a&&this.a.yd&&this.a.yd()}.bind(this)):Promise.reject(new h(2,5,5005))},zs.Ce=function(t){if(!this.f&&!t.xa&&null!=t.qa&&!t.sa)if(t.qa=null,t.ra)kr(this,t,t.tb);else{try{var e=pr(this,t);null!=e&&(Ir(this,t,e),t.Qa=!1)}catch(t){return void _r(this,t)}e=z(this.c),Er(this,t),e.every(function(t){return t.endOfStream})&&this.a.M.endOfStream().then(function(){this.b.presentationTimeline.ga(this.a.M.W())}.bind(this))}},zs.Ud=function(t,e,i){var n=i.u.Lb(),r=i.u.Lb(),a=i.u.F(),s=i.u.F(),o=i.u.F(),u=i.u.F();i=i.u.Ja(i.u.O.byteLength-i.u.v),t=t.startTime+e.startTime+s/a,"urn:mpeg:dash:event:2012"==n?this.a.Ad():this.a.onEvent(new G("emsg",{detail:{startTime:t,endTime:t+o/a,schemeIdUri:n,value:r,timescale:a,presentationTimeDelta:s,eventDuration:o,id:u,messageData:i}}))},e("shaka.net.HttpPlugin",xr),io.http=xr,io.https=xr,zs=Rr.prototype,zs.init=function(t,e){return Mr(this,t,e).then(function(){var e=Object.keys(t);return Promise.all(e.map(function(t){return Lr(this,t).then(function(e){this.c[t]=e}.bind(this))}.bind(this)))}.bind(this))},zs.o=function(){return Promise.all(this.b.map(function(t){try{t.transaction.abort()}catch(t){}return t.N.catch(x)})).then(function(){this.a&&(this.a.close(),this.a=null)}.bind(this))},zs.get=function(t,e){var i;return Cr(this,t,"readonly",function(t){i=t.get(e)}).then(function(){return i.result})},zs.forEach=function(t,e){return Cr(this,t,"readonly",function(t){t.openCursor().onsuccess=function(t){(t=t.target.result)&&(e(t.value),t.continue())}})},zs.remove=function(t,e){return Cr(this,t,"readwrite",function(t){t.delete(e)})};var Co={manifest:"key",segment:"key"};Gr.prototype.o=function(){var t=this.j,e=this.l,i=this.i||Promise.resolve();return e.length&&(i=i.then(function(){return Dr(t,e)})),this.b={},this.l=[],this.i=this.a=this.w=this.s=this.j=this.m=null,i},zs=zr.prototype,zs.configure=function(){},zs.start=function(t){var e=/^offline:([0-9]+)$/.exec(t);if(!e)return Promise.reject(new h(2,1,9004,t));var i=Number(e[1]),n=Kr();return this.a=i,n?n.init(Co).then(function(){return n.get("manifest",i)}).then(function(t){if(!t)throw new h(2,9,9003,i);return $r(t)}).then(function(t){return n.o().then(function(){return t})},function(t){return n.o().then(function(){throw t})}):Promise.reject(new h(2,9,9e3))},zs.stop=function(){return Promise.resolve()},zs.update=function(){},zs.onExpirationUpdated=function(t,e){var i=Kr();i.init(Co).then(function(){return i.get("manifest",this.a)}.bind(this)).then(function(n){if(n&&!(0>n.sessionIds.indexOf(t))&&(void 0==n.expiration||n.expiration>e))return n.expiration=e,Nr(i,"manifest",n)}).catch(function(){}).then(function(){return i.o()})},Po["application/x-offline-manifest"]=zr,e("shaka.offline.OfflineScheme",Wr),io.offline=Wr,e("shaka.text.SimpleTextDisplayer",Jr),Jr.prototype.remove=function(t,e){return!!this.a&&(Zr(this,function(i){return!(i.startTime>=e||i.endTime<=t)}),!0)},Jr.prototype.remove=Jr.prototype.remove,Jr.prototype.append=function(t){for(var e=[],i=0;i<t.length;i++){var n=Qr(t[i]);n&&e.push(n)}e.slice().sort(function(t,i){return t.startTime!=i.startTime?t.startTime-i.startTime:t.endTime!=i.endTime?t.endTime-i.startTime:e.indexOf(i)-e.indexOf(t)}).forEach(function(t){this.a.addCue(t)}.bind(this))},Jr.prototype.append=Jr.prototype.append,Jr.prototype.o=function(){return this.a&&Zr(this,function(){return!0}),this.a=null,Promise.resolve()},Jr.prototype.destroy=Jr.prototype.o,Jr.prototype.isTextVisible=function(){return"showing"==this.a.mode},Jr.prototype.isTextVisible=Jr.prototype.isTextVisible,Jr.prototype.setTextVisibility=function(t){this.a.mode=t?"showing":"hidden"},Jr.prototype.setTextVisibility=Jr.prototype.setTextVisibility,ta.prototype.then=function(t){return this.a=this.a.then(t).then(function(t){return this.b?(this.g(),Promise.reject(this.h)):Promise.resolve(t)}.bind(this)),this},ta.prototype.cancel=function(t){return this.c?Promise.resolve():(this.b=!0,this.h=t,this.i)},i(ia),e("shaka.Player",ia),ia.prototype.o=function(){return this.D=!0,na(this).then(function(){var t=Promise.all([this.Pa,la(this),this.m?this.m.o():null,this.s?this.s.o():null]);return this.f=null,this.jb=!1,this.c=this.s=this.g=this.m=null,t}.bind(this))},ia.prototype.destroy=ia.prototype.o,ia.version="v2.2.8";var Mo={};ia.registerSupportPlugin=function(t,e){Mo[t]=e},ia.isBrowserSupported=function(){return!!(t.Promise&&t.Uint8Array&&Array.prototype.forEach&&t.MediaSource&&MediaSource.isTypeSupported&&t.MediaKeys&&t.navigator&&t.navigator.requestMediaKeySystemAccess&&t.MediaKeySystemAccess&&t.MediaKeySystemAccess.prototype.getConfiguration)},ia.probeSupport=function(){return Pt().then(function(t){t={manifest:Mi(),media:Bt(),drm:t};for(var e in Mo)t[e]=Mo[e]();return t})},ia.prototype.load=function(t,e,i){var n=this.sb(),r=new ta;this.ia=r,this.dispatchEvent(new G("loading"));var a=Date.now();return ea(r.then(function(){return n}).then(function(){return this.j=ma(),F(this.m,this.f,"playing",this.Za.bind(this)),F(this.m,this.f,"pause",this.Za.bind(this)),F(this.m,this.f,"ended",this.Za.bind(this)),this.g=new this.c.abrFactory,oa(this),this.w=new this.c.textDisplayFactory,this.w.setTextVisibility(this.jb),Oi(t,this.s,this.c.manifest.retryParameters,i)}.bind(this)).then(function(e){return this.i=new e,this.i.configure(this.c.manifest),e={networkingEngine:this.s,filterNewPeriod:this.kb.bind(this),filterAllPeriods:this.Tb.bind(this),onTimelineRegionAdded:this.Nd.bind(this),onEvent:this.Ya.bind(this),onError:this.La.bind(this)},2<this.i.start.length?(o("The ManifestParser interface has changed. Please upgrade your plugin to accept the PlayerInterface structure. See the ManifestParser documentation for details."),this.i.start(t,this.s,e.filterNewPeriod,e.onError,e.onEvent)):this.i.start(t,e)}.bind(this)).then(function(e){if(e.periods.some(function(t){return t.variants.some(function(t){return t.video&&t.audio})})&&e.periods.forEach(function(t){t.variants=t.variants.filter(function(t){return t.video&&t.audio})}),0==e.periods.length)throw new h(2,4,4014);return this.b=e,this.ib=t,this.l=new ft({Sa:this.s,onError:this.La.bind(this),Hb:this.zd.bind(this),onExpirationUpdated:this.wd.bind(this),onEvent:this.Ya.bind(this)}),this.l.configure(this.c.drm),this.l.init(e,!1)}.bind(this)).then(function(){this.Tb(this.b.periods),this.cb=Date.now()/1e3,this.Ma=this.c.preferredAudioLanguage,this.$a=this.c.preferredTextLanguage;var t=this.b.presentationTimeline.W(),e=this.c.playRangeEnd,i=this.c.playRangeStart;return 0<i&&(this.R()||this.b.presentationTimeline.Fc(i)),e<t&&(this.R()||this.b.presentationTimeline.ga(e)),Promise.all([dt(this.l,this.f),this.gb])}.bind(this)).then(function(){return this.g.chooseStreams?(o("AbrManager API has changed. The SwitchCallback signature has changed to accept a variant instead of a map. Please update your AbrManager. The old API will be removed in v2.3."),this.g.init(this.Fe.bind(this))):this.g.init(this.Kc.bind(this)),this.h=new Hn(this.f,this.b,this.c.streaming,void 0==e?null:e,this.te.bind(this),this.Ya.bind(this)),this.B=new Jn(this.f,this.L,this.b,this.c.streaming,this.Jc.bind(this),this.Ya.bind(this),this.se.bind(this)),this.J=new jt(this.f,this.L,this.w),this.a=new er(this.b,{Ua:this.h,M:this.J,Sa:this.s,kc:this.td.bind(this),jc:this.Rc.bind(this),onError:this.La.bind(this),onEvent:this.Ya.bind(this),Ad:this.Bd.bind(this),Ib:this.Kd.bind(this),filterNewPeriod:this.kb.bind(this),filterAllPeriods:this.Tb.bind(this)}),this.a.configure(this.c.streaming),this.dispatchEvent(new G("streaming")),ra(this),this.a.init()}.bind(this)).then(function(){if(this.c.streaming.startAtSegmentBoundary){var t=ba(this,qn(this.h));Kn(this.h,t)}this.b.periods.forEach(this.kb.bind(this)),Ea(this),wa(this);var t=ir(this.a),e=se(t,this.Ma,this.ab);this.g.setVariants(e),t.variants.some(function(t){return t.primary}),this.hb.forEach(this.B.s.bind(this.B)),this.hb=[],V(this.m,this.f,"loadeddata",function(){this.j.loadLatency=(Date.now()-a)/1e3}.bind(this)),this.ia=null}.bind(this))).catch(function(t){return this.ia==r&&(this.ia=null,this.dispatchEvent(new G("unloading"))),Promise.reject(t)}.bind(this))},ia.prototype.load=ia.prototype.load,ia.prototype.configure=function(t){if(t.abr&&t.abr.manager){o("AbrManager configuration has changed. Please use abrFactory instead of abr.manager. The old API will be removed in v2.3.");var e=t.abr.manager;delete t.abr.manager,t.abrFactory=function(){return e}}t.streaming&&null!=t.streaming.infiniteRetriesForLiveStreams&&(o("Streaming configuration has changed. Please use streaming.failureCallback instead of streaming.infiniteRetriesForLiveStreams. The old API will be removed in v2.3."),this.Zb=!!t.streaming.infiniteRetriesForLiveStreams,delete t.streaming.infiniteRetriesForLiveStreams),k(this.c,t,pa(this),da(),""),sa(this)},ia.prototype.configure=ia.prototype.configure,ia.prototype.getConfiguration=function(){var t=pa(this);return k(t,this.c,pa(this),da(),""),t},ia.prototype.getConfiguration=ia.prototype.getConfiguration,ia.prototype.ge=function(){this.c=pa(this),sa(this)},ia.prototype.resetConfiguration=ia.prototype.ge,ia.prototype.cd=function(){return this.f},ia.prototype.getMediaElement=ia.prototype.cd,ia.prototype.gc=function(){return this.s},ia.prototype.getNetworkingEngine=ia.prototype.gc,ia.prototype.bd=function(){return this.ib},ia.prototype.getManifestUri=ia.prototype.bd,ia.prototype.R=function(){return!!this.b&&this.b.presentationTimeline.R()},ia.prototype.isLive=ia.prototype.R,ia.prototype.va=function(){return!!this.b&&this.b.presentationTimeline.va()},ia.prototype.isInProgress=ia.prototype.va,ia.prototype.od=function(){if(!this.b||!this.b.periods.length)return!1;var t=this.b.periods[0].variants;return!!t.length&&!t[0].video},ia.prototype.isAudioOnly=ia.prototype.od,ia.prototype.ie=function(){var t=0,e=0;return this.b&&(e=this.b.presentationTimeline,t=e.ka(),e=e.nb()),{start:t,end:e}},ia.prototype.seekRange=ia.prototype.ie,ia.prototype.keySystem=function(){return this.l?this.l.keySystem():""},ia.prototype.keySystem=ia.prototype.keySystem,ia.prototype.drmInfo=function(){return this.l?this.l.b:null},ia.prototype.drmInfo=ia.prototype.drmInfo,ia.prototype.mb=function(){return this.l?this.l.mb():1/0},ia.prototype.getExpiration=ia.prototype.mb,ia.prototype.pd=function(){return this.Oa},ia.prototype.isBuffering=ia.prototype.pd,ia.prototype.sb=function(){return this.D?Promise.resolve():(this.dispatchEvent(new G("unloading")),na(this).then(function(){return this.Pa||(this.Pa=fa(this).then(function(){this.Pa=null}.bind(this))),this.Pa}.bind(this)))},ia.prototype.unload=ia.prototype.sb,ia.prototype.zb=function(){return this.h?this.h.zb():0},ia.prototype.getPlaybackRate=ia.prototype.zb,ia.prototype.Ge=function(t){this.h&&Yn(this.h,t),this.a&&ar(this.a,1!=t)},ia.prototype.trickPlay=ia.prototype.Ge,ia.prototype.Sc=function(){this.h&&Yn(this.h,1),this.a&&ar(this.a,!1)},ia.prototype.cancelTrickPlay=ia.prototype.Sc,ia.prototype.md=function(){if(!this.b||!this.h)return[];var t=fe(this.b,qn(this.h)),e=this.C[t]||{};return ee(this.b.periods[t],e.audio,e.video)},ia.prototype.getVariantTracks=ia.prototype.md,ia.prototype.ld=function(){if(!this.b||!this.h)return[];var t=fe(this.b,qn(this.h));return ie(this.b.periods[t],(this.C[t]||{}).text).filter(function(t){return 0>this.eb.indexOf(t.id)}.bind(this))},ia.prototype.getTextTracks=ia.prototype.ld,ia.prototype.me=function(t){if(this.a){(t=re(ir(this.a),t))&&(ha(this,t,!1),this.Ba?this.X=t:or(this.a,t,!0))}},ia.prototype.selectTextTrack=ia.prototype.me,ia.prototype.ne=function(t,e){if(this.a){this.c.abr.enabled&&o("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var i=ir(this.a);(i=ne(i,t))&&i.allowedByApplication&&i.allowedByKeySystem&&(ua(this,i,!1),va(this,i,e))}},ia.prototype.selectVariantTrack=ia.prototype.ne,ia.prototype.Zc=function(){return this.a?ae(ir(this.a).variants).map(function(t){return t.language}).filter(N):[]},ia.prototype.getAudioLanguages=ia.prototype.Zc,ia.prototype.kd=function(){return this.a?ir(this.a).textStreams.map(function(t){return t.language}).filter(N):[]},ia.prototype.getTextLanguages=ia.prototype.kd,ia.prototype.ke=function(t,e){if(this.a){var i=ir(this.a);this.Ma=t,this.ab=e||"",Ta(this,i)}},ia.prototype.selectAudioLanguage=ia.prototype.ke,ia.prototype.le=function(t,e){if(this.a){var i=ir(this.a);this.$a=t,this.ub=e||"",Ta(this,i)}},ia.prototype.selectTextLanguage=ia.prototype.le,ia.prototype.rd=function(){return this.w?this.w.isTextVisible():this.jb},ia.prototype.isTextTrackVisible=ia.prototype.rd,ia.prototype.qe=function(t){this.w?this.w.setTextVisibility(t):this.jb=t,Sa(this)},ia.prototype.setTextTrackVisibility=ia.prototype.qe,ia.prototype.ed=function(){return this.b?new Date(1e3*this.b.presentationTimeline.c+1e3*this.f.currentTime):null},ia.prototype.getPlayheadTimeAsDate=ia.prototype.ed,ia.prototype.hd=function(){return this.b?new Date(1e3*this.b.presentationTimeline.c):null},ia.prototype.getPresentationStartTimeAsDate=ia.prototype.hd,ia.prototype.yb=function(){return this.J?this.J.yb():{total:[],audio:[],video:[],text:[]}},ia.prototype.getBufferedInfo=ia.prototype.yb,ia.prototype.getStats=function(){ga(this),this.Za();var t=null,e=null,i=this.f,i=i&&i.getVideoPlaybackQuality?i.getVideoPlaybackQuality():{};return this.h&&this.b&&(t=fe(this.b,qn(this.h)),e=this.C[t],e=le(e.audio,e.video,this.b.periods[t].variants),t=e.video||{}),t||(t={}),e||(e={}),{width:t.width||0,height:t.height||0,streamBandwidth:e.bandwidth||0,decodedFrames:Number(i.totalVideoFrames),droppedFrames:Number(i.droppedVideoFrames),estimatedBandwidth:this.g?this.g.getBandwidthEstimate():NaN,loadLatency:this.j.loadLatency,playTime:this.j.playTime,bufferingTime:this.j.bufferingTime,switchHistory:I(this.j.switchHistory),stateHistory:I(this.j.stateHistory)}},ia.prototype.getStats=ia.prototype.getStats,ia.prototype.addTextTrack=function(t,e,i,n,r,a){if(!this.a)return Promise.reject();for(var s,o=ir(this.a),u=0;u<this.b.periods.length;u++)if(this.b.periods[u]==o){if(u==this.b.periods.length-1){if(s=this.b.presentationTimeline.W()-o.startTime,1/0==s)return Promise.reject()}else s=this.b.periods[u+1].startTime-o.startTime;break}var h={id:this.Oc++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(e){return 1!=e?null:new ei(1,0,s,function(){return[t]},0,null)},initSegmentReference:null,presentationTimeOffset:0,mimeType:n,codecs:r||"",kind:i,encrypted:!1,keyId:null,language:e,label:a||null,type:"text",primary:!1,trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null};return this.eb.push(h.id),o.textStreams.push(h),cr(this.a,{text:h}).then(function(){if(!this.D){var t=this.b.periods.indexOf(o),n=rr(this.a);return n.text&&(this.C[t].text=n.text.id),this.eb.splice(this.eb.indexOf(h.id),1),Ta(this,o),Ea(this),{id:h.id,active:!1,type:"text",bandwidth:0,language:e,label:a||null,kind:i,width:null,height:null}}}.bind(this))},ia.prototype.addTextTrack=ia.prototype.addTextTrack,ia.prototype.Sb=function(t,e){this.fb.width=t,this.fb.height=e},ia.prototype.setMaxHardwareResolution=ia.prototype.Sb,ia.prototype.Cc=function(){if(this.a){var t=this.a;if(t.f)t=!1;else if(t.l)t=!1;else{for(var e in t.c){var i=t.c[e];i.Qa&&(i.Qa=!1,Ir(t,i,.1))}t=!0}}else t=!1;return t},ia.prototype.retryStreaming=ia.prototype.Cc,ia.prototype.ad=function(){return this.b},ia.prototype.getManifest=ia.prototype.ad,zs=ia.prototype,zs.Vc=function(t){var e=[1001,1002,1003];this.R()&&this.Zb&&0<=e.indexOf(t.code)&&(t.severity=1,this.Cc())},zs.Tb=function(t){var e=this.a?rr(this.a):{};t.forEach(function(t){Zt(this.l,e,t)}.bind(this));var i=0;if(t.forEach(function(t){0<ae(t.variants).length&&i++}.bind(this)),!i)throw new h(2,4,9009);if(i<t.length)throw new h(2,4,4011);t.forEach(function(t){if(Qt(t,this.c.restrictions,this.fb)&&this.a&&ir(this.a)==t&&Ea(this),1>ae(t.variants).length)throw new h(2,4,4012)}.bind(this))},zs.kb=function(t){var e=this.a?rr(this.a):{};if(Zt(this.l,e,t),e=0<ae(t.variants).length,Qt(t,this.c.restrictions,this.fb)&&this.a&&ir(this.a)==t&&Ea(this),t=1>ae(t.variants).length,!e)throw new h(2,4,4011);if(t)throw new h(2,4,4012)},zs.ue=function(t,e){this.g&&this.g.segmentDownloaded(t,e)},zs.Jc=function(t){if(ga(this),this.Oa=t,this.Za(),this.h){var e=this.h;t!=e.j&&(e.j=t,Yn(e,e.i))}this.dispatchEvent(new G("buffering",{buffering:t}))},zs.se=function(){Ea(this)},zs.Za=function(){if(!this.D){var t=this.Oa?"buffering":this.f.ended?"ended":this.f.paused?"paused":"playing",e=Date.now()/1e3;if(this.j.stateHistory.length){var i=this.j.stateHistory[this.j.stateHistory.length-1];if(i.duration=e-i.timestamp,t==i.state)return}this.j.stateHistory.push({timestamp:e,state:t,duration:0})}},zs.te=function(){if(this.B){var t=this.B;t.c.forEach(t.m.bind(t,!0))}this.a&&ur(this.a)},zs.td=function(t){this.Ba=!0,this.g.disable();var e={audio:!1,text:!1},i=se(t,this.Ma,this.ab,e);return t=oe(t,this.$a,this.ub,e),i=ya(this,i),t=t[0]||null,this.X=this.Na=null,i&&ua(this,i,!0),t&&(ha(this,t,!0),!nr(this.a)&&i&&i.audio&&e.text&&t.language!=i.audio.language&&(this.w.setTextVisibility(!0),Sa(this))),{variant:i,text:t}},zs.Rc=function(){this.Ba=!1,this.c.abr.enabled&&this.g.enable(),this.Na&&(sr(this.a,this.Na,this.Yb),this.Na=null),this.X&&(or(this.a,this.X,!0),this.X=null)},zs.Bd=function(){this.i&&this.i.update&&this.i.update()},zs.Kd=function(){this.h&&this.h.Ib()},zs.Kc=function(t,e){ua(this,t,!0),this.a&&(sr(this.a,t,e||!1),wa(this))},zs.Fe=function(t,e){if(this.a){var i=nr(this.a);(i=ce(t.audio,t.video,i?i.variants:[]))&&this.Kc(i,e)}},zs.La=function(t){if(!this.D){var e=new G("error",{detail:t});this.dispatchEvent(e),e.defaultPrevented&&(t.handled=!0)}},zs.Nd=function(t){this.B?this.B.s(t):this.hb.push(t)},zs.Ya=function(t){this.dispatchEvent(t)},zs.Od=function(){if(this.f.error){var t=this.f.error.code;if(1!=t){var e=this.f.error.msExtendedCode;e&&(0>e&&(e+=Math.pow(2,32)),e=e.toString(16)),this.La(new h(2,3,3016,t,e,this.f.error.message))}}},zs.zd=function(t){var e=["output-restricted","internal-error"],i=ir(this.a),n=!1,r=1==Object.keys(t).length&&"00"==Object.keys(t)[0];i.variants.forEach(function(i){var a=[];i.audio&&a.push(i.audio),i.video&&a.push(i.video),a.forEach(function(a){var s=i.allowedByKeySystem;a.keyId&&(a=t[r?"00":a.keyId],i.allowedByKeySystem=!!a&&0>e.indexOf(a)),s!=i.allowedByKeySystem&&(n=!0)})});var a=rr(this.a);(a=ce(a.audio,a.video,i.variants))&&!a.allowedByKeySystem&&Ta(this,i),n&&Ea(this)},zs.wd=function(t,e){this.i&&this.i.onExpirationUpdated&&this.i.onExpirationUpdated(t,e),this.dispatchEvent(new G("expirationupdated"))},e("shaka.offline.Storage",Aa),Aa.support=ka,Aa.prototype.o=function(){var t=this.a,e=this.i?this.i.o().catch(function(){}).then(function(){if(t)return t.o()}):Promise.resolve();return this.b=this.g=this.i=this.a=null,e},Aa.prototype.destroy=Aa.prototype.o,Aa.prototype.configure=function(t){k(this.b,t,Pa(this),{},"")},Aa.prototype.configure=Aa.prototype.configure,Aa.prototype.De=function(t,e,i){function n(t){a=t}if(this.s)return Promise.reject(new h(2,9,9006));this.s=!0;var r,a=null;return _a(this).then(function(){return Da(this),Ia(this,t,n,i)}.bind(this)).then(function(i){if(Da(this),this.f=i.manifest,this.c=i.Wc,this.f.presentationTimeline.R()||this.f.presentationTimeline.va())throw new h(2,9,9005,t);this.m(this.f.periods),this.h=this.a.c.manifest++,this.l=0,i=e||{};var n=this.f.periods.map(this.C.bind(this)),a=this.c.b,s=vt(this.c);if(a){if(!s.length)throw new h(2,9,9007,t);a.initData=[]}return r={key:this.h,originalManifestUri:t,duration:this.l,size:0,expiration:this.c.mb(),periods:n,sessionIds:this.b.usePersistentLicense?s:[],drmInfo:a,appMetadata:i},Xr(this.i,r)}.bind(this)).then(function(){if(Da(this),a)throw a;return xa(this)}.bind(this)).then(function(){return Ur(r)}.bind(this)).catch(function(t){return xa(this).catch(x).then(function(){throw t})}.bind(this))},Aa.prototype.store=Aa.prototype.De,Aa.prototype.remove=function(t){function e(t){6013!=t.code&&(s=t)}var i=t.offlineUri,n=/^offline:([0-9]+)$/.exec(i);if(!n)return Promise.reject(new h(2,9,9004,i));var r,a,s=null,o=Number(n[1]);return _a(this).then(function(){return Da(this),this.a.get("manifest",o)}.bind(this)).then(function(t){if(Da(this),!t)throw new h(2,9,9003,i);return r=t,t=$r(r),a=new ft({Sa:this.g.s,onError:e,Hb:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),a.configure(this.g.getConfiguration().drm),a.init(t,this.b.usePersistentLicense||!1)}.bind(this)).then(function(){return pt(a,r.sessionIds)}.bind(this)).then(function(){return a.o()}.bind(this)).then(function(){if(Da(this),s)throw s;var e=r.periods.map(function(t){return t.streams.map(function(t){var e=t.segments.map(function(t){return t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t.uri),Number(t[1])});return t.initSegmentUri&&(t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t.initSegmentUri),e.push(Number(t[1]))),e}).reduce(_,[])}).reduce(_,[]),i=0,n=e.length,a=this.b.progressCallback;return Dr(this.a,e,function(){i++,a(t,i/n)})}.bind(this)).then(function(){return Da(this),this.b.progressCallback(t,1),this.a.remove("manifest",o)}.bind(this))},Aa.prototype.remove=Aa.prototype.remove,Aa.prototype.list=function(){var t=[];return _a(this).then(function(){return Da(this),this.a.forEach("manifest",function(e){t.push(Ur(e))})}.bind(this)).then(function(){return t})},Aa.prototype.list=Aa.prototype.list,Aa.prototype.B=function(t){for(var e,i=[],n=Wt(this.g.getConfiguration().preferredAudioLanguage),r=[0,so,oo],a=t.filter(function(t){return"variant"==t.type}),r=r.map(function(t){return a.filter(function(e){return e=Wt(e.language),$t(t,n,e)})}),s=0;s<r.length;s++)if(r[s].length){e=r[s];break}e||(r=a.filter(function(t){return t.primary}),r.length&&(e=r)),e||(e=a,a.map(function(t){return t.language}).filter(N));var o=e.filter(function(t){return t.height&&480>=t.height});return o.length&&(o.sort(function(t,e){return e.height-t.height}),e=o.filter(function(t){return t.height==o[0].height})),e.sort(function(t,e){return t.bandwidth-e.bandwidth}),e.length&&i.push(e[Math.floor(e.length/2)]),i.push.apply(i,t.filter(function(t){return"text"==t.type})),i},Aa.prototype.m=function(t){t.forEach(this.w.bind(this))},Aa.prototype.w=function(t){var e={};if(this.j){var i=this.j.filter(function(t){return"variant"==t.type}),n=null;i.length&&(n=ne(t,i[0])),n&&(n.video&&(e.video=n.video),n.audio&&(e.audio=n.audio))}Zt(this.c,e,t),Qt(t,this.g.getConfiguration().restrictions,{width:1/0,height:1/0})},Aa.prototype.C=function(t){var e,i,n=ee(t,null,null),r=ie(t,null),n=this.b.trackSelectionCallback(n.concat(r));for(this.j||(this.j=n,this.m(this.f.periods)),r=n.length-1;0<r;--r){var a=!1;for(i=r-1;0<=i;--i)if(n[r].type==n[i].type&&n[r].kind==n[i].kind&&n[r].language==n[i].language){a=!0;break}if(a)break}for(a=[],r=0;r<n.length;r++)(e=ne(t,n[r]))?(e.audio&&((i=a.filter(function(t){return t.id==e.audio.id})[0])?i.variantIds.push(e.id):(i=e.video?e.bandwidth/2:e.bandwidth,a.push(Na(this,t,e.audio,i,e.id)))),e.video&&((i=a.filter(function(t){return t.id==e.video.id})[0])?i.variantIds.push(e.id):(i=e.audio?e.bandwidth/2:e.bandwidth,a.push(Na(this,t,e.video,i,e.id))))):a.push(Na(this,t,re(t,n[r]),0));return{startTime:t.startTime,streams:a}},Mo.offline=ka,e("shaka.polyfill.installAll",function(){for(var t=0;t<Oo.length;++t)Oo[t]()});var Oo=[];e("shaka.polyfill.register",La),La(function(){if(t.Document){var e=Element.prototype;e.requestFullscreen=e.requestFullscreen||e.mozRequestFullScreen||e.msRequestFullscreen||e.webkitRequestFullscreen,e=Document.prototype,e.exitFullscreen=e.exitFullscreen||e.mozCancelFullScreen||e.msExitFullscreen||e.webkitExitFullscreen,"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}})),document.addEventListener("webkitfullscreenchange",Ca),document.addEventListener("webkitfullscreenerror",Ca),document.addEventListener("mozfullscreenchange",Ca),document.addEventListener("mozfullscreenerror",Ca),document.addEventListener("MSFullscreenChange",Ca),document.addEventListener("MSFullscreenError",Ca)}}),La(function(){var e=navigator.userAgent;e&&0<=e.indexOf("CrKey")&&delete t.indexedDB});var Uo;La(function(){0>navigator.userAgent.indexOf("Trident/")||HTMLInputElement.prototype.addEventListener==Ma||(Uo=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=Ma)}),La(function(){if(4503599627370497!=Math.round(4503599627370497)){var t=Math.round;Math.round=function(e){var i=e;return 4503599627370496>=e&&(i=t(e)),i}}}),Oa.prototype.c=function(t){if(!(1<t.version)){var e=ct(t.u.Ja(16)),i=[];if(0<t.version)for(var n=t.u.F(),r=0;r<n;++r){var a=ct(t.u.Ja(16));i.push(a)}n=t.u.F(),t.u.I(n),this.b.push.apply(this.b,i),this.f.push(e),this.a.push({start:t.start,end:t.start+t.size-1})}},ja.prototype.createMediaKeys=function(){var t=new Fa(this.keySystem);return Promise.resolve(t)},ja.prototype.getConfiguration=function(){return this.a},Fa.prototype.createSession=function(t){if("temporary"!=(t||"temporary"))throw new TypeError("Session type "+t+" is unsupported on this platform.");return new Ha(this.a)},Fa.prototype.setServerCertificate=function(){return Promise.resolve(!1)},i(Ha),zs=Ha.prototype,zs.generateRequest=function(t,e){this.a=new y;try{this.c=this.g.createSession("video/mp4",new Uint8Array(e),null),F(this.f,this.c,"mskeymessage",this.Fd.bind(this)),F(this.f,this.c,"mskeyadded",this.Dd.bind(this)),F(this.f,this.c,"mskeyerror",this.Ed.bind(this)),qa(this,"status-pending")}catch(t){this.a.reject(t)}return this.a},zs.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},zs.update=function(t){this.b=new y;try{this.c.update(new Uint8Array(t))}catch(t){this.b.reject(t)}return this.b},zs.close=function(){try{this.c.close(),this.closed.resolve(),H(this.f)}catch(t){this.closed.reject(t)}return this.closed},zs.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},zs.Fd=function(t){this.a&&(this.a.resolve(),this.a=null),this.dispatchEvent(new G("message",{messageType:void 0==this.keyStatuses.a?"licenserequest":"licenserenewal",message:t.message.buffer}))},zs.Dd=function(){this.a?(qa(this,"usable"),this.a.resolve(),this.a=null):this.b&&(qa(this,"usable"),this.b.resolve(),this.b=null)},zs.Ed=function(){var t=Error("EME PatchedMediaKeysMs key error");if(t.errorCode=this.c.error,this.a)this.a.reject(t),this.a=null;else if(this.b)this.b.reject(t),this.b=null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:qa(this,"output-not-allowed");default:qa(this,"internal-error")}};var jo;zs=Xa.prototype,zs.forEach=function(t){this.a&&t(this.a,jo)},zs.get=function(t){if(this.has(t))return this.a},zs.has=function(t){var e=jo;return!(!this.a||!lt(new Uint8Array(t),new Uint8Array(e)))},zs.entries=function(){},zs.keys=function(){},zs.values=function(){},$a.prototype.createSession=function(){},$a.prototype.setServerCertificate=function(){},Wa.prototype.getConfiguration=function(){},Wa.prototype.createMediaKeys=function(){};var Bo="";es.prototype.createMediaKeys=function(){var t=new is(this.a);return Promise.resolve(t)},es.prototype.getConfiguration=function(){return this.b},zs=is.prototype,zs.createSession=function(t){var e=t||"temporary";if("temporary"!=e&&"persistent-license"!=e)throw new TypeError("Session type "+t+" is unsupported on this platform.");return t=this.b||document.createElement("video"),t.src||(t.src="about:blank"),e=new as(t,this.g,e),this.c.push(e),e},zs.setServerCertificate=function(){return Promise.resolve(!1)},zs.Sd=function(t){var e=document.createEvent("CustomEvent");e.initCustomEvent("encrypted",!1,!1,null),e.initDataType="webm",e.initData=t.initData,this.b.dispatchEvent(e)},zs.Rd=function(t){var e=rs(this,t.sessionId);e&&(t=new G("message",{messageType:void 0==e.keyStatuses.a?"licenserequest":"licenserenewal",message:t.message}),e.b&&(e.b.resolve(),e.b=null),e.dispatchEvent(t))},zs.Pd=function(t){(t=rs(this,t.sessionId))&&(os(t,"usable"),t.a&&t.a.resolve(),t.a=null)},zs.Qd=function(t){var e=rs(this,t.sessionId);if(e){var i=Error("EME v0.1b key error");i.errorCode=t.errorCode,i.errorCode.systemCode=t.systemCode,!t.sessionId&&e.b?(i.method="generateRequest",45==t.systemCode&&(i.message="Unsupported session type."),e.b.reject(i),e.b=null):t.sessionId&&e.a?(i.method="update",e.a.reject(i),e.a=null):(i=t.systemCode,t.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?os(e,"output-restricted"):1==i?os(e,"expired"):os(e,"internal-error"))}},i(as),zs=as.prototype,zs.Ub=function(t,e){if(this.a)this.a.then(this.Ub.bind(this,t,e)).catch(this.Ub.bind(this,t,e));else{if(this.a=t,"webkit-org.w3.clearkey"==this.c){var i=Z(e),n=JSON.parse(i);"oct"!=n.keys[0].kty&&(this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a=null),i=ut(n.keys[0].k),n=ut(n.keys[0].kid)}else i=new Uint8Array(e),n=null;var r=Qa("addKey");try{this.f[r](this.c,i,n,this.sessionId)}catch(t){this.a.reject(t),this.a=null}}},zs.generateRequest=function(t,e){return ss(this,e,null)},zs.load=function(t){return"persistent-license"==this.g?ss(this,null,t):Promise.reject(Error("Not a persistent session."))},zs.update=function(t){var e=new y;return this.Ub(e,t),e},zs.close=function(){if("persistent-license"!=this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var t=Qa("cancelKeyRequest");try{this.f[t](this.c,this.sessionId)}catch(t){}}return this.closed.resolve(),this.closed},zs.remove=function(){return"persistent-license"!=this.g?Promise.reject(Error("Not a persistent session.")):this.close()};var Fo;zs=us.prototype,zs.forEach=function(t){this.a&&t(this.a,Fo)},zs.get=function(t){if(this.has(t))return this.a},zs.has=function(t){var e=Fo;return!(!this.a||!lt(new Uint8Array(t),new Uint8Array(e)))},zs.entries=function(){},zs.keys=function(){},zs.values=function(){},La(function(){!t.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(HTMLMediaElement.prototype.webkitGenerateKeyRequest?Ja("webkit"):HTMLMediaElement.prototype.generateKeyRequest?Ja(""):t.MSMediaKeys?(jo=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Ba,t.MediaKeys=Fa,t.MediaKeySystemAccess=ja,navigator.requestMediaKeySystemAccess=Ua):(navigator.requestMediaKeySystemAccess=Ya,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=za,t.MediaKeys=$a,t.MediaKeySystemAccess=Wa))}),La(function(){if(t.MediaSource)if(t.cast&&cast.__platform__&&cast.__platform__.canDisplayType)ms();else if(navigator.vendor&&0<=navigator.vendor.indexOf("Apple")){var e=navigator.appVersion;ps(),0<=e.indexOf("Version/8")?t.MediaSource=null:0<=e.indexOf("Version/9")?hs():0<=e.indexOf("Version/10")?(hs(),ls()):0<=e.indexOf("Version/11")&&(hs(),cs())}});var Vo=0;vs.prototype.then=function(t,e){var i=new vs;switch(this.za){case 1:ws(this,i,t);break;case 2:ws(this,i,e);break;case Vo:this.c.push({N:i,wb:t}),this.b.push({N:i,wb:e})}return i},vs.prototype.catch=function(t){return this.then(void 0,t)},vs.prototype.ma=function(t){if(this.za==Vo){for(this.f=t,this.za=1,t=0;t<this.c.length;++t)ws(this,this.c[t].N,this.c[t].wb);this.c=[],this.b=[]}},vs.prototype.a=function(t){if(this.za==Vo){for(this.f=t,this.za=2,t=0;t<this.b.length;++t)ws(this,this.b[t].N,this.b[t].wb);this.c=[],this.b=[]}};var Ho=null,Ko=[];La(function(e){t.setImmediate?(As=function(e){return t.setImmediate(e)},ks=function(e){return t.clearImmediate(e)}):(As=function(e){return t.setTimeout(e,0)},ks=function(e){return t.clearTimeout(e)}),t.Promise&&!e||(t.Promise=vs,t.Promise.resolve=gs,t.Promise.reject=bs,t.Promise.all=ys,t.Promise.race=Ts,t.Promise.prototype.then=vs.prototype.then,t.Promise.prototype.catch=vs.prototype.catch)}),La(function(){if(t.HTMLMediaElement){var e=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var t=e.apply(this,arguments);return t&&t.catch(function(){}),t}}}),La(function(){if(t.HTMLVideoElement){var e=HTMLVideoElement.prototype;!e.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in e&&(e.getVideoPlaybackQuality=Is)}}),La(function(){if(!t.VTTCue&&t.TextTrackCue){var e=TextTrackCue.length;if(3==e)t.VTTCue=Ps;else if(6==e)t.VTTCue=_s;else{try{var i=!!Ps(1,2,"")}catch(t){i=!1}i&&(t.VTTCue=Ps)}}}),e("shaka.text.Cue",xs);var Go="auto";xs.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Go};var qo="center",Xo={LEFT:"left",RIGHT:"right",CENTER:qo,START:"start",END:"end"};xs.textAlign=Xo;var Yo="before",zo={BEFORE:Yo,CENTER:"center",AFTER:"after"};xs.displayAlign=zo;var $o=0,Wo=2,Jo=3;xs.writingDirection={HORIZONTAL_LEFT_TO_RIGHT:$o,HORIZONTAL_RIGHT_TO_LEFT:1,VERTICAL_LEFT_TO_RIGHT:Wo,VERTICAL_RIGHT_TO_LEFT:Jo};var Qo=0,Zo=1;xs.lineInterpretation={LINE_NUMBER:Qo,PERCENTAGE:Zo};var tu="center",eu={CENTER:tu,START:"start",END:"end"};xs.lineAlign=eu;var iu=400;xs.fontWeight={NORMAL:iu,BOLD:700};var nu="normal",ru={NORMAL:nu,ITALIC:"italic",OBLIQUE:"oblique"};xs.fontStyle=ru,xs.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"},Rs.prototype.parseInit=function(){},Rs.prototype.parseMedia=function(t,e){var i=Z(t),n=[],r=new DOMParser,a=null;try{a=r.parseFromString(i,"text/xml")}catch(t){throw new h(2,2,2005)}if(a){var s=a.getElementsByTagName("tt")[0];if(!s)throw new h(2,2,2005);r=s.getAttribute("ttp:frameRate"),a=s.getAttribute("ttp:subFrameRate");var o=s.getAttribute("ttp:frameRateMultiplier"),u=s.getAttribute("ttp:tickRate");if("default"!=(i=s.getAttribute("xml:space")||"default")&&"preserve"!=i)throw new h(2,2,2005);for(i="default"==i,r=new Fs(r,a,o,u),a=Ns(s.getElementsByTagName("styling")[0]),o=Ns(s.getElementsByTagName("layout")[0]),s=Ns(s.getElementsByTagName("body")[0]),u=0;u<s.length;u++){var c=s[u],l=e.periodStart,f=r,d=a,p=o,m=i;if(c.hasAttribute("begin")||c.hasAttribute("end")||!/^\s*$/.test(c.textContent)){Ds(c,m);var m=js(c.getAttribute("begin"),f),v=js(c.getAttribute("end"),f),f=js(c.getAttribute("dur"),f),g=c.textContent;if(null==v&&null!=f&&(v=m+f),null==m||null==v)throw new h(2,2,2001);l=new xs(m+l,v+l,g),m=Us(c,"region",p),p=l,"rtl"==Cs(c,m,d,"tts:direction")&&(p.writingDirection=1),v=Cs(c,m,d,"tts:writingMode"),"tb"==v||"tblr"==v?p.writingDirection=Wo:"tbrl"==v?p.writingDirection=Jo:"rltb"==v||"rl"==v?p.writingDirection=1:v&&(p.writingDirection=$o),(v=Cs(c,m,d,"tts:origin"))&&(v=lu.exec(v))&&(p.region.x=Number(v[1]),p.region.y=Number(v[2])),(v=Cs(c,m,d,"tts:extent"))&&(v=lu.exec(v))&&(p.region.width=Number(v[1]),p.region.height=Number(v[2])),(v=Cs(c,m,d,"tts:textAlign"))&&(p.positionAlign=pu[v],p.lineAlign=du[v],p.textAlign=Xo[v.toUpperCase()]),(v=Cs(c,m,d,"tts:displayAlign"))&&(p.displayAlign=zo[v.toUpperCase()]),(v=Cs(c,m,d,"tts:color"))&&(p.color=v),(v=Cs(c,m,d,"tts:backgroundColor"))&&(p.backgroundColor=v),(v=Cs(c,m,d,"tts:fontFamily"))&&(p.fontFamily=v),(v=Cs(c,m,d,"tts:fontWeight"))&&"bold"==v&&(p.fontWeight=700),(v=Cs(c,m,d,"tts:wrapOption"))&&"noWrap"==v&&(p.wrapLine=!1),(v=Cs(c,m,d,"tts:lineHeight"))&&v.match(fu)&&(p.lineHeight=v),(v=Cs(c,m,d,"tts:fontSize"))&&v.match(fu)&&(p.fontSize=v),(v=Cs(c,m,d,"tts:fontStyle"))&&(p.fontStyle=ru[v.toUpperCase()]),(m=Ms(m,d,"tts:textDecoration"))&&Ls(p,m),(c=Os(c,d,"tts:textDecoration"))&&Ls(p,c)}else l=null;l&&n.push(l)}}return n};var au=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,su=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,ou=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,uu=/^(\d*\.?\d*)f$/,hu=/^(\d*\.?\d*)t$/,cu=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,lu=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,fu=/^(\d+px|\d+em)$/,du={left:"start",center:"center",right:"end",start:"start",end:"end"},pu={left:"line-left",center:"center",right:"line-right"};Mt("application/ttml+xml",Rs),Vs.prototype.parseInit=function(t){var e=!1;if((new ai).G("moov",si).G("trak",si).G("mdia",si).G("minf",si).G("stbl",si).ca("stsd",oi).G("stpp",function(){e=!0}).parse(t),!e)throw new h(2,2,2007)},Vs.prototype.parseMedia=function(t,e){var i=!1,n=[];if((new ai).G("mdat",ui(function(t){i=!0,n=n.concat(this.a.parseMedia(t.buffer,e))}.bind(this))).parse(t),!i)throw new h(2,2,2007);return n},Mt('application/mp4; codecs="stpp"',Vs),Mt('application/mp4; codecs="stpp.TTML.im1t"',Vs),Hs.prototype.parseInit=function(){},Hs.prototype.parseMedia=function(t,e){var i=Z(t),i=i.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n"),i=i.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(i[0]))throw new h(2,2,2e3);var n=e.segmentStart;if(0<=i[0].indexOf("X-TIMESTAMP-MAP")){var r=i[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),a=i[0].match(/MPEGTS:(\d+)/m);r&&a&&(n=Gs(new un(r[1])),n=e.periodStart+(Number(a[1])/9e4-n))}for(a=[],r=1;r<i.length;r++){var s=i[r].split("\n"),o=n;if(1==s.length&&!s[0]||/^NOTE($|[ \t])/.test(s[0])||"STYLE"==s[0])var u=null;else{u=null,0>s[0].indexOf("--\x3e")&&(u=s[0],s.splice(0,1));var c=new un(s[0]),l=Gs(c),f=hn(c,/[ \t]+--\x3e[ \t]+/g),d=Gs(c);if(null==l||!f||null==d)throw new h(2,2,2001);for(s=new xs(l+o,d+o,s.slice(1).join("\n").trim()),hn(c,/[ \t]+/gm),o=cn(c);o;)Ks(s,o),hn(c,/[ \t]+/gm),o=cn(c);null!=u&&(s.id=u),u=s}u&&a.push(u)}return a},Mt("text/vtt",Hs),Mt('text/vtt; codecs="vtt"',Hs),qs.prototype.parseInit=function(t){var e=!1;if((new ai).G("moov",si).G("trak",si).G("mdia",si).ca("mdhd",function(t){0==t.version?(t.u.I(4),t.u.I(4),this.a=t.u.F(),t.u.I(4)):(t.u.I(8),t.u.I(8),this.a=t.u.F(),t.u.I(8)),t.u.I(4)}.bind(this)).G("minf",si).G("stbl",si).ca("stsd",oi).G("wvtt",function(){e=!0}).parse(t),!this.a)throw new h(2,2,2008);if(!e)throw new h(2,2,2008)},qs.prototype.parseMedia=function(t,e){var i=0,n=[],r=[],a=[],s=!1,o=!1,u=!1,c=null;if((new ai).G("moof",si).G("traf",si).ca("tfdt",function(t){s=!0,i=t.version?t.u.Va():t.u.F()}).ca("tfhd",function(t){var e=t.ec;t=t.u,t.I(4),1&e&&t.I(8),2&e&&t.I(4),c=8&e?t.F():null}).ca("trun",function(t){o=!0;var e=t.version,i=t.ec;t=t.u;var r=t.F();1&i&&t.I(4),4&i&&t.I(4);for(var a=[],s=0;s<r;s++){var u={duration:null,Vb:null};256&i&&(u.duration=t.F()),512&i&&t.I(4),1024&i&&t.I(4),2048&i&&(u.Vb=e?t.xc():t.F()),a.push(u)}n=a}).G("vtte",function(){r.push(null)}).G("vttc",ui(function(t){r.push(t.buffer)})).G("mdat",function(t){u=!0,si(t)}).parse(t),!u&&!s&&!o)throw new h(2,2,2008);for(var l=i,f=0;f<n.length;f++){var d=n[f],p=r[f],m=d.duration||c;m&&(d=d.Vb?i+d.Vb:l,l=d+m,p&&a.push(Xs(p,e.periodStart+d/this.a,e.periodStart+l/this.a)))}return a.filter(R)},Mt('application/mp4; codecs="wvtt"',qs)}).call(r,this),void 0!==t&&t.exports?t.exports=r.shaka:void 0!==(n=function(){return r.shaka}.call(e,i,e,t))&&(t.exports=n)}()}])});
+//# sourceMappingURL=dash-shaka-playback.min.js.map \ No newline at end of file
diff --git a/assets/clapprio/level-selector.min.js b/assets/clapprio/level-selector.min.js
index c851956..e4310dd 100644
--- a/assets/clapprio/level-selector.min.js
+++ b/assets/clapprio/level-selector.min.js
@@ -1,10 +1,10 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Clappr")):"function"==typeof define&&define.amd?define(["Clappr"],t):"object"==typeof exports?exports.LevelSelector=t(require("Clappr")):e.LevelSelector=t(e.Clappr)}(this,function(e){return function(e){function t(n){if(l[n])return l[n].exports;var o=l[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var l={};return t.m=e,t.c=l,t.p="<%=baseUrl%>/",t(0)}([/*!******************!*\
!*** ./index.js ***!
\******************/
-function(e,t,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=l(1),e.exports=t["default"]},/*!*********************!*\
+function(e,t,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l(/*! ./src/main.js */1),e.exports=t.default},/*!*********************!*\
!*** ./src/main.js ***!
\*********************/
-function(e,t,l){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var l=0;l<t.length;l++){var n=t[l];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,l,n){return l&&e(t.prototype,l),n&&e(t,n),t}}(),s=function(e,t,l){for(var n=!0;n;){var o=e,r=t,i=l;n=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,r);if(void 0!==s){if("value"in s)return s.value;var a=s.get;if(void 0===a)return;return a.call(i)}var c=Object.getPrototypeOf(o);if(null===c)return;e=c,t=r,l=i,n=!0,s=c=void 0}},a=l(2),c=l(3),u=n(c),v=l(4),h=n(v),f=-1,d=function(e){function t(){o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),i(t,[{key:"bindEvents",value:function(){this.listenTo(this.core,a.Events.CORE_READY,this.bindPlaybackEvents),this.listenTo(this.core.mediaControl,a.Events.MEDIACONTROL_CONTAINERCHANGED,this.reload),this.listenTo(this.core.mediaControl,a.Events.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.core.mediaControl,a.Events.MEDIACONTROL_HIDE,this.hideSelectLevelMenu)}},{key:"unBindEvents",value:function(){this.stopListening(this.core,a.Events.CORE_READY),this.stopListening(this.core.mediaControl,a.Events.MEDIACONTROL_CONTAINERCHANGED),this.stopListening(this.core.mediaControl,a.Events.MEDIACONTROL_RENDERED),this.stopListening(this.core.mediaControl,a.Events.MEDIACONTROL_HIDE),this.stopListening(this.core.getCurrentPlayback(),a.Events.PLAYBACK_LEVELS_AVAILABLE),this.stopListening(this.core.getCurrentPlayback(),a.Events.PLAYBACK_LEVEL_SWITCH_START),this.stopListening(this.core.getCurrentPlayback(),a.Events.PLAYBACK_LEVEL_SWITCH_END),this.stopListening(this.core.getCurrentPlayback(),a.Events.PLAYBACK_BITRATE)}},{key:"bindPlaybackEvents",value:function(){var e=this.core.getCurrentPlayback();this.listenTo(e,a.Events.PLAYBACK_LEVELS_AVAILABLE,this.fillLevels),this.listenTo(e,a.Events.PLAYBACK_LEVEL_SWITCH_START,this.startLevelSwitch),this.listenTo(e,a.Events.PLAYBACK_LEVEL_SWITCH_END,this.stopLevelSwitch),this.listenTo(e,a.Events.PLAYBACK_BITRATE,this.updateCurrentLevel);var t=e.levels&&e.levels.length>0;t&&this.fillLevels(e.levels)}},{key:"reload",value:function(){this.unBindEvents(),this.bindEvents(),this.bindPlaybackEvents()}},{key:"shouldRender",value:function(){if(!this.core.getCurrentContainer())return!1;var e=this.core.getCurrentPlayback();if(!e)return!1;var t=void 0!==e.currentLevel,l=!!(this.levels&&this.levels.length>1);return t&&l}},{key:"render",value:function(){if(this.shouldRender()){var e=a.Styler.getStyleFor(h["default"],{baseUrl:this.core.options.baseUrl});this.$el.html(this.template({levels:this.levels,title:this.getTitle()})),this.$el.append(e),this.core.mediaControl.$(".media-control-right-panel").append(this.el),this.highlightCurrentLevel()}return this}},{key:"fillLevels",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?f:arguments[1];void 0===this.selectedLevelId&&(this.selectedLevelId=t),this.levels=e,this.configureLevelsLabels(),this.render()}},{key:"configureLevelsLabels",value:function(){if(void 0!==this.core.options.levelSelectorConfig)for(var e in this.core.options.levelSelectorConfig.labels||{}){e=parseInt(e,10);var t=!!this.findLevelBy(e);t&&this.changeLevelLabelBy(e,this.core.options.levelSelectorConfig.labels[e])}}},{key:"findLevelBy",value:function(e){var t;return this.levels.forEach(function(l){l.id===e&&(t=l)}),t}},{key:"changeLevelLabelBy",value:function(e,t){var l=this;this.levels.forEach(function(n,o){n.id===e&&(l.levels[o].label=t)})}},{key:"onLevelSelect",value:function(e){return this.selectedLevelId=parseInt(e.target.dataset.levelSelectorSelect,10),this.core.getCurrentPlayback().currentLevel==this.selectedLevelId?!1:(this.core.getCurrentPlayback().currentLevel=this.selectedLevelId,this.toggleContextMenu(),e.stopPropagation(),!1)}},{key:"onShowLevelSelectMenu",value:function(e){this.toggleContextMenu()}},{key:"hideSelectLevelMenu",value:function(){this.$(".level_selector ul").hide()}},{key:"toggleContextMenu",value:function(){this.$(".level_selector ul").toggle()}},{key:"buttonElement",value:function(){return this.$(".level_selector button")}},{key:"levelElement",value:function(e){return this.$(".level_selector ul a"+(isNaN(e)?"":'[data-level-selector-select="'+e+'"]')).parent()}},{key:"getTitle",value:function(){return(this.core.options.levelSelectorConfig||{}).title}},{key:"startLevelSwitch",value:function(){this.buttonElement().addClass("changing")}},{key:"stopLevelSwitch",value:function(){this.buttonElement().removeClass("changing")}},{key:"updateText",value:function(e){e===f?this.buttonElement().text(this.currentLevel?"AUTO ("+this.currentLevel.label+")":"AUTO"):this.buttonElement().text(this.findLevelBy(e).label)}},{key:"updateCurrentLevel",value:function(e){var t=this.findLevelBy(e.level);this.currentLevel=t?t:null,this.highlightCurrentLevel()}},{key:"highlightCurrentLevel",value:function(){this.levelElement().removeClass("current"),this.currentLevel&&this.levelElement(this.currentLevel.id).addClass("current"),this.updateText(this.selectedLevelId)}},{key:"name",get:function(){return"level_selector"}},{key:"template",get:function(){return(0,a.template)(u["default"])}},{key:"attributes",get:function(){return{"class":this.name,"data-level-selector":""}}},{key:"events",get:function(){return{"click [data-level-selector-select]":"onLevelSelect","click [data-level-selector-button]":"onShowLevelSelectMenu"}}}],[{key:"version",get:function(){return VERSION}}]),t}(a.UICorePlugin);t["default"]=d,e.exports=t["default"]},/*!*************************!*\
+function(e,t,l){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var l=0;l<t.length;l++){var n=t[l];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,l,n){return l&&e(t.prototype,l),n&&e(t,n),t}}(),s=function(e,t,l){for(var n=!0;n;){var o=e,r=t,i=l;n=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,r);if(void 0!==s){if("value"in s)return s.value;var a=s.get;if(void 0===a)return;return a.call(i)}var c=Object.getPrototypeOf(o);if(null===c)return;e=c,t=r,l=i,n=!0,s=c=void 0}},a=l(/*! Clappr */2),c=l(/*! ./public/level-selector.html */3),u=n(c),v=l(/*! ./public/style.scss */4),h=n(v),f=-1,d=function(e){function t(){o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),i(t,[{key:"bindEvents",value:function(){this.listenTo(this.core,a.Events.CORE_READY,this.bindPlaybackEvents),this.listenTo(this.core.mediaControl,a.Events.MEDIACONTROL_CONTAINERCHANGED,this.reload),this.listenTo(this.core.mediaControl,a.Events.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.core.mediaControl,a.Events.MEDIACONTROL_HIDE,this.hideSelectLevelMenu)}},{key:"unBindEvents",value:function(){this.stopListening(this.core,a.Events.CORE_READY),this.stopListening(this.core.mediaControl,a.Events.MEDIACONTROL_CONTAINERCHANGED),this.stopListening(this.core.mediaControl,a.Events.MEDIACONTROL_RENDERED),this.stopListening(this.core.mediaControl,a.Events.MEDIACONTROL_HIDE),this.stopListening(this.core.getCurrentPlayback(),a.Events.PLAYBACK_LEVELS_AVAILABLE),this.stopListening(this.core.getCurrentPlayback(),a.Events.PLAYBACK_BITRATE)}},{key:"bindPlaybackEvents",value:function(){var e=this.core.getCurrentPlayback();this.listenTo(e,a.Events.PLAYBACK_LEVELS_AVAILABLE,this.fillLevels),this.listenTo(e,a.Events.PLAYBACK_BITRATE,this.handleAdaptation);var t=e.levels&&e.levels.length>0;t&&this.fillLevels(e.levels)}},{key:"reload",value:function(){this.unBindEvents(),this.bindEvents(),this.bindPlaybackEvents()}},{key:"shouldRender",value:function(){if(!this.core.getCurrentContainer())return!1;var e=this.core.getCurrentPlayback();if(!e)return!1;var t=void 0!==e.currentLevel,l=!!(this.levels&&this.levels.length>1);return t&&l}},{key:"render",value:function(){if(this.shouldRender()){var e=a.Styler.getStyleFor(h.default,{baseUrl:this.core.options.baseUrl});this.$el.html(this.template({levels:this.levels,title:this.getTitle()})),this.$el.append(e),this.core.mediaControl.$(".media-control-right-panel").append(this.el),this.highlightCurrentLevel()}return this}},{key:"fillLevels",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?f:arguments[1];void 0===this.selectedLevelId&&(this.selectedLevelId=t),this.levels=e,this.configureLevelsLabels(),this.render()}},{key:"configureLevelsLabels",value:function(){if(this.levels.forEach(function(e){e.label=e.height+"p"}),void 0!==this.core.options.levelSelectorConfig){var e=this.core.options.levelSelectorConfig.labelCallback;if(e&&"function"!=typeof e)throw new TypeError("labelCallback must be a function");var t=this.core.options.levelSelectorConfig.labels,l=t?this.core.options.levelSelectorConfig.labels:{};if(e||t){var n,o;for(var r in this.levels)n=this.levels[r],o=l[n.id],e?n.label=e(n,o):o&&(n.label=o)}}}},{key:"findLevelBy",value:function(e){var t;return this.levels.forEach(function(l){l.id===e&&(t=l)}),t}},{key:"onLevelSelect",value:function(e){return this.selectedLevelId=parseInt(e.target.dataset.levelSelectorSelect,10),this.core.getCurrentPlayback().currentLevel!=this.selectedLevelId&&(this.core.getCurrentPlayback().currentLevel=this.selectedLevelId,this.toggleContextMenu(),e.stopPropagation(),!1)}},{key:"onShowLevelSelectMenu",value:function(e){this.toggleContextMenu()}},{key:"hideSelectLevelMenu",value:function(){this.$(".level_selector ul").hide()}},{key:"toggleContextMenu",value:function(){this.$(".level_selector ul").toggle()}},{key:"buttonElement",value:function(){return this.$(".level_selector button")}},{key:"levelElement",value:function(e){return this.$(".level_selector ul a"+(isNaN(e)?"":'[data-level-selector-select="'+e+'"]')).parent()}},{key:"getTitle",value:function(){return(this.core.options.levelSelectorConfig||{}).title}},{key:"updateText",value:function(e){e===f?this.buttonElement().text(this.currentLevel?"AUTO ("+this.currentLevel.label+")":"AUTO"):this.buttonElement().text(this.findLevelBy(e).label)}},{key:"handleAdaptation",value:function(e){var t=this.findLevelBy(e.level);this.currentLevel=t?t:null,this.highlightCurrentLevel()}},{key:"highlightCurrentLevel",value:function(){var e=this;this.updateText(this.selectedLevelId),this.levelElement().removeClass("current"),this.currentLevel&&this.levelElement(this.currentLevel.id).addClass("current");var t=this.currentLevel&&this.currentLevel.language;t&&(this.levelElement().removeClass("hidden"),this.levels.forEach(function(l){l.language!=t&&e.levelElement(l.id).addClass("hidden")}))}},{key:"name",get:function(){return"level_selector"}},{key:"template",get:function(){return(0,a.template)(u.default)}},{key:"attributes",get:function(){return{class:this.name,"data-level-selector":""}}},{key:"events",get:function(){return{"click [data-level-selector-select]":"onLevelSelect","click [data-level-selector-button]":"onShowLevelSelectMenu"}}}],[{key:"version",get:function(){return VERSION}}]),t}(a.UICorePlugin);t.default=d,e.exports=t.default},/*!*************************!*\
!*** external "Clappr" ***!
\*************************/
function(t,l){t.exports=e},/*!****************************************!*\
@@ -13,7 +13,7 @@ function(t,l){t.exports=e},/*!****************************************!*\
function(e,t){e.exports='<button data-level-selector-button>\n Auto\n</button>\n<ul>\n <% if (title) { %>\n <li data-title><%= title %></li>\n <% }; %>\n <li><a href="#" data-level-selector-select="-1">AUTO</a></li>\n <% for (var i = 0; i < levels.length; i++) { %>\n <li><a href="#" data-level-selector-select="<%= levels[i].id %>"><%= levels[i].label %></a></li>\n <% }; %>\n</ul>\n'},/*!*******************************!*\
!*** ./src/public/style.scss ***!
\*******************************/
-function(e,t,l){t=e.exports=l(5)(),t.push([e.id,".level_selector[data-level-selector]{float:right;margin-top:5px;position:relative}.level_selector[data-level-selector] button{background-color:transparent;color:#fff;font-family:Roboto,Open Sans,Arial,sans-serif;-webkit-font-smoothing:antialiased;border:none;font-size:10px}.level_selector[data-level-selector] button:hover{color:#c9c9c9}.level_selector[data-level-selector] button.changing{-webkit-animation:pulse .5s infinite alternate}.level_selector[data-level-selector]>ul{list-style-type:none;position:absolute;bottom:25px;border:1px solid #000;display:none;background-color:#e6e6e6}.level_selector[data-level-selector] li{font-size:10px}.level_selector[data-level-selector] li[data-title]{background-color:#c3c2c2;padding:5px}.level_selector[data-level-selector] li a{color:#444;padding:2px 10px;display:block;text-decoration:none}.level_selector[data-level-selector] li a:hover{background-color:#555;color:#fff}.level_selector[data-level-selector] li a:hover a{color:#fff;text-decoration:none}.level_selector[data-level-selector] li.current a{color:red}@-webkit-keyframes pulse{0%{color:#fff}50%{color:#ff0101}to{color:#b80000}}",""])},/*!**************************************!*\
+function(e,t,l){t=e.exports=l(/*! ../../~/css-loader/lib/css-base.js */5)(),t.push([e.id,".level_selector[data-level-selector]{float:right;margin-top:7px;position:relative}.level_selector[data-level-selector] button{background-color:transparent;color:#fff;font-family:Roboto,Open Sans,Arial,sans-serif;-webkit-font-smoothing:antialiased;border:none;font-size:12px}.level_selector[data-level-selector] button:hover{color:#c9c9c9}.level_selector[data-level-selector] button.changing{-webkit-animation:pulse .5s infinite alternate}.level_selector[data-level-selector]>ul{list-style-type:none;position:absolute;bottom:25px;border:1px solid #000;display:none;background-color:#e6e6e6}.level_selector[data-level-selector] li{font-size:12px}.level_selector[data-level-selector] li[data-title]{background-color:#c3c2c2;padding:5px}.level_selector[data-level-selector] li a{color:#444;padding:2px 10px;display:block;text-decoration:none}.level_selector[data-level-selector] li a:hover{background-color:#555;color:#fff}.level_selector[data-level-selector] li a:hover a{color:#fff;text-decoration:none}.level_selector[data-level-selector] li.current a{color:red}.level_selector[data-level-selector] li.hidden{display:none}@-webkit-keyframes pulse{0%{color:#fff}50%{color:#ff0101}to{color:#b80000}}",""])},/*!**************************************!*\
!*** ./~/css-loader/lib/css-base.js ***!
\**************************************/
function(e,t){"use strict";e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var l=this[t];l[2]?e.push("@media "+l[2]+"{"+l[1]+"}"):e.push(l[1])}return e.join("")},e.i=function(t,l){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},o=0;o<this.length;o++){var r=this[o][0];"number"==typeof r&&(n[r]=!0)}for(o=0;o<t.length;o++){var i=t[o];"number"==typeof i[0]&&n[i[0]]||(l&&!i[2]?i[2]=l:l&&(i[2]="("+i[2]+") and ("+l+")"),e.push(i))}},e}}])});